How to insert int into dialog ?
#1

Hi, does anyone know how to by example when I'm doing /withdraw, the dialog appear but id like to have their balance into the dialog Your balance: %d somelike like that is it possible?
Reply
#2

this is possible:

First of all You must have a varible for player balance.... Let me show you

pawn Код:
new pbalance[MAX_PLAYERS];//this is my var for player balance use your var in which you are saving player balance or what ever it is
Now On Command in which you are showing player dialog you have to use format like this:
See this for more about format:https://sampwiki.blast.hk/wiki/Format
pawn Код:
new msg[64];//we will format it for our message + varaible in message
format(msg,sizeof(msg),"Your balance is : %d",pbalance[playerid]);// %d uses for integar variable and this will use value of pbalance[playerid] , just your varaible for balance here in place of pbalance[playerid]
//now time for dialog
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"Bank Balnce",msg,"Okay","Close");// here msg is format we define above
Enjoy it.... Hope it helps you.
Reply
#3

Working thanks +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)