SA-MP Forums Archive
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=584919)



array must be indexed - PowerF - 09.08.2015

Код:
votekicks.pwn(162) : error 033: array must be indexed (variable "inputtext")
Код:
		if(inputtext == playerid) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR:] {BBBBBB}You Cant Votekick yourself.");



Re: array must be indexed - Lynn - 09.08.2015

Quote:
Originally Posted by PowerF
Посмотреть сообщение
Код:
votekicks.pwn(162) : error 033: array must be indexed (variable "inputtext")
Код:
		if(inputtext == playerid) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR:] {BBBBBB}You Cant Votekick yourself.");
if(strlen(inputtext) == playerid)


Re: array must be indexed - muhsah007 - 09.08.2015

deleted


Re: array must be indexed - SickAttack - 09.08.2015

Quote:
Originally Posted by Lynn
Посмотреть сообщение
if(strlen(inputtext) == playerid)
/votekick

-> Input "player" into the dialog.

pawn Код:
if(6 == playerid)
---------------------------------------------------------------------------------------------------

pawn Код:
if(!IsNumeric(inputtext)) return 1;

new id = strval(inputtext);
if(!IsPlayerConnected(id)) return 1;
if(strval(inputtext) == playerid) ...

stock IsNumeric(const string[]) return !sscanf(string, "{d}");



Re: array must be indexed - MarvinPWN - 09.08.2015

Quote:
Originally Posted by Lynn
Посмотреть сообщение
if(strlen(inputtext) == playerid)
strlen => strval

PHP код:
if(strval(inputtext) == playerid
That is correct.