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

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
In your case, MAX_PLAYERS is 100 and INVALID_PLAYER_ID is 65535, so no. It will fail again. The code you had in the first post checks for the last part of it but you miss one:
pawn Код:
if(APlayerData[killerid][PlayerLevel] < 1){
        if(GetPlayerWeapon(killerid) == 38) BanEx(killerid, "Weapon Hack"); //Ban if they have a minigun
        if(GetPlayerWeapon(killerid) == 35) BanEx(killerid, "Weapon Hack"); //Ban if they have a minigun
        if(GetPlayerWeapon(killerid) == 36) BanEx(killerid, "Weapon Hack"); //Ban if they have a minigun
        if(GetPlayerWeapon(killerid) == 37) BanEx(killerid, "Weapon Hack"); //Ban if they have a minigun
    }
is out of that check; thus it gives the run time error. Add it inside that check:
pawn Код:
if (killerid != INVALID_PLAYER_ID)
{
    // here..
}
Ok, Thanks, Repped +
Reply


Messages In This Thread
Run time error 4: "Array index out of bounds" - by AntonioCroatia - 01.02.2014, 14:10
Re: Run time error 4: "Array index out of bounds" - by Konstantinos - 01.02.2014, 14:14
Re: Run time error 4: "Array index out of bounds" - by AntonioCroatia - 01.02.2014, 14:32
Re: Run time error 4: "Array index out of bounds" - by Konstantinos - 01.02.2014, 14:36
Re: Run time error 4: "Array index out of bounds" - by AntonioCroatia - 01.02.2014, 14:42

Forum Jump:


Users browsing this thread: 3 Guest(s)