26.08.2010, 11:01
Код:
public OnPlayerDeath(playerid, killerid, reason) { if(killerid != INVALID_PLAYER_ID) { new pname[30]; new string[95]; GetPlayerName(killerid,pname,30); format(string, sizeof(string),"* You were killed by %s(%d): Distance: %2.f | Weapon: %s",pname,killerid,GetDistanceBetweenPlayers(playerid,killerid),aWeaponNames[reason]); SendClientMessage(playerid,COLOR_LIGHTGREEN, string); SendDeathMessage(INVALID_PLAYER_ID, playerid, reason); SetPlayerScore(playerid,(GetPlayerScore(playerid))-1); GivePlayerMoney(playerid, -500); SendClientMessage(playerid,COLOR_RED,"You lost 500$"); SendClientMessage(playerid,COLOR_RED,"You lost 1pt score"); } else { //You had a ( instead of a { GetPlayerName(killerid,pname,30); format(string, sizeof(string),"* You killed %s(%d): Distance: %2.f | Weapon: %s",pname,killerid,GetDistanceBetweenPlayers(playerid,killerid),aWeaponNames[reason]); SendClientMessage(playerid,COLOR_LIGHTGREEN, string); SendDeathMessage(killerid, playerid, reason); SetPlayerScore(killerid,(GetPlayerScore(killerid))+1); GivePlayerMoney(killerid, 1000); SendClientMessage(killerid,COLOR_GREEN,"You earned 1000$"); SendClientMessage(killerid,COLOR_GREEN,"You won 1pt score"); } return 1; }