17.09.2017, 16:02
Quote:
I was creating some buy car in dealerships system, And when i use the command, It only shows an empty dialog with just title, Vehicle Name and Price, and plus there's no error / warning in the compiler
Код:
CMD:dealerships(playerid, params[]) { for(new d=0; d < MAX_CARDEALERSHIPS; d++) { if(CarDealershipInfo[d][cdOwned]) { if(IsPlayerInRangeOfPoint(playerid, 3, CarDealershipInfo[d][cdEntranceX], CarDealershipInfo[d][cdEntranceY], CarDealershipInfo[d][cdEntranceZ])) { new str[900], string[64]; format(STRING, "Vehicle Name\tPrice\n"); strcat(str, string); for(new v = 0; v < MAX_DEALERSHIPVEHICLES; v++) { if(CarDealershipInfo[d][cdVehicleModel][v] > MIN_VEHI_ID && CarDealershipInfo[d][cdVehicleModel][v] > MAX_VEHI_ID) { format(STRING, "%s\t$%d", VehicleName[CarDealershipInfo[d][cdVehicleModel][v] - 400], CarDealershipInfo[d][cdVehicleCost][v]); strcat(str, string); } } ShowPlayerDialog(playerid, DIALOG_CDNEWBUY, DIALOG_STYLE_TABLIST_HEADERS, "Dealerships", str, "Buy", "Cancel"); } } } return 1; } Код:
#define MAX_CARDEALERSHIPS 15 #define MAX_DEALERSHIPVEHICLES 10 |
As i see, there's some of your codes that will trigger a warning, like when you use an integer as second argument while you're calling IsPlayerInRangeOfPoint function.
And also, the problem probably because of these codes:
Код:
format(STRING, "%s\t$%d", VehicleName[CarDealershipInfo[d][cdVehicleModel][v] - 400], CarDealershipInfo[d][cdVehicleCost][v]); strcat(str, string);