16.01.2013, 03:37
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
PlayerInfo[killerid][Kills]++;
PlayerInfo[playerid][Deaths]++;
SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
OnWeaponDrop(playerid);
SendClientMessage(playerid, -1, "I am called.");
if(killerid != TopKiller)
{
TopKiller = killerid;
TopKills = 0;
}
TopKills++;
if(TopKills == 5)
{
new String[128];
format(String,sizeof(String),"You have filled the kills board with your name and recived a 25000$ bonus!");
SendClientMessage(playerid,0xFF0000DD,String);
GivePlayerMoney(killerid,25000);
TopKills = 0;
}
if(playerid == CashboxOwner)
{
new str[128], pName[MAX_PLAYER_NAME];
GetPlayerPos(playerid, CashboxX, CashboxY, CashboxZ);
GetPlayerName(playerid, pName, sizeof(pName));
format(str, 128, "Cashbox-Owner %s (ID: %d) has died and droped the cashbox!", pName, playerid);
SendClientMessageToAll(0xFFD700AA, str);
CashboxPickup = CreatePickup(1210, 3, CashboxX, CashboxY, CashboxZ);
CashboxOwner = INVALID_PLAYER_ID;
if(mode == 1)
{
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
SetPlayerCheckpoint(i, CashboxX, CashboxY, CashboxZ, 1);
}
}
}
}
if(PlayerInfo[playerid][InDerby] == 1)
{
SendFMessageToAll(COL_RED,"« Derby » "CBLUE"%s has died while in the derby!",PlayerName(playerid));
derbyplayers--;
PlayerInfo[playerid][InDerby] = 0;
}
if(Joined[playerid] == true)
{
JoinCount--;
Joined[playerid] = false;
DestroyVehicle(CreatedRaceVeh[playerid]);
DisablePlayerRaceCheckpoint(playerid);
TextDrawHideForPlayer(playerid, RaceInfo[playerid]);
TextDrawHideForPlayer(playerid, RaceBox);
TextDrawHideForPlayer(playerid, RaceLogo);
TextDrawHideForPlayer(playerid, RaceOut1);
TextDrawHideForPlayer(playerid, RaceOut2);
CPProgess[playerid] = 0;
KillTimer(InfoTimer[playerid]);
#if defined RACE_IN_OTHER_WORLD
SetPlayerVirtualWorld(playerid, 0);
#endif
}
if(BuildRace == playerid+1) BuildRace = 0;
return 1;
}