PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
SetTimerEx("AntiFakeFreeKill", 2000,false,"i",playerid);
DarK_OnPlayerDeath(playerid, killerid, reason);
KillTimer(TimerTeleportCP[playerid]);
if(TaX1[playerid] == true)
{
BloquearComandosNoX1[playerid] = false;
ResetPlayerWeapons(playerid);
ResetPlayerWeapons(killerid);
TaX1[playerid] = false;
TaX1[killerid] = false;
SpawnPlayer(killerid);
Playersx1 = 0;
new string[128];
new pname[MAX_PLAYER_NAME];
new matador[MAX_PLAYER_NAME];
GetPlayerName(killerid, matador, sizeof(matador));
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "[X1] {09FF00}%s {00FFE1}venceu o /x1 contra {FF0000}%s{00FFE1} parabйns para o {09FF00}%s{00FFE1}!", matador, pname, matador);
SendClientMessageToAll(AMARELO, string);
}else{
GetPlayerPos(playerid, pos_info[playerid][pX], pos_info[playerid][pY], pos_info[playerid][pZ]);
GetPlayerFacingAngle(playerid, pos_info[playerid][pA]);
CriouCaixao++;
ObjetoCaixao[CriouCaixao] = CreateObject(19339, pos_info[playerid][pX], pos_info[playerid][pY], pos_info[playerid][pZ]-0.7, 0.00000, 0.00000, pos_info[playerid][pA]);
ObjetoMorto[playerid] = CreateObject(18668, pos_info[playerid][pX], pos_info[playerid][pY], pos_info[playerid][pZ]-0.6, 0.00000, 0.00000, 0.00000);
new string[128];
new pname[MAX_PLAYER_NAME];
new matador[MAX_PLAYER_NAME];
GetPlayerName(killerid, matador, sizeof(matador));
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "{FF0000}%s{3845FF} foi morto por {00FF22}%s{3845FF} aqui!", pname,matador);
CriouTextoCaixao++;
TextoCaixao[CriouTextoCaixao] = Create3DTextLabel(string, 0xFF00FFFF, pos_info[playerid][pX], pos_info[playerid][pY], pos_info[playerid][pZ], 40.0, 0, 0);
SetTimerEx ( "ApagarObjetoMorto" , 5000 , 0 , "i" , playerid );
if(GetPlayerWeapon(playerid) == 17
|| GetPlayerWeapon(playerid) == 18
|| GetPlayerWeapon(playerid) == 35
|| GetPlayerWeapon(playerid) == 36
|| GetPlayerWeapon(playerid) == 37
|| GetPlayerWeapon(playerid) == 38
|| GetPlayerWeapon(playerid) == 43
|| GetPlayerWeapon(playerid) == 44
|| GetPlayerWeapon(playerid) == 45)
{
return 1;
}
for(new i_slot = 0, gun, ammo; i_slot != 12; i_slot++)
{
new Float:pPosX, Float:pPosY, Float:pPosZ;
GetPlayerPos(playerid, pPosX, pPosY, pPosZ);
GetPlayerWeaponData(playerid, i_slot, gun, ammo);
if(gun != 0 && ammo != 0) CreateDroppedGun(gun, ammo, pPosX+random(2)-random(2), pPosY+random(2)-random(2), pPosZ);
}
}
TextDrawShowForPlayer(playerid, Textdraw10000);
if(killerid != INVALID_PLAYER_ID) SendDeathMessage(killerid, playerid, reason);
else SendDeathMessage(INVALID_PLAYER_ID, playerid, reason);
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
ScoreNaSessao[killerid]++;
CallRemoteFunction("DarDinheiro", "ii", killerid, 100);
if(killerid == INVALID_PLAYER_ID)
{
TogglePlayerSpectating ( playerid , 1 );
PlayerSpectatePlayer ( playerid , 49 );
SetTimerEx ( "FinishPlayerSpectatePlayer" , 5000 , 0 , "i" , playerid );
}
TogglePlayerSpectating ( playerid , 1 );
PlayerSpectatePlayer ( playerid , killerid );
GameTextForPlayer(playerid,"~y~OLHA QUEM TE ~n~~r~MATOU",3000,3);
GameTextForPlayer(killerid,"~y~MENOS UM!",3000,3);
SetTimerEx ( "FinishPlayerSpectatePlayer" , 5000 , 0 , "i" , playerid );
TextDrawHideForPlayer(playerid,txtTimeDisp);
TextDrawHideForPlayer(playerid,txtDateDisp);
if(IsPlayerAttachedObjectSlotUsed(playerid, 1)) ATT_RemovePlayerAttachedObject(playerid, 1);
TextDrawHideForPlayer(playerid,NomeTeleporte[0]);
TextDrawHideForPlayer(playerid,NomeTeleporte[1]);
TextDrawHideForPlayer(playerid,NomeTeleporte[2]);
TextDrawHideForPlayer(playerid,NomeTeleporte[3]);
TextDrawHideForPlayer(playerid,NomeTeleporte[4]);
TextDrawHideForPlayer(playerid,NomeTeleporte[5]);
TextDrawHideForPlayer(playerid,NomeTeleporte[6]);
TextDrawHideForPlayer(playerid,NomeTeleporte[7]);
return 1;
}