10.11.2009, 14:58
I just wanted to make a /afk <minutes> <reason> command and tried to split the string with sscanf.
but now when you do /afk 2 its working fine but by doing /afk 2 some reason you get : "kidul is away from keyboard for 97 minutes (Reason: ...kidul)"
here is my code:
but now when you do /afk 2 its working fine but by doing /afk 2 some reason you get : "kidul is away from keyboard for 97 minutes (Reason: ...kidul)"
here is my code:
Код:
command(afk, playerid, params[]) { new string[128]; new pName[MAX_PLAYER_NAME]; new minutes, reason; if(sscanf(params,"uz",minutes,reason)) return SendClientMessage(playerid,0xFF0000AA,"Usage: /afk <minutes> <reason>"); GetPlayerName(playerid,pName,sizeof(pName)); format(string,sizeof(string),"%s is away from keyboard for %i minutes (Reason: %s)",pName,minutes,reason); SendClientMessageToAll(0xFF0000AA,string); return 1; }