29.01.2019, 22:56
Boa noite, estou com um enorme problema.
Estou morrendo sempre e nгo estou a conseguir resolver este problemas pois o Debug й no Onplayerdeath e eu nгo modifiquei nada nele.
Agradeзo muito a quem me poder ajudar!
DEBUG
Cуdigo OnPlayerDeath
Cуdigo OnPlayerDeathEx
Estou morrendo sempre e nгo estou a conseguir resolver este problemas pois o Debug й no Onplayerdeath e eu nгo modifiquei nada nele.
Agradeзo muito a quem me poder ajudar!
DEBUG
PHP код:
[debug] #0 00126948 in ?? (2, 65535, 255) from BPS.amx
[debug] #1 00124f00 in public ab_OnPlayerDeath (2, 65535, 255) from BPS.amx
[debug] #2 native CallLocalFunction () from samp-server.exe
[debug] #3 0000b720 in public OnPlayerDeath (2, 65535, 255) from BPS.amx
PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
totaldemortes[playerid]++;
if(totaldemortes[playerid] > 4)
{
new gstring[128];
format(gstring, sizeof gstring, "ANTI-CHEAT: %s[ID: %d] Foi Kickado por poder estar usando Flood Kill!", NomePlayer(playerid), playerid);
ABroadCast(COLOR_LIGHTRED,gstring, 1);
Kick(playerid);
return 1;
}
SetTimerEx("DesbugMorte", 1000, false, "i",playerid);
ColocarColete[playerid] = 0;
Cartola[playerid] = 0;
if(GetPVarInt(playerid, "inArena"))
{
new rand;
rand = random(sizeof(Arenax1Spawns));
SetPlayerPos(playerid, Arenax1Spawns[rand][0], Arenax1Spawns[rand][1], Arenax1Spawns[rand][2]);
SetPlayerFacingAngle(playerid, Arenax1Spawns[rand][3]);
SetPlayerInterior(playerid, 15);
SetPlayerVirtualWorld(playerid, 0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 24, 200);
GivePlayerWeapon(playerid, 31, 500);
SetPlayerHealth(playerid, 50);
SetPlayerArmour(playerid, 50);
SetPVarInt(playerid, "inArena", 1);
ChatKill[playerid] = true;
SendClientMessage(playerid, COLOR_GRAD1, "{FFFFFF}Bem vindo a Arena X1, caso queira sair, use: /sairarena");
return 1;
}
if(GetPVarType(killerid, "Tempo") != 0)
{
new tempo;
tempo = GetPVarInt(killerid, "Tempo"), SetPVarInt(playerid, "Tempo", 0), DeletePVar(playerid, "Tempo"), SetPVarInt(killerid, "Tempo", 0), DeletePVar(killerid, "Tempo");
new _s[128], _n[24];
SendClientMessageToAll(COLOR_WHITE, "|_________ Aviso da Administraзгo _________|");
format(_s, sizeof(_s), "%s vence o X1 contra %s com um tempo de %d segundos.", (GetPlayerName(killerid, _n, 24), _n),(GetPlayerName(playerid, _s, 128), _s), gettime() - tempo);
SendClientMessageToAll(COLOR_DBLUE, _s);
ResetPlayerWeapons(killerid);
SetPlayerSpawn(killerid);
SetPlayerSpawn(playerid);
return 1;
}
if(pmorto[playerid])return true;
OnPlayerDeathEx(playerid, killerid, reason);
TextDrawShowForPlayer(playerid, textmorte[0]);
TextDrawShowForPlayer(playerid, textmorte[1]);
JoinedHay[playerid] = 0;
UpdatePlayerPanel(playerid);
return 1;
}
PHP код:
stock OnPlayerDeathEx(playerid, killerid, reason)
{
ColocarColete[playerid] = 0;
Cartola[playerid] = 0;
PlayerInfo[playerid][pArmour] = 0;
SetPlayerArmour(playerid, 0);
UpdatePlayerPanel(playerid);
gPlayerMascarause[playerid] = 0; RemovePlayerAttachedObject(playerid, 3);
OnDuty[playerid] = 0;
Update3DTextLabelText(PolicialCivilLabel[playerid], -1, " ");
if(IsAPM(playerid))
{
PlayerInfo[playerid][pWeaponDelay][23] = 0;
PlayerInfo[playerid][pWeaponDelay][24] = 0;
PlayerInfo[playerid][pWeaponDelay][25] = 0;
PlayerInfo[playerid][pWeaponDelay][27] = 0;
PlayerInfo[playerid][pWeaponDelay][29] = 0;
PlayerInfo[playerid][pWeaponDelay][30] = 0;
PlayerInfo[playerid][pWeaponDelay][31] = 0;
PlayerInfo[playerid][pWeaponDelay][33] = 0;
PlayerInfo[playerid][pWeaponDelay][34] = 0;
PlayerInfo[playerid][pWeaponDelay][35] = 0;
PlayerInfo[playerid][pWeaponDelay][36] = 0;
}
if(GetPVarInt(playerid, "inArena")) return 1;
if(GetPVarInt(killerid, "inArena")) return 1;
if(GetPVarInt(playerid,"roped") == 1)
{
for(new destr2=0;destr2<=ropelength;destr2++)
{
DestroyDynamicObject(r0pes[playerid][destr2]);
}
SetPVarInt(playerid,"roped",0);
DisablePlayerCheckpoint(playerid);
}
new string[256];
if(MecanicMission[playerid])
{
EndMission(playerid);
}
if(PlayerPaintballing[playerid] != 0)
{
PlayerPaintballKills[killerid] ++;
if(PlayerPaintballKills[killerid] > PaintballWinnerKills)
{
PaintballWinner = killerid;
PaintballWinnerKills = PlayerPaintballKills[killerid];
foreach(Player, i)
{
if(PlayerPaintballing[i] != 0)
{
format(string, sizeof(string), "%s estб em 1є com %d Kills.",PlayerName(killerid),PaintballWinnerKills);
SendClientMessage(i, COLOR_WHITE, string);
}
}
}
return 1;
}
SBizzInfo[12][sbTill] += 100;
ExtortionSBiz(12, 100);
new GunID = GetPlayerWeapon(playerid);
new GunAmmo = GetPlayerAmmo(playerid);
new Float:x, Float:y, Float:z;
if(GunID > 0 && GunAmmo != 0)
{
new f = MAX_OBJ+1;
for(new a = 0; a < MAX_OBJ; a++)
{
if(dGunData[a][ObjPos][0] == 0.0)
{
f = a;
break;
}
}
RemovePlayerWeapon(playerid, GunID);
GetPlayerPos(playerid, x, y, z);
CreateDroppedGun(GunID, GunAmmo, x, y, z);
}
/* new Float:pPosX, Float:pPosY, Float:pPosZ;
GetPlayerPos(playerid, pPosX, pPosY, pPosZ);
for(new i_slot = 0, gun, ammo; i_slot != 12; i_slot++)
{
GetPlayerWeaponData(playerid, i_slot, gun, ammo);
if(gun != 0 && ammo != 0)
{
if(TempDropArmasBody[playerid] >= 30)
{
CreateDroppedGun(gun, ammo, pPosX+random(3)-random(3), pPosY+random(3)-random(3), pPosZ);
}
}
}*/
if(roubando[playerid] >= 1 && Temporoubando[playerid] != 0)
{
Temporoubando[playerid] = gettime();
}
if(invadindo[playerid] >= 1 && Tempoinvadindo[playerid] != 0)
{
Tempoinvadindo[playerid] = gettime();
}
if(!admtrampando[playerid] && !helpertrampando[playerid])
{
PlayerInfo[playerid][pHospital] = true;
PlayerInfo[playerid][pTempoHospital] = TempoHospital;
}
if(GuerraMorro[gGuerra])
{
CheckPontosTr(playerid, killerid);
if(NaCamera[playerid] > 1)
{
TextDrawHideForPlayer(playerid, Hidealto2);
TextDrawHideForPlayer(playerid, Hidebaixo2);
NaCamera[playerid] = 0;
}
RemovePlayerAttachedObjectEx(playerid,Vaga_Escudo);
gPlayerSpawned[playerid] = 0;
if(IsPlayerInGuerra(playerid))
{
PlayerInfo[playerid][pHospital] = false;
PlayerInfo[playerid][pTempoHospital] = 0;
}
else
gCheckPontos(playerid, killerid);
if(GuerraNavio[nmGuerra])
nmCheckPontos(playerid, killerid);
}
PlayerInfo[playerid][pLocal] = 255;
GetPlayerName(playerid, sendername, sizeof(sendername));
new Float:px,Float:py,Float:pz;
GetPlayerPos(playerid, px, py, pz);
spawnado[playerid] = 0;
if(PlayerInfo[playerid][pLevel] >= 3 && !IsAMedicos(playerid))
{
foreach(Player, i)
{
if(IsAMedicos(i))
{
PlayerPlaySound(i, 1039, 0.0, 0.0, 0.0);
GameTextForPlayer(i, "~w~Pessoa ~r~Morta~n~Bonus~g~R$100", 5000, 1);
GiveDinheiro(i, 100);
}
}
}
if(Sequestrado[playerid] == 1)
{
format(string, sizeof(string), "[SEQUESTRO] Os sequestradores mataram o refйm %s. Fim do Sequestro!", NomePlayer(playerid));
SendClientMessageToAll(COLOR_DBLUE, string);
Sequestrado[playerid] = 0;
PlayerTied[playerid] = 0;
PlayerInfo[playerid][pMuted] = 0;
PLO += 100;
DepositarOrgGrana(7,100);
}
if (gPlayerTerminal[playerid] != 0)
{
BusrouteEnd(playerid);
}
if(killerid != INVALID_PLAYER_ID)
{
if(reason < sizeof(ReasonName))
format(string, sizeof string, "(( Foi morto por {FFFFFF}%s {33CCFF}com a arma: {FFFFFF}%s ))", NomePlayer(killerid), ReasonName[reason]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof string, "%s foi morto por %s com a arma: [%s]", NomePlayer(playerid), NomePlayer(killerid), ReasonName[reason]);
ABroadCast(COLOR_DBLUE,string,1);
format(string, sizeof string, "(( Matou {FFFFFF}%s {33CCFF}com a arma: {FFFFFF}%s ))", NomePlayer(playerid), ReasonName[reason]);
SendClientMessage(killerid, COLOR_LIGHTBLUE, string);
PlayerInfo[killerid][pKills] ++;
MataMorre(playerid,killerid);
CheckPontosTr(playerid,killerid);
}
else
{
if(reason < sizeof(ReasonName))
format(string, sizeof string, "Morreu (Motivo: %s)", ReasonName[reason]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof string, "%s morreu (Motivo: %s)", NomePlayer(playerid), ReasonName[reason]);
ABroadCast(COLOR_DBLUE,string,1);
}
if(TendoGuerra)
{
new orgid = GetPlayerOrg(playerid);
new orgid2 = GetPlayerOrg(killerid);
if((orgid==3||orgid==15||orgid==23) && (orgid2==3||orgid2==15||orgid2==23))
{
if(IsPlayerInGuerra(playerid) && IsPlayerInGuerra(killerid) && orgid != orgid2)
{
PSG[orgid2] += 1;
GranaGuerra += 825+random(500);
}
}
}
//==================================[SUSPEITO MORTO]=========================//
if (gPlayerCheckpointStatus[playerid] > 4 && gPlayerCheckpointStatus[playerid] < 11)
{
DisablePlayerCheckpoint(playerid);
gPlayerCheckpointStatus[playerid] = CHECKPOINT_Nenhum;
}
new caller = Mobile[playerid];
if(caller != 255)
{
if(caller < 255)
{
SendClientMessage(caller, -1, "Morreram do outro lado da linha...");
CellTime[caller] = 0;
CellTime[playerid] = 0;
Mobile[caller] = 255;
}
Mobile[playerid] = 255;
CellTime[playerid] = 0;
}
ClearCrime(playerid);
if(PlayerInfo[playerid][pHeadValue] > 0 || PlayerInfo[playerid][pHeadValueT] > 0 || PlayerInfo[playerid][pHeadValueM] > 0)
{
if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID)
{
if(GetPlayerOrg(killerid) == 8)
{
if(GoChase[killerid] == playerid)
{
new Receber = (PlayerInfo[playerid][pHeadValue])/(1);
DepositarGranaOrg(8,Receber);
GiveDinheiro(killerid, Receber);
format(string,sizeof string,"<< [Hitman] Acabou de morrer para contrato. >>"),
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string,128,"[Hitman] %s cumpriu o contrato em %s e recebeu R$%s para o cofre.",PlayerName(killerid),PlayerName(playerid),ConvertMoney(Receber));
SendFamilyMessage(8, COLOR_YELLOW, string);
format(string, sizeof(string), "~w~Contrato ~b~Feito~n~~w~Recebimento:~n~~g~R$%s", ConvertMoney(Receber));
SendFamilyMessageGT(8, string);
PlayerInfo[playerid][pHeadValue] = 0;
GotHit[playerid] = 0;
GetChased[playerid] = 999;
GoChase[killerid] = 999;
PlayerInfo[killerid][pContratos]++;
HitmanMatou++;
//SetPlayerSkin(killerid, PlayerInfo[killerid][pSkin]);
SetPlayerToTeamColor(killerid);
if(VendoNick[killerid] == false)
{
VendoNick[killerid] = true;
SendClientMessage(killerid, COLOR_GRAD1, "(( Agora nгo estбs em modo secreto ))");
foreach(Player, i)
{
ShowPlayerNameTagForPlayer(i, killerid, true);
}
}
}
}
else if(GetPlayerOrg(killerid) == 22)
{
if(GoChase[killerid] == playerid)
{
new Receber = (PlayerInfo[playerid][pHeadValueT])/(1);
DepositarGranaOrg(22,Receber);
GiveDinheiro(killerid, Receber);
format(string,sizeof string,"<< [Triad] Acabou de morrer para contrato. >>"),
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "~w~Contrato ~b~Feito~n~~w~Recebimento:~n~~g~R$%s", ConvertMoney(Receber));
SendFamilyMessageGT(22, string);
format(string,128,"[Triad] %s cumpriu o contrato em %s e recebeu $%s para o cofre.",PlayerName(killerid),PlayerName(playerid),ConvertMoney(Receber));
SendFamilyMessage(22, COLOR_YELLOW, string);
PlayerInfo[playerid][pHeadValueT] = 0;
GotTri[playerid] = 0;
GetChased[playerid] = 999;
GoChase[killerid] = 999;
PlayerInfo[killerid][pContratos]++;
TriadMatou++;
//SetPlayerSkin(killerid, PlayerInfo[killerid][pSkin]);
SetPlayerToTeamColor(killerid);
if(VendoNick[killerid] == false)
{
VendoNick[killerid] = true;
SendClientMessage(killerid, COLOR_GRAD1, "(( Agora nгo estбs em modo secreto ))");
foreach(Player, i)
{
ShowPlayerNameTagForPlayer(i, killerid, true);
}
}
}
}
}
}
killerid = INVALID_PLAYER_ID;
return true;
}