SA-MP Forums Archive
little problem - 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: little problem (/showthread.php?tid=321303)



little problem - mitchboy - 26.02.2012

The error:
Код:
C:\Users\Mitchell\Desktop\server\gamemodes\SumoGM.pwn(895) : error 033: array must be indexed (variable "-unknown-")
The part where i made the variable:
pawn Код:
new boughtcar[MAX_SERVER_PLAYERS];
And the line where i got the error:
pawn Код:
if(boughtcar[playerid]=="dumper"){



Re: little problem - Shabi RoxX - 26.02.2012

Use:
pawn Код:
new boughtcar[MAX_SERVER_PLAYERS][64]; // Make it String



Re: little problem - mitchboy - 26.02.2012

Now i still get the same error, but now like this:
Код:
C:\Users\Mitchell\Desktop\server\gamemodes\SumoGM.pwn(895) : error 033: array must be indexed (variable "boughtcar")



Re: little problem - emokidx - 26.02.2012

its MAX_PLAYERS not MAX_SERVER_PLAYERS


Re: little problem - mitchboy - 26.02.2012

in my code, everywhere is used MAX_SERVER_PLAYERS, even when i use MAX_PLAYERS, i get the same error.


Re: little problem - Universal - 26.02.2012

Use strcmp instead of using ==, since you are trying to compare strings not integers or floats.

pawn Код:
if(!strcmp(boughtcar[playerid], "dumper"))
And also, change the array into this:

pawn Код:
new boughcar[MAX_PLAYERS][64];