Change ShowPlayerDialog params?
#1

Hi guys,
I thought that it would be much easier if I could use the second param, dialogid, as string and not integer, so I went to a_samp.inc, and I've changed this lines:
Код:
native ShowPlayerDialog(playerid, dialogid[], style, caption[], info[], button1[], button2[]);
forward OnDialogResponse(playerid, dialogid[], response, listitem, inputtext[]);
And on my gamemode I've changed the OnDialogResponse to:
Код:
public OnDialogResponse(playerid, dialogid[], response, listitem, inputtext[])
I think that with this changes it should now handle strings with no problem, but when I show a dialog like this:
Код:
ShowPlayerDialog(playerid, "24/7", DIALOG_STYLE_MSGBOX....
I print the dialogid on the OndialogResponse and I get a null value...

Does anyone have an idea about how to fix this if possible?

I'll rep you for sure, Thanks
Reply
#2

you can not override native functions
Reply
#3

You could easily define the dialogid like this:

pawn Код:
#define ADialogName 1
And use it like this:

pawn Код:
ShowPlayerDialog(playerid, ADialogName, DIALOG_STYLE_MSGBOX....
// here your PAWNO reads ADialoigName as an integer which is 1 as we defined it above.
Reply
#4

Why would you want to use a string as the dialog ID? It uses more memory. Use #define.
Reply
#5

Thanks, it's probably the best solution I get here, +rep for all
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)