XP Bar not updating
#1

removed
Reply
#2

For that you need a timer or use OnPlayerUpdate but I'd rather recommand a timer since OnPlayerUpdate gets called 100 times per ms

Код:
forward yournameofthetimer();
public yournameofthetimer()
{
     for(new i = 0; i < MAX_PLAYERS; i++)
     {
         new string[30];
         format(string, sizeof(string), "%5d", pInfo[playerid][pXP]);
         PlayerTextDrawSetString(playerid, textdrawhere, string);
     }
     return 1;
}
You'll need to call it with SetTimer on a loop.
Reply
#3

or update the textdraw when it actually gets updated
Reply
#4

It's faster with a timer this way he would'n need to update it everytime he wants to create something related to xp.
Reply
#5

undefined symbol "playerid" in both sentences..
Reply
#6

Код:
forward yournameofthetimer();
public yournameofthetimer()
{
     for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
     {
         new string[30];
         format(string, sizeof(string), "%5d", pInfo[playerid][pXP]);
         PlayerTextDrawSetString(playerid, textdrawhere, string);
     }
     return 1;
}
Reply
#7

where to add the timer??
Reply
#8

Код:
CMD:xpls(playerid, params[])
{
	pInfo[playerid][pXP] = 25000;
	SetTimer("UpdateXP", 500, true);
	return 1;
}
here's what i did.. it's not working bro..
Reply
#9

idk.. i type /xpls.. but it doesn't update my XP..


Do i need any plugin or include for this?
Reply
#10

Did you also changed the name of the timer to UpdateXP?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)