SA-MP Forums Archive
How to?.. - 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: How to?.. (/showthread.php?tid=599177)



How to?.. - Brys - 22.01.2016

How to display a text for player under the cash ammount for example of "Coins system" like:
Код:
CMD:mygears(playerid, params[])
{
        format(sstring, sizeof(sstring), "\t%s 's Gears ammount:\n\nYou Have: %d Gears!", Global_Name, PlayerInfo[playerid][GoldCoins]);
        ShowPlayerDialog(playerid, MyCoins, BOX,"Gears Info",sstring,"Quit","");
        return 1;
I need it to show how many coins a player have once he connects till he disconnects.


Re: How to?.. - Lucky13 - 22.01.2016

You should use a Textdraw for that which can be updated every second.


Re: How to?.. - Brys - 22.01.2016

The question is how to display the ammount of gears in the textdraw?


Re: How to?.. - jlalt - 22.01.2016

If i'm not wrong it supposed to be like that:
PHP код:
new Text:PTextDraw[MAX_PLAYERS]; // on top 
PHP код:
PTextDraw[playerid] = TextDrawCreate(x,y," "); // on player connect 
PHP код:
TextDrawDestroy(PTextDraw[playerid]); // onplayerdisconnect 
And For update text
PHP код:
  new string[150];
  
format(stringsizeof(string), "\t%s 's Gears ammount:\n\nYou Have: %d Gears!"Global_NamePlayerInfo[playerid][GoldCoins]);
  
TextDrawSetString(PTextDraw[playerid],string);
  
TextDrawShowForPlayer(playerid,PTextDraw);