Change ShowPlayerDialog params?

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, 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

you can not override native functions

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.

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

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

Forum Jump:

Users browsing this thread: 1 Guest(s)