12.07.2010, 12:18
how to check if someone if someone did kill hisself
my code is:
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; }