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

Quote:
Originally Posted by [xB]Lordz
Посмотреть сообщение
Nice idea.
Good work.
But you could explain bit more because there are a lot of beginners.

Like this:
pawn Код:
new string[16]; //Creating a string to output the loss of HP.
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid) //Using OnPlayerTakeDamage callback to get lost hp.
{ //Opening brackets to write the function below.
    format(string,sizeof(string),"-%.0f hp",amount); //Creating a format of our string to display lost hp.
 //Here amount refers to the loss of player's health.
    SetPlayerChatBubble(playerid,string,0x660000AA,150.0,2500); // Adding our string and Creating Chat Bubble to display above player's head.
    return 1; //Returning the functions.
} //Closing the brackets which we've opened.
No need because they are in plain English everyone can understand it.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)