How to put tags on dialog list item? - 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: How to put tags on dialog list item? (
/showthread.php?tid=444738)
How to put tags on dialog list item? -
Cameryn - 18.06.2013
So, basically I want to attach data to a specific list item of a dynamic dialog and afterwards get that data when a user selects that item. How would I go about doing that?
Re: How to put tags on dialog list item? -
MP2 - 18.06.2013
What sort of data? Use an array then do array[listitem] and stuff blah blah
Re: How to put tags on dialog list item? -
Enforcer501 - 18.06.2013
You
could use an array, but I personally prefer sticking to defines for dialog ID's or listitem's
I.E.,
#define Item_GPS 0 //Item ID 0
#define Item_ExtraThinCondoms 1 //Item ID 1
if(listitem == Item_GPS)
{
SendClientMessage(playerid,COLOR_RED,"Oh, you need a GPS? Too bad.");
}
etc. You get the idea.
Re: How to put tags on dialog list item? -
Scenario - 18.06.2013
Or, you could do an enum for ID's as it's MUCH easier to maintain and it also looks 100% cleaner.
pawn Код:
enum
{
ITEM_GPS,
ITEM_EXTRATHINCONDOMS
}
Re: How to put tags on dialog list item? -
MP2 - 18.06.2013
Someone should write a library for easy dialog responses. Doesn't y_dialog have that?
Re: How to put tags on dialog list item? -
Scenario - 18.06.2013
Quote:
Originally Posted by MP2
Someone should write a library for easy dialog responses. Doesn't y_dialog have that?
|
y_dialog has inline dialog responses, yes. That's about as good as it gets AFAIK.
Re: How to put tags on dialog list item? -
random123 - 18.06.2013
Quote:
Originally Posted by RealCop228
y_dialog has inline dialog responses, yes. That's about as good as it gets AFAIK.
|
https://sampforum.blast.hk/showthread.php?tid=377140
I preffer those.
Re: How to put tags on dialog list item? -
Cameryn - 18.06.2013
Thanks for your response everyone. The problem is that my data is dynamic on an array and I was silly not to use the listitem as an index of the dynamic array. Thanks again!