sscanf and OnRconCommand
#2

It works exactly the same way as in commands.

The difference, is that the first parameter is the command itself.

PHP код:
public OnRconCommand(cmd[])
{
    new 
command[40];
    
    if(
sscanf(cmd,"s[40]",command))
        return 
0;
    
    if(!
strcmp(command,"test",true))
    {
        
printf("You typed rcon command 'test'!");
        
        return 
1;
    }
    else if(!
strcmp(command,"anothertest",true))
    {
        
printf("You typed rcon command 'anothertest'!");
        
        return 
1;
    }
    return 
0;

Hope it helps.
Reply


Messages In This Thread
sscanf and OnRconCommand - by JaKe Elite - 17.03.2015, 01:48
Re: sscanf and OnRconCommand - by arakuta - 17.03.2015, 02:03
Re: sscanf and OnRconCommand - by JaKe Elite - 17.03.2015, 03:46
Re: sscanf and OnRconCommand - by Threshold - 17.03.2015, 10:42

Forum Jump:


Users browsing this thread: 1 Guest(s)