-
Posts
2,921 -
Joined
-
Last visited
-
Days Won
48
Content Type
Profiles
Forums
Events
Everything posted by KyleMassacre
-
In theory that would work if there was a listener named “insert_chat_line”. What you posted was the “Event” portion of it. GL will let you create your own listener(s) that will allow other devs to use your event in their code. So if you created your hook/listener in your “moduleName.hook.php” file called “sims_hook”, I could then create an event and use “sims_hook”, pass in the values you ask for, then your hook would execute the code. Hook names are arbitrary so you are not restricted to hooks created by the engine itself. is that kind of what you are asking?
- 17 replies
-
- mccode-v2
- mccode-lite
-
(and 3 more)
Tagged with:
-
@Sim read here, it may help a little
- 17 replies
-
- mccode-v2
- mccode-lite
-
(and 3 more)
Tagged with:
-
On a previous thread of yours I provided a link to a post I made that talked a little about hooks and how they work. You can DM me or hit me up in discord if you use it and I can try to explain it there or you can pop over to my thread
-
That’s where the hooks come in place.
-
And since it is just a game, it would be unfair to punish the 90% of people with 1% of the games money by jacking up prices because the rich people want to hoard all the money in game so I’m sure it’s doable to create some algorithm to adjust inflation on a per player basis. And maybe only a price adjustment should be made if there is more money in players pockets than in the game bank. Maybe I’ll spin up an instance of MCC or something that is easy to tinker around with some inflation and see what I come up with.
-
I would figure that inflation should handle the amount of currency being paid out for actions such as crimes especially since most of the payouts are a static number or some sort of min/max and that money should come from the game bank. Another thing too is that instead of people accruing interest in banks they should pay a tax on that much like real life. Anything the game pays out should be adjusted in one way or another unlike something like stocks. Stocks would be something that should ultimately come from “taxed” money until they receive a payout then whatever they “gain” should be taxed and put back into the game bank
-
Sims topic for GL typo's, possible bugs, ect.
KyleMassacre replied to Sim's topic in Gangster Legends
It should ideally go in the parent constructor which I would assume without looking, the Module class. -
I posted something on hooks here And as for calling other module methods, I don't believe so because I don't think they are auto-loaded. I think that you would have to require/include the file and instantiate the class and call the method but I am unsure of how that would work
-
It would be the same. The more money in the game, the more anything costs that the game would provide or the less the game would pay out.
-
I wish I was an economist because one of my goals is to write an inflation plugin/module for any “outgoing” currency from the game bank. I figure people could sell or trade for any price they see fit but at least anything coming from a “crime” or equivalent would be updated based on how much money is floating around in the game. And it would also help or may even be required but, have an actual game bank
-
Never used it but I have heard of this https://codeanywhere.com/apps#android
-
If you were targeting mainly only higher versions of PHP you could provide a callback to you methods you defined to run whatever you wish in that callback x number of times automatically.
-
I don’t really have one TBH. I’m not looking for anything too fancy I just suck at HTML/CSS lol. If it’s pre-made that’ll do. Can you post a screen shot? I do want to make sure it looks nice
-
Hello MWG, I am looking for someone that can make me a simple and clean Bootstrap template. What I am looking for is Bootstrap 4 Your basic Nav at the top where I can add menu items with some sub menu items (kind of what you see with “admin” templates). (I am not looking for an admin template) Collapsible side menu that supports both links and I guess categories for links like a treeview Font Awesome support. Dark themed I would like it to look like it would belong in a game and not a standard bootstrap template ie not a “flat” looking design and not “tall” headers like for cards etc. I am willing to pay so if anyone wants to make a couple extra bucks let me know.
-
Yeah I had interest and will get to it when I can. I wanted to over this past weekend but I was not able to.
-
Yep!! We probably only have like 16 people on site though so it’s not bad
-
My work shut down for the most part but we are in the exclusion list because we are a medical device company. Most of our “Non-essential” operations personnel (people in manufacturing) are working from home and about 26/30 operators we gave them PTO. I am currently business as usual though since I am in charge of the 4 people that are on site lol
-
When would you need it by? I can possibly do it this weekend if you have no takers that can get it started sooner
-
You need help with it or need someone to write it up for you from scratch?
-
Im glad it could help at least one person Yeah I know your a busy dude and I had a couple of minutes to spare so I went ahead and posted where I could. Some people may know and some may not know, I used to work a lot with NWE and that engine used a lot of hooks and “migration” type sql files for install/upgrade using version numbers in the file name. And what we would do is, the initial sql file (schema.sql) would be a copy/paste of all sql files including the upgrade ones. The engine would only look for the initial file on module upload and install everything everything from there, but when it was an upgrade, it would look for the module-{version}.sql and run only that one because in theory you should be caught up.
- 17 replies
-
- 1
-
-
- mccode-v2
- mccode-lite
-
(and 3 more)
Tagged with:
-
Hi Everyone, I just wanted to post some module development tip for GLV2 since this engine is gaining more and more traction as the time passes. I would first like to point people to Here. I think it may be a little unfinished, I assume Chris is a pretty busy guy, but it does give some boilerplate stuff. I recently wrote a review for a module stating that it seemed unfinished because no SQLs were provided for a column insert. The engine will look for a schema.sql file in the module root directory and it will run it on install. With that being said, I think this could potentially be improved on, so Chris, if you are reading this as well, maybe you could look for a schema-[version].sql file so it runs similar to a migration? When writing your schema.sql file, PLEASE run some simple checks by using "CREATE IF NOT EXISTS" or some other conditionals for adding columns like: IF COL_LENGTH('table_name', 'column_name') IS NULL BEGIN ALTER TABLE table_name ADD [column_name] INT END Auto-ran SQLs can be dangerous so I urge people to take caution when writing up their schema files. Another tip that I have is hooks. Hooks are great because they allow you or other developers to "hook" into other modules. I recently helped out a developer with creating a hook for their module and told him that he should get in touch with some other devs for their paid modules and ask what hooks they use because he may be able to tap into their module and also make his hook known so that maybe they can use it in their module. Hooks are easy once you get the hang of it. Basically as a developer you need to create an "Event" for your module in your {moduleName}.inc.php file and another developer can create a "Listener" in their {moduleName}.hook.php file. For example I will take Dave's chat mod (I have not purchased it so I dont know if he created a hook for it.). But Dave could create a davesChatMod.hook.php that could look similar to: new hook('insert_chat_line', function($hook){ global $db; $db->query("insert into chat (user_id, text, when) values ($hook['user_id'], $hook['text'], ".now().")"); }); That above is the listener. And now we can get into the event. In another developer inc.php they can run $chatLine = new hook('insert_chat_line'); $args = ['user_id' => $user_id, 'text' => $text] $chatLine->run($args); All the keys provided in the $args array will be available in the the listener via the $hook variable. So when a user completes the action where the hook is ran, Daves listener would then insert a chat line into the database. That is all I have for now. I would like to note, this code probably wont work and it was written fo simplicity. For example $db->query() I think doesnt even exist.
- 17 replies
-
- 2
-
-
- mccode-v2
- mccode-lite
-
(and 3 more)
Tagged with:
-
Maybe if it was 5.6 to 7.* that MAY be worth it for someone looking for a quick buck but chances are you’re looking into a lot more than fixing deprecated functions/methods. Your code base probably requires a lot of type checking/casting unless you’re still using an older version of MySQL/Maria DB and checking to see if your array keys are set. TBH you may need to up your budget if I’m going to be real with you
-
Could possibly look into webhooks for when you push code to the repo the market place picks it up
-
Without seeing what you are actually doing, it looks like you are including the table header(s) in your loop where as you really only want to include the table cells in your loop
-
mccode-v2 Best Way to Prevent Repetitive Attacks?
KyleMassacre replied to TonyCisseroni's topic in Game Support
What you can do is store each mugging into a table and determine what a decent number of muggings in "x" amount of time would be like 3/hr or whatever. I created a mugging module for NWE and used this exact same approach I looked at the timers GL offers and didn’t see anything that may help you unless there was some sort of data field that you can serialize or whatever to extract that information out but I think it only returns a timestamp- 9 replies
-
- 1
-
-
- mccode-v2
- mccode-lite
-
(and 3 more)
Tagged with: