13.09.2014, 21:28
Hi all , i have a sh** of problem i tryed to fix it but i can't i don't know why , the problem is:
[debug] AMX backtrace:
[debug] #0 0005536c in public OnPlayerStateChange (playerid=0, newstate=2, oldstate=1) at C:\***\***\Desktop\***\gamemodes\***.pwn:1482
[debug] Run time error 4: "Array index out of bounds"
[debug] Accessing element at index 103 past array upper bound 99
This is the line:
if(VehicleInfo[vehicleid][bought] == 1)
Full line :
new vehicleid = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
new pVehicleModel = GetVehicleModel(GetPlayerVehicleID(playerid)), sStr[128];
//----------------------------------------------------------------------
pvehicleid[ playerid ] = GetPlayerVehicleID(playerid);
pmodelid[ playerid ] = GetVehicleModel(pvehicleid[ playerid ]);
//----------------------------------------------------------------------
format(sStr, 128, "%s", VehicleNames[pVehicleModel - 400]);
//----------------------------------------------------------------------
PlayerTextDrawSetString(playerid, ecar8[playerid], sStr);
//----------------------------------------------------------------------
for(new i = 0; i < 7; i++) TextDrawShowForPlayer(playerid,Ecar[i]);
PlayerTextDrawShow(playerid, ecar8[playerid]);
if(VehicleInfo[vehicleid][bought] == 1)
{
AccInfo[playerid][lastvehicle] = vehicleid;
SendVehicleSecurityMessage(playerid,vehicleid);
}
}
What can i do?
[debug] AMX backtrace:
[debug] #0 0005536c in public OnPlayerStateChange (playerid=0, newstate=2, oldstate=1) at C:\***\***\Desktop\***\gamemodes\***.pwn:1482
[debug] Run time error 4: "Array index out of bounds"
[debug] Accessing element at index 103 past array upper bound 99
This is the line:
if(VehicleInfo[vehicleid][bought] == 1)
Full line :
new vehicleid = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
new pVehicleModel = GetVehicleModel(GetPlayerVehicleID(playerid)), sStr[128];
//----------------------------------------------------------------------
pvehicleid[ playerid ] = GetPlayerVehicleID(playerid);
pmodelid[ playerid ] = GetVehicleModel(pvehicleid[ playerid ]);
//----------------------------------------------------------------------
format(sStr, 128, "%s", VehicleNames[pVehicleModel - 400]);
//----------------------------------------------------------------------
PlayerTextDrawSetString(playerid, ecar8[playerid], sStr);
//----------------------------------------------------------------------
for(new i = 0; i < 7; i++) TextDrawShowForPlayer(playerid,Ecar[i]);
PlayerTextDrawShow(playerid, ecar8[playerid]);
if(VehicleInfo[vehicleid][bought] == 1)
{
AccInfo[playerid][lastvehicle] = vehicleid;
SendVehicleSecurityMessage(playerid,vehicleid);
}
}
What can i do?