Jump to content
MakeWebGames

Dayo

Administrators
  • Posts

    2,491
  • Joined

  • Last visited

  • Days Won

    196

Everything posted by Dayo

  1. I'm intergrating my game with facebook and the web version to start of it was hard but once you have the core files working it is easy (core files ... Template, login, register, global files.)
  2. The search feature dosent seam to work for the old CE posts unless you specify the forum you want to search, does any one else have this problem
  3. Yea i made it as i finished posting that :P And im making more mods/layouts as we speek :D
  4. $rand=mt_rand(1, 5); $desc =array('shoot man', 'shoot other man', 'shot a diffrent man', 'duo what to put here', 'or here'); echo $desc[($rand-1)]'; that makes a diffrent target each time you visit a page to let them chose from all use this <?php $a =array('0'=>'shoot man', '1'=>'shoot other man', '2'=>'shot a diffrent man', '3'=>'duno what to put here', '4'=>'or here'); $i=0; foreach ($a as $v) { echo '[url="shooting.php?ben=shooting&id='.$i.'"]'.$v.'[/url] '; $i++; } ?>
  5. danny if its that hard why couldent you just say look line what ever change it from ... x ... to ... x ... or better still dont even post cos things like that are just pointless if you want to replace gang with faction replace this (lines 137 - 144) if($r['gang']) { echo '[url="gangs.php?action=view&ID='.$r['gang'].'"]'.$r['gangNAME'].'[/url] '; } else { echo 'Not in a gang. '; } with this if($r['faction']) { echo '[url="faction.php?action=view&ID='.$r['faction'].'"]'.$r['factionNAME'].'[/url] '; } else { echo 'Not in a faction. '; } please note i dont know what tables you use for your faction so you may have to edit them acordenly
  6. ben there is no point trying to learn from other people, they will teach you from there level (beginer, intermidiet, pro ... what ever) you need to learn on your own at your own pace. do what i did get a few books read a few online php tutorials, play with mccodes/free script a bit ... you will lear alot faster doing things yourselt rather then being show what to do by some one on MSN
  7. yes at the bottom of teh page there is the thing to add to the hour cron mysql_query("UPDATE `thugs` SET `tClaim`='1'"); i think that is what it is but just check glad peole actuly like this one rather then tearing there hair out trying to fix bugs :P
  8. the register was a bit saw on my eyes
  9. the income/crimes instalation structions are located here If you need help i will install it to your site for $5
  10. always check throgh your code ... read it backwards that way your errors stick out
  11. do to my mccodes od in my signature its there
  12. you dont have to be like that just point out what could be better my 1st mccode mod was just the smenu with some DWCS3 CSS n JS
  13. add somat so they can only do it once an hour or else you could just hold f5 and get lots of money and str like make a field in user called shot ihrn if ($ir['shot']) {echo 'you have shot already today';$h->endpage();exit;} then add somat in cron hour But any way good first mod
  14. Yea sorry about hat we had a water and fry vat incdent I had to stay on to clean the mess
  15. arghhh you had to take my nedt two mod ideas didnt you :P the income from the thugs will be finished tonight and will be a free mod for ppl to use as will the attack
  16. having a quick look they do seam to be similar but with tgh pet mod it looks very limited to what you can do with it, attack, level up and maby a few things i missed. atleast with this you can intergrate it into many parts of your game
  17. tbh i wouldent know without seeing the mod in action send me a link to where one is and ill see
  18. yup the script for that and for the user to make money is being made will probly be finished tonight
  19. Yea tglobals is correct in there it will see if you use version 1 or two and will either use the include 'globals.php'; or the v1 code. thugs.php is just the functions and tglobals calls them to be used. ive only seen the pets mod once or twice and personly dont like it ... come on most games are mobster/gangster sorta game who wants pets (no offence to the author). This was built purly to add something new into mccodes something that could be expanded even more
  20. woops can some one move to free plugins please i just relised i posted in the mccodes section
  21. Hi when on ce i made a thug system ... it was an epic fail with many many bugs, Today i decided to remake it, code it better and remove a few things. This is the core system made for version 1 and 2 the script will detect your mccode version and run for that version so none of this converting to v1 or v2 :D(if some 1 can they verify it will work on v1 as its only tested on v2 (dont see why it shouldent tho)). I will be making add-ons for this in the next few days so that it can play a bigger role in your game and to fit your specific game. the free mods for this are located here http://cddesigns.org/thug.php well here is the sql you have to run[mysql] CREATE TABLE `thugs` ( `userid` INT NOT NULL , `tID` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `tName` VARCHAR( 255 ) NOT NULL , `tLevel` INT NOT NULL , `tHealth` INT( 3 ) NOT NULL , `tStr` INT NOT NULL , `tDef` INT NOT NULL , `tPrice` INT NOT NULL ALTER TABLE `thugs` CHANGE `userid` `userid` INT( 11 ) NOT NULL , CHANGE `tID` `tID` INT( 11 ) NOT NULL AUTO_INCREMENT , CHANGE `tName` `tName` VARCHAR( 255 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL , CHANGE `tLevel` `tLevel` INT( 11 ) NOT NULL DEFAULT '1', CHANGE `tHealth` `tHealth` INT( 3 ) NOT NULL DEFAULT '100', CHANGE `tStr` `tStr` INT( 11 ) NOT NULL DEFAULT '1', CHANGE `tDef` `tDef` INT( 11 ) NOT NULL DEFAULT '1', CHANGE `tPrice` `tPrice` INT( 11 ) NOT NULL DEFAULT '100', CHANGE `tExp` `tExp` INT( 11 ) NOT NULL DEFAULT '0', Here is thugs.php <?php /////////////////////////////////////////////////////////////////// // Thug Core System - McCodes V1/2 // // Made By Christopher day (AKA Dayo) December 2009 // // Support is limited for the Core system ONLY!!! // // Support is located at cddesigns.org/support // // Relesed under the GNU licence // // This is the remake please email me any bugs // // Enjoy this FREE mod Thanks, Dayo // /////////////////////////////////////////////////////////////////// include 'tglobals.php'; ///////////// // HOME // ///////////// function home() { global $ir, $h, $tSettings; echo '<p>Welcome to your thug overveiw. Here you can organise your thugs, buy equipment, train stats and hire more.</p><h1>Your Thugs</h1>Click on your thug to edit it - <a href="thugs.php?action=hire">Hire a thug($'.number_format($tSettings['ThugPrice']).')</a></p>'; echo '<table width="480" border="0" cellspacing="0" cellpadding="0"> <tr> <td><strong>Thug</strong></td> <td><strong>Level</strong></td> <td><strong>Strengh</strong></td> <td><strong>Defence</strong></td> <td><strong>Health</strong></td> <td><strong>Pay</strong></td> </tr>'; $sql="SELECT `tID`, `tName`, `tLevel`, `tHealth`, `tStr`, `tDef`, `tPrice` FROM `thugs` WHERE `userid`='".$ir['userid']."'"; $qry=mysql_query($sql); while ($t=mysql_fetch_array($qry)) { echo ' <tr> <td><a href="thugs.php?action=thug&id='.$t['tID'].'">'.htmlspecialchars($t['tName']).'</a></td> <td>'.$t['tLevel'].'</td> <td>'.$t['tStr'].'</td> <td>'.$t['tDef'].'</td> <td>'.$t['tHealth'].'%</td> <td>$'.number_format($t['tPrice']).'</td> </tr>'; } echo '</table>'; } /////////// // Thugs // /////////// function thug() { global $ir, $h, $tSettings; $id=abs(@intval($_GET['id'])); $sql="SELECT `userid`, `tID`, `tName`, `tLevel`, `tHealth`, `tStr`, `tDef`, `tPrice`, `tExp`, `tEnergy`, `tActions` FROM `thugs` WHERE `tID`='".$id."'"; $qry=mysql_query($sql); $t=mysql_fetch_array($qry); if($t['userid']!=$ir['userid']){echo 'This is not your thug!'; $h->endpage();exit;} echo '<h1>'.htmlspecialchars($t['tName']).' - <a href="thugs.php">Back</a></h1> <table width="400" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="100"><strong>Name:</strong></td> <td width="120">'.htmlspecialchars($t['tName']).'</td> <td width="180">[<a href="thugs.php?action=edit&option=name">Change</a>]</td> </tr> <tr> <td><strong>Level:</strong></td> <td>'.$t['tLevel'].'</td> <td>['.$t['tExp'].'%]</td> </tr> <tr> <td><strong>Strengh:</strong></td> <td>'.$t['tStr'].'</td> <td>[<a href="thugs.php?action=train&option=str&id='.$t['tID'].'">Train</a>] - [Energy: '.$t['tEnergy'].']</td> </tr> <tr> <td><strong>Defence:</strong></td> <td>'.$t['tDef'].'</td> <td>[<a href="thugs.php?action=train&option=def&id='.$t['tID'].'">Train</a>] - [Energy: '.$t['tEnergy'].']</td> </tr> <tr> <td><strong>Health:</strong></td> <td>'.$t['tHealth'].'%</td> <td>'; if ($t['tHealth'] != 100) { echo '[<a href="thugs.php?action=heal&id='.$t['tID'].'">Heal ($'.number_format(($t['tLevel']*(100-$t['tHealth'])*100)).')</a>]'; } echo '</td> </tr> <tr> <td><strong>Cost:</strong></td> <td>$'.$t['tPrice'].'</td> <td></td> </tr>'; $a=explode('-', $t['tActions']); $income = ($tSettings['Actions'][1]['Income']*$a[0])+($tSettings['Actions'][2]['Income']*$a[1])+($tSettings['Actions'][3]['Income']*$a[2])+($tSettings['Actions'][4]['Income']*$a[3])+($tSettings['Actions'][5]['Income']*$a[4]); echo ' <tr> <td><strong>Income:</strong></td> <td>$'.number_format($income).'</td> <td>[<a href="thugs.php?action=actions&id='.$t['tID'].'">Upgrade</a>]- [<a href="thugs.php?action=claim&id='.$t['tID'].'">Collect</a>]</td> </tr> </table>'; } //////////// // Train // //////////// function train() { global $ir, $h, $tSettings; $id=abs(@intval($_GET['id'])); $alowedoptions = array('str', 'def', 'Str', 'Def'); $option = $_GET['option']; if (!in_array($option, $alowedoptions)) {echo 'You can only train strengh or defence. <a href="thugs.php?action=thug&id='.$id.'">Back</a>';$h->endpage();exit;} $sql="SELECT `tID`, `tName`, `tStr`, `tDef`, `tEnergy` FROM `thugs` WHERE `userid`='".$ir['userid']."' AND `tID`='".$id."'"; $qry=mysql_query($sql); $t=mysql_fetch_array($qry); if ($t['tEnergy'] < 1) { echo 'Your thug dosent have energy. <a href="thugs.php?action=thug&id='.$id.'">Back</a>';$h->endpage(); exit; } if ($option == 'str') { mysql_query("UPDATE `thugs` SET `tStr`=`tStr`+'1', `tEnergy`=`tEnergy`-'1' WHERE `tID`='".$t['tID']."'"); echo htmlspecialchars($t['tName'])." Gained one Strengh Point. <a href='thugs.php?action=thug&id=".$id."'>Back</a>"; } else { mysql_query("UPDATE `thugs` SET `tDef`=`tDef`+'1', `tEnergy`=`tEnergy`-'1' WHERE `tID`='".$t['tID']."'"); echo htmlspecialchars($t['tName'])." Gained one Defence Point. <a href='thugs.php?action=thug&id=".$id."'>Back</a>"; } } ///////////// // Heal // ///////////// function heal() { global $ir, $h, $tSettings; $id=abs(@intval($_GET['id'])); $sql="SELECT `tID`, `tName`, `tLevel`, `tHealth` FROM `thugs` WHERE `userid`='".$ir['userid']."' AND `tID`='".$id."'"; $qry=mysql_query($sql); $t=mysql_fetch_array($qry); $price = ($t['tLevel']*(100-$t['tHealth'])*100); if ($price > $ir['money']) { echo 'You dont have enough money to do this. <a href="thugs.php?action=thug&id='.$id.'">Back</a>'; $h->endpage();exit;} mysql_query("UPDATE `thugs` SET `tHealth`='100' WHERE `tID`='".$t['tID']."'"); mysql_query("UPDATE `users` SET `money`=`money`-'".$price."' WHERE `userid`='".$ir['userid']."'"); echo htmlspecialchars($t['tName']).' was healed for $'.number_format($price).'. <a href="thugs.php?action=thug&id='.$id.'">Back</a>'; } //////////// // Hire // //////////// function hire() { global $ir, $h, $tSettings; if ($ir['money'] < $tSettings['ThugPrice']){ echo 'You Dont Have enough money for a thug. <a href="thugs.php">Back</a>';$h->endpage();exit;} $qry=mysql_query("SELECT `tID` FROM `thugs` WHERE `userid`='".$ir['userid']."'"); if(mysql_num_rows($qry)>=$tSettings['MaxThugs']){ echo 'You already have '.$tSettings['MaxThugs'].' thugs. <a href="thugs.php">Back</a>';$h->endpage();exit; } if ($_POST['name']) { $name=mysql_real_escape_string($_POST['name']); mysql_query("INSERT INTO thugs(`userid`, `tName`) VALUES ('".$ir['userid']."', '".$name."')"); echo mysql_error(); mysql_query("UPDATE `users` SET `money`=`money`-'".$tSettings['ThugPrice']."' WHERE `userid`='".$ir['userid']."'"); echo 'You Hired '.htmlspecialchars($name).' <a href="thugs.php">Back</a>'; } else { echo 'Chose a name<br /><form name="form1" method="post" action="thugs.php?action=hire"> <input type="text" name="name"> <input type="submit" name="Submit" value="Submit"> </form> '; } } ////////////// // Actions // ////////////// function actions(){ global $ir, $h, $tSettings, $actions; $id=abs(@intval($_GET['id'])); $qry=mysql_query("SELECT `tActions`, `userid` FROM `thugs` WHERE `tID`='".$id."'"); $t=mysql_fetch_array($qry); $a=explode('-', $t['tActions']); if ($ir['userid'] != $t['userid']) { echo 'This is not your thug! <a href="thugs.php?action=thug&id='.$id.'">Back</a>';$h->endpage();exit;} echo '<table width="98%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center"><strong>Crime</strong></td> <td align="center"><strong>Income</strong></td> <td align="center"><strong>Cost</strong></td> <td align="center"><strong>Current Ammount</strong> </td> <td align="center"><strong> Max</strong> </td> <td align="center"><strong>Buy</strong></td> </tr> <tr> <td align="center">'.$tSettings['Actions']['1']['Name'].'</td> <td align="center">$'.number_format($tSettings['Actions']['1']['Income']).'</td> <td align="center">'.number_format($tSettings['Actions']['1']['Price']).'</td> <td align="center">'.$a[0].'</td> <td align="center">'.$tSettings['Actions']['1']['Max'].'</td> <td align="center"><a href="thugs.php?action=buy&id='.$id.'&type=0">Buy</a></td> </tr> <tr> <td align="center">'.$tSettings['Actions']['2']['Name'].'</td> <td align="center">$'.number_format($tSettings['Actions']['2']['Income']).'</td> <td align="center">$'.number_format($tSettings['Actions']['2']['Price']).'</td> <td align="center">'.$a[1].'</td> <td align="center">'.$tSettings['Actions']['2']['Max'].'</td> <td align="center"><a href="thugs.php?action=buy&id='.$id.'&type=1">Buy</a></td> </tr> <tr> <td align="center">'.$tSettings['Actions']['3']['Name'].'</td> <td align="center">$'.number_format($tSettings['Actions']['3']['Income']).'</td> <td align="center">$'.number_format($tSettings['Actions']['3']['Price']).'</td> <td align="center">'.$a[2].'</td> <td align="center">'.$tSettings['Actions']['3']['Max'].'</td> <td align="center"><a href="thugs.php?action=buy&id='.$id.'&type=2">Buy</a></td> </tr> <tr> <td align="center">'.$tSettings['Actions']['4']['Name'].'</td> <td align="center">$'.number_format($tSettings['Actions']['4']['Income']).'</td> <td align="center">$'.number_format($tSettings['Actions']['4']['Price']).'</td> <td align="center">'.$a[3].'</td> <td align="center">'.$tSettings['Actions']['4']['Max'].'</td> <td align="center"><a href="thugs.php?action=buy&id='.$id.'&type=3">Buy</a></td> </tr> <tr> <td align="center">'.$tSettings['Actions']['5']['Name'].'</td> <td align="center">$'.number_format($tSettings['Actions']['5']['Income']).'</td> <td align="center">$'.number_format($tSettings['Actions']['5']['Price']).'</td> <td align="center">'.$a[4].'</td> <td align="center">'.$tSettings['Actions']['5']['Max'].'</td> <td align="center"><a href="thugs.php?action=buy&id='.$id.'&type=4">Buy</a></td> </tr> </table>'; } //////////// // Buy // //////////// function buy() { global $ir, $h, $tSettings, $actions; $id=abs(@intval($_GET['id'])); $type=abs(@intval($_GET['type'])); $sql = "SELECT `userid`, `tID`, `tActions` FROM `thugs` WHERE `tID`='".$id."'"; $qry = mysql_query($sql); $t = mysql_fetch_array($qry); if ($ir['userid'] != $t['userid']) { echo 'This is not your thug! <a href="thugs.php?action=actions&id='.$id.'">Back</a>';$h->endpage();exit;} $a=explode('-', $t['tActions']); if ($tSettings['Actions'][($type+1)]['Max'] < ($a[$type]+1)) { echo 'You are only alowed to do this '.$tSettings['Actions'][($type+1)]['Max'].' times a hour! <a href="thugs.php?action=actions&id='.$id.'">Back</a>';$h->endpage();exit;} mysql_query("UPDATE `users` SET `money`=`money`-'".$tSettings['Actions'][($type+1)]['Price']."' WHERE `userid`='".$ir['userid']."'"); $a[$type]=$a[$type]+1; $implode=implode('-', $a); $sql="UPDATE `thugs` SET `tActions`='".$implode."' WHERE `tID`='".$t['tID']."'"; mysql_query($sql); echo mysql_error(); echo 'You now '.$tSettings['Actions'][($type+1)]['Name'].' '.($a[$type]).' times a hour. <a href="thugs.php?action=actions&id='.$id.'">Back</a>'; } //////////// // Claim // //////////// function claim() { global $ir, $h, $tSettings; $id=abs(@intval($_GET['id'])); $sql="SELECT `userid`, `tID`, `tName`, `tClaim`, `tActions` FROM `thugs` WHERE `tID`='".$id."'"; $qry=mysql_query($sql); $t=mysql_fetch_array($qry); if ($ir['userid'] != $t['userid']) { echo 'This is not your thug! <a href="thugs.php?action=thug&id='.$id.'">Back</a>';$h->endpage();exit;} if ($t['tClaim'] != '0') { echo 'You have already claimed money for this thug! <a href="thugs.php?action=thug&id='.$id.'">Back</a>';$h->endpage();exit;} $a=explode('-', $t['tActions']); $income = ($tSettings['Actions'][1]['Income']*$a[0])+($tSettings['Actions'][2]['Income']*$a[1])+($tSettings['Actions'][3]['Income']*$a[2])+($tSettings['Actions'][4]['Income']*$a[3])+($tSettings['Actions'][5]['Income']*$a[4]); mysql_query("UPDATE `users` SET `money`=`money`+'".$income."' WHERE `userid`='".$ir['userid']."'"); mysql_query("UPDATE `thugs` SET `tClaim`='1' WHERE `tID`='".$t['tID']."'"); echo $t['tName'].' handed you $'.number_format($income).'<a href="thugs.php?action=thug&id='.$id.'">Back</a>'; } $h->endpage(); ?> and here is tglobals.php <?php /////////////////////////////////////////////////////////////////// // Thug Core System - McCodes V1/2 // // Made By Christopher day (AKA Dayo) December 2009 // // Support is limited for the Core system ONLY!!! // // Support is located at cddesigns.org/support // // Relesed under the GNU licence // // This is the remake please email me any bugs // // Enjoy this FREE mod Thanks, Dayo // /////////////////////////////////////////////////////////////////// //This autoselects the version of mccodes (pure lazyness as i cant be asked to make 2 versions :P) if (file_exists('globals.php')) {include 'globals.php'; } else { require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.,us. FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm); $h->menuarea(); } // Alowed values for the $_GET['action'] $actions = array('', 'thug', 'edit', 'train', 'hire', 'heal'); if (!in_array($_GET['action'], $actions)) {echo 'There was an error, The selected action is not allowed!';$h->endpage();exit;} // This is the main settings for the thug system $tSettings = array( 'ThugPrice'=>'2500', 'MaxThugs'=>'5' ); // This selects the function we want to use switch ($_GET['action']) { default: home(); break; case 'thug': thug(); break; case 'train': train(); break; case 'edit': edit(); break; case 'heal': heal(); break; case 'hire': hire(); break; } ?> Enjoy, Dayo 👍 .
  22. thanks pudda. ill be making more SIMPLE layouts soon for to people to build on and make there own ... as for mods i am making a few more for the new year NPC Paypackets ... 100 Club - half done on my comp... And a complet redo of my thugs core system as last time it was shockingly bad with endless errors :D...
  23. lol i need all the luck i can get :P
  24. i couldent care less what people think, i needed the money for my hosting as it runs out tomorow :D BTW ITS SOLD!
  25. price is now $15 due to the simplicity
×
×
  • Create New...