error array must be indexed (variable "tmp")
#1

pawn Код:
if (strcmp("/login", cmdtext, true, 10) == 0)
    {
      if(PlayerInfo[playerid][Logedin] == 0)
      {
        new tmp[64];
        new idx;
      tmp = strtok(cmdtext, idx);
            if( tmp == PlayerInfo[playerid][Password])
            {
        SendClientMessage(playerid, COLOR_YELLOW, "You Are Now Logged In");
            }
            else
            {
              SendClientMessage(playerid, COLOR_YELLOW, "Wrong Password");
            }
        }
        else
        {
          SendClientMessage(playerid, COLOR_YELLOW, "You are already loged in");
        }
    }
Код:
D:\Multiple\Servere\Sa-mp\UnderProgress\gamemodes\underprogress.pwn(191) : error 033: array must be indexed (variable "tmp")
HELP PLEASE
Reply
#2

You're supposed to use the function "strcmp" when comparing 2 strings.

Try something like
if!strcmp(tmp,PlayerInfo[playerid][Password])
{
...
}
Reply
#3

Doesn't work , another problem , how do i read from file , but not all file .
For example i have AdminLevel=x , how do i read the x ?(the x is an number) .I wanna use this in basic kick , ban , slap etc commands , i tryed with wikipedia but i did not undestand anything.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)