Change ShowPlayerDialog params? -
mati233 - 30.06.2012
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
Re: Change ShowPlayerDialog params? -
CoaPsyFactor - 30.06.2012
you can not override native functions
Re: Change ShowPlayerDialog params? -
[KHK]Khalid - 30.06.2012
You could easily define the dialogid like this:
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.
Re: Change ShowPlayerDialog params? -
MP2 - 30.06.2012
Why would you want to use a string as the dialog ID? It uses more memory. Use #define.
Re: Change ShowPlayerDialog params? -
mati233 - 30.06.2012
Thanks, it's probably the best solution I get here, +rep for all