cerere plugin executare comenzi

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
DiRTy
Membru, skill +1
Membru, skill +1
Posts: 191
Joined: 11 Jun 2009, 12:53
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Has thanked: 79 times
Been thanked: 11 times

30 Aug 2010, 12:31

Salut, as dorii si eu un plugin ca la inceputul hartii sa execute serverul niste comenzi automat, de exemplu unii admini mai seteaza mp_timelimit 0 la sfarsitul harti pentru a da harti la vot... si vreau ca la inceputul hartii sa execute serverul singur comanda mp_timelimit 25 in caz ca un admin uita sa o seteze el.

As dorii si .sma daca se poate, cu timpul poate mai adaug si alte comenzi :).

Multumesc.
User avatar
Ciprian
Fost administrator
Fost administrator
Posts: 5172
Joined: 10 May 2008, 20:29
Detinator Steam: Da
CS Status: ^^
SteamID: crazycipry
Reputatie: Fost administrator
Fost Scripter eXtreamCS
Fost Supervizor CS.eXtreamCS.com
Fost Unbanner ZM.eXtreamCS.com
Fost Contribuitor
Nume anterior: crazy.cipry
Location: Baia Mare
Has thanked: 176 times
Been thanked: 401 times

30 Aug 2010, 12:44

DiRTy wrote:Salut, as dorii si eu un plugin ca la inceputul hartii sa execute serverul niste comenzi automat, de exemplu unii admini mai seteaza mp_timelimit 0 la sfarsitul harti pentru a da harti la vot... si vreau ca la inceputul hartii sa execute serverul singur comanda mp_timelimit 25 in caz ca un admin uita sa o seteze el.

As dorii si .sma daca se poate, cu timpul poate mai adaug si alte comenzi :).

Multumesc.
Pai nu iti trebuie plugin, setezi in server.cfg mp_timelimit pe 25.
DiRTy
Membru, skill +1
Membru, skill +1
Posts: 191
Joined: 11 Jun 2009, 12:53
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Has thanked: 79 times
Been thanked: 11 times

30 Aug 2010, 15:21

E setat in server.cfg mp_timelimit 25 si nu merge :) .
User avatar
Ciprian
Fost administrator
Fost administrator
Posts: 5172
Joined: 10 May 2008, 20:29
Detinator Steam: Da
CS Status: ^^
SteamID: crazycipry
Reputatie: Fost administrator
Fost Scripter eXtreamCS
Fost Supervizor CS.eXtreamCS.com
Fost Unbanner ZM.eXtreamCS.com
Fost Contribuitor
Nume anterior: crazy.cipry
Location: Baia Mare
Has thanked: 176 times
Been thanked: 401 times

30 Aug 2010, 15:26

| Afiseaza codul
[code=php]#include <amxmodx>

#define PLUGIN "Exec Commands"
#define VERSION "1.0"
#define AUTHOR "anakin_cstrike"

new g_Commands[ ][ ] =
{
    "rate 10000",
    "rate 9000",
    "rate 9500",
    "cl_updaterate 20",
    "cl_updaterate 15",
    "cl_cmdrate 15",
    "cl_cmdrate 20",
    "ex_interp 0.10",
    "cl_weather 0",
    "fps_max 200",
    "fps_modem 200",
    "cl_rate 20"
};

new g_maxplayers;

public plugin_init()
{
    register_plugin( PLUGIN, VERSION, AUTHOR );
    
    set_task( 30.0, "commands", _, _, _, "b" );
    g_maxplayers = get_maxplayers();
}

public commands()
{
    for( new i = 1; i <= g_maxplayers; i++ )
    {
        if( !is_user_connected( i ) )
            continue;
        if( is_user_bot( i ) )
            continue;
            
        for( new j; j < sizeof g_Commands; j++ )
            client_cmd( i, g_Commands[ j ] );
    }
} [/code]
DiRTy
Membru, skill +1
Membru, skill +1
Posts: 191
Joined: 11 Jun 2009, 12:53
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Has thanked: 79 times
Been thanked: 11 times

31 Aug 2010, 01:25

Alea sunt comenzi executate de client, nu le poate executa serverul, doar clientul Counter-Strike, daca pun mp_timelimit acolo executeaza clientul nu serverul.
User avatar
b[L]u
Membru, skill +1
Membru, skill +1
Posts: 314
Joined: 31 May 2010, 13:27
Detinator Steam: Nu
Has thanked: 26 times
Been thanked: 8 times

31 Aug 2010, 08:01

dirty iti dau ceva mai simplu vote_map_time ,dupa 3 minute de la schimbarea harti apare un vot ex cat vrei sa joci pe aceasta mapa?:
20 min
30 min
40 min
50 min
| Afiseaza codul
[quote]#include <amxmodx>
#include <amxmisc>

#define PLUGIN   "TimeLimit vote"
#define AUTHOR   "many"
#define VERSION   "0.4"

#define MAX_RESULTS 5

#pragma semicolon 1

//thnx pr4er for help

new Float:g_timelimit;
new menu;

new g_voteCount[MAX_RESULTS + 1];
new g_tls[MAX_RESULTS];
new tls[MAX_RESULTS];

