death killer id
#1

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;
}
Reply
#2

And how can player kill himself?

Shoot himself?
Reply
#3

fixed by the worldfamous, almighty, alknowing: GESO
Reply
#4

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!!
Reply
#5

Thank you legodude!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)