SA-MP Forums Archive
death killer id - 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: death killer id (/showthread.php?tid=159172)



death killer id - legodude - 12.07.2010

how to check if someone if someone did kill hisself

my code is:
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	SendDeathMessage(killerid,playerid,reason);
	new name[MAX_PLAYER_NAME],kname[MAX_PLAYER_NAME], string[128];
    GetPlayerName(killerid, kname, sizeof(kname));
    GetPlayerName(playerid, name, sizeof(name));
	if(killerid==playerid)
	{
 	format(string, sizeof(string), "%s did suicide. his score will be reduced by 1",name);
 	SendClientMessageToAll(COLOR_DEATHMESSAGE, string);
 	if(playerid != INVALID_PLAYER_ID) SetPlayerScore(playerid, GetPlayerScore(killerid) - 1);
	}
	else if(playerid!=killerid)
	{
    format(string, sizeof(string), "%s has killed %s, %s will be awarded 1 score",kname, name, kname);
    SendClientMessageToAll(COLOR_DEATHMESSAGE, string);
    if(killerid != INVALID_PLAYER_ID){ SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);}
    }
	return 1;
}



Re: death killer id - MadeMan - 12.07.2010

And how can player kill himself?

Shoot himself?


Re: death killer id - legodude - 12.07.2010

fixed by the worldfamous, almighty, alknowing: GESO


Re: death killer id - samp03c - 23.01.2011

Hahahaah!
Quote:

And how can player kill himself?

Shoot himself?

He can get killed when he hites the barrel or when he falls somewhere! Like "legodude" said a suicide!!


Re: death killer id - samp03c - 23.01.2011

Thank you legodude!