MySQL listitem ID?
#1

Hi all.

My gamemode has a table only for vehicles, and by the command /vehicles all vehicles that belong to you are listed.
My question is: How can I know the selected vehicle in the dialog?
The script simply search all vehicles with my account ID and it shows it in the list, but I can't know what vehicle has been selected in the dialog, how can I do this?

Thanks for your help.
Reply
#2

An idea could be to sort the query in some way. Alphabetical, price or table-id's if you have a column index.
Then assign them to arrays in a loop, and show the array in the dialog.

SELECT * FROM my_car_table ORDER BY price DESC

Then on the callback, you can loop through the rows in the result, and add them to the array respectively.
Reply
#3

Quote:
Originally Posted by denNorske
Посмотреть сообщение
An idea could be to sort the query in some way. Alphabetical, price or table-id's if you have a column index.
Then assign them to arrays in a loop, and show the array in the dialog.

SELECT * FROM my_car_table ORDER BY price DESC

Then on the callback, you can loop through the rows in the result, and add them to the array respectively.
So do I have to use some clever way to do it and a regular function doesn't exist?
Reply
#4

you gotta do that on your own yes
Because there is always differnt types of data to load, so making one function doesn't work. You gotta build it up for the purpose yourself
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)