Accessing element at index 65535 past array upper bound 999
#1

Hi all, when a player dies on the server, these errors are coming. What is the problem ?

Код:
[22:47:58] [debug] Run time error 4: "Array index out of bounds"
[22:47:58] [debug]  Accessing element at index 65535 past array upper bound 999
[22:47:58] [debug] AMX backtrace:
[22:47:58] [debug] #0 00047f28 in ?? (0, 65535, 255) from HirsizPolis.amx
[22:47:58] [debug] #1 0000d8dc in public OnPlayerDeath (0, 65535, 255) from HirsizPolis.amx
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
SetPlayerWantedLevel(playerid,0);
SetPVarInt(playerid,"SpawnDurum",0);
STIVirus[playerid] = 0;
TecavuzEdilenSure[playerid] = 0;
if(GetPVarInt(playerid,"AntiFakeKill")>GetTickCount()) return BanEx(playerid,"Fake-Kill Hack");
SetPVarInt(playerid,"AntiFakeKill",GetTickCount()+3000);
SoygunIptalEt(playerid);
SendDeathMessage(killerid,playerid,reason);
PlayerInfo[killerid][pOldurme]++;
PlayerInfo[playerid][pOlum]++;
aranmaLeveli(playerid, 0);

if(OdulKoyulmus[playerid] >= 1)
{
new string[256];
format(string,sizeof(string),"[ЦLЬM] %s(%d) adlı oyuncu %s(%d) adlı oyuncuyu цldьrdь.",getName(killerid),killerid,getName(playerid),playerid);
SendClientMessageToAll(0xFF80CEFF,string);
GivePlayerMoney(killerid,OdulParasi[playerid]);
format(string,sizeof(string),"%s(%d) isimli Kontraktlı oyuncuyu цldьrdьğьnьz iзin %d$ dolar kazandınız.",getName(playerid),playerid,OdulParasi[playerid]);
SendClientMessage(killerid,0xFF80CEFF,string);
aranmaLeveli(killerid,20);
format(string,sizeof(string),"{003366}[Polis Telsizi] {FFFFFF}%s(%d) isimli oyuncu %s(%d) цldьrdь.",getName(killerid),killerid,getName(playerid),playerid);
PolisRadiosu(string);
OdulKoyulmus[playerid] = 0;
OdulParasi[playerid] = 0;
SetPlayerWantedLevel(playerid,0);
}

if(gTeam[playerid] == Takim_Polis || gTeam[playerid] == Takim_Swat || gTeam[playerid] == Takim_TPolisi ||
gTeam[playerid] == Takim_DPolisi || gTeam[playerid] == Takim_HPolisi || gTeam[playerid] == Takim_FBI ||
gTeam[playerid] == Takim_Cia || gTeam[playerid] == Takim_Army)
{
new str[128];
format(str,sizeof(str),"<< %s(%d) isimli devlet memurunu цldьrdьnьz. >>",getName(playerid),playerid);
SendClientMessage(killerid,0xAAAAAAAA,str);
aranmaLeveli(killerid,24);
}

if(gTeam[playerid] == Sivil_Spawn || gTeam[playerid] == Takim_Tecavuzcu || gTeam[playerid] == Takim_ArabaHirisiz ||
gTeam[playerid] == Takim_SilahSatıcısı || gTeam[playerid] == Takim_UyusturucuSaticisi || gTeam[playerid] == Takim_Suikastci ||
gTeam[playerid] == Takim_Gaspci || gTeam[playerid] == Takim_InsanKacakcisi || gTeam[playerid] == Takim_Terorist)
{
if(gTeam[killerid] == Takim_Polis || gTeam[killerid] == Takim_Swat || gTeam[killerid] == Takim_TPolisi ||
gTeam[killerid] == Takim_DPolisi || gTeam[killerid] == Takim_HPolisi || gTeam[killerid] == Takim_FBI ||
gTeam[killerid] == Takim_Cia || gTeam[killerid] == Takim_Army)
{
return 1;
}
new str[128];
format(str,sizeof(str),"<< %s(%d) isimli oyuncuyu цldьrdьnьz. >>",getName(playerid),playerid);
SendClientMessage(killerid,0xAAAAAAAA,str);
aranmaLeveli(killerid,12);
}
	return 1;
}
Reply
#2

Quote:
Originally Posted by sampkinq
Посмотреть сообщение
Hi all, when a player dies on the server, these errors are coming. What is the problem ?

