(not an array or too many subscripts) - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: (not an array or too many subscripts) (
/showthread.php?tid=177145)
(not an array or too many subscripts) -
HardMode - 16.09.2010
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?
Re: (not an array or too many subscripts) -
HardMode - 16.09.2010
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
Re: (not an array or too many subscripts) -
Hiddos - 16.09.2010
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:
If it IS a variable, post the declaration of it.
Re: (not an array or too many subscripts) -
HardMode - 16.09.2010
: o no erros now

i didnt made it before now i know what to use thank you