SA-MP Forums Archive
3rd error tonight, :/ - error 033: array must be indexed (variable "pJob") - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: 3rd error tonight, :/ - error 033: array must be indexed (variable "pJob") (/showthread.php?tid=325827)



3rd error tonight, :/ - error 033: array must be indexed (variable "pJob") - NewerthRoleplay - 14.03.2012

This is my thir error tonight its error 033: array must be indexed (variable "pJob") this time.

My full error message is here:

pawn Код:
C:\Users\Andy\Documents\Connor\NRP - New\gamemodes\NRP.pwn(2138) : error 033: array must be indexed (variable "pJob")
C:\Users\Andy\Documents\Connor\NRP - New\gamemodes\NRP.pwn(2144) : error 033: array must be indexed (variable "pJob")
C:\Users\Andy\Documents\Connor\NRP - New\gamemodes\NRP.pwn(2151) : error 033: array must be indexed (variable "pJob")
C:\Users\Andy\Documents\Connor\NRP - New\gamemodes\NRP.pwn(2157) : error 033: array must be indexed (variable "pJob")
C:\Users\Andy\Documents\Connor\NRP - New\gamemodes\NRP.pwn(2164) : error 033: array must be indexed (variable "pJob")
C:\Users\Andy\Documents\Connor\NRP - New\gamemodes\NRP.pwn(2170) : error 033: array must be indexed (variable "pJob")
C:\Users\Andy\Documents\Connor\NRP - New\gamemodes\NRP.pwn(2177) : error 033: array must be indexed (variable "pJob")
C:\Users\Andy\Documents\Connor\NRP - New\gamemodes\NRP.pwn(2184) : error 033: array must be indexed (variable "pJob")
C:\Users\Andy\Documents\Connor\NRP - New\gamemodes\NRP.pwn(2683) : warning 203: symbol is never used: "HouseInformation"
C:\Users\Andy\Documents\Connor\NRP - New\gamemodes\NRP.pwn(2683) : warning 203: symbol is never used: "fquery"
C:\Users\Andy\Documents\Connor\NRP - New\gamemodes\NRP.pwn(2683) : warning 203: symbol is never used: "houseid"
C:\Users\Andy\Documents\Connor\NRP - New\gamemodes\NRP.pwn(2683) : warning 203: symbol is never used: "queryresult"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


8 Errors.
Ignore the warnings i already know about them just have yet to impliment them.


Re: 3rd error tonight, :/ - error 033: array must be indexed (variable "pJob") - Twisted_Insane - 14.03.2012

I don't know how you want us to fix this without even showing us the line(s)? Also, show us your enum where the playerinfo should be saved in!


Re: 3rd error tonight, :/ - error 033: array must be indexed (variable "pJob") - NewerthRoleplay - 14.03.2012

woops sorry xD

2138 - 2177
pawn Код:
if(pJob == 0)
        {
        pJob[playerid] = TRUCKER;
        SendClientMessage(playerid, COLOR_WHITE, ".:: You have now joined the job, Trucker ::.");
        SendClientMessage(playerid, COLOR_WHITE, ".:: To start work grab a truck and use /startjob ::.");
        }
        if(pJob > 0)
        {
            SendClientMessage(playerid, COLOR_WHITE, ".:: You must quit your current job using /quitjob ::.");
        }
    }
 if(IsPlayerInRangeOfPoint(playerid, 10,1760.1884,-1895.4938,13.5612))
    {
        if(pJob == 0)
        {
        pJob[playerid] = TAXI;
        SendClientMessage(playerid, COLOR_WHITE, ".:: You have now joined the job, Taxi Drive ::.");
        SendClientMessage(playerid, COLOR_WHITE, ".:: To start work grab a taxi and use /startjob ::.");
        }
        if(pJob > 0)
        {
            SendClientMessage(playerid, COLOR_WHITE, ".:: You must quit your current job using /quitjob ::.");
        }
    }
 if(IsPlayerInRangeOfPoint(playerid, 10,-2033.3699,133.1192,28.8359))
    {
        if(pJob == 0)
        {
        pJob[playerid] = MECHANIC;
        SendClientMessage(playerid, COLOR_WHITE, ".:: You have now joined the job, Mechanic ::.");
        SendClientMessage(playerid, COLOR_WHITE, ".:: To start work grab a tow truck and use /startjob ::.");
        }
        if(pJob > 0)
        {
            SendClientMessage(playerid, COLOR_WHITE, ".:: You must quit your current job using /quitjob ::.");
        }
    }
 if(IsPlayerInRangeOfPoint(playerid, 10,-1721.8835,1356.2217,7.1805))
    {
        if(pJob ==0)
Here is my player enum
pawn Код:
//-----[Enum Playerinfo]-----
enum pInfo
{
    Password,
    Cash,
    Kills,
    Deaths,
    Adminlevel,
    Faction,
    Job,
}



Re: 3rd error tonight, :/ - error 033: array must be indexed (variable "pJob") - [ABK]Antonio - 14.03.2012

It will be Something[playerid][Job]


Re: 3rd error tonight, :/ - error 033: array must be indexed (variable "pJob") - Twisted_Insane - 14.03.2012

@Antonio

Let's guess:

pawn Код:
if(PlayerInfo[playerid][pJob] == 0)
Just search for the main variable which is controllin' the enum, it's probably under the enum you've just posted...


Re: 3rd error tonight, :/ - error 033: array must be indexed (variable "pJob") - NewerthRoleplay - 14.03.2012

SOLVED had to add [playerid] after the pJob when im talking about its value thanks guys