-
Posts
693 -
Joined
-
Last visited
-
Days Won
1
Content Type
Profiles
Forums
Events
Everything posted by radio_active
-
Re: [mccode v2] Lottery There needs to be at least one ticket bought for this lottery to work. If you run the query and there has been no tickets bought it will throw and error. can someone please reply coz i am a N0OB ??? Try something like this $sql = $db->query("SELECT * FROM `lottery`"); $rows = $db->num_rows($sql); $row = $db->fetch_row($sql); $winner = rand(3,$rows); $winnerq = sprintf("SELECT `userid` FROM `lottery` WHERE `id` = %d", $winner); $winnerq1 = $db->query($winnerq); $user = $db->fetch_row($winnerq1); $user2 = $db->fetch_row($winnerq1); $user3 = $db->fetch_row($winnerq1); $1win = $row['jackpot'] / 2 ; $2win = $row['jackpot'] / 2 ; $3win = $row['jackpot'] / 2 ; $credit = sprintf("UPDATE `users` SET `money` = `money` + %d WHERE `userid` = (%u)", $row['jackpot'], $user['userid']); event_add($user['userid'],"You won the weekly lottery and were credited \$$1win",$c); event_add($user2['userid'],"You won the weekly lottery and were credited \$$2win",$c); event_add($user3['userid'],"You won the weekly lottery and were credited \$$3win",$c); $db->query("UPDATE `users` SET `lottery` = 0"); $db->query("TRUNCATE TABLE `lottery`"); $update = sprintf("UPDATE `lottery` SET `jackpot` = %d", 500000); $db->query($update); ?> I do not know if this will work or not. But what it does if it works is 1st winner gets half the jackpot, 2nd winner gets half of the half, then the 3rd winner gets half of the quarter. If your not getting anywhere there (note you will need at least 3 different people to buy tickets. But if you get know where, just add this to end of the script $update = sprintf("UPDATE `lottery` SET `jackpot` = %d", 500000); $db->query($update); Which will set the lottery to 500k but you have to add it after the last query (the truncate table query). Hope this helps :-)
-
Re: day cron error No wait, you will have to change $that to $coud as the $coud variable is being called later in the script, woops. Change that.
-
Re: day cron error Glad i could help ;)
-
Re: day cron error $cd=mysql_query("SELECT * FROM courses WHERE crID={$r['course']}"); $coud=mysql_fetch_row($cd); Try replace that with this. $well = {$r['course']}; $cd = sprintf("SELECT * FROM `courses`` WHERE crID` = %d",$well); $that = mysql_fetch_array($cd); for it to be more secure (if it works for V1) or just simply change the row => array. (just replace those two lines with the ones below) $cd=mysql_query("SELECT * FROM courses WHERE crID={$r['course']}"); $coud=mysql_fetch_array($cd); EDIT: Forgot code tags
-
Re: Crystal Market Addon That is a tonne of work there when you can just use what luke posted hey! lol
-
Re: Crystal Market Addon O right, so you can only have one listing up at a time, is that what you meant? Or you can only put crystals up in say, lots of 50?
-
Re: Crystal Market Addon or just if($_POST['amnt'] <=10) { die ("You can only post a minimum of 11 crystals in one instance"); $h->endpage(); exit; Or something like that, changing the number 10 to however much one below the minumum is!
-
Re: [mccode v2] House Rentals Dude read the first post... "This is an add-on to Multiple Houses Mod" Search Multiple Houses Mod by Richard... Second thing this mod does not work, have a look at the replies!
-
Re: [mccode v2] House Rentals Go to the original script that he made which was Advanced properties or something like that and it comes with the market..
-
Re: [mccode v2] cash percentages Impressive, 100 lines of code or more into like 10 or 11...Nice!
-
Re: Stats Page Doesnt do that for me,but it should be accurate so it probably means someone has like -100000000000000 in there bank account, look through your database tables, click browse on the users and browse the bank accounts.
-
Re: Gang surrenders to lose respect! So basically what i had in the first post accept with the event ads? Ummmm okay this is what im wanting.. If GANG1 declares war on GANG2 and then GANG1 surrenders, it will cost them 5 respect to send a surrender and if GANG2 accepts the surrender, they will recieve 5 respect. If GANG1 declares on GANG2 and GANG2 surrenders, it will cost GANG2 1 respect to send the surrender and GANG1 will get that respect point if they accept it. So whoever declares war, it will cost them more respect if they surrender...Else it will only cost 1 respect for gangs to surrender being they didnt declare war on the gang they are surrendering to.
-
Re: Gang surrenders to lose respect! Oo yah i forgot the $gangdata but i believe you need it on the gangID aswell as its searching for gangs through the gang field list. As for the $respect = 5; Well that would need the variable function being something like.. $rep = sprintf('SELECT `gangrespect` FROM `gangs` WHERE gangID = %u' ,$gangdata['gangID'] ); $respect= $db->query($rep); So your defining what the variable is! So are you saying something like this? $rep = sprintf('SELECT `gangrespect` FROM `gangs` WHERE gangID = %u' ,$gangdata['gangID'] ); $respect= $db->query($rep); if($gangdata['gangID'] == $gangdata['warDECLARER']) { $respect = +5; } else { $respect = +1; } $rep1 = sprintf('UPDATE `gangs` SET `gangsrespect`= %u WHERE gangID = %u' ,$respect, $gangdata['gangID'] ); $respect1= $db->query($rep1); Or along those lines.. What i stated in my previous post about inserting the variable into the words it would be.. Gang surrendered to gang losing $respect respect. I think we are on the right track now =) PS. on the line if($gangdata['gangID'] == $gangdata['warDECLARER']), i dont need the second $gangdata right? It could be something like this? if($gangdata['gangID'] == ['warDECLARER']) as its alreaedy defined... So its like saying if GangID ==Wardeclarer?
-
Re: [mccode] ZBank [$5.00] *the banker toke his $2 cut* Little typo there =) So wait this is like your free modifcation of a bank and donator bank in one only with a link to take you to the crystal bank or money bank? lol
-
Re: [REVIEW] Dowtown Toronto RPG ~ review I was looking for a piece of code that fixed the background but i couldnt find it, do i add what you gave to my line or do i replace the complete thing, if i replace i think i still have to show the url of the BG pic right?
-
Re: [REVIEW] Dowtown Toronto RPG ~ review Thanks for the support there Vorless. Zero, thankyou for your input! Im not sure what you mean, if i change to what you have shown its not defining the bg picture? I have used the validator before and cleaned my CSS up but just before i added the background in. Can you explain a bit more? thankyou :-)
-
Re: Gang surrenders to lose respect! Any help appreciated :-)
-
[mccode V2] Easy and cleaner [FIX]
radio_active replied to radio_active's topic in Free Modifications
Re: Easy and cleaner. I experienced this a while back so i thought i would post this so people can counter the attack if it every takes place! -
Hello all, what im about to show you can fix some errors that occur in the V2 code. Basically all it is-is just running your CSS stylesheets on an external file. Running on the header normally works perfect however in some instances it can cause duplications of everything when buying houses, how much energy is used in attacking etc. So this will just make it safer and cleaner and prevent any duplication bugs. Copy your CSS Stylesheets into say notepad and save the file as whatever name you wish. But save it like mystylesheets.css If you have the original stylesheets they will look something like this. <style type="text/css"> <!-- body { background-color: #DEDEDE; margin-top: 0px; margin-bottom: 0px; font-family:calibri, helvetica, arial, geneva, sans-serif;font-size:12px;color: black; scrollbar-base-color: #005B70; scrollbar-arrow-color: #F3960B; scrollbar-DarkShadow-Color: #000000; } 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:#FFFFFF; vertical-align:top; text-align:center; } .table { background-color:#000000; } .table3 { background-color:#000000; } .table td { background-color:#DEDEDE; height:22px; } .table3 td { background-color:#CCCCCC; } td .alt { background-color:#EEEEEE; height:22px; } td .h { background-image:url(tablehgrad.png); background-repeat:repeat-x; font-weight: bold; background-color: #D6D6D6; } .table th { background-image:url(tablehgrad.png); background-repeat:repeat-x; font-weight: bold; background-color: #D6D6D6; } --> </style> So remove that onto a separate file. You have to add the .css at the end when you save. When you have the CSS file uploaded on your server, remove the stylesheets from your header. Once removed you make a link like this. echo '<link rel="stylesheet" type="text/css" href="mystylesheets.css" />'; Changing the link href to your filename.css place that link below if(!$ir['email']) { global $domain; die ("<body>Your account may be broken. Please mail staff@{$domain} stating your username and player ID."); } Now your CSS sheets will be running in a separate external file. Things to note: When you edit your style sheets in the external file there will be about a 5 minute delay on the first edit and then all edits after are immediate. Enjoy :-)
-
[MCcodes All] Staff Members cannot be attacked.
radio_active replied to Undergroundcity's topic in Free Modifications
Re: [MCcodes All] Staff Members cannot be attacked. Yeah i completly with you but i wouldnt make it so your whole staff list cannot be attacked, you would make so only admin or only cannot be attacked, not the whole staff list. -
Re: Gang surrenders to lose respect! Problem ive hit at the moment is i need to make a variable $respect so in gang events it will say ---------------------------------------------------------- Gang surrendered to gang losing 5 respect. Gang surrender to gang2 losing 1 respect. Gang have asked to surrender losing 5 respect. Gang have asked to surrender losing 1 respect ----------------------------------------------------------- Any help here appreciated. Im not sure if the first post is going at it from the right direct. I need an array possible of 1 or 5 in the variable so i can put it into the text events.
-
Re: Gang surrenders to lose respect! I thought i defined that in the first line :? Do i have to define twice?
-
Re: [REVIEW] Dowtown Toronto RPG ~ review Okay so a 5/10 because i had no Story on the front page because it was hacked a few weeks back and deleted and has not been put back up yet. It will be put back up before its moved into ALPHA. Then a 4/10 because you didnt have to verify your account. hmmm Okay thankyou for reviewing. Last bit of your first sentence made no sense. "then possibliy change the design of the site to something that suites the game design." Simplify that, "Change the design of the game to something that suites the desgn." Have a look at an orignal MCcode then compare. completly differernt, i have not used one persons login or header script, i have done my design completly by myself. just about to introduce a template into the register page. That was harsh but okay then!
-
Re: Hospital & Jail Timestamp. Thankyou for your input. Well if you have $howlong = 300; // can be any number set as a certain number that will mean they will be heading to hospital for pretty much the same time every they go to hospital whether it be for being attacked? Lets say i use the field "hospitaltime" in the users table. When they are attacked etc they hospitaltime is updated like it is in any instance with a cron. But instead of decreasing through a cron, when the time is greater then 0minutes the timestamp begins.
-
Okay ive decided that im going to make it so if a gang declares war on another gang then surrenders to the gang they declared on they will lose 5 respect to surrender. If they surrender to a gang who declares war on them it will only cost 1 respect. So i came up with something like this which im 100% sure will not work. But im trying to get my head around it as i havnt done any coding in 2 months. if($gangdata['gangID'] == $ir['warDECLARER']) { $rep = sprintf('UPDATE `gangs` set `gangrespect`=gangrespect-%u WHERE `gangid`=%u',5,$ir['gang']); $repl = $db->query($rep); } else { $rep1 = sprintf('UPDATE `gangs` set `gangrespect`=gangrespect-%u WHERE `gangid`=%u',1,$ir['gang']); $rep2 = $db->query($rep1); } The gang that receives the surrender will receive the respect that goes along with the surrender. Once i have this part worked out ill be able to do the second part by myself. Any help is appreciated! I will also give karma if its helpful xD Thankyou