pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
MostrarTextVida(playerid);
if(issuerid != INVALID_PLAYER_ID)
{
//No Evento de Sniper
if(InEvento[issuerid] == 1)
{
if(InEvento[playerid] == 1)
{
if(weaponid == 34)
{
SetPlayerHealth(playerid, 0);
SetPlayerArmour(playerid, 0);
}
if(weaponid == 6)
{
new Float: Tcolete;
GetPlayerArmour(playerid, Tcolete);
if(Tcolete > 0)
{
SetPlayerArmour(playerid, 0);
}
else
{
SetPlayerHealth(playerid, 0);
SetPlayerArmour(playerid, 0);
}
}
}
}
//No Evento Guerra de Eagle
if(InEvento[issuerid] == 2)
{
if(InEvento[playerid] == 2)
{
if(weaponid == 24)
{
SetPlayerHealth(playerid, 0);
SetPlayerArmour(playerid, 0);
}
}
}
//
}
if(IsPlayerConnected(playerid))
{
new str[256];
//===================[ playerid ]==================================
new Float:health;
GetPlayerHealth(playerid, health);
if(issuerid == INVALID_PLAYER_ID)
{
KillTimer(TempoMostrarLife[playerid]);
TextDrawShowForPlayer(playerid, MostrarVida[playerid]);
format(str, sizeof(str), "~r~ %f", amount);
GameTextForAll(str, 8000, 4);
TempoMostrarLife[playerid] = SetTimerEx("HideTextoLife", 3000, 0, "i", playerid);
MostrandoVida[playerid] = 1;
}
else
{
KillTimer(TempoMostrarLife[playerid]);
TextDrawShowForPlayer(playerid, MostrarVida[playerid]);
format(str, sizeof(str), "~p~ %f", amount);
GameTextForAll(str, 8000, 4);
TempoMostrarLife[playerid] = SetTimerEx("HideTextoLife", 3000, 0, "i", playerid);
MostrandoVida[playerid] = 1;
}
//==================[ issuerid ] ======================================
KillTimer(TempoMostrarLife[issuerid]);
TextDrawShowForPlayer(issuerid, MostrarVida[issuerid]);
format(str, sizeof(str), "~r~ %f", amount);
GameTextForAll(str, 8000, 4);
TempoMostrarLife[issuerid] = SetTimerEx("HideTextoLife", 3000, 0, "i", issuerid);
MostrandoVida[issuerid] = 1;
}
return 1;
}
Tente usar %.0f para ser mostrado um nъmero de certa forma mais agradбvel.