new g_CountSys;

enum Color {
   NORMAL = 1, // clients scr_concolor cvar color
   GREEN, // Green Color
   TEAM_COLOR, // Red, grey, blue
   GREY, // grey
   RED, // Red
   BLUE, // Blue
};

new TeamName[][] = {
   "",
   "TERRORIST",
   "CT",
   "SPECTATOR"
};


public plugin_init() {
   register_plugin(PLUGIN, VERSION, AUTHOR);
   
   g_CountSys = register_cvar("amx_countsys",   "1");
   
   new name[12], string[12];
   new multiplic = 20;// +++++
   
   for(new i=0;i<MAX_RESULTS;i++) {
      format(name, sizeof name -1, "amx_tl_%d", i+1);
      
      format(string, sizeof string -1, "%d", multiplic);
      
      tls = register_cvar(name, string);
      
      multiplic += 10;
   }
}

public plugin_cfg() {
   menu = menu_create("\wCat vrei sa joci pe aceasta harta ?", "menu_handler");
   
   for(new i=0;i<MAX_RESULTS;i++)
      g_tls = get_pcvar_num(tls);
   
   set_task(180.0, "start_vote");
   
   build_menu();
}

build_menu() {   
   new option[64], temp[12];
   
   for(new i=0;i<MAX_RESULTS;i++) {
      format(option, sizeof option -1, "\w%d minute", g_tls);
      format(temp, sizeof temp -1, "%d", i+1);
      
      menu_additem(menu, option, temp, 0);
   }
   
   menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
}

public start_vote(id) {   
   new players[32], inum, i;
   get_players(players, inum, "ch");
   
   for(i=0;i<inum;i++)
      menu_display(players, menu, 0);
   
   set_task(15.0, "finish_vote");
   
   for(i=1;i<(MAX_RESULTS+1);i++)
      g_voteCount = 0;
   
   return PLUGIN_CONTINUE;
}

public menu_handler(id, menu, item) {
   if( !is_user_connected( id ) )
      return PLUGIN_HANDLED ;

   if(item == MENU_EXIT) {
      menu_cancel(id);
      
      return PLUGIN_HANDLED;
   }
   
   new data[6], name[32];
   new access, callback;
   
   menu_item_getinfo(menu, item, access, data, 5, "", 0, callback);
   
   new key = str_to_num(data);
   get_user_name(id, name, 31);
   
   ColorChat(0, GREEN, "[AMXX] %s^x01 vrea sa joace^x04 %d^x01 minute !", name, g_tls[key -1]);
   
   g_voteCount[key]++;
   
   menu_cancel(id);
   
   return PLUGIN_HANDLED;
}

public finish_vote() {   
   new players[32], inum;
   get_players(players, inum, "ch");
   
   for(new i=0;i<inum;i++)
      client_cmd(players, "slot10");
   
   CountVotes();
}

public CountVotes() {
   g_timelimit = get_cvar_float("mp_timelimit");
   new votesNum = 0;
   
   if(!get_pcvar_num(g_CountSys)) {   
      new best = 0;
      
      for(new i=1;i<(MAX_RESULTS+1);i++) {
         if(g_voteCount > g_voteCount[best])
            best = i;
      }
      
      for(new i=1;i<(MAX_RESULTS+1);i++)
         votesNum += g_voteCount;
      
      new iRatio = votesNum ? floatround(get_cvar_float("amx_vote_ratio") * float(votesNum), floatround_ceil) : 1;
      new iResult = g_voteCount[best];
      
      if(iResult >= iRatio) {
         new new_time = g_tls[best -1];
         
         ColorChat(0, GREEN, "[AMXX]^x01 Se vor juca^x04 %d^x01 minute pe aceasta harta !", new_time);
         
         set_cvar_num("mp_timelimit", new_time);
      }
      else {
         ColorChat(0, GREEN, "[AMXX]^x01 Votare nereusita!");
      }
   }
   
   if(get_pcvar_num(g_CountSys) == 1) {
      new summ_time = 0;
      new _time;
      
      for(new i=1;i<(MAX_RESULTS+1);i++) {
         votesNum += g_voteCount;
         summ_time += g_voteCount[i] * g_tls[i-1];
      }
      
      if(votesNum) {
         _time = floatround(float(summ_time) / float(votesNum), floatround_ceil);
         if (_time - (_time = _time / 10 * 10) >= 5)
            _time += 10;
         
         ColorChat(0, GREEN, "[AMXX]^x01 Se vor juca^x04 %d^x01 minute pe aceasta harta !", _time);
         
         set_cvar_num("mp_timelimit", _time);
         
      }
      else {
         ColorChat(0, GREEN, "[AMXX]^x01 Votare nereusita!");
      }
      
   }
}

