PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
if(PlayerInfo[playerid][InParkour] > 0)
{
SendClientMessage(playerid, -1, ""RED"[Parkour]: "GREY"You have died while in parkour! Parkour event has been cancelled..");
PlayerInfo[playerid][InParkour] = 0;
}
if(IsBeingSpeced[playerid] == 1)
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if(spectatorid[i] == playerid)
{
format(strg, sizeof(strg), ""STEELBLUE"- AS - {%06x}%s(%d) "STEELBLUE"died while you were spectating, you may resume spectating by using /spec again.", (GetPlayerColor(playerid) >>> 8), GetName(playerid), playerid);
SendClientMessage(i, -1, strg);
TogglePlayerSpectating(i,false);
}
}
}
GameTextForPlayer(playerid, "~r~DEAD!", 3000, 3);
PlayerInfo[playerid][Deaths]++;
if(killerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[killerid][ClanID] != 0)
{
new query[128];
mysql_format(MySQL, query, 128, "SELECT `cScore` FROM `"Clans_Table"` WHERE cID = '%i' LIMIT 1", PlayerInfo[killerid][ClanID]);
mysql_tquery(MySQL, query, "IncreaseClanScore", "ii", PlayerInfo[killerid][ClanID], 1);
//IncreaseClanScore(PlayerInfo[killerid][ClanID]);
}
if(PlayerInfo[playerid][Robbing] == 1)
{
if(IsPlayerInRobberyCP(playerid))
{
GameTextForPlayer(playerid,"~r~Robbery failed! ~n~~b~You left the checkpoint!",3000,5);
PlayerInfo[playerid][Robbing] = 0;
RobberyTimer[playerid] = 0;
}
}
gTotalKills++;
switch (gTotalKills)
{
case 50: SendClientMessageToAll(-1, "{FFD700}[USF] {008FFB}50{2BD9F8} players have been killed since the server launch!");
case 100: SendClientMessageToAll(-1, "{FFD700}[USF] {008FFB}100{2BD9F8} players have been killed since the server launch!");
case 250: SendClientMessageToAll(-1, "{FFD700}[USF] {008FFB}100{2BD9F8} players have been killed since the server launch!");
case 500: SendClientMessageToAll(-1, "{FFD700}[USF] {008FFB}500{2BD9F8} players have been killed since the server launch!");
case 1000: SendClientMessageToAll(-1, "{FFD700}[USF] {008FFB}1000{2BD9F8} players have been killed since the server launch!");
}
SaveServerInfo();
new str[128];
//DM
EXPforDM[killerid] = CreatePlayerTextDraw(killerid, 2.500000, 175.466751, "+1 Score");
PlayerTextDrawLetterSize(killerid, EXPforDM[killerid], 0.449999, 1.600000);
PlayerTextDrawAlignment(killerid, EXPforDM[killerid], 1);
PlayerTextDrawColor(killerid, EXPforDM[killerid], -5963521);
PlayerTextDrawSetShadow(killerid, EXPforDM[killerid], 0);
PlayerTextDrawSetOutline(killerid, EXPforDM[killerid], -256);
PlayerTextDrawBackgroundColor(killerid, EXPforDM[killerid], 51);
PlayerTextDrawFont(killerid, EXPforDM[killerid], 2);
PlayerTextDrawSetProportional(killerid, EXPforDM[killerid], 1);
CashforDM[killerid] = CreatePlayerTextDraw(killerid, 2.500000, 191.644439, "+3000$");
PlayerTextDrawLetterSize(killerid, CashforDM[killerid], 0.449999, 1.600000);
PlayerTextDrawAlignment(killerid, CashforDM[killerid], 1);
PlayerTextDrawColor(killerid, CashforDM[killerid], 16711935);
PlayerTextDrawSetShadow(killerid, CashforDM[killerid], 0);
PlayerTextDrawSetOutline(killerid, CashforDM[killerid], 0);
PlayerTextDrawBackgroundColor(killerid, CashforDM[killerid], 51);
PlayerTextDrawFont(killerid, CashforDM[killerid], 2);
PlayerTextDrawSetProportional(killerid, CashforDM[killerid], 1);
PlayerTextDrawShow(killerid, EXPforDM[killerid]);
PlayerTextDrawShow(killerid, CashforDM[killerid]);
PlayerTextDrawShow(killerid, EXPforDM[killerid]);
PlayerTextDrawShow(killerid, CashforDM[killerid]);
PlayerInfo[killerid][Kills]++;
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
GivePlayerMoney(killerid, 3000);
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if (PlayerInfo[i][inDM] == 1)
{
format(str, sizeof(str), "%s(%d) killed %s(%d) (%s)", GetName(killerid), killerid, GetName(playerid), playerid, WeaponNames[reason]);
SendClientMessage(i, COLOR_VIOLET, str);
}
}
}
//SendClientMessageToAll(COLOR_VIOLET, str);
gDMTD = SetTimerEx("HideDMTextDraw", 2000, false, "i", killerid);
}
return 1;
}