From 6c0c617b393c6d461316f5e70fedcb0b359ebe29 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 22 Nov 2016 14:59:40 +0100 Subject: Fix possible crash after player left --- API.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'API.md') diff --git a/API.md b/API.md index c4eb87b..03e93ea 100644 --- a/API.md +++ b/API.md @@ -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. -- cgit v1.2.3