Page 1 of 1

Jailbust Module not working

Posted: Fri Sep 26, 2014 3:44 pm
by njfrlng
Just bought this module: http://nw-engine.com/index.php?c=modules&m=169

After I install it, I get the following error:


Error: Cannot redeclare IsInJail() (previously declared in C:\xampp\htdocs\monsters\modules\jail\lib.php:3)
Error in "C:/xampp/htdocs/monsters/modules/jailbust/lib.php"
Line 17



Line 17 is just a }

Any advice? I paid for this module, so assumed it worked! :S

Re: Jailbust Module not working

Posted: Fri Sep 26, 2014 4:31 pm
by njfrlng
Just re read the module and realized its an entirely new module for jail.

So i disabled the old jail module and now it works!!

That being said, theres lots of problems with this mod.

When you go to bail someone out you get an error:

Error: Call to undefined function FindUserName()
Error in C:/xampp/htdocs/monsters/modules/jailbust/content.php
Line 154

Re: Jailbust Module not working

Posted: Sat Sep 27, 2014 3:09 pm
by SophieEV
Apologies, that FindUserName function is used alot and is missing from the module as for some reason i added it to my common library as its used elsewhere in my game.

I have submitted an update to the market place for this, hopefully it will be available for you shortly :)

If its not or if you have any other problems let me know x

Re: Jailbust Module not working

Posted: Sat Sep 27, 2014 3:22 pm
by KyleMassacre
You should generally NEVER add anything to core files especially if you plan on releasing a module to the public*. If you have a function that you would like your module to use then you can create a lib.php file and add that to the modules folder. And if you do that then other modules can piggy back off that function as well.

Also a tip for a paid module which I believe this one in question is:
If you use that function in other modules you can use

Code: Select all

if(function_exists("function_name")) {
//Execute here;
}
This way people wont get an undefined function error when using a module that uses that function

Also take a LOOK here, it needs some updating but this has the most common stuff for module developers.

* Not entirely true if its for your own game, just for potential modules to release to other people. Still not the best idea though since Alain can update the core files for an engine update then it gets erased

Re: Jailbust Module not working

Posted: Sat Sep 27, 2014 3:53 pm
by SophieEV
Thanks for the tips,

When i wrote the module i didn't intend it to be public because ive never used php before, never done any game development, and didnt know the engine quite how i do now, but i spent significant time on it, and it seemed decent to me, so i did.

I know i had bad habits while i was working it all out so i went back through all my code before releasing to clean it all up and added in the checks for custom functions as you suggest, ive just missed this one as it sounds similar to one of the core functions.

I think my main problem is that at the time i didnt have a clean nw enviroment to install and test this on (which i do now), i just had my game which it obviously worked just brilliantly in.

You live and learn, apologies for the trouble caused

Re: Jailbust Module not working

Posted: Sat Sep 27, 2014 4:11 pm
by KyleMassacre
And now you know, and knowing is half the battle. *queue cheesy 80s chime music*

Re: Jailbust Module not working

Posted: Sat Sep 27, 2014 4:16 pm
by a_bertrand
Accepted the new release of it.

Re: Jailbust Module not working

Posted: Wed Nov 05, 2014 10:10 pm
by VashNaroom
Excellent mod, Very versatile for any game theme. Cannot wait to see what future mods Sophie cooks up.

Re: Jailbust Module not working

Posted: Tue Sep 22, 2015 9:10 pm
by cbsarge
I just purchased and added it. I got an error:

Code: Select all

Error: Cannot redeclare IsInJail() (previously declared in /hermes/bosnaweb03a/b2751/ipg.cbsargecom/VillainsandHeroes/modules/jail/lib.php:3)
Error in "/hermes/bosnaweb03a/b2751/ipg.cbsargecom/VillainsandHeroes/modules/jailbust/lib.php"
Line 17
Was I supposed to disable the regular jail module first? I had to go into the rgular jail mod, comment out it's code, upload it so I could get the game back up and then disable the standard jail module. Would have been nice to know if I was supposed to disable it first. :roll:

Re: Jailbust Module not working

Posted: Tue Sep 22, 2015 9:27 pm
by cbsarge
Also, When I tried to use the Bust option I got an error saying undeclared index of Energy....

I'm REALLY getting bummed that the add-on modules I purchase because I think are going to improve the game keep breaking it! :evil: