SA-MP Forums Archive
Best way for handling custom textdraw menus? (enums, dialog style IDs) - 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: Best way for handling custom textdraw menus? (enums, dialog style IDs) (/showthread.php?tid=468438)



Best way for handling custom textdraw menus? (enums, dialog style IDs) - RajatPawar - 08.10.2013

Hi guys. I have created TD menus, I am now struggling to decide which would be a better option.

Would it be better to create an enum, then store EACH menu created, it's info, and return it's ID and then show it to the player? Or just like dialogs, create ONE type and show it to all? I have no idea on how to go ahead with this.

If it's not clear, do ask.
Also, I'd like to know how do you 'create' tags for your variables?
pawn Код:
new TextDrawMenu: custom_menu;
ShowMenu( custom_menu );
Thanks!


Re: Best way for handling custom textdraw menus? (enums, dialog style IDs) - Misiur - 08.10.2013

2. You've just created a tag! Simply creating a variable with your new custom tag will do this. Also keep in mind that named enums register a new tag type.

1. Really, it's completely up to you. I don't quite know what do you mean by creating enum. Do you have in mind something like enumerated array?

pawn Код:
#define MAX_CUSTOM_TEXTDRAWS    20

enum E_CUSTOM_TEXTDRAW {
    Text:tid,
    tmessage[128]
}
static
    CustomTextDraws[MAX_CUSTOM_TEXTDRAWS][E_CUSTOM_TEXTDRAW],
    Iterator:CustomTextDraws<MAX_CUSTOM_TEXTDRAWS>;
In either case, think what will be easier for you to work with and go with it.


Re: Best way for handling custom textdraw menus? (enums, dialog style IDs) - RajatPawar - 08.10.2013

Thanks for replying! By enums, I meant.. Storing each menu's data indivisually under the ''create stock'' and returning an id, which then you use under the show stock.. Also, you said I created a tag, but if I don't use it, I won't get a tag mismatch error! Could you please explain to me 'named enums', I have seen examples, but not the syntax, really. And then how'd you use it? Thanks already!