SA-MP Forums Archive
Need help, loading data from database - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need help, loading data from database (/showthread.php?tid=663292)



Need help, loading data from database - akib - 27.01.2019

Hello, i was trying to make a dealership system dynamic

CMD will be /adddealer /adddealercar

Everything is fine but problem is OnDialogResponse

when player do /buycar on a dealership i can show them specified vehicles for the dealership in a dialog but when player click on the first item on the dialog then it will select 0.

so the code will be like
Code:
SpawnCar(Vehicle[0][model_id],x,y,z);
but if the car's variable number is 345 then how i can spawn it? (Car variable value isn't fixed, it can be 240,410,1)

Code:
----------------------------------------------------
Vehicle Name               |                  Price
----------------------------------------------------
Sultan                                           $25000
Savana                                          $10000
Sultan's variable id is 845 and Savana variable is 902

now if player click on Sultan, it will spawn
Code:
Vehicle[listitem][vehicle_mode]
Which will spawn Vehicle[0]