Optinal multi params command using sscanf
#3

yes iam using sscanf but look at this cmd ZCMD

Код:
CMD:slap(playerid, params[])
{
	    if(sscanf(params, "us[128]", pid, creason)) return SendClientMessage(playerid, Grey, "Usage:/slap <id> <reason>");
		else
		{
			GetPlayerPos(pid, X, Y, Z);
			SetPlayerPos(pid, X, Y, Z+6);
			new Float:Health;
			GetPlayerHealth(pid,Health);
			SetPlayerHealth(pid,Health-20);
			PlayerPlaySound(playerid,1190,0.0,0.0,0.0);
			PlayerPlaySound(pid,1190,0.0,0.0,0.0);
			GetPlayerName(playerid, pname, 24);
			GetPlayerName(pid, gname, 24);
			format(sc, sizeof(sc), "AdmCmd:%s(%d) Was slapped by admin %s reason: %s", gname, pid, pname, creason);
			SendClientMessageToAll(Red, sc);
		}
	return 1;
}
problem is that params has pid whick is the slapped player idk how to make the slapped player id cant be removed and the reason optional please help

YES IAM USING SSCANF

no other old shit plz
Reply


Messages In This Thread
Optinal multi params command using sscanf - by Kyro - 12.03.2011, 12:26
Re: Optinal multi params command using sscanf - by JamesC - 12.03.2011, 12:28
Re: Optinal multi params command using sscanf - by Kyro - 12.03.2011, 12:34
Re: Optinal multi params command using sscanf - by JamesC - 12.03.2011, 12:46
Re: Optinal multi params command using sscanf - by Kyro - 12.03.2011, 12:52
Re: Optinal multi params command using sscanf - by JamesC - 12.03.2011, 12:56
Re: Optinal multi params command using sscanf - by Kyro - 12.03.2011, 13:12
Re: Optinal multi params command using sscanf - by Kyro - 12.03.2011, 13:41
Re: Optinal multi params command using sscanf - by HyperZ - 12.03.2011, 14:08
Re: Optinal multi params command using sscanf - by Kyro - 12.03.2011, 14:15

Forum Jump:


Users browsing this thread: 2 Guest(s)