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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: array must be indexed (
/showthread.php?tid=122170)
array must be indexed -
Kanji_Suzuki - 20.01.2010
Hello im makeing a auto login for me script.
Top script
Код:
new pIP[16][MAX_PLAYERS];
Onplayerconnect
Код:
if(!pIP[playerid] == " ") <---- Error
{
if(pIP[playerid] == plrIP[playerid]) <---Error
{
Onplayerlogin
Код:
GetPlayerIp(playerid, plrIP[playerid], 16);
pIP[playerid]=plrIP[playerid];
Errors
Код:
error 033: array must be indexed (variable "pIP")
error 033: array must be indexed (variable "pIP")
Thanks for helping
Re: array must be indexed -
MadeMan - 20.01.2010
pawn Код:
new pIP[MAX_PLAYERS][16];
What are you trying to check?
Re: array must be indexed -
Kanji_Suzuki - 20.01.2010
Quote:
|
Originally Posted by MadeMan
pawn Код:
new pIP[MAX_PLAYERS][16];
What are you trying to check?
|
when you login it does
Код:
GetPlayerIp(playerid, plrIP[playerid], 16);
pIP[playerid]=plrIP[playerid];
Re: array must be indexed -
MadeMan - 20.01.2010
pawn Код:
if(!pIP[playerid] == " ") <---- Error
What does that mean?
Re: array must be indexed -
Kanji_Suzuki - 20.01.2010
Quote:
|
Originally Posted by MadeMan
pawn Код:
if(!pIP[playerid] == " ") <---- Error
What does that mean?
|
if pIP is not empty
Re: array must be indexed -
MadeMan - 20.01.2010
pawn Код:
new pIP[MAX_PLAYERS][16];
pawn Код:
if(strlen(pIP[playerid]) != 0)
{
if(strcmp(pIP[playerid], plrIP[playerid], true) == 0)
{
Re: array must be indexed -
Kanji_Suzuki - 20.01.2010
I will try
Re: array must be indexed -
Kanji_Suzuki - 21.01.2010
Yeah , Thanks it works like a Dream