Problem with textdraw -
Peep - 03.01.2010
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.
Re: Problem with textdraw -
SpiderPork - 03.01.2010
Use a timer?
Re: Problem with textdraw -
Peep - 03.01.2010
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?
Re: Problem with textdraw -
SpiderPork - 03.01.2010
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).
Re: Problem with textdraw -
Peep - 03.01.2010
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?
Re: Problem with textdraw -
Peep - 03.01.2010
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] ?
Re: Problem with textdraw -
Peep - 04.01.2010
bump
Re: Problem with textdraw -
Peep - 08.01.2010
anybody really dont know?
Re: Problem with textdraw -
Peep - 13.01.2010
bump
Re: Problem with textdraw -
Peep - 19.01.2010
Anyone really dont know?