OnPlayerDeath
#1

I kinda have a problem here, i`m making a gravedigger job and let a message + checkpoint spawn to the gravediggers when someone dies.. this works perfect as long as the player is killed, but when the player just dies with "/kill" or falls or any other reason then the message + checkpoint doesnt work.. its kinda anoying me now since there`s nothing that only makes the message show when someone gets killed instead of dieing without being killed.

public OnPlayerDeath
Код:
	new Float:px,Float:py,Float:pz;
	GetPlayerPos(playerid, px, py, pz);
	if(IsPlayerConnected(playerid))
	{
        //------Grave Digger:-------//
		for(new i = 0; i < MAX_PLAYERS; i++)
		{
			if(IsPlayerConnected(i))
			{
				SetPlayerCheckpoint(i, px, py, pz, 5);
				SendClientMessage(i, COLOR_RED, "* Someone died, go collect his body.");
			}
		}
		//---------<
	}
(even this without sending it only to gravediggers doesnt work when the player isnt killed & works perfect when he/she gets killed.. is that weird or just me nub? xD)

EDIT: nvm, made a second onplayerdeath and works fine
Reply
#2

Debug 'playerid' to see if it changes when you die and when you're killed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)