ShowPlayDialog , DIALOG_STYLE_MSGBOX
#1

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!
Reply
#2

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");
Reply
#3

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

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.
Reply
#5

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

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...
Reply
#7

OK, worked.
Thanks for the help guys.
Reply
#8

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.
Reply
#9

Edited - Fixed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)