Jump to content
MakeWebGames

Recommended Posts

Posted (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.

image.thumb.png.fae7828478e97037918299da29910d57.png

when i add a json file to this now i get this 

 

image.thumb.png.0de89799bed097f32688791cd32ac0c9.png

Edited by SwiftGameR
Posted

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 🙂 

  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...