PHPDevil Posted July 7, 2012 Posted July 7, 2012 This is a small mod, my first one aswell. Basically when someone wants to change their username it will charge them a set amount of donator days to prevent them from changing it time and time again. The file you want to work with will be preferences.php We want to check that the user has enough donator days firstly to be charged! (For my example I'll use eight but you can use whatever amount you like) First find this code in the do name change function. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Directly underneath you want to place You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Next we want to update the database to deduct the eight donator days IF the name change is succesful so find this code first in the same do name change function. Should be a bit lower then the previous code You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Add underneath You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. That should really be it. Any issues let me know. Remember it is my first mod so I ain't aware of any security problems with that at the moment. Quote
David_1507 Posted July 7, 2012 Posted July 7, 2012 You could combine the 2 queries into 1 like: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Added some simple security to the Username as well. Quote
rulerofzu Posted July 8, 2012 Posted July 8, 2012 Your using a pretty old mc2 version with that code there. Why dont you download the latest? If your not aware of the security or lack of it with the code you posted PHPDevil then you should go read up on it. Basic PHP as David has pointed out. Quote
gideon prewett Posted July 9, 2012 Posted July 9, 2012 prob cause he downloaded a old version from some site rather than buy legit but hey how many people do have valid licences? Quote
KyleMassacre Posted July 10, 2012 Posted July 10, 2012 prob cause he downloaded a old version from some site rather than buy legit but hey how many people do have valid licences? Or maybe the update was not recommended for exsisting games if I remember correctly. If you wish to place the 2.0.5 files over your (UNMODIFIED) 2.0.4 ones you can do so without having to make any database changes. 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.