SA-MP Forums Archive
Player help - 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: Player help (/showthread.php?tid=620371)



Player help - Hunud - 29.10.2016

Help me for +REP

How to made if i slap player that it only takes 5 percent of his health if you understand me!


Re: Player help - iLearner - 29.10.2016

On setplayerPos set the Z+VALUE to whatever you want, you gotta check where it takes 5 percent.


Re: Player help - ThatFag - 29.10.2016

Код:
COMMAND:slap(playerid, params[])
{
	new iPlayer;
	if( sscanf ( params, "u", iPlayer))  return SendClientMessage(playerid,-1, "[PlayerID/PartOfName]");
	if(!IsPlayerConnected(iPlayer)) return SendClientMessage(playerid,-1,"No player with that id" );
	new Float:old;
	GetPlayerHealth(iPlayer,old);
	SetPlayerHealth(iPlayer,old-5);
	GetPlayerPos(iPlayer,px,py,pz);
	return 1;
}
Edited.


Re: Player help - Hunud - 29.10.2016

I mean whenever i slap playerid it will always take 5 percent of his/her health ?