SA-MP Forums Archive
ShowPlayDialog , DIALOG_STYLE_MSGBOX - 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: ShowPlayDialog , DIALOG_STYLE_MSGBOX (/showthread.php?tid=445353)



ShowPlayDialog , DIALOG_STYLE_MSGBOX - AdamCooper - 20.06.2013

Is this possible to add
pawn Код:
%d and %s
in DIALOG_STYLE_MSGBOX

example :

pawn Код:
ShowPlayerDialog(playerid,2000,DIALOG_STYLE_MSGBOX,"Mobile Data Control","Convicts:\n[%s]","Accept","Cancel", PlayerInfo[x][crimereason]);
Right now I'm getting error "warning 202: number of arguments does not match definition"

Any ideas? Thanks!


Respuesta: ShowPlayDialog , DIALOG_STYLE_MSGBOX - JustBored - 20.06.2013

No, you have to format it
pawn Код:
format(string, sizeof(string), "Convicts:\n[%s]", PlayerInfo[x][crimereason]
ShowPlayerDialog(playerid,2000,DIALOG_STYLE_MSGBOX,"Mobile Data Control",string,"Accept","Cancel");



Re: ShowPlayDialog , DIALOG_STYLE_MSGBOX - SwisherSweet - 20.06.2013

Код:
ShowPlayerDialog(playerid,2000,DIALOG_STYLE_MSGBOX,"Mobile Data Control", "Convicts:\n %s", "Accept", "Cancel", PlayerInfo[x][crimereason]);



Re: ShowPlayDialog , DIALOG_STYLE_MSGBOX - Scenario - 20.06.2013

Quote:
Originally Posted by Aveger
Посмотреть сообщение
Код:
ShowPlayerDialog(playerid,2000,DIALOG_STYLE_MSGBOX,"Mobile Data Control", "Convicts:\n %s", "Accept", "Cancel", PlayerInfo[x][crimereason]);
No, that's wrong.

JustBored has the right idea! %s, %d, %i, %f are all "placeholders" as I like to call them. You need to use format in order to actually sort out what should be substituted in for each of them.


Re: ShowPlayDialog , DIALOG_STYLE_MSGBOX - AdamCooper - 20.06.2013

Yup that's smart I will give it a try and update here.
Thanks


Re: ShowPlayDialog , DIALOG_STYLE_MSGBOX - SwisherSweet - 20.06.2013

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
No, that's wrong.

JustBored has the right idea! %s, %d, %i, %f are all "placeholders" as I like to call them. You need to use format in order to actually sort out what should be substituted in for each of them.
im still learning myself...


Re: ShowPlayDialog , DIALOG_STYLE_MSGBOX - AdamCooper - 20.06.2013

OK, worked.
Thanks for the help guys.


Re: ShowPlayDialog , DIALOG_STYLE_MSGBOX - Scenario - 20.06.2013

Quote:
Originally Posted by Aveger
Посмотреть сообщение
im still learning myself...
I figured as much. I'm just letting you know you're wrong. If I wanted to be an ass, believe me, I would of said it differently.


Re: ShowPlayDialog , DIALOG_STYLE_MSGBOX - AdamCooper - 20.06.2013

Edited - Fixed.