command
#2

pawn Код:
new
    bool: CommandLimiter [ MAX_PLAYERS ] = false;

public OnPlayerCommandText(playerid, cmdtext[])
{
    if( strcmp ( "/work", cmdtext, true, 5 ) == 0 )
    {
        CommandLimiter [ playerid ] = true;
        return true;
    }
   
    else if( strcmp ( "/speed", cmdtext, true, 6 ) == 0 )
    {
        if( CommandLimiter [ playerid ] == false )
        {
            // Allow the command.
        }
        else return false;
    }
   
    else if( strcmp ( "/leave", cmdtext, true, 6 ) == 0 )
    {
        if( CommandLimiter [ playerid ] == true )
        {
            CommandLimiter [ playerid ] = false;
        }
        else return false;
    }
    return false;
}
Should give you a good idea on how to go about it.
Reply


Messages In This Thread
command - by maisto5 - 12.02.2013, 20:25
Re: command - by 2KY - 12.02.2013, 20:48
Re: command - by maisto5 - 15.02.2013, 15:05

Forum Jump:


Users browsing this thread: 1 Guest(s)