[HELP]YCMD Slap
#1

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;
}
Reply
#2

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

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

help me
Reply
#5

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);
Reply
#6

Perfetto, Grazie jumbo.
Reply
#7

Aswell sscanf is bugged for 0.3d, just saying.
Reply
#8

the plugin its bugged or the code too ?

https://sampwiki.blast.hk/wiki/Sscanf_code
Reply
#9

The plugin is bugged.
Reply
#10

I use SA-MP 0.3c R5
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)