How to put tags on dialog list item?
#1

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?
Reply
#2

What sort of data? Use an array then do array[listitem] and stuff blah blah
Reply
#3

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.
Reply
#4

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
}
Reply
#5

Someone should write a library for easy dialog responses. Doesn't y_dialog have that?
Reply
#6

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.
Reply
#7

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.
Reply
#8

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!
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)