Not adding up
#1

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            format(string, sizeof(string), "~b~~h~%i ~w~- ~r~~h~%i", bluescore, redscore);
            TextDrawSetString(TS, string);
            if(gTeam[i] == TEAM_HOME && iRound[i] == 1)
            {
                bteamtotal = (GetPlayerHealth(i, health) + GetPlayerArmour(i, armor));
                format(string, sizeof(string), "~l~| ~w~Alive: ~b~%i ~l~| ~w~Health: ~b~%.0f", bblue, bteamtotal);
                TextDrawSetString(HC, string);
            }
            else if(gTeam[i] == TEAM_AWAY && iRound[i] == 1)
            {
                rteamtotal = bteamtotal = (GetPlayerHealth(i, health) + GetPlayerArmour(i, armor));
                format(string, sizeof(string), "~w~Alive: ~r~%i ~l~| ~w~Health: ~r~%.0f ~l~|", bred, rteamtotal);
                TextDrawSetString(AC, string);
            }
        }
    }
I'm trying to add up the total health of the players in the round on each team. When I do this, I can never get the HP on the textdraw, it never shows any numbers just a blank space where it's suppose to be. Any help or suggestion on how to get the hp of the team?
Reply
#2

How big is the string?
Reply
#3

It actually says 0 on the textdraw
Reply
#4

Change this
rteamtotal = bteamtotal =

to this
rteamtotal =
Reply
#5

That was a typo on copy and pasting while posting the topic that actually isnt in there
Reply
#6

The string says 0?
Reply
#7

Try float(rteamtotal); and float(bteamtotal);
Reply
#8

Hide the textdraw
set the string
reshow it to everyone
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)