Error help.
#1

Quote:

(33074) : error 032: array index out of bounds (variable "plate")
(33079) : error 032: array index out of bounds (variable "plate")
(33084) : error 032: array index out of bounds (variable "plate")

pawn Код:
command(lookupplate, playerid, params[])
{
    if(gPlayerData[playerid][Faction] == 5)
    {
        new plate[128], string[256];
        if(sscanf(params, "s", plate)) return SendClientMessage(playerid, GREY, "Server: /lookupplate [Plate]");
        {
            for(new i = 0; i < MAX_PLAYERS; i ++)
            {
                if(plate[128] == gPlayerData[i][NumPlate]) //line 33074
                {
                    format(string, sizeof(string), "[%s] This vehicle belongs to %s.", plate, RemoveUnderScore(i));
                    SendClientMessage(playerid, WHITE, string);
                }
                else if(plate[128] == gPlayerData[i][NumPlate2]) //line 33079
                {
                    format(string, sizeof(string), "[%s] This vehicle belongs to %s.", plate, RemoveUnderScore(i));
                    SendClientMessage(playerid, WHITE, string);
                }
                else if(plate[128] == gPlayerData[i][NumPlate3]) //line 33084
                {
                    format(string, sizeof(string), "[%s] This vehicle belongs to %s.", plate, RemoveUnderScore(i));
                    SendClientMessage(playerid, WHITE, string);
                }
                else return SendClientMessage(playerid, WHITE, "This vehicle wasn't found in the vehicle database.");
            }
        }
    }
    else return SendClientMessage(playerid, GREY, "You are not in the correct Faction.");
    return 1;
}
I've marked the lines in the PAWN code.
Reply
#2

new plate[129], string[256];

or:


if(plate[127] == gPlayerData[i][NumPlate]) //line 33074//same for all
Reply
#3

OK so I added the thing you said FarSE. and it's now not recognizing the number plate.

I have /setnumplate [plate]

It doesn't do nothing though, just returns: "This vehicle wasn't found in the vehicle database."

What's wrong?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)