array must be indexed
#1

http://pastebin.com/d2dd602a6
I've really hit a brick wall here guys, any help appreciated.
Код:
C:\Users\XXXX\Desktop\0.3a SAMP Server\filterscripts\a_fuel.pwn(93) : error 033: array must be indexed (variable "invalidvehs")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
pawn Код:
new invalidvehs[0][0] =
{
    {441}, {464}, {465}, {481}, {501},
    {509}, {510}, {564}, {572}, {594}
};

public IsVehicleValid(vehicleid)
{
    if (GetVehicleModel(vehicleid) == invalidvehs[0]) return false; // Line 93
    else return true;
}
Reply
#2

Hmm, on line 93, try to take out the second ' = ' and see what happens.
Reply
#3

Quote:
Originally Posted by [NaB
Hiitch - No srsly, Im a NaB ! ]
Hmm, on line 93, try to take out the second ' = ' and see what happens.
Код:
C:\Users\XXXX\Desktop\0.3a SAMP Server\filterscripts\a_fuel.pwn(93) : warning 211: possibly unintended assignment
C:\Users\XXXX\Desktop\0.3a SAMP Server\filterscripts\a_fuel.pwn(93) : error 022: must be lvalue (non-constant)
C:\Users\XXXX\Desktop\0.3a SAMP Server\filterscripts\a_fuel.pwn(93) : warning 215: expression has no effect
C:\Users\XXXX\Desktop\0.3a SAMP Server\filterscripts\a_fuel.pwn(93) : error 001: expected token: ";", but found ")"
C:\Users\XXXX\Desktop\0.3a SAMP Server\filterscripts\a_fuel.pwn(93) : error 029: invalid expression, assumed zero
C:\Users\XXXX\Desktop\0.3a SAMP Server\filterscripts\a_fuel.pwn(93) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
I need to check if the vehicle is equal to one of the invalid vehicles.
Reply
#4

Ohh, I saw the first error, put the other = back in, it must be something to do with the other statement.
Reply
#5

I just don't get it.
I've made things like this before (error/warning-less), & i can't see anything that is really changed except for the name & use.
Reply
#6

pawn Код:
new invalidvehs[] =
{
   441, 464, 465, 481, 501, 509, 510, 564, 572, 594
};

public IsVehicleValid(vehicleid)
{
   new k = sizeof(invalidvehs);
   for(new i;i<k;i++)
     if(GetVehicleModel(vehicleid) == invalidvehs[i]) return false; // Line 93
   return true;
}
Reply
#7

pawn Код:
IsVehicleValid(vehicleid)
{
  switch(GetVehicleModel(vehicleid))
  {
    case 441, 464, 465, 481, 501, 509, 510, 564, 572, 594 :
      return false;
  }
  return true;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)