some admin commands help
#4

Sure. I have built a barebones command for you. You will need to edit the script specific information (I just used the most generic information I could think of) and you will need to edit what you want to happen when time == 0 or some other number, but this is what it would look like using multiple parameters.

pawn Код:
COMMAND:freeze(playerid, params[])
{  
    new player, time, reason[128];
    if(pInfo[playerid][Admin] < 1)
    {
        SendClientMessage(playerid, RED, "Error: You are not an admin");
    }
    else if(sscanf(params, "iis", player, time, reason ))
    {
        SendClientMessage(playerid, BLUE, "Syntax: /freeze [playerid] [time] [reason]");
    }
    else
    {
        if(time == 0)
        {
             // Freeze the player permanently.
        }
        else
        {
            // Freeze the player for 'time' using a timer.
        }
    }
    return 1;
}
Also, quick warning: this code is not tested. While I'm eyeballing it and it looks good, it may contain an error. I would not recommend actually using this code as, like I said, it is just the 'example' you were asking for.
Reply


Messages In This Thread
some admin commands help - by -=Dar[K]Lord=- - 27.04.2013, 14:06
Re: some admin commands help - by RVRP - 27.04.2013, 14:11
Re: some admin commands help - by -=Dar[K]Lord=- - 27.04.2013, 14:19
Re: some admin commands help - by RVRP - 27.04.2013, 14:40
Re: some admin commands help - by -=Dar[K]Lord=- - 27.04.2013, 14:41
Re: some admin commands help - by RVRP - 27.04.2013, 14:51
Re: some admin commands help - by ]Rafaellos[ - 27.04.2013, 15:00

Forum Jump:


Users browsing this thread: 1 Guest(s)