Run time error 4: "Array index out of bounds"
#1

HI GUYS Can somebody help me with this ?


PHP код:
[13:39:03] [debug#0  000636d0 in public CheckPlayerState () from GM.amx 
pawn Код:
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 );
}
Reply
#2

pawn Код:
for(i=0;i<MAX_PLAYERS;i++){
Reply
#3

thx
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)