Error crashdetect
#1

Hi all, crashdetect errors:

Accessing element at index 65535 past array upper bound 99
[debug] AMX backtrace:
[debug] #0 003a7040 in ?? () from CiudadRP.amx
[debug] #1 003a6b1c in public severTimers@_yT () from NewLife.amx

Quote:

// Funciуn: Otros Timers.
timer severTimers[MAX_PLAYERS]()
{
if(iAdverTimer >= 1)
--iAdverTimer;
foreach(Player, i)
{
SyncPlayerTime(i);
if(IsPlayerConnected(i) && gPlayerLogged{i} == 1)
{
if(Tied[i] > 0) TogglePlayerControllable(i, 0);
if(GetPVarInt(i, "EMSAttempt") == -1) ApplyAnimation(i, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0, 1);
if(CellTime[i] > 0)
{
if (CellTime[i] == cchargetime)
{
CellTime[i] = 1;
if(Mobile[Mobile[i]] == i)
{
CallCost[i] = CallCost[i]+callcost;
}
}
CellTime[i]++;
if (Mobile[Mobile[i]] == INVALID_PLAYER_ID && CellTime[i] == 5)
{
if(IsPlayerConnected(Mobile[i]))
{
new called[MAX_PLAYER_NAME], string[96];
GetPlayerName(Mobile[i], called, sizeof(called));
format(string, sizeof(string), "* El telйfono de %s esta sonando", called);
ProxDetector(30.0, Mobile[i], string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
}
}
}
if(CellTime[i] == 0 && CallCost[i] > 0)
{
new string[24];
format(string, sizeof(string), "~w~Costo de llamada~n~~r~%d",CallCost[i]);
GivePlayerCash(i, -CallCost[i]);
GameTextForPlayer(i, string, 5000, 1);
CallCost[i] = 0;
}
for(new h = 0; h < sizeof(Points); h++)
{
if(IsPlayerInRangeOfPoint(i, 2.0, Points[h][Pointx], Points[h][Pointy], Points[h][Pointz])){
if(Points[h][Type] == 3 && Info[i][pPot] < 3){
GameTextForPlayer(i, "~w~Usa /comprarhierba para comprar algo de ~n~~r~hierba", 5000, 5);
}
else if(Points[h][Type] == 1 && GetPVarInt(i, "Packages") == 0){
GameTextForPlayer(i, "~w~Usa /materiales para comprar ~n~~r~paquetes de materiales.", 5000, 5);
}
else if(Points[h][Type] == 4){
GameTextForPlayer(i, "~w~Usa /comprarcrack para comprar ~n~algo de ~r~crack", 5000, 5);
}
else if(Points[h][Type] == 5){
GameTextForPlayer(i, "~w~Usa /paquete para comprar un ~n~~r~paquete de droga", 5000, 5);
}
}
}
if(TransportDriver[i] < 999)
{
if(GetPlayerVehicleID(i) != GetPlayerVehicleID(TransportDriver[i]) || !TransportDuty[TransportDriver[i]])
{
if(IsPlayerConnected(TransportDriver[i]))
{
new string[24];
TransportMoney[TransportDriver[i]] += TransportCost[i];
TransportTime[TransportDriver[i]] = 0;
TransportCost[TransportDriver[i]] = 0;
format(string, sizeof(string), "~w~Pasajero se fue~n~~g~ganaste %d",TransportCost[i]);
GameTextForPlayer(TransportDriver[i], string, 5000, 1);
TransportDriver[i] = 999;
}
}
else if(TransportTime[i] >= 16)
{
TransportTime[i] = 1;
GivePlayerCash(i, -TransportValue[TransportDriver[i]]);
if(TransportDriver[i] < 999)
{
if(IsPlayerConnected(TransportDriver[i]))
{
TransportCost[i] += TransportValue[TransportDriver[i]];
TransportCost[TransportDriver[i]] = TransportCost[i];
}
}
}
TransportTime[i] += 1;
new string[24];
format(string, sizeof(string), "~r~%d ~w~: ~g~%d",TransportTime[i],TransportCost[i]);
GameTextForPlayer(i, string, 15000, 6);
GameTextForPlayer(TransportDriver[i], string, 15000, 6);
if(TransportCost[i] > GetPlayerCash(i))
{
RemovePlayerFromVehicle(i);
new Floatlx, Floatly, Floatlz;
GetPlayerPos(i, slx, sly, slz);
SetPlayerPos(i, slx, sly, slz + 2);
GameTextForPlayer(i, "~r~No tienes mбs dinero para pagar el taxi!", 4000, 4);
}
}
if(IsPlayerInAnyVehicle(i))
{
if(GetPlayerState(i) == PLAYER_STATE_DRIVER) SetPlayerArmedWeapon(i, 0);
else if(Info[i][pWeapons][4] == 0) SetPlayerArmedWeapon(i, 0);
else SetPlayerArmedWeapon(i, 29);
}
if(GetPlayerSpecialAction(i) == SPECIAL_ACTION_USEJETPACK && JetPack[i] == 0 && Info[i][AdminGame] < 4)
{
new string[74 + MAX_PLAYER_NAME];
format( string, sizeof( string ), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) es posible que use Cheat de JetPack .", GetPlayerNameEx(i), i);
ABroadCast( COLOR_YELLOW, string, 2 );
format(string, sizeof(string), "%s (ID %d) es posible que use Cheat de JetPack.", GetPlayerNameEx(i), i);
Log("logs/hack.log", string);
format(string, sizeof(string), "AdmCmd: %s ha sido auto-expulsado, razуn: jetpack hack.", GetPlayerNameEx(i), i);
ABroadCast(COLOR_YELLOW, string, 0 );
Kick(i);
}
if(IsPlayerInRangeOfPoint(i, 2, 1544.2, -1353.4, 329.4))
{
GivePlayerValidWeapon(i, 46);
}
}
}
}

Reply
#2

Try to put
Код:
SyncPlayerTime(i);
Under
Код:
if(IsPlayerConnected(i) && gPlayerLogged{i} == 1)
{
Otherwise the problem should be under this
Код:
for(new h = 0; h < sizeof(Points); h++)
{
65535 should be an inexistent index...
Btw honestly i think that's the 1st problem
Reply
#3

thank you, i try.
Reply
#4

Quote:
Originally Posted by Nicosm
Посмотреть сообщение
thank you, i try.
Let me know if it still crashes
Reply
#5

I worked, how did you know the problem? If you could explain, I would appreciate it.
Reply
#6

Yeah sure
Код:
SyncPlayerTime(i);
was in the loop above IsPlayerConnected, this wouldn't check if the player is connected so it will try to do a function on someone who isn't connected causing those problems
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)