Zero-Affect Posted November 16, 2008 Share Posted November 16, 2008 Re: Free Starter Pack i removed the vip days from the pack and got this Warning: sprintf() [function.sprintf]: Too few arguments in /home/jezebel/public_html/starterkit.php on line 45 QUERY ERROR: Query was empty Query was Okay guys...lemme try and explain again. I only have myself to blame, as the coding of the starter pack was not very good, I've made it slightly better. Basically, sprintf is used to secure the query. Here is an example of a sprintf query, and how to edit it, to ensure you do not get errors. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Basically, the '%d' is a number. It is the number of crystals / money you want the user to get. At present, %d has not been defined, however, after you get to the center of the query...right after ", you will notice a few numbers and a userid (100,500,$ir['userid']). These define the %d's and the %u in the query. So the money will be +100, crystals +500 and userid $ir['userid']. Now if you did not have crystals for example in your game, you would have to remove the part that says: `crystals` = `crystals` + '%d' but also the bit that says 500, as it defines the crystals. For anyone who didn't understand this, go to http://www.php.net and learn it. It's simple once you know it and contact me if you need more help. nice explanation but you forgot has from your post %s meaning alpha / numberic chars for example You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. %d = defined number %u = undefined number %s = alpha / number chars there are many more options which i have not yet explored but i think that would help money and money are the %s alpha / numeric the 100 is the %d meaning defined because you input it so it's not gunna be anything difference and finally the %u which is $userid in many owners cases is 1 but obviously if its on the game it could mean any number so its undefined hence the %u i hope that helps and im sure i will get some replies on this matter where i may be wrong but im sure im right Quote Link to comment Share on other sites More sharing options...
Akash Posted November 17, 2008 Author Share Posted November 17, 2008 Re: [mccode] Free Starter Pack Ah thanks Zero completely missed that out. Quote Link to comment Share on other sites More sharing options...
Zero-Affect Posted November 18, 2008 Share Posted November 18, 2008 Re: [mccode] Free Starter Pack Ah thanks Zero completely missed that out. No problem Quote Link to comment Share on other sites More sharing options...
Akash Posted November 20, 2008 Author Share Posted November 20, 2008 Re: [mccode] Free Starter Pack Guys, I'm only posting again to provide you with an updated file. It's slightly neater and perhaps slightly better than the other one. There are more annotations on it allowing it to be customised with ease. I can't seem to find the 'Edit post' button, so I've had to do it here. This is all compatible with V1/V2 and if you do find any errors, simply let me know and I'll deal with them ASAP. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. I hope everyone enjoys this :). Quote Link to comment Share on other sites More sharing options...
HITMAN 17 Posted November 22, 2008 Share Posted November 22, 2008 Re: [mccode] Free Starter Pack Parse error: syntax error, unexpected T_VARIABLE in /home/thedestr/public_html/starterkit.php on line 42 error on this line `donatorpack` = '%d' Quote Link to comment Share on other sites More sharing options...
Akash Posted January 4, 2009 Author Share Posted January 4, 2009 Re: [mccode] Free Starter Pack Guys, The last file I posted had some errors, here is a version that should work but I haven't tested: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote Link to comment Share on other sites More sharing options...
Akash Posted January 4, 2009 Author Share Posted January 4, 2009 Re: [mccode] Free Starter Pack Sorry again. You will see this somewhere: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. change it to: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote Link to comment Share on other sites More sharing options...
nedved Posted January 4, 2009 Share Posted January 4, 2009 Re: [mccode] Free Starter Pack You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Wtf?? Quote Link to comment Share on other sites More sharing options...
POG1 Posted January 4, 2009 Share Posted January 4, 2009 Re: [mccode] Free Starter Pack You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Wtf?? it looks like its trying to detect the mccode version, because only V2 has globals.php Quote Link to comment Share on other sites More sharing options...
Akash Posted January 4, 2009 Author Share Posted January 4, 2009 Re: [mccode] Free Starter Pack You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Wtf?? it looks like its trying to detect the mccode version, because only V2 has globals.php Nedved, that part of the code, as you can see, detects whether the file 'globals.php' exists. If it does, it continues with the file as normal. If not, it uses the includes for V1. The point of it is to make the script compatible with V1 and V2 MC Codes to stop users from asking 'convert to V1/V2 for me please'. I'm not 100% if the file will work in V1, it should do. Quote Link to comment Share on other sites More sharing options...
DissObey Posted January 5, 2009 Share Posted January 5, 2009 Re: [mccode] Free Starter Pack Why bother adding more to the user table, and adding an exrta query on the explore page? If your anything like me you will be going to explore at least once every 5 mins, that means the query will be run every time.. Here's what i use: authenticate.php Find You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Add above it You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Replace 7 and 8 with item id's of items you want to give new players, this will give them 50 of each, i have it also set to give 3 donator days also. Quote Link to comment Share on other sites More sharing options...
gurpreet Posted January 5, 2009 Share Posted January 5, 2009 Re: [mccode] Free Starter Pack Why bother adding more to the user table, and adding an exrta query on the explore page? If your anything like me you will be going to explore at least once every 5 mins, that means the query will be run every time.. Here's what i use: authenticate.php Find You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Add above it You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Replace 7 and 8 with item id's of items you want to give new players, this will give them 50 of each, i have it also set to give 3 donator days also. Can you give a donator pack as an item (aka starter pack, but just downgraded donator pack) using this? Quote Link to comment Share on other sites More sharing options...
DissObey Posted January 6, 2009 Share Posted January 6, 2009 Re: [mccode] Free Starter Pack Why bother adding more to the user table, and adding an exrta query on the explore page? If your anything like me you will be going to explore at least once every 5 mins, that means the query will be run every time.. Here's what i use: authenticate.php Find You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Add above it You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Replace 7 and 8 with item id's of items you want to give new players, this will give them 50 of each, i have it also set to give 3 donator days also. Can you give a donator pack as an item (aka starter pack, but just downgraded donator pack) using this? Of course, just make an item in the admin panel, get the itemid and change the above script to credit the player the pack, and the ammount you want to give. Then you'll need to edit inventory to add a link to use the Starter Pack something like You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. then in itemuse.php just add what you want the user to get above the "Sorry this item has no effect" message But the way i posted earlier is a lot more simple, only need to edit one page, not 3. Quote Link to comment Share on other sites More sharing options...
Akash Posted January 8, 2009 Author Share Posted January 8, 2009 Re: [mccode] Free Starter Pack Nice idea DissObey, but just so you know it doesn't run a query on every visit to the explore page becuase if the user has claimed their starter pack/kit, the query doesn't run anyway. Also, the only reason I did it on explore is toget the user involved. Instead of crediting it to them, I put in on explore so not every user will get it. e.g. one user may not see it. Otherwise, the game becomes too much of an automated system with no chance for the user to do something. That's just my view. Quote Link to comment Share on other sites More sharing options...
redsnake420 Posted January 8, 2009 Share Posted January 8, 2009 Re: [mccode] Free Starter Pack does it still show up up in explore after they claim their pack cause i seen it do that before on a couple different games? Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted January 8, 2009 Share Posted January 8, 2009 Re: [mccode] Free Starter Pack That's because on those game's they do not install it correctly. Quote Link to comment Share on other sites More sharing options...
DeaTH_RideR Posted January 9, 2009 Share Posted January 9, 2009 Re: [mccode] Free Starter Pack Why bother adding more to the user table, and adding an exrta query on the explore page? If your anything like me you will be going to explore at least once every 5 mins, that means the query will be run every time.. Here's what i use: authenticate.php Find You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Add above it You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Replace 7 and 8 with item id's of items you want to give new players, this will give them 50 of each, i have it also set to give 3 donator days also. this works, but it give the stuff every time you login.lol Quote Link to comment Share on other sites More sharing options...
Bubbl3z Posted January 9, 2009 Share Posted January 9, 2009 Re: [mccode] Free Starter Pack +2 Quote Link to comment Share on other sites More sharing options...
Lithium Posted January 9, 2009 Share Posted January 9, 2009 Re: [mccode] Free Starter Pack Why bother adding more to the user table, and adding an exrta query on the explore page? If your anything like me you will be going to explore at least once every 5 mins, that means the query will be run every time.. Here's what i use: authenticate.php Find You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Add above it You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Replace 7 and 8 with item id's of items you want to give new players, this will give them 50 of each, i have it also set to give 3 donator days also. this works, but it give the stuff every time you login.lol it only gives stuff everytime you login IF you don't update "laston" field, otherwise it does give ONE time as of first login! Quote Link to comment Share on other sites More sharing options...
DeaTH_RideR Posted January 9, 2009 Share Posted January 9, 2009 Re: [mccode] Free Starter Pack i guess i just dont understand what you mean but here is my file. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote Link to comment Share on other sites More sharing options...
POG1 Posted January 11, 2009 Share Posted January 11, 2009 Re: [mccode] Free Starter Pack session_start(); if(get_magic_quotes_gpc() == 0) { die("Fatal error: MCCode cannot function without MagicQuotes GPC being turned on in PHP.INI."); } this is compensated for in a file somewhere, think its in config.php Quote Link to comment Share on other sites More sharing options...
redsnake420 Posted January 12, 2009 Share Posted January 12, 2009 Re: [mccode] Free Starter Pack i installed everything perfect and used your updated post and all it does is say welcome stuff and doesnt do anything else doesnt credit anything and i made sure everything is correct Quote Link to comment Share on other sites More sharing options...
Strats Posted April 14, 2009 Share Posted April 14, 2009 Re: [mccode] Free Starter Pack I put this on my game but i get this error : Warning: require(. /globals.php) [function.require]: failed to open stream: No such file or directory in /home/wrestlin/public_html/starterkit.php on line 9 Warning: require(. /globals.php) [function.require]: failed to open stream: No such file or directory in /home/wrestlin/public_html/starterkit.php on line 9 Fatal error: require() [function.require]: Failed opening required '. /globals.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/wrestlin/public_html/starterkit.php on line 9 Quote Link to comment Share on other sites More sharing options...
Josh23 Posted April 14, 2009 Share Posted April 14, 2009 Re: [mccode] Free Starter Pack I put this on my game but i get this error : Warning: require(. /globals.php) [function.require]: failed to open stream: No such file or directory in /home/wrestlin/public_html/starterkit.php on line 9 Quote Link to comment Share on other sites More sharing options...
.: Reaper :. Posted April 14, 2009 Share Posted April 14, 2009 Re: [mccode] Free Starter Pack i was confused at first none of these worked on my game so i just edited 2 things and it worked hope it helps you out : You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote Link to comment Share on other sites More sharing options...
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.