Quote:
Originally Posted by Koala818
To detect if a player commits suicide, just check if there's no killer (killerid==INVALID_PLAYER_ID)
pawn Код:
public OnPlayerDeath(playerid, killerid, reason) { if(a51_haveMB[playerid] == 1) //if you have Money bag { if(killerid!=INVALID_PLAYER_ID) //if reason isn't sucicide { GivePlayerMoney(killerid, a51_MB_money); new str[128], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(str, sizeof(str), "[AREA51]%s и STATO UCCISO! %s ha ora i soldi dell'area 51", name, killerid); SendClientMessageToAll(COLOR_RED, str); } else { new str[128], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(str, sizeof(str), "[AREA51]%s и MORTO e ha perso i soldi dell'area 51", name); SendClientMessageToAll(COLOR_RED, str); } a51_haveMB[playerid] = 0; GivePlayerMoney(playerid, -a51_MB_money); } return 1; }
|
thank you, i've add 1 rep to you