SA-MP Forums Archive
[HELP]YCMD Slap - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP]YCMD Slap (/showthread.php?tid=285339)



[HELP]YCMD Slap - TheBluec0de - 23.09.2011

What we do wrong? if I do this command on another play it on me why?

Код:
YCMD:slap(playerid, params[], help)
{
	#pragma unused help
	if (pInfo[playerid][pAdmin] == 0) return 0;
	
	new
	    giveplayerid,
	    Float:value,
	    reason[70];
	    
 	if (sscanf(params, "rfs[70]", giveplayerid, value, reason)) SendClientMessage(playerid, COLOR_GREEN, "* USAGE: /slap [Nick/ID] [Height] [Reason]");
 	else if (giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "* Player not fuond!");
 	else if (value < 1 || value > 100) SendClientMessage(playerid, COLOR_RED, "* Height can't by lower than 1 and bigger than 100!");
 	else
 	{
	    new
			Float:x,
			Float:y,
			Float:z;
			
		GetPlayerPos(playerid, x, y, z);
		SetPlayerPos(playerid, x, y, z +value);
		
		new
		    string[128];
		    
		format(string, 128, "['SLAP ]: %s was slapped by Admin %s. Reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
		SendClientMessageToAll(COLOR_RED, string);
	}
	return 1;
}



Re: [HELP]YCMD Slap - brett7 - 23.09.2011

Do you get any errors, and what doesn't work?


Re: [HELP]YCMD Slap - TheBluec0de - 23.09.2011

no errors, but if I do this command on another player throws me instead of the player on which I do


Re: [HELP]YCMD Slap - TheBluec0de - 23.09.2011

help me


Re: [HELP]YCMD Slap - iJumbo - 23.09.2011

pawn Код:
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z +value);
to
pawn Код:
GetPlayerPos(giveplayerid, x, y, z);
SetPlayerPos(giveplayerid, x, y, z +value);



Re: [HELP]YCMD Slap - TheBluec0de - 23.09.2011

Perfetto, Grazie jumbo.


Re: [HELP]YCMD Slap - [MWR]Blood - 23.09.2011

Aswell sscanf is bugged for 0.3d, just saying.


Re: [HELP]YCMD Slap - iJumbo - 23.09.2011

the plugin its bugged or the code too ?

https://sampwiki.blast.hk/wiki/Sscanf_code


Re: [HELP]YCMD Slap - [MWR]Blood - 23.09.2011

The plugin is bugged.


Re: [HELP]YCMD Slap - TheBluec0de - 23.09.2011

I use SA-MP 0.3c R5