Indexed error?
#1

Hey, I have this error:

pawn Код:
C:\Users\Will\Desktop\San Andreas Stuntz by Lolrofl\filterscripts\teles2.pwn(38) : error 033: array must be indexed (variable "cmd")
heres the line

pawn Код:
cmd = strtok(cmdtext,idx);
help pls
Reply
#2

pawn Код:
new cmd[128];
Reply
#3

same error, someone help??
here are the surrounding linez

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256];
    new idx;
    cmd = strtok(cmdtext,idx);
    if(strcmp(cmd,"/teleports",true)==0)
    {
Reply
#4

y'know, a reply might be nice
Reply
#5

I was looking at this forever, and i see whats wrong. LOL
pawn Код:
if(strcmp(cmd,"/teleports",true)==0)
This should be:
pawn Код:
if(strcmp(cmdtext,"/teleports",true)==0)//note the "cmd" changed to "cmdtext"
strcmp is looking for a string, and cmd[] isn't a string yet....so use cmdtext.
Reply
#6

still got the error...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)