[Tutorial] Worlds shortest tutorial - Display hp loss above player (when hurt)
#1

Top of script:

Код:
new string[16];
Then:

Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    format(string,sizeof(string),"-%.0f hp",amount);
    SetPlayerChatBubble(playerid,string,0x660000AA,150.0,2500);
    return 1;
}
This will display how much health/armor the player lost when hit in a chat bubble above the player's head (for 2.5 seconds).

Note: this is a good way to spot cheaters, because I've noticed people using health/armor hacks do NOT call OnPlayerTakeDamage...so if you shoot a player and never see the chat bubble, they are likely cheating. Food for thought.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)