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", ""); } } |
dialogMsg[0] = EOS;
Your codes really messy. Could you put it in [PHP] and make it more clear?
For dialogMsg, add: PHP код:
|
forward vs_OnPlayerSpawnsVehicle(playerid);
public vs_OnPlayerSpawnsVehicle(playerid) {
new rows = cache_get_row_count(handlesql);
if(rows > 0) {
new dialogMsg[400],
addition[20],
value;
new dialogMsg[0] = EOS;
new plate[VEHICLE_PLATE_MAX_LENGTH];
for(new i = 0; i < rows; i++) {
format(dialogMsg, sizeof(dialogMsg), "{AFAFAF}Vehicle Name\t{AFAFAF}Market Value\t{AFAFAF}Plate Number{AFAFAF}");
value = cache_get_field_content_int(i, "Value");
for(new x = 0; x < cache_get_row_count(); x++) {
cache_get_field_content(x, "Plate", 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\n", VehicleName[cache_get_field_content_int(i, "Model") - 400], addition, FormatMoney(value), plate);
} else {
format(dialogMsg, sizeof(dialogMsg), "%s\n%s\t%s\t%s\t%s\n", dialogMsg, VehicleName[cache_get_field_content_int(i, "Model") - 400], addition, FormatMoney(value), plate);
}
}
}
ShowPlayerDialogEx(playerid, DIALOG_VEHICLE_SPAWN, DIALOG_STYLE_TABLIST_HEADERS, "{ff9900}Personal Vehicle", dialogMsg, "Spawn", "Exit");
} else {
ShowPlayerDialogEx(playerid, 3155, DIALOG_STYLE_MSGBOX, "{ff9900}Personal Vehicle", "{FF0000}You have have any vehicles on your possesssion.\n{AFAFAF}HINT: If you'd like to purchase a vehicle for your ride, head down to the dealerships and purchase one!\n{AFAFAF}Hint: You can go to the newbies spawn to rent a vehicle until you work to gain enough money for a sufficent vehicle.", "Okay", "");
}
}