Help "invalid array size (negative, zero or out of bounds)
#1

I don't know the Problem Here or whre the Error is but this is what i added before that Error came


pawn Код:
else if(IsARRWrecker(vehicleid))
        {
            if(PlayerInfo[playerid][pMember] == 14 && PlayerInfo[playerid][pRank] >= 4)
            {
                SendClientMessageEx(playerid, COLOR_GREEN, "__________________RAPID RECOVERY WRECKER____________________");
                SendClientMessageEx(playerid, COLOR_GRAD2, "<< Avaiable wrecker commands: >>");
                SendClientMessageEx(playerid, COLOR_GRAD2, "<< /wreck /unwreck /impound >>");
                SendClientMessageEx(playerid, COLOR_GREEN, "____________________________________________________________");
            }
            else
            {
                RemovePlayerFromVehicle(playerid);
                new Float:slx, Float:sly, Float:slz;
                GetPlayerPos(playerid, slx, sly, slz);
                SetPlayerPos(playerid, slx, sly, slz);
                defer NOPCheck(playerid);
                SendClientMessageEx(playerid, COLOR_GRAD2, "You are not atleast rank 4 and above in Rapid Recovery");
            }
        }
        else if(IsARRTower(vehicleid))
        {
            if(PlayerInfo[playerid][pMember] == 14 && PlayerInfo[playerid][pRank] >= 2)
            {
                SendClientMessageEx(playerid, COLOR_GREEN, "__________________RAPID RECOVERY TOW TRUCK____________________");
                SendClientMessageEx(playerid, COLOR_GRAD1, "<< Avaiable tow commands: >>");
                SendClientMessageEx(playerid, COLOR_GRAD1, "<< /tow /untow /impound >>");
                SendClientMessageEx(playerid, COLOR_GREEN, "______________________________________________________________");
            }
            else
            {
                RemovePlayerFromVehicle(playerid);
                new Float:slx, Float:sly, Float:slz;
                GetPlayerPos(playerid, slx, sly, slz);
                SetPlayerPos(playerid, slx, sly, slz);
                defer NOPCheck(playerid);
                SendClientMessageEx(playerid, COLOR_GRAD2, "You are not atleast rank 2 and above in Rapid Recovery");
            }
        }
        else if(IsARRBattery(vehicleid))
        {
            if(PlayerInfo[playerid][pMember] == 14 && PlayerInfo[playerid][pRank] >= 1)
            {
                SendClientMessageEx(playerid, COLOR_GREEN, "__________________RAPID RECOVERY BATTERY______________________");
                SendClientMessageEx(playerid, COLOR_GRAD1, "<< Avaiable mechanic commands: >>");
                SendClientMessageEx(playerid, COLOR_GRAD1, "<< /fix /refill >>");
                SendClientMessageEx(playerid, COLOR_GREEN, "______________________________________________________________");
            }
            else
            {
                RemovePlayerFromVehicle(playerid);
                new Float:slx, Float:sly, Float:slz;
                GetPlayerPos(playerid, slx, sly, slz);
                SetPlayerPos(playerid, slx, sly, slz);
                defer NOPCheck(playerid);
                SendClientMessageEx(playerid, COLOR_GRAD2, "You are not atleast rank 3 and above in Rapid Recovery");
            }
        }

And After i Compile and Run This Error Came

invalid array size (negative, zero or out of bounds)


This is the Same Script with it that i didn't encounter any errors

pawn Код:
else if(IsAnAmbulance(vehicleid)) {
            if(PlayerInfo[playerid][pFaction] == 3 || PlayerInfo[playerid][pLeader] == 3) {
                if(LAFDVehicles[13] == vehicleid && PlayerInfo[playerid][pRank] < 5) {
                    RemovePlayerFromVehicle(playerid);
                    new Float:slx, Float:sly, Float:slz;
                    GetPlayerPos(playerid, slx, sly, slz);
                    SetPlayerPos(playerid, slx, sly, slz);
                    NOPCheck(playerid);
                    SendClientMessage(playerid, COLOR_GRAD2, "Only ranks 5+ can drive this vehicle.");
                }
            }
            else
            {
                SendClientMessage(playerid,COLOR_GREY,"   You're not in the LAFD!");
                RemovePlayerFromVehicle(playerid);
                new Float:slx, Float:sly, Float:slz;
                GetPlayerPos(playerid, slx, sly, slz);
                SetPlayerPos(playerid, slx, sly, slz);
                NOPCheck(playerid);
            }
        }

I Really Need Help! I'm new here i really really wanna know anything/everything about Scripting
Reply
#2

Can you remove all of the code apart from the parts that give the errors?

Also, please put all your code in [pawn] [ /pawn] brackets! (:

pawn Код:
code
Reply
#3

@Mionee Done
Please Help me , I that's the only Problem of my Script
Reply
#4

What line does the error occur on?
Reply
#5

Sorry Mionee but i don't know where the Error Occur

But when i compile and run the Error is "invalid array size (negative, zero or out of bounds)"

I'm new in scripting so i don't know how to find where the Error Occurs

But Like i said when i Put the "ScriptThe First Pawn) and i compile and run the Error Occurs

Help please
Reply
#6

Your compiler output shows what line the error occurs on.

This comes from my compiler output, just to give an example:
pawn Код:
C:\Users\Harukaze\Desktop\Pawn Library\ex.pwn(8) : error 032: array index out of bounds (variable "var")
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
The (8) is the line it's on. If you paste your compiler output here, I can tell you what line it's on and you can paste that line here.
Reply
#7

Yes using that how to Trace the Error?? i Don't Understand how to Trace the Error

Sorry i'm new in scripting :3
Reply
#8

The Error is 759

The OPGVehicles[0]

i made it Zero because the Faction doesn't have Fac Cars right now

How to fix it?
Reply
#9

Closed , Fixed But thanks Mionee
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)