SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 16/05/2015, 07:41 PM   #1
Boyka96
Big Clucker
 
Join Date: Feb 2014
Location: Morocco
Posts: 56
Reputation: 2
Default tracking problem

Hii .. it's a little bit hard to explain, so I'll do my best and please if you dont understand comment and I'll try to explain more.
While making a system I came to a point where I have to list items from a Database table collumn into a Dialog (type list) then I need to react depending on which item the player has choosen .. the problem is that all I still have in OnDialogResponse is the index of the choosen dialog item (listitem) .. if someone have an idea .. please post it .. if you dont understand something please post and I'll try to explain more.
I thought of creating an array at the time of showing the dialog and save the primary keys on it in the order of apparition but the problem I was facing is the size of this array .. I also believe there is an easier way as I saw this working perfectly in other servers.
Thanks
__________________
Boyka96 is offline   Reply With Quote
Old 16/05/2015, 07:47 PM   #2
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,828
Reputation: 1401
Default Re: tracking problem

You get the listitem and the inputtext. I'm sure those two are enough.

Can you describe what's the problem and what you're trying to do so we'll be able to help you more?
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Old 16/05/2015, 07:51 PM   #3
Boyka96
Big Clucker
 
Join Date: Feb 2014
Location: Morocco
Posts: 56
Reputation: 2
Default Re: tracking problem

the listitem is the index of the dialog item .. what I need to know is which line of the database the player selected as the dialog list items are fetched from the database.
Edit: also there is no inputtext in a dialog list
__________________
Boyka96 is offline   Reply With Quote
Old 16/05/2015, 07:56 PM   #4
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,828
Reputation: 1401
Default Re: tracking problem

What do you mean by "which line of the database"?

If you show 25 items and the player selected the 10th, then you know which row they selected.
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Old 16/05/2015, 08:02 PM   #5
Boyka96
Big Clucker
 
Join Date: Feb 2014
Location: Morocco
Posts: 56
Reputation: 2
Default Re: tracking problem

Quote:
Originally Posted by Konstantinos View Post
What do you mean by "which line of the database"?

If you show 25 items and the player selected the 10th, then you know which row they selected.
then I know that he selected the item which index is 9 from the dialog list .. not the Row related to that item in the database table I fetched these items from when showing the dialog.. you see what I mean ?
__________________
Boyka96 is offline   Reply With Quote
Old 16/05/2015, 08:07 PM   #6
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,828
Reputation: 1401
Default Re: tracking problem

Everytime you select a listitem, inputtext holds the text of that index.

I cannot understand you very well, an example of code would be a good start as I'm not aware of what you actually load from the database (name, ids etc).
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Old 16/05/2015, 08:15 PM   #7
Boyka96
Big Clucker
 
Join Date: Feb 2014
Location: Morocco
Posts: 56
Reputation: 2
Default Re: tracking problem

Quote:
Originally Posted by Konstantinos View Post
Everytime you select a listitem, inputtext holds the text of that index.
That's the information I needed .. thanks +rep
__________________
Boyka96 is offline   Reply With Quote
Old 16/05/2015, 11:34 PM   #8
Boyka96
Big Clucker
 
Join Date: Feb 2014
Location: Morocco
Posts: 56
Reputation: 2
Default Re: tracking problem

Update: it worked .. I edited the items so they contain the Row ID then I used string functions to retrieve it back from inputtext.. thanks for giving me the key Konstantinos .. You always do it
__________________
Boyka96 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tracking Car Missiles ? Opah Scripting Help 4 06/07/2013 10:12 AM
Tracking paydays dusk Scripting Help 11 17/03/2013 01:27 PM
can some one make me a geo-ip tracking filterscript crowb14 Help Archive 1 13/07/2011 09:47 PM
[HELP] tracking players zouyun Help Archive 2 27/06/2011 03:21 PM


All times are GMT. The time now is 11:29 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.