Arrays problem
#1

I made 2 variables:
1_ PlayerVCantidad[MAX_PLAYERS] for store the total of player vehicles
2_ PlayerVehicle[MAX_PLAYERS][MAX_PLAYER_VEHICLES] for store playervehicles ids in differents arrays

I put this when player login, but doesn't work, when I use the test command print:
Quote:

1: 0
2: 0
3: 0
4: 0
5: 0

pawn Код:
new vv = 1;
for(new v = 1; v < MAX_VEHICLES; v ++)
{
    if(strcmp(NombreJ(playerid), cInformacion[v][cOwner]) == 0) //This check if the player is Owner
    {
        vv ++
        PlayerVehicle[playerid][vv] = v;
        PlayerVCantidad[playerid] ++;
    }
}
Command:
pawn Код:
CMD:TEST(playerid, params[])
{
    new string[6];
    for(new pv = 1; pv < MAX_PLAYER_VEHICLES; pv ++)
    {
        format(string, sizeof(string), "%d: %d", pv, PlayerVehicle[playerid][pv]);
        SendClientMessage(playerid, -1, string);
    }
    return 1;
}
Reply


Messages In This Thread
Arrays problem - by FullCircle - 27.07.2014, 20:34
Re: Arrays problem - by Jefff - 27.07.2014, 20:52
Respuesta: Re: Arrays problem - by FullCircle - 27.07.2014, 21:16

Forum Jump:


Users browsing this thread: 1 Guest(s)