array must be indexed - 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: array must be indexed (
/showthread.php?tid=451477)
array must be indexed -
Blackazur - 17.07.2013
Hello, i would like to ask something, how to fix this, i know it is because the size, but what can i make because it's params?
Код:
if(params < 1 || params > 20) return SendClientMessage(playerid, -1,""chat""COL_RED" The password must be between 1 and 20!");
Re: array must be indexed -
Misiur - 17.07.2013
Use strlen to get params length.
AW: array must be indexed -
Blackazur - 17.07.2013
yes, but this wont work with strlen:
Код:
if(strlen < 1 || strlen > 20) return SendClientMessage(playerid, -1,""chat""COL_RED" The password must be between 1 and 20!");
Re: array must be indexed -
Bakr - 17.07.2013
https://sampwiki.blast.hk/wiki/Strlen
Re: array must be indexed -
Danyal - 17.07.2013
are you doing this on OnDialogResponse??
Re: array must be indexed -
dominik523 - 17.07.2013
Код:
if(strlen(params) > 20) return SendClientMessage(playerid, COLOR_GREY, "Maximum character limit is 20.");
Re: array must be indexed -
GWMPT - 17.07.2013
PHP код:
if(strlen(params) < 1 || strlen(params) > 20) {
return SendClientMessage(playerid, -1, COL_RED" The password must be between 1 and 20!");
}
It seems that you don't even know the basis of programming...
AW: Re: array must be indexed -
Blackazur - 17.07.2013
@Kikito thanks, yes i dont know some things from scripting im not an genie, and i like to ask something, when i dont know how to make it right.