Код:
[22:47:58] [debug] Run time error 4: "Array index out of bounds"
[22:47:58] [debug]  Accessing element at index 65535 past array upper bound 999
[22:47:58] [debug] AMX backtrace:
[22:47:58] [debug] #0 00047f28 in ?? (0, 65535, 255) from HirsizPolis.amx
[22:47:58] [debug] #1 0000d8dc in public OnPlayerDeath (0, 65535, 255) from HirsizPolis.amx
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
SetPlayerWantedLevel(playerid,0);
SetPVarInt(playerid,"SpawnDurum",0);
STIVirus[playerid] = 0;
TecavuzEdilenSure[playerid] = 0;
if(GetPVarInt(playerid,"AntiFakeKill")>GetTickCount()) return BanEx(playerid,"Fake-Kill Hack");
SetPVarInt(playerid,"AntiFakeKill",GetTickCount()+3000);
SoygunIptalEt(playerid);
SendDeathMessage(killerid,playerid,reason);
PlayerInfo[killerid][pOldurme]++;
PlayerInfo[playerid][pOlum]++;
aranmaLeveli(playerid, 0);

if(OdulKoyulmus[playerid] >= 1)
{
new string[256];
format(string,sizeof(string),"[ЦLЬM] %s(%d) adlı oyuncu %s(%d) adlı oyuncuyu цldьrdь.",getName(killerid),killerid,getName(playerid),playerid);
SendClientMessageToAll(0xFF80CEFF,string);
GivePlayerMoney(killerid,OdulParasi[playerid]);
format(string,sizeof(string),"%s(%d) isimli Kontraktlı oyuncuyu цldьrdьğьnьz iзin %d$ dolar kazandınız.",getName(playerid),playerid,OdulParasi[playerid]);
SendClientMessage(killerid,0xFF80CEFF,string);
aranmaLeveli(killerid,20);
format(string,sizeof(string),"{003366}[Polis Telsizi] {FFFFFF}%s(%d) isimli oyuncu %s(%d) цldьrdь.",getName(killerid),killerid,getName(playerid),playerid);
PolisRadiosu(string);
OdulKoyulmus[playerid] = 0;
OdulParasi[playerid] = 0;
SetPlayerWantedLevel(playerid,0);
}

if(gTeam[playerid] == Takim_Polis || gTeam[playerid] == Takim_Swat || gTeam[playerid] == Takim_TPolisi ||
gTeam[playerid] == Takim_DPolisi || gTeam[playerid] == Takim_HPolisi || gTeam[playerid] == Takim_FBI ||
gTeam[playerid] == Takim_Cia || gTeam[playerid] == Takim_Army)
{
new str[128];
format(str,sizeof(str),"<< %s(%d) isimli devlet memurunu цldьrdьnьz. >>",getName(playerid),playerid);
SendClientMessage(killerid,0xAAAAAAAA,str);
aranmaLeveli(killerid,24);
}

if(gTeam[playerid] == Sivil_Spawn || gTeam[playerid] == Takim_Tecavuzcu || gTeam[playerid] == Takim_ArabaHirisiz ||
gTeam[playerid] == Takim_SilahSatıcısı || gTeam[playerid] == Takim_UyusturucuSaticisi || gTeam[playerid] == Takim_Suikastci ||
gTeam[playerid] == Takim_Gaspci || gTeam[playerid] == Takim_InsanKacakcisi || gTeam[playerid] == Takim_Terorist)
{
if(gTeam[killerid] == Takim_Polis || gTeam[killerid] == Takim_Swat || gTeam[killerid] == Takim_TPolisi ||
gTeam[killerid] == Takim_DPolisi || gTeam[killerid] == Takim_HPolisi || gTeam[killerid] == Takim_FBI ||
gTeam[killerid] == Takim_Cia || gTeam[killerid] == Takim_Army)
{
return 1;
}
new str[128];
format(str,sizeof(str),"<< %s(%d) isimli oyuncuyu цldьrdьnьz. >>",getName(playerid),playerid);
SendClientMessage(killerid,0xAAAAAAAA,str);
aranmaLeveli(killerid,12);
}
	return 1;
}
Add this at the top of the callback
PHP код:
if(killerid == INVALID_PLAYER_ID) return 1
Reply
#3

Quote:
Originally Posted by Jamester
Посмотреть сообщение
Add this at the top of the callback
PHP код:
if(killerid == INVALID_PLAYER_ID) return 1
Thank you, the problem is solved.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)