Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Problem with Health TD.

$
0
0
Top:

Code:

new Text:HPP[MAX_PLAYERS];
OnGameModeInit

Code:

       
          for(new i = 0; i < MAX_PLAYERS; i++)
    {
        HPP[i] = TextDrawCreate(8.000000, 430.000000, "_");
        TextDrawBackgroundColor(HPP[i], 16711935);
        TextDrawFont(HPP[i], 3);
        TextDrawLetterSize(HPP[i], 0.700000, 1.800000);
        TextDrawColor(HPP[i], 712256255);
        TextDrawSetOutline(HPP[i], 1);
        TextDrawSetProportional(HPP[i], 1);
        }

end:

Code:

forward hp(playerid);
public hp(playerid)
{
    new string[100];
    new Float:pHealth;
    GetPlayerHealth(playerid,pHealth);
    format(string, sizeof(string), "hp: %.0f", pHealth);
    TextDrawSetString(HPP[playerid], string);
}

I don't understand, when i tested it with 2 guys, the id 0 has all the textdraws including HP (which shows correctly fine), but me as id 2, doesnt see the HP td, which is actually weird and i dont know what to do.
Probably something regarding on forward and public hp lines, just cant find the problem, help me please.

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>