SetPlayerArmour

From SA-MP Wiki

Jump to: navigation, search


Description:

Set a player's armor level.


Parameters:
(playerid, Float:armour)
playeridThe ID of the player to set the armour of.
Float:armourThe amount of armour to set, as a percentage (float). Values larger than 100 are valid, but won't be displayed in the HUD's armour bar.


Return Values:

  • 1: The function executed successfully.
  • 0: The function failed to execute. This means the player specified does not exist.


Image:32px-Circle-style-warning.png

Important
Note

Armour is obtained rounded to integers: set 50.15, but get 50.0


Image:32px-Ambox_warning_orange.png

Note

The function's name is armour, not armor (Americanized). This is inconsistent with the rest of SA-MP, so remember that.


Example Usage:

public OnPlayerSpawn(playerid)
{
    // Give players full armour (100%) when they spawn.
    SetPlayerArmour(playerid, 100.0);
    return 1;
}

Related Functions

The following functions may be useful, as they are related to this function in one way or another.

Personal tools
Navigation
Toolbox
In other languages