SwiftGameR Posted February 23, 2020 Posted February 23, 2020 (edited) I have been trying to get into developing for gangster legends engine but i just cant figure out how to work it properly i was trying to make a simple lucky dip to try learn here is what i got so far 1. Created a folder called lucky in the modules section 2. Inside the folder i added 3 files lucky.hooks.php , lucky.inc.php , lucky.tpl.php lucky.hooks.php <?php new hook("actionMenu", function () { return array( "url" => "?page=lucky", "text" => "Lucky Dip" ); }); lucky.tpl.php <?php class luckyTemplate extends template { public $lucky = ' <div class="panel panel-default"> <div class="panel-heading">Lucky Dip!</div> <div class="panel-body"> <p>Want to try your luck at the lucky dip it costs $1,000 per try and you can try 5 times a day.</p> <a href="?page=lucky&action=chance">Lucky Dip It</a> </div> </div> '; } ?> lucky.inc.php <?php class lucky extends module { public $maxcost = 1000; public function constructModule() { } public function method_chance() { if ($this->user->US_money < 10000) { return $this->error('You do not have enough money.'); } } } ?> I don't quite know what to do with the construct module section i gather the function below is for actions. Below is a screenshot of what i see when i click on my Lucky dip link in the actions menu. when i add a json file to this now i get this Edited February 23, 2020 by SwiftGameR Quote
Dayo Posted February 24, 2020 Posted February 24, 2020 You need a module.json file see any other module as an example. I’ll add some documentation later You are getting the blank white screen as there is no HTML output in constructModule it’s a bug I’m looking into 🙂 1 Quote
SwiftGameR Posted February 24, 2020 Author Posted February 24, 2020 (edited) Yes @AdamHull said i was missing a json file so i took another look and honestly never seen that file in there before haha Right that makes sense Edited February 24, 2020 by SwiftGameR 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.