/    Sign up×
Community /Pin to ProfileBookmark

Anyone with PHP game programming exp. – Please help!

This is about a problem I’m having with an item in an online game. There is a weapon that is a shotgun. You can find ‘boxes of shells’ to load into the shotgun. Each box holds 4 shells, and you can carry up to 4 boxes. Hitting ‘reload’ is supposed to load 4 shells into your shotgun, provided you are carrying at least one box. So just an example of how it would look in-game:

>>

You find a box of shells.
>>You reload your shotgun. (Shotgun would now have 4 shells in it)

There used to be only individual shells. You could find one, two, three, or four at a time, and hitting ‘reload’ only loaded one into your shotgun at a time, and you would have to use that shell before loading any others. Example of how it was previously:

>>

You find some shotgun shells (4).
>>You reload your shotgun. (Shotgun would now have 1 shell in it and has to be fired before loading anymore shells)

Problem:
With the switch to ‘boxes of shells’ things have gone awry. It appears that, for some reason, loading a box of shells into a shotgun more often than not will only give you 1 shell in your gun. You can continue reloading until you have four shells, but boxes are supposed to give four shells a piece. Also, when carrying more than one box, it will only load one shell from each box and the boxes will be removed from your inventory like they are empty.

The single shell item was changed to the box of shells item. Like, literally, that item was altered into the new item. All other weapons work fine and reload correctly. Any ideas what may be going on here?
[B]The code for the reload function IS ATTACHED.[/B] The info on the shotgun (what it holds, how much, etc.) is kept in the MySQL database of course, I checked it against all other projectile weapons, and there are no irregularities.

[i]Any[/i] help, ideas, guesses, anything would be appreciated. ?

[upl-file uuid=feea25f2-59e2-4c0c-823c-64e75e255a04 size=2kB]reload.txt[/upl-file]

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @SugaSuga42 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...