03.06.2017, 01:23
I have tried to use the new style that came up with 0.3.7 in the vehicle's list of the gamemode I'm working on, and basically everything has gone smoothly but a small bug occured when I was trying to show more than one line. for example if I own 5+ cars, it won't show 5 lines, just exchange between the single line.
That's the code:
How to show more than one line?
That's the code:
Quote:
forward vs_OnPlayerSpawnsVehicle(playerid); public vs_OnPlayerSpawnsVehicle(playerid) { new rows = cache_get_row_count(handlesql); if(rows > 0) { new dialogMsg[400], addition[20], platenum, value; for(new i = 0; i < rows; i++) { format(dialogMsg, sizeof(dialogMsg), "{ff9900}Vehicle Name\t{ff9900}Market Value\t{ff9900}Plate Number{AFAFAF}"); value = cache_get_field_content_int(i, "Value"); platenum = cache_get_field_content_int(i, "Plate"); if(cache_get_field_content_int(i, "Donate") != 0 || value == 0) { format(addition, sizeof(addition), "Donator Vehicle, "); } else { format(addition, sizeof(addition), "%s", EOS); } if(isnull(dialogMsg)) { format(dialogMsg, sizeof(dialogMsg), "%s\n%s\t%s\t%s", VehicleName[cache_get_field_content_int(i, "Model") - 400], addition, FormatMoney(value), platenum); } else { format(dialogMsg, sizeof(dialogMsg), "%s\n%s\t%s\t%s", dialogMsg, VehicleName[cache_get_field_content_int(i, "Model") - 400], addition, FormatMoney(value), platenum); } } ShowPlayerDialogEx(playerid, DIALOG_VEHICLE_SPAWN, DIALOG_STYLE_TABLIST_HEADERS, "{AFAFAF}Personal Vehicles", dialogMsg, "Spawn", "Cancel"); } else { ShowPlayerDialogEx(playerid, 3155, DIALOG_STYLE_MSGBOX, "{AFAFAF}Personal Vehicles", "{FF0000}You don't have any vehicles.", "EXIT", ""); } } |