avoid death - 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: avoid death (
/showthread.php?tid=433369)
avoid death -
Civilian - 27.04.2013
i need help with avoid death now if player its fight and dont have HP and Leave from game when he is fight System Give Msg %s quirt game in avoid death. who can make this?
Re: avoid death -
Jstylezzz - 27.04.2013
You can make this. Just check the leaving player's health, and send a message if it's lower than, 10 for example. S This is what the code would look like, sort of.
pawn Код:
public OnPlayerDisconnect(playerid,reason)
{
new Float:health;
GetPlayerHealth(playerid,health);
if(health < 10)
{
new string[128],pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,128,"%s has quit the game to avoid death. Same on you!",pName);
SendClientMessageToAll(-1,string);
}
return 1;
}
Try to play around with the functions I've used in the code above, and I'm sure you will able to do it just fine.
Re: avoid death -
Civilian - 27.04.2013
Thank you bro