Array in an array
#8

pawn Код:
if(dialogid == DIALOG_RACE && response) // Start race
    {
        format(string, sizeof(string), "%s", VehicleNames2[race_vehicle_list[listitem][0]-400]);
        for(new i=1; i<sizeof(race_vehicle_list[listitem]); i++)
        {
            format(string, sizeof(string), "%s\n%s", string, VehicleNames2[race_vehicle_list[listitem][i]-400]);
        }
        ShowPlayerDialog(playerid, DIALOG_RACE_VEHICLE, DIALOG_STYLE_LIST, "Start Race - Select Vehicle", string, "Race", "Cancel");
        SetPVarInt(playerid, "race_map", listitem+1);
        return 1;
    }
Gives these errors:
Quote:

C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\MS.pwn(7363) : error 001: expected token: "]", but found "-identifier-"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\MS.pwn(7363) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\MS.pwn(7363) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\MS.pwn(7363) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

4 Errors.

That line is:

pawn Код:
for(new i=1; i<sizeof(race_vehicle_list[listitem]); i++)
and it's refering to the sizeof(race_veh...) part. How can I tell how many vehicles are in the array?

This is the array:
pawn Код:
new race_vehicle_list[][] = {
{411, 411, 411},
{411, 522, 522},
{520, 520}
};
Reply


Messages In This Thread
Array in an array - by MP2 - 19.02.2011, 19:24
Re: Array in an array - by Hiddos - 19.02.2011, 19:36
Respuesta: Array in an array - by anonymousx - 19.02.2011, 20:01
Re: Array in an array - by MP2 - 19.02.2011, 21:51
AW: Array in an array - by Nero_3D - 20.02.2011, 00:02
Re: AW: Array in an array - by Stigg - 20.02.2011, 00:08
Re: Array in an array - by MP2 - 20.02.2011, 16:53
Re: Array in an array - by MP2 - 20.02.2011, 17:35
Re: Array in an array - by rjjj - 20.02.2011, 17:43
Re: Array in an array - by iMonk3y - 20.02.2011, 17:45

Forum Jump:


Users browsing this thread: 1 Guest(s)