Raised This Month: $12 Target: $400
 3% 

Someone knows how to...


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
unnyquee
Senior Member
Join Date: Jun 2009
Location: Constanta, Romania
Old 05-27-2010 , 12:37   Re: Someone knows how to...
Reply With Quote #11

PHP Code:
#include <amxmodx>

#pragma semicolon 1

new const g_szCommands[][] =
{
      
"/rr",
      
"!rr",
      
".rr"
};


public 
plugin_init()
{
      
register_plugin("O""M""G");
      
      
register_concmd("say""ConsoleCommand_Say");
}

public 
ConsoleCommand_Say(iClient)
{
      new 
szSaid[192], szCommand[3], szValue[3], iValue;
      
      
read_args(szSaidcharsmax(szSaid));
      
      for(new 
0sizeof(g_szCommands); i++)
      {
           if(
equali(szSaidg_szCommands[i], 3))
           {
                 
strbreak(szSaidszCommandcharsmax(szCommand), szValuecharsmax(szValue));
            
                 
iValue str_to_num(szValue);
            
                 if(
iValue)
                       
server_cmd("sv_restart %d"iValue);
            
                 else
                       
server_cmd("sv_restart 1");
           }
      }

      return 
PLUGIN_CONTINUE;

Not tested, though.
__________________

Last edited by unnyquee; 05-27-2010 at 12:46. Reason: edited a lil' bit
unnyquee is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:53.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode