Array Must Be Indexed
#1

So I'm creating my code for a taxi radio, and I get a error

pawn Код:
if(strcmp(cmd, "/tr", true) == 0 || strcmp(cmd, "/taxiradio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new wstring[128];
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[128];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "[USAGE] /tr [message]");
                return 1;
            }
            if(Muted[playerid])
            {
                SendClientMessage(playerid, COLOR_RED, "[ERROR] You can't use the radio, your muted.");
                return 1;
            }
            if(Taxijob == 1)
            {
                format(wstring, sizeof(wstring), "(DPSCOM) %s : %s",GetPlayerNameEx(playerid),result);
                SendTaxiMessage(COLOR_YELLOW, wstring);
                return 1;
            }
        }
        return 1;
    }
Код:
C:\Users\machine\Desktop\PCRPbeta\gamemodes\pcrp.pwn(7513) : error 033: array must be indexed (variable "Taxijob")
Reply
#2

Where do you defined 'Taxijob'?
Reply
#3

pawn Код:
new Taxijob[MAX_PLAYERS];
that's it?
Reply
#4

FIXED.

I forgot to add [playerid]
Reply
#5

Quote:
Originally Posted by vincee
Посмотреть сообщение
FIXED.

I forgot to add [playerid]
Exactly...
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)