[Help] Converting TextDraw Text
#1

Hello all , i have Premium points system but i want to remove it from TextDraw . Following is my Public UpdatePlayer() code.
PHP код:
        format(string128"Premium Points: %d"User[i][accountPP]);
        
PlayerTextDrawSetString(iTextdraw0string); 
It Update players Textdraw0 which is Premium points . But i want to have the premium points written in the heading of ShowPlayerDialog.

PHP код:
ShowPlayerDialog(playeridDIALOG_SHOPDIALOG_STYLE_LIST""newb"Server Shop""Change Name\t\t($50,000 + 100 score)\nPremium Points\t\t(10 PP)\t\t(1500 scores)""Buy""Cancel"); 
The Above ShowPlayerDialog is of Shop . Now i want to have premium points written in fron ot Server Shop . Which will looks like this
Server Shop : Premium points = (points) . and also it updates as the textdraw.
Reply
#2

You'll have to format a string and use that in your ShowPlayerDialog-function:

pawn Код:
new string[64];
format(string, sizeof(string), "Server Shop : Premium points = (%d)", User[i][accountPP]);
ShowPlayerDialog(playerid, DIALOG_SHOP, DIALOG_STYLE_LIST, string, "Change Name\t\t($50,000 + 100 score)\nPremium Points\t\t(10 PP)\t\t(1500 scores)", "Buy", "Cancel");
Reply
#3

It works but there is a little problem . I added SetTimer for that public UpdatePlayer to update the player's point after every 0.5 second . Now that dialog appears in every 0.5 seconds.If i try to close it again appear.
Reply
#4

As far as I know you can't update the text in a dialog while it's visible to players. You first have to hide it before you can change it.
Reply
#5

It is hidden . I want that when player get premium points they updated on the Dialogbox but after giving me the code the textdraw appears when i login and don't hide even if i press close.
Reply
#6

I think you shouldn't put ShowPlayerDialog in a timer.

You could just update the variable for the premiumpoints whenever you give it to them, and whenever you want the dialog to appear you first format string, and use that in the ShowPlayerDialog-function.
Reply
#7

How i can? will you please give me the code.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)