Jump to content
MakeWebGames

Some Code Confusion???????


Z?v??
 Share

Recommended Posts

I'm having a bit of trouble with 2 of my mods. I converted these to fit with my version.

This is the error message i'm getting with my battletent:

Fatal error: Call to a member function on a non-object in /home2/lifecom/public_html/battletent.php on line 19

Herre are lines from my battle tent:

17 - print "

Battle Tent

18 - Welcome to the battle tent! Here you can challenge NPCs for money.

19 -

Bot Name Level Times Owned Ready

21 -  To Be Challenged?

Location Money Won Challenge

 

The other mod i'm having trouble with is my lucky boxes mod. I also converted this on to work with my game.

This is the error message i'm getting with my lucky boxes mod:

Fatal error: Call to a member function on a non-object in /home2/lifecom/public_html/lucky.php on line 31

Here are the lines from my lucky boxes mod:

31 - $number=rand(1, 5);

32 - $db->query("UPDATE users SET boxes_opened=boxes_opened+1, money=money-

33 - 1000 WHERE userid=$userid");

 

Any Help With Either of These Would Be Much Appreciated. :-)

Link to comment
Share on other sites

Re: Some Code Confusion???????

 

The other mod i'm having trouble with is my lucky boxes mod. I also converted this on to work with my game.

This is the error message i'm getting with my lucky boxes mod:

Fatal error: Call to a member function on a non-object in /home2/lifecom/public_html/lucky.php on line 31

Here are the lines from my lucky boxes mod:

31 - $number=rand(1, 5);

32 - $db->query("UPDATE users SET boxes_opened=boxes_opened+1, money=money-

33 - 1000 WHERE userid=$userid");

Use this:

Here are the lines from my lucky boxes mod:

31 - $number=rand(1,5);

32 - $db->query("UPDATE users SET boxes_opened=boxes_opened+1, money=money-

33 - 1000 WHERE userid=$userid");

You had a space in your random number draw there between the , and the 5. That was your problem.

Link to comment
Share on other sites

Re: Some Code Confusion???????

$db isn't an object

either you aren't including the right files, you didn't put $db = new Database; or whatever, or you're using stolen code or code that wont fit. for a quick fix just use mysql_query instead of $db->query

and @cronus, spaces dont matter :p

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.

 Share

×
×
  • Create New...