PDA

View Full Version : Run time error 4: "Array index out of bounds"


nGen.SoNNy
02/06/2012, 12:24 PM
HI GUYS:D Can somebody help me with this ?:D


[13:39:03] [debug] #0 000636d0 in public CheckPlayerState () from GM.amx

fc CheckPlayerState()
{
new i,cs;
for(i=0;i<=MAX_PLAYERS;i++){
cs=GetPlayerState(i);
if(DriftMode[i] && cs==PLAYER_STATE_DRIVER && DriftPointsNow[i]>70){
new Float:h;
GetVehicleHealth(GetPlayerVehicleID(i),h);
if(h<HealthInit[i]){
KillTimer(DriftTimer[i]);
DriftExit(i);
GameTextForPlayer(i,"~n~~n~~n~~n~~n~~n~~r~~h~B~b~~h~O~r~~h~O~b~~h~M",800,5);
DriftMode[i]=false;
}
}
if(cs==PLAYER_STATE_DRIVER && DriftMode[i]==false){
if(GetVType(GetPlayerVehicleID(i))){
DriftMode[i]=true;
GetVehicleHealth(GetPlayerVehicleID(i),HealthInit[i]);
DriftTimer[i]=SetTimerEx("Drift", 200, true, "i", i);
}
}
else if(cs!=PLAYER_STATE_DRIVER && DriftMode[i]==true){
KillTimer(DriftTimer[i]);
DriftMode[i]=false;
}
else{}
}
return ( 1 );
}

MadeMan
02/06/2012, 12:36 PM
for(i=0;i<MAX_PLAYERS;i++){

nGen.SoNNy
02/06/2012, 02:54 PM
thx :D