command problem
#1

I Actualy understand the problem, but have no idea how to fix it :/
error 006: must be assigned to an array
pawn Код:
//On top
 new level[MAX_PLAYERS];
//UNDER OnPlayerCommandText
if (strcmp(cmd, "/setlevel", true) == 0)
    {
        new tmp[20], id;
        tmp = strtok(cmdtext, idx);
           if(account[playerid] == ADMIN || account[playerid] == OWNER)
            {
            if (IsPlayerConnected(id))
            {
             if (strlen(tmp))
            {
                id = strval(tmp);
                new promname[MAX_PLAYERS],levelid[28];
                levelid = strtok(cmdtext,idx);
                GetPlayerName(id,promname,sizeof (promname));
                format(promname, sizeof promname, "%s has been promoted by admin to level %d",promname,levelid);
                SendClientMessageToAll(0xFF0000AA, promname);
                SendClientMessage(id, 0xFF0000AA, "You have been promoted.");
                level[id] = levelid;                   //error 006: must be assigned to an array
                }
                else
                {
                    SendClientMessage(playerid, 0xFF0000AA, "USAGE: /setlevel [levelid]");
                }
            }
            else
            {
                SendClientMessage(playerid, 0xFF0000AA, "Invalid Player ID");
            }
        }
    else
    {
    SendClientMessage(playerid, 0xFF0000AA, "You are not admin");
    }
        return 1;
    }
Reply


Messages In This Thread
Command with ID problem - by nejc001 - 19.03.2011, 11:14
Re: command problem - by Biesmen - 19.03.2011, 11:20
Re: command problem - by nejc001 - 19.03.2011, 11:31
Re: command problem - by Biesmen - 19.03.2011, 11:36
Re: command problem - by nejc001 - 19.03.2011, 12:40
Re: command problem - by nejc001 - 21.03.2011, 16:10
Re: command problem - by nejc001 - 24.03.2011, 07:24
Re: command problem - by THE_KNOWN - 24.03.2011, 07:32
Re: command problem - by nejc001 - 24.03.2011, 07:36
Re: command problem - by PinkFloydLover - 24.03.2011, 07:38
Re: command problem - by THE_KNOWN - 24.03.2011, 07:39
Re: command problem - by THE_KNOWN - 24.03.2011, 07:40
Re: command problem - by nejc001 - 24.03.2011, 07:45
Re: command problem - by THE_KNOWN - 24.03.2011, 07:46
Re: command problem - by nejc001 - 24.03.2011, 08:03

Forum Jump:


Users browsing this thread: 1 Guest(s)