[Ajuda] bug no id 0
#1

Код:
forward ContMaintxt();
public ContMaintxt()
{
	if(IniciandoRound || !RoundIniciado)
	return;
	
	if(modetipe == ARENA)
	{
	    sHealth[HOME] = 0;
	    sHealth[AWAY] = 0;
	    for(new i; i < MAX_PLAYERS; i++)
	    {
	        if(pTeam[i] == HOME && InRound[i] && !pSub[i])
	        {
	            static Float:HP, Float:Armour;
	            GetPlayerHealth(i, HP);
	            GetPlayerArmour(i, Armour);
	            sHealth[HOME] = sHealth[HOME] + HP + Armour;
	            SetPlayerScore(i, floatround(HP + Armour));
	        }
	        else if(pTeam[i] == AWAY && InRound[i] && !pSub[i])
	        {
	            static Float:HP, Float:Armour;
	            GetPlayerHealth(i, HP);
	            GetPlayerArmour(i, Armour);
	            sHealth[AWAY] = sHealth[AWAY] + HP + Armour;
	            SetPlayerScore(i, floatround(HP + Armour));
	        }
	    }
	
		new mensagem[190];
		format(mensagem, sizeof(mensagem), "~r~%s(~g~~h~%i~r~)                     ~w~--:--                    ~b~%s(~g~~h~%i~b~)", TeamName[HOME], floatround(sHealth[HOME]), TeamName[AWAY], floatround(sHealth[AWAY]));
		for(new i; i < MAX_PLAYERS; i++)
		{
			TextDrawHideForPlayer(i, maintxt[1]);
			TextDrawSetString(maintxt[1], mensagem);
			TextDrawShowForPlayer(i, maintxt[1]);
		}
	}
	SetTimer("ContMaintxt", 500, false);
}
o ID 0 fica com hp bugado ( 999999 ) e os outros ids fica normal
se alguem puder dar uma forзa =S
Reply
#2

tente ;

pawn Код:
forward ContMaintxt();
public ContMaintxt(){
    for(new i = 0; i < MAX_PLAYERS; i++){
        if(IniciandoRound || !RoundIniciado)
        return;
        if(modetipe == ARENA){
            sHealth[HOME] = 0;
            sHealth[AWAY] = 0;
            if(pTeam[i] == HOME && InRound[i] && !pSub[i]){
                    static Float:HP, Float:Armour;
                    GetPlayerHealth(i, HP);
                    GetPlayerArmour(i, Armour);
                    sHealth[HOME] = sHealth[HOME] + HP + Armour;
                    SetPlayerScore(i, floatround(HP + Armour));
            }
            else if(pTeam[i] == AWAY && InRound[i] && !pSub[i]){
                    static Float:HP, Float:Armour;
                    GetPlayerHealth(i, HP);
                    GetPlayerArmour(i, Armour);
                    sHealth[AWAY] = sHealth[AWAY] + HP + Armour;
                    SetPlayerScore(i, floatround(HP + Armour));
            }
        }
        new mensagem[190];
        format(mensagem, sizeof(mensagem), "~r~%s(~g~~h~%i~r~)                     ~w~--:--                    ~b~%s(~g~~h~%i~b~)", TeamName[HOME], floatround(sHealth[HOME]), TeamName[AWAY], floatround(sHealth[AWAY]));
        TextDrawHideForPlayer(i, maintxt[1]);
        TextDrawSetString(maintxt[1], mensagem);
        TextDrawShowForPlayer(i, maintxt[1]);
    }
    SetTimer("ContMaintxt", 500, false); //arrume isso aqui , nгo sei o que isso tб fazendo aqui..
}
Reply
#3

1 time o hp tб certo, o outro bugado e.e
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)