Small problem
#1

pawn Код:
CMD:vstorage(playerid, params[])
{
    new szCars[1024];
    for(new v; v < MAX_PLAYER_VEHICLES; v++) {
        if(playerVehicles[playerid][v][cModelID] > 399) {
            if(playerVehicles[playerid][v][cStored] == 0) {
                format(szCars, sizeof(szCars), "[%d] | %s | Stored(click to spawn) ", v, VehicleName[playerVehicles[playerid][v][cModelID] - 400]);
            }
            else if(playerVehicles[playerid][v][cStored] == 1) {
                format(szCars, sizeof(szCars), "[%d] | %s | Spawned(click to store)", v, VehicleName[playerVehicles[playerid][v][cModelID] - 400]);
            }
        }
        else strcat(szCars, "\nEmpty(available slot)");
    }
    ShowPlayerDialog(playerid, DIALOG_MYCARS, DIALOG_STYLE_LIST, "[ VEHICLES ]", szCars, "Select", "Cancel");
    return 1;
}
Okay, so im creating a player vehicle system, and the max player cars are 8(defined), and when I do /vstorage it displays the last car.. (, I have no idea why, it only displays ONE car which is the last

I presume this is a small fix, thanks
Reply
#2

pawn Код:
CMD:vstorage(playerid, params[])
{
    new szCars[1024],Model;
    for(new v; v < MAX_PLAYER_VEHICLES; v++)
        if((Model = playerVehicles[playerid][v][cModelID]) > 399)
        {
            if(playerVehicles[playerid][v][cStored] == 0)
                format(szCars, sizeof(szCars), "%s[%d] | %s | Stored(click to spawn)\n",szCars, v, VehicleName[Model - 400]);
            else
                format(szCars, sizeof(szCars), "%s[%d] | %s | Spawned(click to store)\n",szCars, v, VehicleName[Model - 400]);
        }else strcat(szCars, "Empty(available slot)\n");
       
    szCars[strlen(szCars)-1] = 0;

    return ShowPlayerDialog(playerid, DIALOG_MYCARS, DIALOG_STYLE_LIST, "[ VEHICLES ]", szCars, "Select", "Cancel");
}
Reply
#3

Didn't change anything ;/

EDIT: Fixed, thank you, just realised the other n's on the szCars, thanks man!

EDIT: Maybe not, should of tested it before saying it's fixed...

EDIT: I fixed it lol yolo
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)