Array must be indexed error.
#1

Код:
error 033: array must be indexed (variable "PlayerName")
This is the line, help please.
pawn Код:
if(strcmp(VehicleOwner[vehicleid], PlayerName(playerid) == 0)
Reply
#2

show where you defined 'VehicleOwner'
Reply
#3

pawn Код:
if(strcmp(VehicleOwner[vehicleid], PlayerName(playerid) == 0))
Reply
#4

pawn Код:
new VehicleOwner[MAX_VEHICLES][MAX_PLAYER_NAME];
EDIT: SAME errors rudy.
Reply
#5

Is PlayerName a custom function or variable?
Reply
#6

pawn Код:
stock PlayerName(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    return name;
}
There it is. **
Reply
#7

Try this:
PHP код:
if(strcmp(VehicleOwner[vehicleid], PlayerName(playerid)) == 0
Reply
#8

Yep, thank you.

I'll REP you in abit. :*
Reply
#9

You're welcome and thank you for rep.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)