
The Ace
Members-
Posts
363 -
Joined
-
Last visited
Never
Content Type
Profiles
Forums
Events
Everything posted by The Ace
-
Re: Event Add -- stumped Anyone? Please...? :)
-
Re: Event Add -- stumped I have the lottery mod installed, and the winner receives an event. What I would like is that ALL users receive an even saying who won the lottery...so, what would I change this to: (from cron_weekly.php) event_add($user['userid'],"$user['userid'] won the weekly lottery and was credited £{$row['jackpot']}",$c); I'm not too sure what the event_add($user['userid'] should be.......if you need a better explanation, I'll try to explain more. lol. :-P
-
Re: Simple Trades [V2] Nice mod Richard. But I can't seem to trade. :( I can accept the trade, but then I can't do anything else. When I click "Begin Trade", it says "You are already in a trade" when I haven't even traded anything..... Also, when a trade is cancelled, the "trades" field in "users" isn't reset to 0.... :( But it looks really good!!
-
Re: [v2]Html text converter[v2] Thanks Joker.
-
Re: [v2]Html text converter[v2] No problem! Do you know how to incorporate this into the name of a user, like on Torn County??
-
Re: [v2]Html text converter[v2] Quite nice... :) But, isn't print "<form action='htmlfont.php' method='post'> supposed to be print "<form action='htmltext.php' method='post'> htmlfont.php >>>> htmltext.php ??
-
Re: Multiple Houses [V2] Thanks mate!! I'm having some trouble getting the estate into a table, and I know that's really simple. I managed to make a table, but each house had it's own table!! Grr! lol
-
Re: [v2][v1]Special Events[v1][v2] This is quite good, and I will probably use it, but are you able to make it like a count-down clock, like Evo mentioned?? So I don't have to refresh the page to see the "changes" to the time? :-P But great work. :D
-
Re: Multiple Houses [V2] Really nice mod!! I like it. But I have a small question/concern: A house costs £25,000,000, but when I buy it, I buy it for £27,500,000. Why is that? Has it got something to do with: $np['hPRICE']+=$np['hPRICE']/10;
-
Re: Battle Tent Tehe, thanks mate. ;) I kinda forgot to use the helpful search function! (Clear sign I'm not with it!) lol. :D
-
Hmm, I made a Battle Tent Bot, no problem. Then, when I went to add another, it just replaced the first one! :x The first NPC is still in the user list, but not in the Battle Tent. :( Here is my Battle Tent code: (could someone please help me, I don't know where to look today!!!) <?php include "globals.php"; print "<h3>Battle Tent</h3> [b]Welcome to the battle tent! Here you can challenge NPCs for money.[/b] <table width=100% cellspacing=1 class='table'><tr style='background: gray; '><th>Bot Name</th><th>Level</th><th>Times Owned</th><th>Ready To Be Challenged?</th><th>Location</th><th>Money Won</th><th>Challenge</th></tr>"; $q=$db->query("SELECT cb.*,u.*,c.npcid,cy.cityname FROM challengebots cb LEFT JOIN users u ON cb.cb_npcid=u.userid LEFT JOIN challengesbeaten c ON c.npcid=u.userid AND c.userid=$userid LEFT JOIN cities cy ON u.location=cy.cityid"); while($r=$db->fetch_row($q)) { $earn=$r['cb_money']; $v=$r['userid']; $q=$db->query("SELECT count(*) FROM challengesbeaten WHERE npcid=$v"); $times=$db->fetch_single($q); print "<tr><td>{$r['username']}</td><td>{$r['level']}</td><td>$times</td><td>"; if($r['hp'] >= $r['maxhp']/2 and $r['location']==$ir['location'] and !$ir['hospital'] and !$ir['jail'] and !$r['hospital'] and !$r['jail']) { print "<font color=green>Yes</font>"; } else { print "<font color=red>No</font>"; } print "</td><td>{$r['cityname']}</td><td>$earn</td><td>"; if($r['npcid']) { print "[i]Already[/i]"; } else { print "[url='attack.php?ID={$r[']Challenge[/url]"; } print "</td></tr>"; } print "</table>"; $h->endpage(); ?> I'm really lost today! lol. :-P
-
Re: Query Error $SQL = sprintf("UPDATE `users` SET `keys` = `keys` + %u , `ruby` = `ruby` - %u WHERE `userid`= %u ", mysql_real_escape_string($_POST['keys']), mysql_real_escape_string($iqgain), $userid); mysql_query($SQL); I'll try that.... ;) THANKS Iso!! Worked well. ;)
-
Re: Query Error Thanks.....it half worked. ;) I didn't get an error and it said that I bought 1 key for 20 rubies, but I didn't get the key and I lost the 20 rubies. Would it have anything to do with the fact that the default is 10 keys, or that it is mysql_query when I am using V2??
-
Right, I have made a Holiday Ruby Trader, and I made it so you can buy keys (used for the chests mod). I can get to the buying screen, but when I actually click on buy/submit, I get: QUERY ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'keys = keys+1 WHERE userid=1' at line 1 Query was UPDATE users SET keys = keys+1 WHERE userid=1 Here is the bit of code where that query is located: $iqgain=$_POST['keys']*20; $db->query("UPDATE users SET ruby=ruby-$iqgain WHERE userid=$userid"); $db->query("UPDATE users SET keys = keys+{$_POST['keys']} WHERE userid={$ir['userid']}"); //This is it. :@ print "You have bought {$_POST['keys']} keys for $iqgain rubies."; Any ideas? I also had {$ir['userid']} as just $userid, but that didn't work either.... :(
-
Re: Giving Item To All Users [FREE] I like this Mod. ;) But how do I get it to display the item name in the event, instead of the item ID?? Instead of: event_add($r['userid'],"The population has just been given item {$_POST['item']}, Click Here to check.",$c); would it be: event_add($r['userid'],"The population has just been given item {$_POST['itmname']}, Click Here to check.",$c); or something along the lines of that?
-
Re: [Free V2] Lottery Nice fix, thanks. But, just letting everyone else know as well, peeps can buy more than 100. ;)
-
Re: New Template! :p WOW. I really like it!! The images are really good....I wish I could do something like that!! ;) To make it different from other games, you could change the text font.... IMO the colours are good as well! ;) :-P
-
Re: Event Add -- stumped Thank you!! :D
-
Re: Event Add -- stumped Thanks, that worked, but whenever someone tries to attack other admins, the event comes through to me, ID 1.....what would I change $id=1; to, so it applies to ALL admins.....???
-
Re: Event Add -- stumped I had a feeling it was in the wrong section!! lol Um, in a way. ;) What I would like is when a user attempts to attack ANY admin, that admin gets an event saying "Name Here tried to attack you."
-
A bit hard for me to explain, but in my game I have it so that users can't attack admins. I would like it so that if someone tries to attack an admin, it sends an event to that admin. The things I have tried don't seem to work. Here is my code from attack.php (the bit with the user_level): else if($odata['user_level']==2) { print "{$odata['username']}'s bodyguards chase you away. You're not allowed to attack admins! [url='index.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; } Any help will be highly appreciated. ;) (PS. I didn't think this was a Modification Request. That is why I have posted here. :) )
-
Re: [V1] Chests [V1] I tried that when I had first had the problem, and it didn't work. :( lol
-
Re: [V1] Chests [V1] Right....I see....cheers anyway. :)
-
Re: help quick if anyone can Haven't you got to then open another print after the last }? <?php class headers { function startheaders() { global $ir, $set; echo <<<EOF <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>{$set['game_name']}</title> <style type="text/css"> <!-- body { background-color: #DDDDDD; margin-top: 0px; margin-bottom: 0px; font-family:calibri, helvetica, arial, geneva, sans-serif;font-size:12px;color: black; scrollbar-base-color: #DDDDDD; scrollbar-arrow-color: #DDDDDD; scrollbar-DarkShadow-Color: #DDDDDD; } a:visited,a:active,a:hover,a:link { color: black;text-decoration: none; } table,tr,td { font-family:helvetica, arial, geneva, sans-serif;font-size: 12px; } img { border:none; } textarea { font-family:helvetica, arial, geneva, sans-serif;font-size:12px;color: black; } .table2 { } .lgrad { background-image:url(lgrad.jpg); background-repeat:repeat-y; width:19px; } .linegrad { background-image:url(linegrad.PNG); background-repeat:repeat-y; background-align: center; width:2px; } .rgrad { background-image:url(rgrad.jpg); background-repeat:repeat-y; width:19px; } .dgrad { background-image:url(dgrad.jpg); background-repeat:repeat-x; height:38px; } .dgradl { background-image:url(dgradl.jpg); background-repeat:no-repeat; height:38px; width:38px; } .dgradr { background-image:url(dgradr.jpg); background-repeat:no-repeat; height:38px; width:38px; } .center { width:932px; background-color:#DDDDDD; vertical-align:top; text-align:center; } .table { background-color:#DDDDDD; } .table3 { background-color:#DDDDDD; } .table td { background-color:#DDDDDD; height:22px; } .table3 td { background-color:#DDDDDD; } td .alt { background-color:#DDDDDD; height:22px; } td .h { background-image:url(tablehgrad.png); background-repeat:repeat-x; font-weight: bold; background-color: #DDDDDD; } .table th { background-image:url(tablehgrad.png); background-repeat:repeat-x; font-weight: bold; background-color: #DDDDDD; } --> </style></head> <body> <center> <table width="970" border="0" cellpadding="0" cellspacing="0" class="table2"> <tr> <td class="lgrad"></td> <td class="center"> EOF; } function userdata($ir,$lv,$fm,$cm,$dosessh=1) { global $db,$c,$userid, $set; $IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; $db->query("UPDATE users SET laston=unix_timestamp(),lastip='$IP' WHERE userid=$userid"); if(!$ir['email']) { global $domain; die ("<body>Your account may be broken. Please mail help@{$domain} stating your username and player ID."); } if($dosessh && ($_SESSION['attacking'] || $ir['attacking'])) { print "You lost all your EXP for running from the fight."; $db->query("UPDATE users SET exp=0,attacking=0 WHERE userid=$userid"); $_SESSION['attacking']=0; } $enperc=(int) ($ir['energy']/$ir['maxenergy']*100); $wiperc=(int) ($ir['will']/$ir['maxwill']*100); $experc=(int) ($ir['exp']/$ir['exp_needed']*100); $brperc=(int) ($ir['brave']/$ir['maxbrave']*100); $hpperc=(int) ($ir['hp']/$ir['maxhp']*100); $enopp=100-$enperc; $wiopp=100-$wiperc; $exopp=100-$experc; $bropp=100-$brperc; $hpopp=100-$hpperc; $d=""; $u=$ir['username']; if($ir['donatordays']) { $u = "<font color=red>{$ir['username']}</font>";$d="[img=donator.gif]"; } $_GET['ID'] = abs(@intval($_GET['ID'])); $_GET['viewforum'] = abs(@intval($_GET['viewforum'])); $_GET['viewtopic'] = abs(@intval($_GET['viewtopic'])); $gn=""; global $staffpage; $bgcolor = 'DDDDDD'; print <<<OUT [img=title2.jpg] <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="20%" bgcolor="#$bgcolor" valign="top"> [b]Name:[/b] $gn{$u} [{$ir['userid']}] $d [b]Money:[/b] {$fm} [b]Level:[/b] {$ir['level']} "; if($ir['upgrade'] ==1) { print"<a href=upgrade.php>[b][upgrade][/b]</a> "; } print "[b]Crystals:[/b] {$ir['crystals']} [b]Honors:[/b]{$ir['honor']} [[url='logout.php']Emergency Logout[/url]] <hr /> [b]Energy:[/b] {$enperc}% <img src=greenbar.png width=$enperc height=10><img src=redbar.png width=$enopp height=10> [b]Will:[/b] {$wiperc}% <img src=bluebar.png width=$wiperc height=10><img src=redbar.png width=$wiopp height=10> [b]Brave:[/b] {$ir['brave']}/{$ir['maxbrave']} <img src=yellowbar.png width=$brperc height=10><img src=redbar.png width=$bropp height=10> [b]EXP:[/b] {$experc}% <img src=navybar.png width=$experc height=10><img src=redbar.png width=$exopp height=10> [b]Health:[/b] {$hpperc}% <img src=greenbar.png width=$hpperc height=10><img src=redbar.png width=$hpopp height=10> <hr /> OUT; if($ir['fedjail']) { $q=$db->query("SELECT * FROM fedjail WHERE fed_userid=$userid"); $r=$db->fetch_row($q); die("[b]<font color=red size=+1>You have been put in the {$set['game_name']} Federal Jail for {$r['fed_days']} day(s). Reason: {$r['fed_reason']}</font>[/b]</body></html>"); } if(file_exists('ipbans/'.$IP)) { die("[b]<font color=red size=+1>Your IP has been banned from {$set['game_name']}, there is no way around this.</font>[/b]</body></html>"); } } function menuarea() { include "mainmenu.php"; global $ir,$c; $bgcolor = 'DDDDDD'; print '</td><td width="2" class="linegrad" bgcolor="#'.$bgcolor.'"> </td><td width="80%" bgcolor="#'.$bgcolor.'" valign="top"> <center>'; if($ir['hospital']) { print "[b]NB:[/b] You are currently in hospital for {$ir['hospital']} minutes. "; } if($ir['jail']) { print "[b]NB:[/b] You are currently in jail for {$ir['jail']} minutes. "; } print "[url='donator.php'][b]Donate to {$set['game_name']} now for game benefits![/b][/url] "; } function smenuarea() { include "smenu.php"; global $ir,$c; $bgcolor = 'DDDDDD'; print '</td><td width="2" class="linegrad" bgcolor="#'.$bgcolor.'"> </td><td width="80%" bgcolor="#'.$bgcolor.'" valign="top"><center>'; } function endpage() { global $db; print <<<OUT </center> </td> </tr> </table></td> <td class="rgrad"></td> </tr> <tr> <td colspan="3"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td class="dgradl"> </td> <td class="dgrad"> </td> <td class="dgradr"> </td> </tr> </table> </td> </tr> </table> {$db->num_queries} queries</body> </html> OUT; } } /*+++++++++++++++++++++++++++++++++++++*/ /* SQL Protection Start */ /*+++++++++++++++++++++++++++++++++++++*/ //check if incomingData is not empty and of the expected length function checkIncomingData($idata, $minsize, $maxsize) { if ( strlen($idata)<$minsize or strlen($idata)>$maxsize ) { return false; } else { return true; } } //make sure that nothing bad can be entered by the user (-->sql injection attack) function cleanIncomingData($idata) { $cleaned = trim($idata); $cleaned = mysql_real_escape_string($cleaned); return $cleaned; } /*+++++++++++++++++++++++++++++++++++++*/ /* SQL Protection Ended */ /*+++++++++++++++++++++++++++++++++++++*/ ?> MAKE SURE YOU HAVE A BACKUP!!
-
Re: [V1] Chests [V1] I really like this mod, but, how do you get keys after you get to 0? Here is what I have tried: Getting them from Lucky Boxes ------ Did not work Getting them from Prizes ------------ Did not work Adding query to day cron ------------ Did not work Grr!