Dialog shows nothing
#1

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;
}
If you ask about the and MAX_CARDEALERSHIPS MAX_DEALERSHIPVEHICLES, its here
Код:
#define MAX_CARDEALERSHIPS 15
#define MAX_DEALERSHIPVEHICLES 10
Reply
#2

Quote:
Originally Posted by ohmy
Посмотреть сообщение
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;
}
If you ask about the and MAX_CARDEALERSHIPS MAX_DEALERSHIPVEHICLES, its here
Код:
#define MAX_CARDEALERSHIPS 15
#define MAX_DEALERSHIPVEHICLES 10
You are lying that you said you don't get any error/warning while compiling this.
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);
You are using uppercase in format() and lowercase in strcat(), and also remember that those codes only show dealership which is owned and nears the player.
Reply
#3

I'm not lying bro, i got no error / warning, so what i should do now?

Quote:

also remember that those codes only show dealership which is owned and nears the player.

Yeah that's what the command for. Its should be showing the dealerships vehicle and price

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)