О Event Helper
Этот плагин может использоваться разработчиками для управления своими играми на арене и т.д.Разработчики могут использовать это для управления входом / выходом игроков в свои игры.
Плагин будет в основном использоваться в my HungerGames, ScubaArena, FishingCompetition и Skirmish game.
Он имеет:
- Регистрация требует создания и регистрации события с помощью плагина.
- Автоматический запуск событий по порядку, так что вы можете запускать несколько плагинов событий по одному за другим (настраивается).
- Удалите и сохраните текущий инвентарь игроков и восстановите его после того, как они покинут игру.
- Сохраняйте и восстанавливайте статистику метаболизма игроков, когда они присоединяются к игре или покидают ее.
- Зарегистрируйте пункт назначения, куда игроки смогут телепортироваться при присоединении к игре.
- Команда занесена в черный список.
- Встроите управление крючками для популярных плагинов, таких как рюкзаки и наборы.
void EMCreateEvent(string eventName, bool automatic_start, bool stripItems, bool leaves_event_on_death, bool full_health_on_join, bool give_items_back_on_respawn, bool full_metabolism_on_join, Vector3 teleport_destination)
Creates the event and allows the developer to specify the settings:
- eventName: the name of the event. this.Name.
- automatic_start: enrolls the event to be scheduled and ran by EventHelper.
- stripItems: strips the players items and stores them in the data file. Items will be returned upon leaving the event, or when they respawn after they have left the event unless give_items_back_on_respawn is set to false.
- leaves_event_on_death: Kicks the player from the event when they die.
- full_health_on_join: Stores the players health into the data file and sets their health to max.
- give_items_back_on_join: Gives the players items back when they leave the event, or when they respawn after leaving the event. If set to false, they will need to use the /recoveritems command to get their items back.This is useful if a server is running plugins such as kits, which wipes the players inventory to give the player a kit.
- full_metabolism_on_join: Saves and restores the players metabolism before and after a game.
- teleport_destination: The location that a player will teleport to when joining the game. Set to Vector3.new if you do not want them to teleport.
void EMExternalPluginSettings(string eventName, bool canDropBackpack = false, bool canEraseBackpack = false, bool canOpenBackpack = false, bool canBackpackAcceptItem = false, bool canRedeemKit = false, bool CanLoseXP= false)
Sets up the external plugin settings for the event.
- eventName: The registered name of the event.
- canDropBackpack: Backpack plugin.
- canEraseBackpack: Backpack plugin.
- canOpenBackpack: Backpack plugin.
- canBackpackAcceptItem: Backpack plugin.
- canRedeemKit: Can the player redeem kits.
- CanLoseXP: Can the player lose xp when dying in the game.
void EMBlackListCommands(string eventName, string[] commands)
Use to submit a list of commands that cannot be run while at the event.
void EMRemoveEvent(string eventName)
Removes the event from EventHelper. This will automatically trigger the EMPlayerLeaveEvent hook for each player if the event is active.
void EMManuallyStarted(string eventName)
Flags the event as manually started, preventing it from being run automatically if opting in for automatic_start.
void EMUpdateLobby(string eventName, Vector3 pos)
Allows you to update the lobby destination after an event has been created.
void EMStartEvent(string eventName)
Triggers an event to start. Marks the event as running so it can be used with the EMEndEvent hook. Call this when you want the game to start.
void EMEndEvent(string eventName)
Triggers the event to end. Goes through each participant and calls EMPlayerLeaveEvent on them before clearing the participants. Also resets manually_started to false and triggers the EMEndGame.
bool EMEnrollPlayer(BasePlayer player, string eventName)
Enrolls a player into the event. Follows the instructions of the EMCreateEvent settings by stripping items, setting health and metabolisms, as well as teleporting the player to the arena. Also checks for crafting queues, black listed items and escape blocks. Returns true if the player was enrolled successfully.
void EMPlayerLeaveEvent(BasePlayer player, string eventName = null)
Removes the player from the event. Strips the items that they have received from the event, then optionally restores their previous items, teleports them to the location that they were at prior to joining, sets their health and their metabolism etc, or will tell them that they need to use the command in order to get their inventory back.
bool EMIsParticipating(BasePlayer player, string eventName)
Returns true if a player is participating in an event (using the participants list associated with the event itself).
bool EMAtEvent(ulong id)
Returns true if a player is at an event (using the playerdata records).
bool AddBan(BasePlayer player, string event_name)
Bans the player from the specified event.
bool RemoveBan(BasePlayer player, string event_name)
Unbans the player from the specified event.
Hooks
void EMEndGame(string eventName)
Is called when the game ends.
Chat commands
ehban <target name/id> - bans the player from all events globally.
ehunban <target name/id> - unbans the player from all events globally.