Jump to content
MakeWebGames

Recommended Posts

Posted

I was wondering if anyone would be kind enough to help me with jail busts.. at the moment no one is gaining exp when they bust someone and I was hoping that someone could help me out with that..

Posted

Re: jail bust exp

 

$db->query(sprintf("UPDATE users SET exp = exp + %u WHERE (userid = %u), exp-here,$userid));

 

Or you could make it random?

 

$exp = mt_rand(1,10);
$db->query(sprintf("UPDATE users SET exp = exp + %u WHERE (userid = %u), $exp,$userid));

 

For Crazy-T:

No, sprintf() may have not been needed but it's the way I like to do thing's :-)

Posted

Re: jail bust exp

 

$exp = mt_rand(1,10);
$db->query(sprintf("UPDATE users SET exp = exp + %u WHERE (userid = %u), $exp,$userid));

 

That one will give between 1 and 10, just change the number 1 and 10 to whatever you see fit.

And don't know if it's actually called 'exp' so you'd need to check your DB.

:)

Posted

Re: jail bust exp

I get this when I added it

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/pirateba/public_html/jailbust.php on line 34

Posted

Re: jail bust exp

hmm shouldnt really be happening but if i where you id try just a simple rand(1, 10) instead of mt_rand(1, 10) and see if that changes things for you

Posted

Re: jail bust exp

 

$exp = rand(1,10);
$newexp=$exp*$ir['level'];
$db->query(sprintf("UPDATE users SET exp = exp + %u WHERE (userid = %u), $newexp,$userid));

 

Gives them the chance to succeed.

say level 50 has max 500 exp given

and 1000 exp to level 100

since when you level 10 exp looks like nothing. why bust the person?

maybe step the up rand(10,20) or so....

:)

Posted

Re: jail bust exp

thats good and one more thing if you don't mind I'm trying to make is so they use energy when they bust, can that be done some how?

$db->query("UPDATE users SET energy=<10 WHERE userid=$userid");

does that look right?

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