(not an array or too many subscripts)
#1

Im geting some errors 4 errors at one line
pawn Код:
if(IsACop[suspect]) //thats my code error line
And this are the errors
Код:
C:\Users\hpi\Desktop\Script_2.8-2\ser 0.3\gamemodes\sfrp.pwn(473) : error 028: invalid subscript (not an array or too many subscripts): "IsACop"
C:\Users\hpi\Desktop\Script_2.8-2\ser 0.3\gamemodes\sfrp.pwn(473) : warning 215: expression has no effect
C:\Users\hpi\Desktop\Script_2.8-2\ser 0.3\gamemodes\sfrp.pwn(473) : error 001: expected token: ";", but found "]"
C:\Users\hpi\Desktop\Script_2.8-2\ser 0.3\gamemodes\sfrp.pwn(473) : error 029: invalid expression, assumed zero
C:\Users\hpi\Desktop\Script_2.8-2\ser 0.3\gamemodes\sfrp.pwn(473) : fatal error 107: too many error messages on one line
I dont know what is wrong here can someone help me?
Reply
#2

pawn Код:
if(strcmp(cmd, "/tazer", true) ==0)
    {
        if(IsACop(playerid))
        {
            if(IsPlayerInAnyVehicle(playerid))
                {
                    SendClientMessage(playerid, GREY, "   Cannot use this while being in the Car !");
                    return 1;
                }
               new suspect = GetClosestPlayer(playerid);
               if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
            {
                   if(IsACop[suspect])
                {
                       SendClientMessage(playerid, GREY, "   Cannot Tazer Cops !");
                       return 1;
                }
                if(IsPlayerInAnyVehicle(suspect))
                {
                       SendClientMessage(playerid, COLOR_GREY, "   Suspect is in a Car, get him out first !");
                    return 1;
                }
                        }
           
       
        }
        return 1;
Here is all my code is not finished yet im trying to solve this problem first
Reply
#3

Euh, AFAIK "IsACop" is a function, not a variable. Variables (With arrays) use "[" and "]" to work, functions use "(" and ")" to work.

You'll need to adjust your code to:

pawn Код:
if(IsACop(suspect))
If it IS a variable, post the declaration of it.
Reply
#4

: o no erros now i didnt made it before now i know what to use thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)