SA-MP Forums Archive
[Help] How to set up dying - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] How to set up dying (/showthread.php?tid=261511)



[Help] How to set up dying - zouyun - 13.06.2011

When my character gets killed theirs a loop that makes him die and die again. How can I make him spawn with full health again?


Re: [Help] How to set up dying - zouyun - 14.06.2011

Can anyone help me?


Re: [Help] How to set up dying - park4bmx - 14.06.2011

Can u show us your OnPlayerDeath
Code pls


Re: [Help] How to set up dying - zouyun - 14.06.2011

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	new string[64];
	GivePlayerMoney(playerid, -1000);
	GivePlayerMoney(playerid, 1000);
	format(string, sizeof(string), "KILL: You were killed by %s.", killerid);
	SendClientMessage(playerid, COLOR_RED, string);
	format(string, sizeof(string), "KILL: %s was killed by %s.",playerid,killerid);
	SendClientMessageToAll(COLOR_RED, string);
	if(killerid != INVALID_PLAYER_ID) SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
	if(playerid != INVALID_PLAYER_ID) SetPlayerScore(playerid, GetPlayerScore(killerid) - 1);
	return 1;
}



Re: [Help] How to set up dying - grand.Theft.Otto - 14.06.2011

Are you talking about the bug where someone dies and flops to the ground, then it happens a second time, then a 3rd time, etc... then stops and fully kills him, then the camera swings and respawns him?


Re: [Help] How to set up dying - zouyun - 14.06.2011

Well I type /rcon gravity 0 then /rcon gravity 1 wich kills me when I hit the ground. Then when I die I respawn and get kill again and again for ever.


Re: [Help] How to set up dying - Gazmull - 15.06.2011

Change your gravity to default


Re: [Help] How to set up dying - Kwarde - 15.06.2011

Default gravity is 0.008 and not 1 (When I was a beginner I made that mistake :P)
Quote:

GivePlayerMoney(playerid, -1000);
GivePlayerMoney(playerid, 1000);

So it removes 1000 dollar and then gives it back. Use 'killerid' instead of 'playerid' at the second one.

p.s.
Try gravity -1 ^^