Dealership help
#1

Hi , i have a small problem with my dealership system, to explain my system , it's a simple dealership system maked with Textdraws / Dialogs, when i do /dealership ( in the range of point ) , i got a dialog of the vehicle ( UNIQUE , SPORT ect ... ) when i choose SPORT for example i got a dialog of the sport vehicles ( Turismo / infernus this is just an example ) , when i choose one of there cars i got a textdraw to see the price ect .. , everything is OK here, but now i will enter to the UNIQUE vehicles , i got the vehicle list , when i choose one of the vehicles , i got the textdraw of the vehicle of the first dialog ( SPORT ) always with any other type, the problem come from this

definition and 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}
};
enum _playerStats
{
    
carVCP,
    
dealershipChoice,
    
CarChoice,
    
timerSpeed,
    
vsellTo,
    
vsellPrice,
    
vsellFrom,
    
vsellCar
}
new 
Player[MAX_PLAYERS][_playerStats]; 
dialog :

PHP код:
Dialog_DealerShip(playerid, response, listitem)
{
    if(
response)
    {
        
ShowConcessTD(playerid, FormatNumber(Dealership[listitem][dealerPrice]), GetVehicleModelTopSpeed(Dealership[listitem][dealerModel]), Dealership[listitem][dealerType], namaCar[Dealership[listitem][dealerModel] - 400], Dealership[listitem][dealerModel]);
        
Player[playerid][CarChoice] = listitem;
        return 
1;
    }
    return 
1;
} 
i want to make a relation with 'Player[playerid][CarChoice]' and 'Player[playerid][dealershipChoice]' ( this is the category of the cars) the carChoice is Okay but the dealershipchoice is not , because it's return always to 0 ( Sport type ) , please help.
Reply
#2

The problem is that you're not adding up the amount of the chosen option and the initial last offset of the previous category(ies). For example:

pawn Код:
Player[playerid][CarChoice] = listitem + MAX_SPORT_VEHICLES;
pawn Код:
Player[playerid][CarChoice] = listitem + MAX_SPORT_VEHICLES + MAX_SALOON_VEHICLES;
Same goes for any other related-options/features.
Reply
#3

Okay, so it's will be like :

pawn Код:
Player[playerid][CarChoice] = listitem + Player[playerid][dealershipChoice]
Player[playerid][dealershipChoice] = category = listitem from the last dialog ( to choose the gategory ).
Reply
#4

Quote:
Originally Posted by AlexBlack
Посмотреть сообщение
Okay, so it's will be like :

pawn Код:
Player[playerid][CarChoice] = listitem + Player[playerid][dealershipChoice]
Player[playerid][dealershipChoice] = category = listitem from the last dialog ( to choose the gategory ).
If you pick the first element of SALOONS, is the variable set to 12?
Reply
#5

Nop, it's will be set to a value of the first type of vehicles ( SPORTVEHICLES ).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)