pls help me with my string :)
#1

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:
Код:
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;
}
Reply


Messages In This Thread
pls help me with my string :) - by KIDUL - 10.11.2009, 14:58
Re: pls help me with my string :) - by KIDUL - 10.11.2009, 16:04
Re: pls help me with my string :) - by (.Aztec); - 10.11.2009, 16:06
Re: pls help me with my string :) - by KIDUL - 10.11.2009, 16:12
Re: pls help me with my string :) - by KIDUL - 10.11.2009, 16:23
Re: pls help me with my string :) - by oncedead - 10.11.2009, 16:31

Forum Jump:


Users browsing this thread: 1 Guest(s)