Jump to content
MakeWebGames

Free Starter Pack


Akash

Recommended Posts

Ok, I know I posted this in Mod Requests after The Corpse requested it, but seeing as it's free, I thought I add it here too, so people will actually make use of it instead of it being hidden halfway through another topic.

This mod gives a user a starter pack when they begin the game. It credits the user with money, donatordays, vip days or whatever you guys have in your game. It's easy to modify, and there's instructions in the file to help you.

For V1

Find in explore.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Add under it

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

For V2

Find in explore.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Add under it

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

UPDATED(Ability to give out an item too!)

For Both V1 and V2 (Made compatible)

Then create a file called starterkit.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

EDIT:I just made the mod V1 and V2 compatible, all you need to do is change the

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

into

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

AND:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

into

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Then add the following sql

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

And there it is, you're done :mrgreen:

P.S If you would like to remove this feature after a few days in the game, the best way is just to empty the starterkit.php and remove the line from explore.php. However, if you want it done quickly, just use a query in phpMyAdmin that sets the field donatorpack in the users table to one. This will just make sure if anyone goes onto the starter pack file, that they will not get a pack, but just get a message saying you have got the pack already.

Hope you like it, and please feel free to contact me on [email protected] for converting. Also, any bugs you may find, which I doubt, as it's been tested, just post them here.

A final thing, if anyone can make this slightly more secure, then just post your version here.

Thanks

Link to comment
Share on other sites

  • Replies 68
  • Created
  • Last Reply

Top Posters In This Topic

Re: Free Starter Pack

Thank You everyone for the positive comments :). My first mod, a bit simple, but still glad you all like it.

Pog, did you mean to stop people getting it more than once? As in they can only claim the pack if donatordays=0 and daysold=0?

If yes, then great...just add it, nice idea.

Zbirc3, do you mean that you want the starter pack to credit users with items like morphines? Just post on here or PM me to explain, I didn't quite understand what you were trying to say...

Anyway, again, thanks guys, I appreciate the good comments :D

Link to comment
Share on other sites

  • 1 month later...

Re: Free Starter Pack

why do this when you can just add it in globals

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

then simply add a new row in users table called "Kit":

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Link to comment
Share on other sites

Re: Free Starter Pack

Both ways are good :).

But Zero, your way, like Lost One said would load on evey page.

:wink:

Anyway Gulley, in $db->escape, you'd have to learn a bit more php :S...I'll try and explain.

Basically, is used this as a query

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

The stuff in $db->escape actually make up all the %s etc. So I used

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

The first %s means nothing, because there's no money, crystals, points or whatever. So in $db->escape I put this

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

The word money now turns that first %s into money :). I'd do the same thing for the next, so the next %s after the = sign, would also be money. So now my code would look like this

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

%s I think would always be used for words and %d/%u for numbers (and other stuff ...I think...which I have no idea about :p)

You'd continue to do this for all of the values so an example of %s = %s + %d. Lets say that %s is money and %d is a value you want to add on ($10,000). In $db->escape you would put $db->escape(money, money, 10000)

Sorry if it's a bit confusing, not very good at explaining :(

Link to comment
Share on other sites

  • 2 weeks later...

Re: Free Starter Pack

Good mod, however i get this error ?

error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE (`userid` = 0)' at line 7

Query was UPDATE `users` SET `money` = `money` + 10000, `crystals` = `crystals` + 100, `donatordays` = `donatordays` + 5, WHERE (`userid` = 0)

Any idea why?

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

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.

Link to comment
Share on other sites

  • 3 weeks later...

Re: Free Starter Pack

ive seen on a couple games after the person uses this its still in the explore i wanna know before i add it to mine if that just how they added and messed it up on there game or is that how its supposed to be shouldn't it disappear after they use it? also great mod akash very helpful for newbies i plan on adding this to my logged in page

Link to comment
Share on other sites

Re: Free Starter Pack

INSERT INTO `inventory` (`inv_id`, `inv_itemid`, `inv_userid`, `inv_qty`) VALUES

Open your register.php

Find

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Add below

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

here is how the values work

(`inv_id`, `inv_itemid`, `inv_userid`, `inv_qty`)

don't remove the $i

Link to comment
Share on other sites

  • 2 months later...

Re: Free Starter Pack

 

ive seen on a couple games after the person uses this its still in the explore i wanna know before i add it to mine if that just how they added and messed it up on there game or is that how its supposed to be shouldn't it disappear after they use it? also great mod akash very helpful for newbies i plan on adding this to my logged in page

This also something I also would like to know

Link to comment
Share on other sites

  • 4 weeks later...

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