Xp System helpppp!
#1

I have made an xp system and everything works!
except...
The Xp TextDraw shows only for the first player that joins!
Help me!
Code:
Код:
public OnPlayerConnect(playerid)
{
	SetTimer("xpse", 2, 1);
}
public xpse(playerid)
{
 	new newxp[246];
    format(newxp, sizeof(newxp), "Xp: %d", XP[playerid]);
    TextDrawSetString(XPS, newxp);
    TextDrawShowForPlayer(playerid, XPS);
	return 1;
}
It compiles without any error!
Thanks!
IronMen
Reply
#2

Use SetTimerEx.
pawn Код:
public OnPlayerConnect(playerid)
{
    SetTimerEx("xpse", 2, 1, "i", playerid);
}
Also you don't need "newxp" to have the size of 246, max 15 is needed.
Reply
#3

This is a great way to overload your server. You're not killing the timer when the player disconnects and you have it set to an interval of 2 milliseconds. For your information: the blink of an eye is about 250 milliseconds.
Reply
#4

Thanks!
I'll try it now!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)