Problem with textdraw
#1

I have textdraw where are money and things ,but i dont know how to that it is refreshing it.When player got money textdraw shows old ammount.
Reply
#2

Use a timer?
Reply
#3

Quote:
Originally Posted by SpiderPork
Use a timer?
i had this idea , but i dont know how to use timer.
Can anyone help me with timer to get it work?
Reply
#4

pawn Код:
forward MoneyUpdate(playerid);
new Timer[MAX_PLAYERS];

// OnPlayerConnect
Timer[playerid] = SetTimerEx("MoneyUpdate", 5000, 1, "i", playerid);

// OnPlayerDisconnect
KillTimer(Timer[playerid]);

public MoneyUpdate(playerid)
{
    TextDrawSetString(textdraw, GetPlayerMoney(playerid));
    TextDrawShowForPlayer(playerid, textdraw);
}
Make sure you create the textdraw for EACH player (new Text:TextDraw[MAX_PLAYERS], not new Text:Textdraw).
Reply
#5

Quote:
Originally Posted by SpiderPork
pawn Код:
forward MoneyUpdate(playerid);
new Timer[MAX_PLAYERS];

// OnPlayerConnect
Timer[playerid] = SetTimerEx("MoneyUpdate", 5000, 1, "i", playerid);

// OnPlayerDisconnect
KillTimer(Timer[playerid]);

public MoneyUpdate(playerid)
{
    TextDrawSetString(textdraw, GetPlayerMoney(playerid));
    TextDrawShowForPlayer(playerid, textdraw);
}
Make sure you create the textdraw for EACH player (new Text:TextDraw[MAX_PLAYERS], not new Text:Textdraw).
Ok ty , but i have there bank money , ids , zhetons , jobs , factions , pnumbers, respect , phonenumber ,levels and all things how to get these updated?
Is way to make that textdraw gone and come back in very fast ? that player dont see missing?
Reply
#6

Ok i got it all work. ty.

I found a problem when i tested it with another player.I dont see Textdraw Anymore.

format(str, sizeof(str), "[Faction: %d] [Job: %d] [Cash: %d] [Bank: %d] [Zhetons: %d] [Level: %d] [Respect:%d/%d] [Phone: %d] [ID: %d]",ftext,jtext,cash,account,Seton,level,exp,expamou nt,pnumber,playerid);
stats = TextDrawCreate(4.000000,435.000000, str);

How to do that with [MAX_PLAYER] ?
Reply
#7

bump
Reply
#8

anybody really dont know?
Reply
#9

bump
Reply
#10

Anyone really dont know?
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)