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