
cruz
Members-
Posts
26 -
Joined
-
Last visited
Never
cruz's Achievements
Newbie (1/14)
0
Reputation
-
Re: Battle ladder [Mccodes V2] I always thought that reading the entire thread was a requirement for using a mod from ce, as you have to make sure there are no edits later on. My version does not have the staff panel add-ons so you just have to choose which then add it to your game then make adjustments to your game. There are very few mods you can add from ce that wont require you to do something. Everyones game is a bit different and if its a great game its alot different lol. Thanks for the mod.
-
Re: [mccode V2] Ajax Shoutbox. [$12.00] I don't want to get involved in whats going on above. With that said I purchased and installed this mod. It worked right out of the box and does everything it was stated too. Thanks for the mod. I did send you a pm with some ideas for an upgrade. I hope you take those into account cause they would greatly set yours apart from all others.
-
Re: Battle ladder [Mccodes V2] This is what I ended up with after I edited the mod. I have used it for a while now and it work fine. battle_ladder.php Im not sure that I changed anything in this file. <?php include_once ('globals.php'); switch($_GET['page']) { case 'signup': ladder_signup(); break; default: ladder_index(); break; } function ladder_index() { global $ir, $db; if(!isset($_GET['id'])) { echo '<h2>Battle Ladder System</h2> [url="battle_ladder.php?page=signup"][b]Join a ladder[/b][/url] Select a ladder below to view it. '; $fetch = $db->query("SELECT * FROM `battle_ladders` ORDER BY `minladderLevel` ASC"); while ($r = $db->fetch_row($fetch)) { $count ++; echo $count.'. [url="battle_ladder.php?id='.$r['ladderId'].'"]'.stripslashes($r['ladderName']).'[/url] (Min Level Required: '.$r['minladderLevel'].') (Max Level Allowed: '.$r['maxladderLevel'].') '; } echo ''; } else { $fetch = $db->query(sprintf("SELECT * FROM `battle_members` LEFT JOIN `users` ON `userid` = `bmemberUser` WHERE `bmemberLadder` = '%u' ORDER BY `bmemberScore` DESC", abs((int) $_GET['id']))); if(!$db->num_rows($fetch)) { echo 'This battle ladder does not exist at this time, or there are no members using the ladder at this time.'; } else { echo '<table width="600" class="table"> <tr> <th width="10%">Rank</th> <th width="40%">Name</th> <th width="20%">Score</th> <th width="15%">Wins</th> <th width="15%">Losses</th> </tr>'; while($r = $db->fetch_row($fetch)) { $count ++; echo '<tr> <td align="center">'.$count.'</td> <td>[url="viewuser.php?u='.$r['userid'].'"]'.$r['username'].'[/url]</td> <td>'.number_format($r['bmemberScore']).'</td> <td>'.$r['bmemberWins'].'</td> <td>'.$r['bmemberLosses'].'</td> </tr>'; } } } } function ladder_signup() { global $ir, $db; if(!isset($_GET['id'])) { echo '<h2>Join a ladder</h2> You are qualified to join one of the ladders shown below. <table width="300"> <tr> <td>'; $fetch = $db->query(sprintf("SELECT * FROM `battle_ladders` WHERE `minladderLevel` <= '%d' AND `maxladderLevel` >= '%d' ORDER BY `minladderLevel` ASC", $ir['level'], $ir['level'])); while ($r = $db->fetch_row($fetch)) { echo '[url="battle_ladder.php?page=signup&id='.$r['ladderId'].'"]'.stripslashes($r['ladderName']).'[/url] '; } echo '</td> </tr> </table>'; } else { $check = $db->query(sprintf("SELECT * FROM `battle_members` WHERE `bmemberUser` = '%u'", $ir['userid'])); if($db->num_rows($check)) { echo 'You are part of another ladder at this time, wait for that to finish before joining another.'; } else { $sql = $db->query(sprintf("SELECT * FROM `battle_ladders` WHERE `ladderId` = '%u'", abs((int) $_GET['id']))); $r = $db->fetch_row($sql); if($r['minladderLevel'] > $ir['level']) { echo 'You are not experienced enough to join this ladder right now.'; } if($r['maxladderLevel'] < $ir['level']) { echo 'You are too experienced to join this ladder.'; } else { $db->query(sprintf("INSERT INTO `battle_members` (`bmemberId`, `bmemberUser`, `bmemberLadder`, `bmemberScore`) VALUES ('NULL','%u', '%d', '%d')", $ir['userid'], $r['ladderId'], 100)); echo 'You have signed up to the '.stripslashes($r['ladderName']).', attack other members of that ladder to increase the score.'; } } } } print" </table>"; $h->endpage(); ?> Then I used these for my sql. I added the min/max ladder level to heklp split the competition. CREATE TABLE IF NOT EXISTS `battle_ladders` ( `ladderId` int(11) NOT NULL auto_increment, `ladderName` varchar(255) NOT NULL default '', `minladderLevel` int(11) NOT NULL, `maxladderLevel` int(11) NOT NULL, PRIMARY KEY (`ladderId`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ; CREATE TABLE IF NOT EXISTS `battle_members` ( `bmemberId` int(11) NOT NULL auto_increment, `bmemberUser` int(11) NOT NULL, `bmemberLadder` int(11) NOT NULL, `bmemberScore` int(11) NOT NULL, `bmemberWins` int(11) NOT NULL, `bmemberLosses` int(11) NOT NULL, PRIMARY KEY (`bmemberId`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ; This is my battle_cron.php I dont have many players yet so the cron just pulls one name from each ladder and the money/crystals are lowered. <?php include "config.php"; global $_CONFIG; define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; include "global_func.php"; $fetch = $db->query("SELECT * FROM `battle_ladders` ORDER BY `minladderLevel` ASC"); while($ft = $db->fetch_row($fetch)) { $count = 0; $sql = $db->query(sprintf("SELECT * FROM `battle_members` LEFT JOIN `users` ON `userid` = `bmemberUser` WHERE `bmemberLadder` = '%u' ORDER BY `bmemberScore` DESC LIMIT 1", $ft['ladderId'])); while($r = $db->fetch_row($sql)) { $count ++; $cash = ((((rand(5000, 10000) / 10) * $r['level']) / $count)); $points = ((((rand(50, 100) / 10) * $r['level']) / $count)); if($r['userid']) { $db->query(sprintf("UPDATE `users` SET `money` = `money` + '%d', `crystals` = `crystals` + '%d' WHERE `userid` = '%u'", $cash, $points, $r['bmemberUser'])); event_add($r['bmemberUser'], 'You have earned $'.number_format($cash).' and '.number_format($points).' Crystals for achieveing rank #'.$count.' in the '.$ft['ladderName'].' ladder!'); } } } $db->query("TRUNCATE TABLE battle_members;"); ?> I put this in explore.php <center>[url='battle_ladder.php']Battle Ladder</center>[/url] Lastly I put this in attacktake.php. This fixes the bug allowing members of all ladders to earn points on each other. It also doesnt allow the score to go in the negative. $chk_one=$db->query("SELECT * FROM battle_members WHERE bmemberUser=$userid"); $chk_two=$db->query("SELECT * FROM battle_members WHERE bmemberUser={$_GET['ID']}"); $ga5=$db->fetch_row($chk_one); $ga8=$db->fetch_row($chk_two); if ($ga5['bmemberLadder'] == $ga8['bmemberLadder']) { $score = rand(12, 24); $db->query(sprintf("UPDATE `battle_members` SET `bmemberScore` = `bmemberScore` - '%d', `bmemberLosses` = `bmemberLosses` + '1' WHERE `bmemberUser` = '%u'", $score, $r['userid'])); $db->query(sprintf("UPDATE `battle_members` SET `bmemberScore` = `bmemberScore` + '%d', `bmemberWins` = `bmemberWins` + '1' WHERE `bmemberUser` = '%u'", $score, $ir['userid'])); print "You have added {$score} points to the score on the battle ladder, well done. "; if ($ga8['bmemberScore']<=0) { $db->query("UPDATE battle_members SET bmemberScore=0 WHERE bmemberUser={$_GET['ID']}"); } } else { print "This player is not in the same battle ladder as you. Attack players in your battle ladder to earn points."; } Thanks for the free mod m8.
-
Re: New Houses Mod [Mccodes V2] works perfect for me and all of my players enjoy it. Thanks Richard!
-
Re: New Houses Mod [Mccodes V2] 1st look is good. Thanx for the free up.
-
Re: [McCodes][v2] Mailbox Layout Mod Ummm, the file you posted above has an error. Look for print "<script src='SpryCollapsiblePanel.js' type='text/javascript'></script> <link href='SpryCollapsiblePanel.css' rel='stylesheet' type='text/css' />"; change to print "<script src='SpryCollapsiblePanel2.js' type='text/javascript'></script> <link href='SpryCollapsiblePanel2.css' rel='stylesheet' type='text/css' />"; And thanks for the mod. I like it alot.
-
Exp from leaving people not working
cruz replied to EineyEntertainment's topic in General Discussion
Re: Exp from leaving people not working I had the same problem with my attack not giving exp. In my case it would tell you that you received so much exp (3%), but it would actually remove the exp from the players. In the end I found out it was an image that was not on my server, but was called out for in the code. The problem was in my header, so it was messing up alot of things on my site. This could be your problem especially if your having problems with firefox. I was having loads of them in FF and they turned out to be that. Edit-Just so you all dont start flamming me. If you dont have a query adding the exp to the db you wont get any. So I would also check that as the other posts have said. -
Re: Joinable Organised Crimes Pm me seanybob I am interested in purchasing a copy. Especially if you can add the hospital and jail possibility.
-
mccode-v2 New and improved inventory code sources for free!
cruz replied to MDK666's topic in Free Modifications
Re: [mccodes v2]New and improved inventory code sources for free! ummm... I have five in my inventory table. The 5th id for the armory lent items, so if anyone else has this problem it may be that for you too. Just add ,'' to the statement to complete for 5 columns inventory tables with the lent armory feature. Oh and thanks for the awsome free mod!! -
Re: [mccode v2] User Search It does not work with Internet Explorer, Try Firefox. Thanks. Nice mod, but my game is not designed around FF. Hey, its only 20% market share.
-
Re: [mccode v2] Advanced RentASpy Nice mod thank you +1
-
Re: [mccode v2] User Search umm I did everything as told, but the box for searching is not showing up. Basically it just giving me all of the users with no search feature (like the pictures).
-
Re: Enhance course for V2 Great idea and good work, Thanks.
-
Re: times kicked from gangs WOW, mabe i shouldn't have posted anything at all? LOL...
-
Re: House list in admin panel--V2 I know, for those of you who may use this if you figure out how to add the id to the name you dont even have to go to the edit houde list you can just click the name and it will take you strieght to edit the house. Adding it to the staff_houses is for a future mod I only have so much time right now.