chicka Posted July 9, 2009 Posted July 9, 2009 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.. Quote
Miniman Posted July 9, 2009 Posted July 9, 2009 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 :-) Quote
chicka Posted July 9, 2009 Author Posted July 9, 2009 Re: jail bust exp thank you for that.. how much exp will that give them for a bust? Quote
Miniman Posted July 9, 2009 Posted July 9, 2009 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. :) Quote
chicka Posted July 9, 2009 Author Posted July 9, 2009 Re: jail bust exp makes sense.. Thank you very much for your help +1 Quote
chicka Posted July 10, 2009 Author Posted July 10, 2009 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 Quote
endo Posted July 10, 2009 Posted July 10, 2009 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 Quote
chicka Posted July 10, 2009 Author Posted July 10, 2009 Re: jail bust exp got it working thank you Quote
Eternal Posted July 10, 2009 Posted July 10, 2009 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.... :) Quote
chicka Posted July 12, 2009 Author Posted July 12, 2009 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? Quote
AlabamaHit Posted July 12, 2009 Posted July 12, 2009 Re: jail bust exp $exp = $db->query(sprintf("UPDATE `users` SET `energy` = `energy` - 10 WHERE `userid` = %u",abs(@intval($ir['userid'])))); Quote
chicka Posted July 13, 2009 Author Posted July 13, 2009 Re: jail bust exp thanks i'm gonna try that right now.. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.