Jump to content
MakeWebGames

Free Starter Pack


Akash

Recommended Posts

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

Link to comment
Share on other sites

  • Replies 68
  • Created
  • Last Reply

Top Posters In This Topic

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 :).

Link to comment
Share on other sites

  • 1 month later...

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 3 months later...

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

Link to comment
Share on other sites

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