SA-MP Forums Archive
error 033: array must be indexed (variable "inputtext") - 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: error 033: array must be indexed (variable "inputtext") (/showthread.php?tid=199099)



error 033: array must be indexed (variable "inputtext") - eDz0r - 14.12.2010

pawn Код:
if (dialogid == 2)
{
new pName[MAX_PLAYER_NAME], pUFile[50];
GetPlayerName(playerid, pName, sizeof(pName));
format(pUFile, sizeof(pUFile), SERVER_USER_FILES_FOLDER, pName);
if(!response)
{
Kick(playerid);
}
if (!strlen(inputtext))
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login", "Enter Your Password Below", "Login", "Cancel");
}
new tmp;
tmp = dini_Int(pUFile, "Password");
if(inputtext != tmp)//Line Error<<----------------------------
{
SendClientMessage(playerid, LOGINSYSTEMERROR_COLOR, "Wrong Password");
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login", "Enter Your Password Below", "Login", "Cancel");
}
else
{
IsPlayerLogged[playerid] = 1;
PlayerInfo[playerid][pAdminLevel] = dini_Int(pUFile, "AdminLevel");
SetPlayerScore(playerid, dini_Int(pUFile, "Level"));
SendClientMessage(playerid, LOGINSYSTEMERROR_COLOR, "[SYSTEM]: Successfully Logged In");
}
}
Advise Thanks


Re: error 033: array must be indexed (variable "inputtext") - JaTochNietDan - 14.12.2010

Pawn does not support the comparison of strings by that method. You need to use the strcmp function, like so:

pawn Код:
if(strcmp(inputtext,tmp,true))