28.03.2012, 16:51
Basically, instead of trying to write all possible combinations of if statements, how can I effectively display all the vehicles in the persons slots? It only displays one, otherwise..
How can I get my MSGBOX to display like this:

some of the code is here, I don't mean about plates etc, It's just like if a slot is empty, i don't want it to display, but adding a new line to each.
How can I get my MSGBOX to display like this:

some of the code is here, I don't mean about plates etc, It's just like if a slot is empty, i don't want it to display, but adding a new line to each.
pawn Код:
for(new v = 1; v < MAX_VEHICLES; v++)
{
new name = GetVehicleModel(v) - 400;
printf("Vehicle ID: %d", VehicleSQLID[v]);
VehicleSQLID[v] = MySQL_GetValue(VehicleSQLID[v], "id", "vehicles");
if(VehicleSlot1[playerid] == VehicleSQLID[v] || VehicleSlot2[playerid] == VehicleSQLID[v] || VehicleSlot3[playerid] == VehicleSQLID[v])
{
format(string, sizeof(string), "Vehicles for %s", GetNameEx(playerid));
if(VehicleSlot1[playerid] > 0 && VehicleSlot2[playerid] > 0 && VehicleSlot3[playerid] > 0)
{
format(string1, sizeof(string1), "%s - (%d)\n2. %s - (%d)\n 3. %s - (%d)\n", VehicleNames[name], v);
}
ShowPlayerDialog(playerid,DIALOG_SHOWCAR,DIALOG_STYLE_MSGBOX,string, string1,"Close","");
}
}
return 1;
}