13.04.2014, 02:55
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
new kName[128];
new pID;
new string[500+MAX_PLAYER_NAME];
Dead[playerid] = 1;
// SetPlayerScore(playerid, GetPlayerScore(playerid) -1);
SetPlayerScore(killerid, GetPlayerScore(killerid) +1);
// KillingSpree[killerid] ++;
KillingSpree[playerid] = 0;
if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID)
{
new WeapName[32], Name[MAX_PLAYER_NAME], KillerName[MAX_PLAYER_NAME];
GetWeaponName(reason, WeapName, sizeof(WeapName));
GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
GetPlayerName(killerid, KillerName, MAX_PLAYER_NAME);
format(string, sizeof(string),"%s (%d) Died. Killed By: %s (%d) - %s. ", Name, playerid, KillerName, killerid, WeapName);
SendClientMessageToAll(COLOR_DARKRED, string);
}
else
{
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
format(string, sizeof(string),"%s (%d) Died.", Name, playerid);
SendClientMessageToAll(COLOR_DARKRED, string);
}
if(InDMS[playerid] == 1)
{
new Random = random(sizeof(RandomDMSpawns));
SetPlayerPos(playerid, RandomDMSpawns[Random][0], RandomDMSpawns[Random][1], RandomDMSpawns[Random][2]);
SetPlayerFacingAngle(playerid, RandomDMSpawns[Random][3]);
SetTimer("DMSTimer", 3000, false);
}
else SendDeathMessage(killerid, playerid, reason);