26.02.2014, 12:48
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
new kName[128];
new string[503];
new pID;
isDead[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) Has Killed %s (%d) With A %s. ", KillerName, killerid, Name, playerid, WeapName);
SendClientMessageToAll(COLOR_DARKRED, string);
}
if(KillingSpree[killerid] == 10)
{
format(string, sizeof(string), "%s (%d) Is Klapping Niggaz, 10 Killing Spree.", PlayerName(killerid), killerid);
TextDrawSetString(RandomText2, string);
TextDrawShowForAll(RandomText2);
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
GivePlayerMoney(killerid, 10500);
}
if(KillingSpree[killerid] == 15)
{
format(string, sizeof(string), "%s (%d) Is Unstopable, 15 Killing Spree!", PlayerName(killerid), killerid);
TextDrawSetString(RandomText2, string);
TextDrawShowForAll(RandomText2);
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
GivePlayerMoney(killerid, 12500);
}
if(KillingSpree[killerid] == 20)
{
format(string, sizeof(string), "%s (%d) Is Dominating, 20 Killing Spree!", PlayerName(killerid), killerid);
TextDrawSetString(RandomText2, string);
TextDrawShowForAll(RandomText2);
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
GivePlayerMoney(killerid, 15500);
}
if(KillingSpree[killerid] == 25)
{
format(string, sizeof(string), "%s (%d) Is Legendary 25 Killing Spree!", PlayerName(killerid), killerid);
TextDrawSetString(RandomText2, string);
TextDrawShowForAll(RandomText2);
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
GivePlayerMoney(killerid, 20500);
}
if(IsInChallenge[playerid] == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i) && GetPlayerVirtualWorld(playerid) > 0 && i != playerid && IsSpecing[i] == 0)
{
format(string, sizeof string, "%s (%d) Won Against %s (%d) In A Fighting Challenge!", PlayerName(i), playerid, PlayerName(playerid), pID);
// GameTextForPlayer(playerid, "~r~flopped", 3000, 5);
// GameTextForPlayer(killerid, "~w~klapped", 3000, 6);
IsInChallenge[playerid] = 0;
IsInChallenge[i] = 0;
OfferingChallenger[playerid] = -1;
GivePlayerMoney(killerid, 1000);
if(GetPVarInt(playerid, "akilled") == 0)
SetPVarInt(playerid, "akilled", 0);
SetPVarInt(playerid,"PillsTaken",0);
GetPlayerName(killerid, kName, sizeof(kName));
PlayerKills[killerid] = PlayerKills[killerid] +1;
PlayerKills[playerid] = 0;
SetPVarInt(playerid, "Dead", 1);
SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid) + 1);
SetPlayerWantedLevel(playerid, 0);
TextDrawHideForPlayer(playerid, RandomText0);
TextDrawHideForPlayer(playerid, RandomText1);
TextDrawHideForPlayer(playerid, RandomText2);
}
}
}
if(InDMS[playerid] == 1)
{
new Random = random(sizeof(RandomDMSpawns));
SendDeathMessage(killerid, playerid, reason);
SetPlayerPos(playerid, RandomDMSpawns[Random][0], RandomDMSpawns[Random][1], RandomDMSpawns[Random][2]);
SetPlayerFacingAngle(playerid, RandomDMSpawns[Random][3]);
SetTimer("DMSTimer", 3000, false);
}
return 1;
}