PHP код:
public OnPlayerDeath(playerid,killerid,reason)
{
SendDeathMessage(killerid,playerid,reason);
new PlayerSkin=GetPlayerSkin(playerid);
new Float:Angle, Float:x, Float:y, Float:z;
SpecDelay[playerid]=2;
if(PlayerInfo[playerid][PlayerStatus]==Aad)
{
if(PlayerInfo[playerid][PlayerTeam]!=TeamC)
{
PlayerInRound[playerid]=false;
PlayerInfo[playerid][PlayerDeaths]++,dini_IntSet(PlayerInfo[playerid][PlayerFile],"Deaths",PlayerInfo[playerid][PlayerDeaths]),PlayerRoundInfo[PlayerInfo[playerid][PlayerTeam]][PlayerInfo[playerid][Slot]][Deaths]++;
if(killerid!=InvalidId)PlayerRoundInfo[PlayerInfo[killerid][PlayerTeam]][PlayerInfo[killerid][Slot]][Kills]++,PlayerInfo[killerid][PlayerRoundKills]++,TopKillerCount(killerid),PlayerInfo[killerid][PlayerKills]++,dini_IntSet(PlayerInfo[killerid][PlayerFile],"Kills",PlayerInfo[killerid][PlayerKills]);
if(PlayerInfo[playerid][PlayerTeam]==TeamA) TeamInfo[TeamB][Score]++;
else if(PlayerInfo[playerid][PlayerTeam]==TeamB) TeamInfo[TeamA][Score]++;
PlayerInfo[playerid][PlayerStatus]=Waiting,
SetSpawnInfo(playerid,0,PlayerSkin,MainSpawn[0]+RandomPOS[random(13)][0],MainSpawn[1]+RandomPOS[random(13)][0],MainSpawn[2],MainSpawn[3],0,0,0,0,0,0);
}
else SetSpawnInfo(playerid,0,PlayerSkin,x,y,z,Angle,0,0,0,0,0,0);
}
else if(PlayerInfo[playerid][PlayerStatus]==Tw)
{
if(PlayerInfo[playerid][PlayerTeam]!=TeamC)
{
PlayerInRound[playerid]=false;
PlayerInfo[playerid][PlayerDeaths]++,dini_IntSet(PlayerInfo[playerid][PlayerFile],"Deaths",PlayerInfo[playerid][PlayerDeaths]),PlayerRoundInfo[PlayerInfo[playerid][PlayerTeam]][PlayerInfo[playerid][Slot]][Deaths]++;
if(killerid!=InvalidId)PlayerRoundInfo[PlayerInfo[killerid][PlayerTeam]][PlayerInfo[killerid][Slot]][Kills]++,PlayerInfo[killerid][PlayerRoundKills]++,TopKillerCount(killerid),PlayerInfo[killerid][PlayerKills]++,dini_IntSet(PlayerInfo[killerid][PlayerFile],"Kills",PlayerInfo[killerid][PlayerKills]);
if(PlayerInfo[playerid][PlayerTeam]==TeamA) TeamInfo[TeamB][Score]++;
else if(PlayerInfo[playerid][PlayerTeam]==TeamB) TeamInfo[TeamA][Score]++;
PlayerInfo[playerid][PlayerStatus]=Waiting,
SetSpawnInfo(playerid,0,PlayerSkin,MainSpawn[0]+RandomPOS[random(13)][0],MainSpawn[1]+RandomPOS[random(13)][0],MainSpawn[2],MainSpawn[3],0,0,0,0,0,0);
}
else SetSpawnInfo(playerid,0,PlayerSkin,x,y,z,Angle,0,0,0,0,0,0);
}
else if(PlayerInfo[playerid][PlayerStatus]==Tdm)
{
if(PlayerInfo[playerid][PlayerTeam]!=TeamC)
{
PlayerInfo[playerid][PlayerDeaths]++,dini_IntSet(PlayerInfo[playerid][PlayerFile],"Deaths",PlayerInfo[playerid][PlayerDeaths]),PlayerRoundInfo[PlayerInfo[playerid][PlayerTeam]][PlayerInfo[playerid][Slot]][Deaths]++;
if(killerid!=InvalidId)PlayerRoundInfo[PlayerInfo[killerid][PlayerTeam]][PlayerInfo[killerid][Slot]][Kills]++,PlayerInfo[killerid][PlayerRoundKills]++,TopKillerCount(killerid),PlayerInfo[killerid][PlayerKills]++,dini_IntSet(PlayerInfo[killerid][PlayerFile],"Kills",PlayerInfo[killerid][PlayerKills]);
if(PlayerInfo[playerid][PlayerTeam]==TeamA) TeamInfo[TeamB][Score]++,SetSpawnInfo(playerid,0,TeamInfo[TeamA][Skin],ArenaCoord[0]+RandomPOS[random(13)][0],ArenaCoord[1]+RandomPOS[random(13)][0],ArenaCoord[2],ArenaCoord[3],0,0,0,0,0,0);
else if(PlayerInfo[playerid][PlayerTeam]==TeamB) TeamInfo[TeamA][Score]++,SetSpawnInfo(playerid,0,TeamInfo[TeamB][Skin],ArenaCoord[4]+RandomPOS[random(13)][0],ArenaCoord[5]+RandomPOS[random(13)][0],ArenaCoord[6],ArenaCoord[7],0,0,0,0,0,0);
}
else SetSpawnInfo(playerid,0,PlayerSkin,x,y,z,Angle,0,0,0,0,0,0);
}
else if(PlayerInfo[playerid][PlayerStatus]==Waiting)
{
SetSpawnInfo(playerid,0,PlayerSkin,MainSpawn[0]+RandomPOS[random(13)][0],MainSpawn[1]+RandomPOS[random(13)][0],MainSpawn[2],MainSpawn[3],0,0,0,0,0,0);
}
else if(PlayerInfo[playerid][PlayerStatus]==Sub)
{
if(PlayerInfo[playerid][Duel]>0)
{
new DuelStr[256];
new duelid=PlayerInfo[playerid][Duel];
if(killerid != InvalidId)
{
new Hp,Float:H,Float:A;
GetPlayerHealth(killerid,H),GetPlayerArmour(killerid,A);
Hp=floatround(H,floatround_round)+floatround(A,floatround_round);
format(DuelStr,MaxString,"(DUEL): \"%s\" Derrotou \"%s\" no /Duel %d (Hp Restante: %d).",PlayerInfo[killerid][PlayerName],PlayerInfo[playerid][PlayerName],duelid,Hp);
PlayerInfo[killerid][PlayerDuelKills]++;
dini_IntSet(PlayerInfo[killerid][PlayerFile],"DuelKills",PlayerInfo[killerid][PlayerDuelKills]);
PlayerInfo[playerid][PlayerDuelDeaths]++;
dini_IntSet(PlayerInfo[playerid][PlayerFile],"DuelDeaths",PlayerInfo[playerid][PlayerDuelDeaths]);
}
else
{
format(DuelStr,MaxString,"(DUEL): \"%s\" Suicidou-se no /Duel %d.",PlayerInfo[playerid][PlayerName],duelid);
}
SetSpawnInfo(playerid,0,GetPlayerSkin(playerid),MainSpawn[0]+RandomPOS[random(13)][0],MainSpawn[1]+RandomPOS[random(13)][0],MainSpawn[2],MainSpawn[3],0,0,0,0,0,0);
DuelInfos[duelid][Status]=Ending;
PlayerInfo[playerid][Duel]=0;
SendClientMessageToAll(ServerColor2,DuelStr);
}
SetSpawnInfo(playerid,0,PlayerSkin,MainSpawn[0]+RandomPOS[random(13)][0],MainSpawn[1]+RandomPOS[random(13)][0],MainSpawn[2],MainSpawn[3],0,0,0,0,0,0);
}
return 1;
}