MoneyTextdraw
#6

PHP код:
new moneyTimer[MAX_PLAYERS];
public 
OnPlayerConnect(playerid)
{
    for(new 
03i++)
    {
         
PlayerTextDrawShow(playerid,TDEditor_PTD[playerid][i]);
    }
    
moneyTimer[playerid] = SetTimerEx("MoneyUpdater"1000true"i"playerid);
    return 
1;

PHP код:
public OnPlayerDisconnect(playerid)
{
   
KillTimer(moneyTimer[playerid]);
   return 
1;

We can just create a loop to show the textdraw just to be more convenient and clean.

You need to use SetTimerEx to have a way to use the playerid inside the function.

https://sampwiki.blast.hk/wiki/SetTimerEx
https://sampwiki.blast.hk/wiki/SetTimer

Specifically what you should learn about.

PHP код:
public MoneyUpdater(playerid)
{
    new 
          
string[60];
    
format(stringsizeof(string), "%.2f"Peniaze[playerid]);
    
PlayerTextDrawSetString(playeridTDEditor_PTD[playerid][1], string);
    return 
1;

I recommend not using a timer and just updating the textdraw when a player receives / loses money.
Reply


Messages In This Thread
MoneyTextdraw - by IchNar - 17.07.2017, 18:27
Re: MoneyTextdraw - by IchNar - 17.07.2017, 18:48
Re: MoneyTextdraw - by FailerZ - 17.07.2017, 18:49
Re: MoneyTextdraw - by IchNar - 17.07.2017, 19:03
Re: MoneyTextdraw - by FailerZ - 17.07.2017, 19:14
Re: MoneyTextdraw - by Kane - 17.07.2017, 20:52
Re: MoneyTextdraw - by Pottus - 17.07.2017, 21:13

Forum Jump:


Users browsing this thread: 2 Guest(s)