some admin commands help
#6

I'm not sure if I understand what you are asking, but I'll go ahead and explain to the best of my ability.

If you want the 'reason' to be optional (in other words, if they don't want to put a reason they don't have to), you use 'z' instead of 's' to place an optional string.

Then, you would need to designate an area to decide what would happen if the player did and didn't enter a reason. Check out the new barebones command below:

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, "iiz", player, time, reason))
    {
        SendClientMessage(playerid, BLUE, "Syntax: /freeze [playerid] [time] [reason]");
    }
    else
    {
        if(strlen(reason) == 0)
        {
            // What happens if no reason is entered.
        }
        if(strlen(reason) > 0)
        {
            // What happens if a reason is entered.
        }  
        if(time == 0)
        {
             // Freeze the player permanently.
        }
        if(time >= 0)
        {
            // Freeze the player for 'time' using a timer.
        }
    }
    return 1;
}
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)