GetPlayerArmour

From SA-MP Wiki

Jump to: navigation, search


Description:

This function stores the armour of a player into a variable.


Parameters:
(playerid, &Float:armour)
playeridThe ID of the player that you want to get the armour of.
&Float:armourThe float to to store the armour in, passed by reference.


Return Values:

  • 1 - success
  • 0 - failure (i.e. player not connected).
  • The player's armour is stored in the specified variable.


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

Important
Notes

  • Even though the armour can be set to near infinite values on the server side, the individual clients will only report values up to 255. Anything higher will wrap around; 256 becomes 0, 257 becomes 1, etc.
  • Armour is obtained rounded to integers: set 50.15, but get 50.0


new Float:armour;
GetPlayerArmour(playerid, armour);
new s[40];
format(s, sizeof(s), "SERVER: Your armour is %0.f percent", armour);
SendClientMessage(playerid, 0xFFFFFFAA, s);

Related Functions

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

Personal tools
In other languages