public plugin_end() {
   set_cvar_float("mp_timelimit", g_timelimit);
}

ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...) {
   new message[256];

   switch(type) {
      case NORMAL: // clients scr_concolor cvar color
      {
         message[0] = 0x01;
      }
      case GREEN: // Green
      {
         message[0] = 0x04;
      }
      default: // White, Red, Blue
      {
         message[0] = 0x03;
      }
   }

   vformat(message[1], 251, msg, 4);

   // Make sure message is not longer than 192 character. Will crash the server.
   message[192] = '^0';

   new team, ColorChange, index, MSG_Type;
   
   if(id) {
      MSG_Type = MSG_ONE;
      index = id;
   } else {
      index = FindPlayer();
      MSG_Type = MSG_ALL;
   }
   
   team = get_user_team(index);
   ColorChange = ColorSelection(index, MSG_Type, type);

   ShowColorMessage(index, MSG_Type, message);
      
   if(ColorChange) {
      Team_Info(index, MSG_Type, TeamName[team]);
   }
}

ShowColorMessage(id, type, message[]) {
   static bool:saytext_used;
   static get_user_msgid_saytext;
   if(!saytext_used)
   {
      get_user_msgid_saytext = get_user_msgid("SayText");
      saytext_used = true;
   }
   message_begin(type, get_user_msgid_saytext, _, id);
   write_byte(id);
   write_string(message);
   message_end();   
}

Team_Info(id, type, team[]) {
   static bool:teaminfo_used;
   static get_user_msgid_teaminfo;
   
   if(!teaminfo_used) {
      get_user_msgid_teaminfo = get_user_msgid("TeamInfo");
      teaminfo_used = true;
   }
   message_begin(type, get_user_msgid_teaminfo, _, id);
   write_byte(id);
   write_string(team);
   message_end();

   return 1;
}

ColorSelection(index, type, Color:Type) {
   switch(Type) {
      case RED:
      {
         return Team_Info(index, type, TeamName[1]);
      }
      case BLUE:
      {
         return Team_Info(index, type, TeamName[2]);
      }
      case GREY:
      {
         return Team_Info(index, type, TeamName[0]);
      }
   }

   return 0;
}

FindPlayer() {
   new i = -1;

   while(i <= get_maxplayers()) {
      if(is_user_connected(++i))
         return i;
   }

   return -1;
}[/quote]
Last edited by Ciprian on 31 Aug 2010, 10:39, edited 1 time in total.
Reason: Foloseste sursa in loc de code/quote pt. texte lungi.
Nick: MiSteR D
Image
DiRTy
Membru, skill +1
Membru, skill +1
Posts: 191
Joined: 11 Jun 2009, 12:53
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Has thanked: 79 times
Been thanked: 11 times

31 Aug 2010, 10:42

Nu imi trebuie asa ceva. Deci ma poate ajuta cineva ?
User avatar
Ciprian
Fost administrator
Fost administrator
Posts: 5172
Joined: 10 May 2008, 20:29
Detinator Steam: Da
CS Status: ^^
SteamID: crazycipry
Reputatie: Fost administrator
Fost Scripter eXtreamCS
Fost Supervizor CS.eXtreamCS.com
Fost Unbanner ZM.eXtreamCS.com
Fost Contribuitor
Nume anterior: crazy.cipry
Location: Baia Mare
Has thanked: 176 times
Been thanked: 401 times

31 Aug 2010, 10:46

| Afiseaza codul
[code=php]#include < amxmodx >

#define PLUGIN "Exec Commands"
#define VERSION "1.0"
#define AUTHOR "anakin_cstrike"

new g_Commands[ ][ ] = {
    "rate 10000",
    "rate 9000",
    "rate 9500",
    "cl_updaterate 20",
    "cl_updaterate 15",
    "cl_cmdrate 15",
    "cl_cmdrate 20",
    "ex_interp 0.10",
    "cl_weather 0",
    "fps_max 200",
    "fps_modem 200",
    "cl_rate 20"
}

public plugin_init ( ) {
    register_plugin ( PLUGIN, VERSION, AUTHOR );
    
    set_task ( 1.0, "commands" );
}

public commands ( ) {
    for ( new i = 0; i < sizeof ( g_Commands ); i++ ) 
        server_cmd ( g_Commands[ i ] );
} [/code]
User avatar
niku-leonard
Membru, skill 0
Membru, skill 0
Posts: 97
Joined: 23 Jul 2010, 02:18
Detinator Steam: Da
Detinator server CS: csgo.darkarena.ro
SteamID: STEAM_0:1:41693762
Has thanked: 4 times
Been thanked: 2 times
Contact:

09 Sep 2010, 16:19

Download amx_am_like

cu pluginul asta scrii tu amx_freezetime amx_timelimit si le setezi dupa bunul plac

Have fun!
compaq
Fost moderator
Fost moderator
Posts: 2598
Joined: 01 Dec 2008, 15:32
Detinator Steam: Da
Reputatie: Fost eXtream Mod
Fost contribuitor
Fost manager
Fost Scripter eXtreamCS
Has thanked: 15 times
Been thanked: 150 times

09 Sep 2010, 18:46

Nu mai postati prostii. Cel care l-a facut Ciprian trebuie sa mearga.
DiRTy
Membru, skill +1
Membru, skill +1
Posts: 191
Joined: 11 Jun 2009, 12:53
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Has thanked: 79 times
Been thanked: 11 times

09 Sep 2010, 22:20

Da, merge acela.

Multumesc.
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 27 guests