Please, how to make one command with two usages? Using ycmd sscanf2
#1

Hello guys, I need to make this time command to have 2 usages. First usage I have done. It is /restart HOUR MIN but I want to make this command when player enters /restart SEC, when he just type one integer I want to make it for seconds. But dont know how to add it to the command. Code:

pawn Код:
YCMD:restart (playerid, params [], help)
{
    if (!IsPlayerAdmin (playerid)) return SendClientMessage (playerid, -1, "You must be main administrator to use this command!");
    new string [128];
    if (sscanf (params, "ii", restarth, restartm)) return SendClientMessage (playerid, -1, "You have entered wrong format of command. Use: /restart HOUR MINUTE");
    format (string, sizeof (string), "Administrator set server restart today, in time: %d:%d", restarth, restartm);
    SendClientMessageToAll (-1, string);
    SetTimer ("RLTimeRestart", 1000*60, false);
    return true;
}
Thx.
Reply


Messages In This Thread
Please, how to make one command with two usages? Using ycmd sscanf2 - by Riwerry - 29.12.2013, 09:40
Re: Please, how to make one command with two usages? Using ycmd sscanf2 - by Threshold - 29.12.2013, 10:03
Re: Please, how to make one command with two usages? Using ycmd sscanf2 - by Riwerry - 29.12.2013, 10:14
Re: Please, how to make one command with two usages? Using ycmd sscanf2 - by Threshold - 29.12.2013, 10:33

Forum Jump:


Users browsing this thread: 1 Guest(s)