forward OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid); public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid) { MostrarTextVida(playerid); if(IsPlayerConnected(playerid)) { new str[256]; PlayerPlaySound(playerid, 1095, 0.0, 0.0, 0.0); PlayerPlaySound(issuerid, 6401, 0.0, 0.0, 0.0); //===================[ playerid ]==================================/157 new Float:health; new PlayerName[MAX_PLAYER_NAME]; GetPlayerHealth(playerid, health); if(issuerid == INVALID_PLAYER_ID) { //GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME); KillTimer(TempoMostrarLife[playerid]); TextDrawShowForPlayer(playerid, MostrarVida[playerid]); format(str,sizeof(str),"~r~hp:~w~ -%.1f", amount); TextDrawSetString(MostrarVida[playerid], str); TempoMostrarLife[playerid] = SetTimerEx("HideTextoLife", 3000, 0, "i", playerid); MostrandoVida[playerid] = 1; } else { KillTimer(TempoMostrarLife[playerid]); TextDrawShowForPlayer(playerid, MostrarVida[playerid]); format(str,sizeof(str),"~y~%s ~n~~w~tirou: ~r~-%.1f",PlayerName(issuerid), amount); TextDrawSetString(MostrarVida[playerid], str); TempoMostrarLife[playerid] = SetTimerEx("HideTextoLife", 3000, 0, "i", playerid); MostrandoVida[playerid] = 1; } //==================[ issuerid ] ====================================== KillTimer(TempoMostrarLife[issuerid]); TextDrawShowForPlayer(issuerid, MostrarVida[issuerid]); format(str,sizeof(str),"~y~%s:~g~ -%.1f",PlayerName(playerid), amount); TextDrawSetString(MostrarVida[issuerid], str); TempoMostrarLife[issuerid] = SetTimerEx("HideTextoLife", 3000, 0, "i", issuerid); MostrandoVida[issuerid] = 1; } return true; } |
~y~%s ~n~~w~tirou: ~r~-%.1f