Aggiunta documentazione API

This commit is contained in:
Marco 2020-07-14 13:00:19 +02:00
parent 9aa7062a97
commit 6cf24b835e
2 changed files with 23 additions and 1 deletions

19
DOCS.md Normal file
View File

@ -0,0 +1,19 @@
# Parties docs
Because it's always good to understand the API without surfing the code, init? :D
## 1 API
### 1.1 Utils
* `parties.is_player_in_party(p_name)`: (bool) checks whether a player is in any party
* `parties.is_player_party_leader(p_name)`: (bool) checks whether a player is the party leader of any party
* `parties.chat_send_party(p_name, msg, as_broadcast)`: (nil) sends a message to every player inside the party where `p_name` is (`p_name` doesn't necessarily have to be the party leader). If `as_broadcast` is true, it'd be sent without following Minetest chat format. If false, `p_name` will be pointed as the sender when formatting the message
* `parties.change_party_leader(old_leader, new_leader)`: (nil) changes the party leader
### 1.2 Getters
* `parties.get_party_leader(p_name)`: (string) returns the party leader of the party where `p_name` is in
* `parties.get_party_members(party_leader)`: (table) returns a list of every player inside the party of `party_leader`

View File

@ -13,8 +13,11 @@ Minimalist party mod for Minetest
### Chat
* `/p <message>` writes a message in the party chat
> Beware: chat is light blue and it adds the `[Party] ` prefix at the beginning of every message. It then follows the format of the chat set by the owner. By default is:
`[Party] <playername> message`
## Want to help?
Feel free to:
* open an [issue](https://gitlab.com/zughy-friends-minetest/arena_lib/-/issues)
* submit a merge request. In this case, PLEASE, do follow milestones and my [coding guidelines](https://cryptpad.fr/pad/#/2/pad/view/-l75iHl3x54py20u2Y5OSAX4iruQBdeQXcO7PGTtGew/embed/). I won't merge features for milestones that are different from the upcoming one (if it's declared), nor messy code
* contact me on the [Minetest Forum](https://forum.minetest.net/memberlist.php?mode=viewprofile&u=26472)
* contact me on the [Minetest Forum](https://forum.minetest.net/memberlist.php?mode=viewprofile&u=26472)