11.02.2019, 17:21
I have a problem with this exp bar created with textdraw. The bar is not precise, by this I mean that it does not increase depending on the variables of the player. There are also times where your exp is: "11/12" and the bar is not close to its full size (it is in the middle or simply lower). I have made several calculations but I can not achieve it.
PHP код:
new test = PLAYER_LEVEL[playerid] * 12 //the exp increases depending on the player level
new Float:sizex = 514.0 + (PLAYER_EXP[playerid] * 0.9);
PlayerTextDrawTextSize(playerid, TD_HUD[playerid][4], sizex, 0.000000); //empty: 514, full: 604 (size x)
PlayerTextDrawShow(playerid, TD_HUD[playerid][4]);
if(PLAYER_EXP[playerid] >= test) //If the current exp is equal to or greater than the one previously defined.
{
PLAYER_LEVEL[playerid] ++;
SendClientMessage(playerid, -1, "new level");
}