OnPlayerUpdate health
#1

So it works but sometimes the red color won't apply on the player's name, all of the colors work till orange

Код:
public OnPlayerUpdate(playerid)
{
    // Health TD.
		    new InfoString[110];
			if(IsPlayerConnected(playerid))
	{
		if(IsPlayerNPC(playerid)) return 0;
		new Float:healthplayer;
		GetPlayerHealth(playerid, healthplayer);
		format(InfoString, sizeof(InfoString), "hp: %.0f", healthplayer);
		TextDrawSetString(HPP[playerid], InfoString);
 		format(InfoString, sizeof(InfoString), "%d", pInfo[playerid][Points]);
		TextDrawSetString(CASH4[playerid], InfoString);
	    if(healthplayer >= 100)
	    {
	      SetPlayerColor(playerid, COLOR_LIME);
	    }
	    else if(healthplayer > 65)
	    {
	      SetPlayerColor(playerid, COLOR_YELLOW);
	    }
	    else if(healthplayer > 50)
	    {
	      SetPlayerColor(playerid, COLOR_ORANGE);
	    }
	    else if(healthplayer > 40)
	    {
	      SetPlayerColor(playerid, COLOR_RED);
	    }
	}
}
Reply


Messages In This Thread
OnPlayerUpdate health - by ivndosos - 09.02.2018, 12:20
Re: OnPlayerUpdate health - by KayJ - 09.02.2018, 16:18
Re: OnPlayerUpdate health - by rfr - 09.02.2018, 16:25
Re: OnPlayerUpdate health - by David (Sabljak) - 09.02.2018, 17:11
Re: OnPlayerUpdate health - by wallen - 09.02.2018, 17:13
Re: OnPlayerUpdate health - by David (Sabljak) - 09.02.2018, 17:33
Re: OnPlayerUpdate health - by Abagail - 09.02.2018, 17:52
Re: OnPlayerUpdate health - by Mugala - 09.02.2018, 18:30

Forum Jump:


Users browsing this thread: 1 Guest(s)