I need some help
#1

Well, I am trying to make my own /ajail command, ajail stands for admin jail. Well, I get this error at line 466 wich says:
Quote:

error 033: array must be indexed (variable "-unknown-")

Here's my script.

http://pastebin.com/m4db0aeec

Look for: //line 466. That's where I get the error, if anyone could help, then it would be nice.
Reply
#2

Change the line from
pawn Код:
new length = tmp; //line 466
to

pawn Код:
new length = tmp[cmdtext]; //line 466
Reply
#3

Didn't work.

Quote:

if(!cmdtext[3])return SendClientMessage(playerid, COLOR_GREY, "Use: /ajail [playerid] [length] [reason]");
targetid = ReturnUser(tmp);
tmp = strtok(tmp, idx);
new length = tmp[cmdtext];
if(targetid != INVALID_PLAYER_ID)
{
format(string, sizeof(string), "Admin %s Jailed %s Reason: %s Lenght: %s", sendername, targetname, cmdtext[4], length);
printf(string);
SendClientMessageToAll(COLOR_RED, string);
SetTimer("jailtime", length, 0);
SetPlayerPos(targetid,2686.2864,2689.2527,22.9472) ;
return 3;
}
else SendClientMessage(playerid, COLOR_RED, "Invalid Playerid!");
}
}

Reply
#4

Still some error ? If yes show the error and line of error
Reply
#5

Actually the same error:
Quote:

error 033: array must be indexed (variable "cmdtext")

But with cmdtext instead.
Reply
#6

Try this one
pawn Код:
new length = tmp(cmdtext);
Reply
#7

Still doesn't work. It can't use ); only ];
It gives the same error as first time.
Reply
#8

pawn Код:
new length = strval(tmp);
Reply
#9

Thank you, it works.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)