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] =
{
    {
0451450000SPORTVEHICLES},
    {
1411450000SPORTVEHICLES},
    {
2415150000SPORTVEHICLES},
    {
3402150000SPORTVEHICLES},
    {
4541200000SPORTVEHICLES},
    {
5477150000SPORTVEHICLES},
    {
6603120000SPORTVEHICLES},
    {
7565120000SPORTVEHICLES},
    {
8429120000SPORTVEHICLES},
    {
9506120000SPORTVEHICLES},
    {
10589120000SPORTVEHICLES},
    {
11559120000SPORTVEHICLES},
    {
0560180000SALOONS},
    {
1562175000SALOONS},
    {
242670000SALOONS},
    {
351640000SALOONS},
    {
451820000SALOONS},
    {
552640000SALOONS},
    {
655070000SALOONS},
    {
754040000SALOONS},
    {
854220000SALOONS},
    {
954740000SALOONS},
    {
10434120000SALOONS},
    
    {
052290000BIKES},
    {
146320000BIKES},
    {
246820000BIKES},
    {
347120000BIKES},
    {
446220000BIKES},
    {
54815000BIKES},
    {
05561500000UNIQUE},
    {
15571500000UNIQUE},
    {
2539500000UNIQUE},
    {
358890000UNIQUE},
    {
457120000UNIQUE},
    {
557210000UNIQUE},
    {
650890000UNIQUE},
    {
745720000UNIQUE},
    
    {
0515300000INDUSTRIAL},
    {
1455250000INDUSTRIAL},
    {
2456250000INDUSTRIAL},
    {
3499250000INDUSTRIAL},
    {
4482500000INDUSTRIAL},
    {
5543500000INDUSTRIAL},
    {
6478200000INDUSTRIAL},
    {
7403175000INDUSTRIAL},
    {
8431165000INDUSTRIAL},
    {
9443200000INDUSTRIAL},
    {
10514220000INDUSTRIAL},
    {
11578240000INDUSTRIAL},
    
    {
041220000LOWRIDER},
    {
153420000LOWRIDER},
    {
253520000LOWRIDER},
    {
353620000LOWRIDER},
    {
456620000LOWRIDER},
    {
556720000LOWRIDER},
    {
657620000LOWRIDER},
    {
757520000LOWRIDER},
    {
048920000OFFROAD},
    {
1495120000OFFROAD},
    {
257990000OFFROAD},
    {
340090000OFFROAD},
    
    {
0469500000AIR},
    {
14872000000AIR},
    {
25132000000AIR},
    {
35192500000AIR}
};
enum _playerStats
{
    
carVCP,
    
dealershipChoice,
    
CarChoice,
    
timerSpeed,
    
vsellTo,
    
vsellPrice,
    
vsellFrom,
    
vsellCar
}
new 
Player[MAX_PLAYERS][_playerStats]; 
dialog :

PHP код:
Dialog_DealerShip(playeridresponselistitem)
{
    if(
response)
    {
        
ShowConcessTD(playeridFormatNumber(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)