Quote:
Originally Posted by WhoIsYourDaddy
PHP код:
new
count,
text[128],
dialogText[200];
for (new i = 0; i != MAX_VEHICLES; i ++) // put your MAX_DEALERSHIP_VEHICLES thing...
{
if (!CarData[i][cExists]) continue; // create an another variable for each vehicle to see if they exists
strunpack(text, CarData[i][cModel]); // Load things you need... (loads model such as Cheetah, Infernus)
CarData[i][cFuel] = new Float:cFuel; // I'm assuming this is float
format(dialogText, sizeof(dialogText), "Car ID: %d | Car Model: %s | Car Fuel: %f\n", CarData[i][cID], text, cFuel);
ShowPlayerDialog(playerid, DIALOG_LIST_VEHICLES, DIALOG_STYLE_LIST, "Vehicles", dialogText, "Select", "Exit");
count++;
}
if (!count) return SendClientMessage(playerid, -1, "There are no vehicles to display.");
I hope I understood you correctly. You can put these in a command or a function idk whatever pleases you. Ofc you have to change variables to what you set in your script.
|
Don't think you understood, I'll try and be more clear the way I have it set is a user will type /vbuy this will then show a dialogbox(list style) of all the categories and then lets say they press Bikes shows another Dialogbox(list tab style) of all the Vehicles in my dealership table with the catagory for bike e.g
Код:
case dialogThreadCarDealer:
{
if(!response)
{
return 0;
}
switch(listitem)
{
case 0:
{
new string[525], next[255];
for(new i=0; i<MAX_DEALERSHIPVEHICLES; i++)
{
if(Dealer[i][Cat] == 1)
{
format(next, sizeof(next),"%s\t$%d\n",Dealer[i][Name],Dealer[i][Price]);
strcat(string, next, sizeof(string));
}
}
ShowPlayerDialog(playerid, dialogThreadBikes, DIALOG_STYLE_TABLIST, "Vehicle Dealership - Bikes",string, "Purchase", "Back");
}
As you can see this will now load the vehicles I have set what I am wondering is how to do the next step dymically make a case for each vehicle depending on how many vehicles it loaded