diff options
author | Wuzzy <almikes@aol.com> | 2016-11-22 14:59:40 +0100 |
---|---|---|
committer | Wuzzy <almikes@aol.com> | 2016-11-22 14:59:40 +0100 |
commit | 6c0c617b393c6d461316f5e70fedcb0b359ebe29 (patch) | |
tree | 5cf608b92428a9733075bed7d45618cd23004009 /API.md | |
parent | 893ba4e577d541dae543c203cc2131f1f8a5a37b (diff) |
Fix possible crash after player left
Diffstat (limited to 'API.md')
-rw-r--r-- | API.md | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -95,8 +95,7 @@ the HUD bar will be initially be shown to the player. * `start_hidden`: Whether the HUD bar is initially hidden. This is optional, `default_start_hidden` of the registration function will be used as default #### Return value -Always `nil`. - +`true` on success, `false` otherwise. ## Modifying a HUD bar @@ -135,7 +134,7 @@ such network optimization for the “styling” parameters, so keep this in mind * `new_text_color`: A 3-octet number defining the new color of the text. #### Return value -Always `nil`. +`true` on success, `false` otherwise. ## Hiding and unhiding a HUD bar @@ -156,7 +155,7 @@ Hides the specified HUD bar from the screen of the specified player. * `identifier`: The identifier of the HUD bar type to hide, as specified in `hb.register_hudbar`. #### Return value -Always `nil`. +`true` on success, `false` otherwise. ### `hb.unhide_hudbar(player, identifier)` @@ -167,7 +166,7 @@ Makes a previously hidden HUD bar visible again to a player. * `identifier`: The identifier of the HUD bar type to unhide, as specified in `hb.register_hudbar`. #### Return value -Always `nil`. +`true` on success, `false` otherwise. ## Reading HUD bar information @@ -181,12 +180,14 @@ Returns the current state of the active player's HUD bar. * `identifier`: The identifier of the HUD bar type to hide, as specified in `hb.register_hudbar`. #### Return value -A table which holds information on the current state of the HUD bar. Note the table is a deep -copy of the internal HUD bar state, it is *not* a reference; the information hold by the table is -only true for the moment you called this function. The fields of this table are: +On success, returns a table which holds information on the current state of the HUD bar. Note +the table is a deep copy of the internal HUD bar state, it is *not* a reference; the information +hold by the table is only true for the moment you called this function. The fields of this table are: * `value`: Current value of HUD bar. * `max`: Current maximum value of HUD bar. * `hidden`: Boolean denoting whether the HUD bar is hidden. * `barlength`: The length of the HUD bar in pixels. This field is meaningless if the HUD bar is currently hidden. * `text`: The text shown on the HUD bar. This fiels is meaningless if the HUD bar is currently hidden. + +If the player does not exist, returns `nil` instead. |