crash problem fix
#1

how fix that? [15:27:29]: Script[gamemodes\Life.amx]: During execution of removcar():
[15:27:29]: Script[gamemodes\Life.amx]: Run time error 4: "Array index out of bounds"
[15:27:29]: Additional information:
[15:27:29]: Array max index is 79 but accessing an element at -1

script
Код:
forward removcar(playerid);
public removcar(playerid)
{
 new vehicleid = GetPlayerVehicleID(playerid);

	TogglePlayerControllable(playerid,1);
	        SetVehicleParamsForAll(Buylist[Spectating[playerid][0]][Carid],0,0);
	        Spectating[playerid][0]=90;
	        SetVehicleToRespawn(vehicleid);
	        RemovePlayerFromVehicle(playerid);
	return 1;
}
and one this script system
Код:
SetTimerEx("removcar",10000,0,"i",playerid);
so how fix that?
Reply
#2

any ideas?
Reply
#3

pawn Код:
forward removcar(playerid);
public removcar(playerid)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    TogglePlayerControllable(playerid,1);
    if(Spectating[playerid][0] < 0) return 1;
    if(Carid < 0) return 1;
    SetVehicleParamsForAll(Buylist[Spectating[playerid][0]][Carid],0,0);
    Spectating[playerid][0]=90;
    SetVehicleToRespawn(vehicleid);
    RemovePlayerFromVehicle(playerid);
    return 1;
}
I dont know which var of yours has size 80 so i just placed 2 checks.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)