09.06.2015, 22:09
Hi , i use bondowocopz dealership system and i want to dйveloppe it using textdraws , so i want to store the Model ID value.
i have create a function ShowConcessTD to show the Info of the car by textdraws , when i go to the dealership i got a dialog they have too many Vehicles type , when i choose one i got the vehicles that should be in this type ( at now all working with dialogs ) , when i click one of the vehicles , i got the textdraws , but always when i do this it show always the Informations of the first car in the dialog, this is the script:
variables
dialog
My textdraw function
to be clear , the problem is from "Dealership[i][dealerModel]" it's not return the correct value.
i have create a function ShowConcessTD to show the Info of the car by textdraws , when i go to the dealership i got a dialog they have too many Vehicles type , when i choose one i got the vehicles that should be in this type ( at now all working with dialogs ) , when i click one of the vehicles , i got the textdraws , but always when i do this it show always the Informations of the first car in the dialog, this is the script:
variables
PHP код:
enum __dealerInfo
{
dialogID,
dealerModel,
dealerPrice,
dealerType
}
new Dealership[][__dealerInfo] =
{
{0, 451, 450000, SPORTVEHICLES},
{1, 411, 450000, SPORTVEHICLES},
{2, 415, 150000, SPORTVEHICLES},
{3, 402, 150000, SPORTVEHICLES},
{4, 541, 200000, SPORTVEHICLES},
{5, 477, 150000, SPORTVEHICLES},
{6, 603, 120000, SPORTVEHICLES},
{7, 565, 120000, SPORTVEHICLES},
{8, 429, 120000, SPORTVEHICLES},
{9, 506, 120000, SPORTVEHICLES},
{10, 589, 120000, SPORTVEHICLES},
{11, 559, 120000, SPORTVEHICLES},
{0, 560, 180000, SALOONS},
{1, 562, 175000, SALOONS},
{2, 426, 70000, SALOONS},
{3, 516, 40000, SALOONS},
{4, 518, 20000, SALOONS},
{5, 526, 40000, SALOONS},
{6, 550, 70000, SALOONS},
{7, 540, 40000, SALOONS},
{8, 542, 20000, SALOONS},
{9, 547, 40000, SALOONS},
{10, 434, 120000, SALOONS},
{0, 522, 90000, BIKES},
{1, 463, 20000, BIKES},
{2, 468, 20000, BIKES},
{3, 471, 20000, BIKES},
{4, 462, 20000, BIKES},
{5, 481, 5000, BIKES},
{0, 556, 1500000, UNIQUE},
{1, 557, 1500000, UNIQUE},
{2, 539, 500000, UNIQUE},
{3, 588, 90000, UNIQUE},
{4, 571, 20000, UNIQUE},
{5, 572, 10000, UNIQUE},
{6, 508, 90000, UNIQUE},
{7, 457, 20000, UNIQUE},
{0, 515, 300000, INDUSTRIAL},
{1, 455, 250000, INDUSTRIAL},
{2, 456, 250000, INDUSTRIAL},
{3, 499, 250000, INDUSTRIAL},
{4, 482, 500000, INDUSTRIAL},
{5, 543, 500000, INDUSTRIAL},
{6, 478, 200000, INDUSTRIAL},
{7, 403, 175000, INDUSTRIAL},
{8, 431, 165000, INDUSTRIAL},
{9, 443, 200000, INDUSTRIAL},
{10, 514, 220000, INDUSTRIAL},
{11, 578, 240000, INDUSTRIAL},
{0, 412, 20000, LOWRIDER},
{1, 534, 20000, LOWRIDER},
{2, 535, 20000, LOWRIDER},
{3, 536, 20000, LOWRIDER},
{4, 566, 20000, LOWRIDER},
{5, 567, 20000, LOWRIDER},
{6, 576, 20000, LOWRIDER},
{7, 575, 20000, LOWRIDER},
{0, 489, 20000, OFFROAD},
{1, 495, 120000, OFFROAD},
{2, 579, 90000, OFFROAD},
{3, 400, 90000, OFFROAD},
{0, 469, 500000, AIR},
{1, 487, 2000000, AIR},
{2, 513, 2000000, AIR},
{3, 519, 2500000, AIR}
};
PHP код:
Dialog_DealerShip(playerid, response)
{
if(response)
{
for(new i = 0; i < sizeof(Dealership); i++)
{
if(Dealership[i][dealerType] == Player[playerid][dealershipChoice])
{
ShowConcessTD(playerid, FormatNumber(Dealership[i][dealerPrice]), GetVehicleModelTopSpeed(Dealership[i][dealerModel]), Dealership[i][dealerType], namaCar[Dealership[i][dealerModel] - 400], Dealership[i][dealerModel]);
return 1;
}
}
}
return 1;
}
PHP код:
ShowConcessTD(playerid, price[], MaxSpeed, ConcessType, VehName[], VehModel)
{
new string[128];
PlayerTextDrawSetPreviewModel(playerid, Concess_PTD[playerid][0], VehModel);
format(string, 128, "~y~Vehicle Name : ~w~ %s", VehName);
convert_encoding(string);
PlayerTextDrawSetString(playerid, Concess_PTD[playerid][1], string);
format(string, 128, "~y~Max speed : ~w~%d ~r~Km/h", MaxSpeed);
convert_encoding(string);
PlayerTextDrawSetString(playerid, Concess_PTD[playerid][2], string);
format(string, 128, "~y~Price : ~w~ %s$", price);
convert_encoding(string);
PlayerTextDrawSetString(playerid, Concess_PTD[playerid][3], string);
format(string, 128, "~y~Type : ~w~%d", ConcessType);
convert_encoding(string);
PlayerTextDrawSetString(playerid, Concess_PTD[playerid][4], string);
for(new i=0; i < 5; i++) PlayerTextDrawShow(playerid, Concess_PTD[playerid][i]);
for(new i=0; i < 20; i++) TextDrawShowForPlayer(playerid, Concess_TD[i]);
SelectTextDraw(playerid, -1);
putinVehicle(playerid);
return 1;
}