I need some help - 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: I need some help (
/showthread.php?tid=99093)
I need some help -
Benne - 25.09.2009
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.
Re: I need some help -
Peter_Corneile - 25.09.2009
Change the line from
pawn Код:
new length = tmp; //line 466
to
pawn Код:
new length = tmp[cmdtext]; //line 466
Re: I need some help -
Benne - 25.09.2009
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!");
}
}
|
Re: I need some help -
Peter_Corneile - 25.09.2009
Still some error ? If yes show the error and line of error
Re: I need some help -
Benne - 25.09.2009
Actually the same error:
Quote:
error 033: array must be indexed (variable "cmdtext")
|
But with cmdtext instead.
Re: I need some help -
Peter_Corneile - 25.09.2009
Try this one
pawn Код:
new length = tmp(cmdtext);
Re: I need some help -
Benne - 25.09.2009
Still doesn't work. It can't use ); only ];
It gives the same error as first time.
Re: I need some help -
MadeMan - 25.09.2009
pawn Код:
new length = strval(tmp);
Re: I need some help -
Benne - 25.09.2009
Thank you, it works.