From 44c787f929ffc9f9df5f2d3ca7dfcf1e929cc41b Mon Sep 17 00:00:00 2001 From: Ad5001 Date: Fri, 10 Jun 2016 20:19:08 +0200 Subject: [PATCH] Updated What are Scenarios? (markdown => textile) --- What-are-Scenarios?.md | 17 ---------- What-are-Scenarios?.textile | 65 +++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 17 deletions(-) delete mode 100644 What-are-Scenarios?.md create mode 100644 What-are-Scenarios?.textile diff --git a/What-are-Scenarios?.md b/What-are-Scenarios?.md deleted file mode 100644 index 7f25eeb..0000000 --- a/What-are-Scenarios?.md +++ /dev/null @@ -1,17 +0,0 @@ -# Scenarios -Scenarios for UHC are like plugins for server. -Download them then put them in your scenarios folder to add them. -To add a scenario to your UHC game, you need to be in waiting for more players, then type "/uhc scenarios add <****Scenario name>" - -## How to create a scenario? -**Requirements**: -- PHP knowledges. You can learn it on [CodeAcademy](https://www.codecademy.com/en/learn/php) -- Some pocketmine API knowledeges that are essentials to know how to code it. - -If you know all those, let's start: -First, create a new File that will be your scenario code named **"YOUR_SCENARIO_NAME.php"**. -Then, you'll need to add the class that will be your main class. So to do that, add some code inside: - Scenarios +Scenarios for UHC are like plugins for server. +Download them then put them in your scenarios folder to add them. +To add a scenario to your UHC game, you need to be in waiting for more players, then type "/uhc scenarios add <****Scenario name>" + +

How to create a scenario?

+**Requirements**: +- PHP knowledges. You can learn it on "CodeAcademy":https://www.codecademy.com/en/learn/php +- Some pocketmine API knowledeges that are essentials to know how to code it. + +If you know all those, let's start: +First, create a new File that will be your scenario code named **"YOUR_SCENARIO_NAME.php"**. +Then, you'll need to add the class that will be your main class. So to do that, add some code inside: + +
+Great ! Now you know that, let's learn a bit about the functions of the API: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Function name Function parameters Description
onEnable none Execute the code when the game start !
onStop none Execute the code when the game finish
getConfig none Return you the params of the scenario's config
getServer none Return you the Server instance
reloadConfig none Reload the config
saveConfig config Save all the args you want in the config
getScenarioFolder none Get the path/folder of the scenarios.
+ +

Hope you will play around with those ! +You can publish your scenario here on the scenario resources/scenarios by clicking the "Fork" button, adding your scenario, then make a "Pull request" to merge your changes

\ No newline at end of file