-
Posts
2,491 -
Joined
-
Last visited
-
Days Won
196
Content Type
Profiles
Forums
Events
Everything posted by Dayo
-
Re: [MC-Codes][V2]Thugs (core system) BUG FIX the training wasent woking soz mythugs.php <?php /* * Thug script V1.0.0 * This script was made by: DAYO * THIS IS FULLY SUPPORTED * IF YOU EDIT THIS AND NEED ANY HELP MAIL DAYO ON THE CE FORUMS / MSN: [email][email protected][/email] * YOU CAN USE THE INSTALLER TO INSTALL THE SQL NOT THE GAME VALUES */ include 'globals.php'; include 'thug-globals.php'; $action = $_GET[action]; if ($action == 'buyhideout') { if ($hideoutcost > $ir['money']) { echo 'you cant buy a hideout, you dont have enough cash!'; $h->endpage(); EXIT; } else { echo "you have broght a hideout for $"; echo $hideoutcost; $db->query("UPDATE users SET `money` = `money` - {$hideoutcost}, `hideout` = 1 WHERE userid = {$ir['userid']}"); $h->endpage(); EXIT; } } if ($ir['hideout'] == -1) { echo 'At the moment you do not have a hideout for your thugs! <a href = "mythugs.php?action=buyhideout">BUY A HIDEOUT</a> ($'; echo $hideoutcost; echo ')'; $h->endpage(); EXIT; } // this is the default page if ($action == '') { echo 'Welcome to your thug hangout! [b]<div allign = "right">Actions:</div>[/b] <a href = "mythugs.php?action=hire">Hire Thugs</a> || <a href = "mythugs.php?action=upgrade">Upgrade Thugs</a> || <a href = "mythugs.php?action=train">Train Thugs</a>'; echo ' <table width="835" border="0" cellspacing="0" cellpadding="0"> <tr> <td><div align="center">Name</div></td> <td><div align="center">Level</div></td> <td><div align="center">Attack</div></td> <td><div align="center">Defence</div></td> <td><div align="center">Attack Item</div></td> <td><div align="center">Defence Item</div> <div align="center"></div> <div align="center"></div></td> </tr>'; $query = "SELECT * FROM thugs WHERE userid={$ir['userid']}"; $rt=mysql_query($query); // query executed echo mysql_error(); // if any error is there that will be printed to the screen if ($rt) { while ($VT = mysql_fetch_array($rt)){ echo " <tr> <td>$VT[name]</td> <td>$VT[level] ($VT[exp] exp)</td> <td>$VT[attack]</td> <td>$VT[defend]</td> <td>$VT[aitme]</td> <td>$VT[ditem]</td> </tr>" ; } } else { echo " <tr> <td>N/A</td> <td>N/A</td> <td>N/A</td> <td>N/A</td> <td>N/A</td> <td>N/A</td> </tr>" ; } echo '</table>'; } else if ($action == hire) { echo '<form id="form1" name="form1" method="post" action="mythugs.php?action=hire2"> <label> [b]Name: [/b]<input type="text" name="name" id="name" /> </label> <label> <input type="submit" name="button" id="button" value=" hire thug ($'; echo $thugcost; echo ')" /> </label> </form>'; } else if ($action == hire2) { if ($ir['thugs'] >= $maxthugs) { echo 'you already have the max amount of thugs you cant have any more!'; $h->endpage(); EXIT; } if ($thugcost > $ir['money']) { echo 'you dont have enough money'; $h->endpage(); EXIT; } else { $name = htmlspecialchars($_POST[name]); $name = mysql_real_escape_string ($name); $db->query("UPDATE `users` SET `money`= `money` - {$thugcost}, `thugs` = `thugs` + 1"); $db->query("INSERT INTO thugs (name, userid) VALUES ('{$name}', '{$ir['userid']}')"); echo 'you broght a thug for $'; echo $thugcost; echo' <a href = "mythugs.php">BACK</a>'; $h->endpage(); EXIT; } } else if ($action == train) { echo 'Here you can train your thugs attack and defence stats'; echo '<form id="form1" name="form1" method="post" action="mythugs.php?action=train2"> <label> <select name="id" id="id">'; $trainingquery = "SELECT * FROM thugs WHERE userid = {$ir['userid']}"; $qw=mysql_query($trainingquery); // query executed while($TT=mysql_fetch_array($qw)){ echo '<option value="'; echo $TT[id]; echo '">'; echo $TT[name]; echo ' ('; echo $TT[level]; echo') </option>'; } echo ' </select> </label> <label> <select name="type" id="type"> <option value="attack">Train Attack</option> <option value="defend">Train Defence </option> </select> </label> <label> <input type="submit" name="button" id="button" value=" Train thug " /> </label> </form> '; } else if ($action == train2) { //checks if the user can train the thug if ($ir['thugtime'] > 0) { echo "You can not train your thug, you can in {$ir['thugtime']} mins"; $h->endpage(); EXIT; } $thugid = mysql_real_escape_string($_POST[id]); $training = $db->query("SELECT level FROM thugs WHERE id = {$thugid}"); $mintrain = $training * 3; $maxtrain = $training * 10; $type = mysql_real_escape_string($_POST[type]); $trainamount = mt_rand ($mintrain, $maxtrain); $db->query("UPDATE thugs SET {$type} = {$type} + {$trainamount} WHERE id = {$thugid}"); echo 'Your thug traied his ability to '; echo $type; echo ' He gained'; echo $trainamount; echo ' points'; $db->query("UPDATE users SET `thugtime` = `thugtime` + {$thugtraintime}"); } else if ($action == upgrade) { echo' here you can upgrade your thugs equipment'; echo '<form id="form1" name="form1" method="post" action="mythugs.php?action=upgrade2"> <label> <select name="id" id="id">'; $upgradequery = "SELECT * FROM thugs WHERE userid = {$ir['userid']}"; $rt=mysql_query($upgradequery); // query executed while($UT=mysql_fetch_array($rt)){ echo '<option value="'; echo $UT[id]; echo '">'; echo $UT[name]; echo' ('; echo $UT[level]; echo ') </option>'; } echo ' </select> </label> <label> <input type="submit" name="button" id="button" value=" Upgrade Thug " /> </label> </form> '; } else if ($action == upgrade2) { //they have selected a thug now lets select there new item $id = $_POST[id]; $upgrade2query = "SELECT * FROM thugitems"; $rt=mysql_query($upgrade2query); // query executed while($U2T=mysql_fetch_array($rt)){ echo $U2T[name]; echo' - $'; echo $U2T[price] ; echo' ('; echo $U2T[type]; echo ' Item) <a href="mythugs.php?action=upgrade3&thugid='; echo $id; echo '&price='; echo $U2T[price]; echo '&id='; echo $U2T[id];echo '&name='; echo $U2T[name]; echo '&type='; echo $U2T[type]; echo '">BUY</a>'; } } else if ($action == upgrade3) { $item = mysql_real_escape_string($_GET[id]); $price = mysql_real_escape_string($_GET[price]); $type = mysql_real_escape_string($_GET[type]); $name = mysql_real_escape_string($_GET[name]); $thugid = mysql_real_escape_string($_GET[thugid]); $name = $db->query("SELECT name FROM thugitems WHERE id={$item}"); $price = $db->query("SELECT price FROM thugitems WHERE id={$item}"); if ($price > $ir['money']) { echo 'you dont have enough money to do this!!!'; $h->endpage(); EXIT; } $db->query("UPDATE `users` SET `money` = `money` - ". mysql_real_escape_string($_GET['price']) ." WHERE (`userid` = ". $ir['userid'] .")") or die($db->error()); if ($type == attack) { $db->query("UPDATE thugs SET `aitem` = '". mysql_real_escape_string($_GET['name']) ."' WHERE id={$thugid}"); } else if ($type == defend) { $db->query("UPDATE thugs SET `ditem` = '". mysql_real_escape_string($_GET['name']) ."' WHERE id={$thugid}"); } echo 'You have broght the item for your thug!'; } else { echo 'WTF this is an invalid action!!'; $h->endpage(); EXIT; } $h->endpage(); ?>
-
Re: [MC-Codes][V2]Thugs (core system) oh yea add this to cron min $db->query("UPDATE users SET `thugtime` = `thugtime` - 1 WHERE `thugtime` > 0");
-
Re: [MC-Codes][V2]Thugs (core system) i done that for ease of use and edit as not all users on ce know php
-
Re: [MC-Codes][V2]Thugs (core system) make file mythugs.php <?php /* * Thug script V1.0.0 * This script was made by: DAYO * THIS IS FULLY SUPPORTED * IF YOU EDIT THIS AND NEED ANY HELP MAIL DAYO ON THE CE FORUMS / MSN: [email][email protected][/email] * YOU CAN USE THE INSTALLER TO INSTALL THE SQL NOT THE GAME VALUES */ include 'globals.php'; include 'thug-globals.php'; $action = $_GET[action]; if ($action == 'buyhideout') { if ($hideoutcost > $ir['money']) { echo 'you cant buy a hideout, you dont have enough cash!'; $h->endpage(); EXIT; } else { echo "you have broght a hideout for $"; echo $hideoutcost; $db->query("UPDATE users SET `money` = `money` - {$hideoutcost}, `hideout` = 1 WHERE userid = {$ir['userid']}"); $h->endpage(); EXIT; } } if ($ir['hideout'] == -1) { echo 'At the moment you do not have a hideout for your thugs! <a href = "mythugs.php?action=buyhideout">BUY A HIDEOUT</a> ($'; echo $hideoutcost; echo ')'; $h->endpage(); EXIT; } // this is the default page if ($action == '') { echo 'Welcome to your thug hangout! [b]<div allign = "right">Actions:</div>[/b] <a href = "mythugs.php?action=hire">Hire Thugs</a> || <a href = "mythugs.php?action=upgrade">Upgrade Thugs</a> || <a href = "mythugs.php?action=train">Train Thugs</a>'; echo ' <table width="835" border="0" cellspacing="0" cellpadding="0"> <tr> <td><div align="center">Name</div></td> <td><div align="center">Level</div></td> <td><div align="center">Attack</div></td> <td><div align="center">Defence</div></td> <td><div align="center">Attack Item</div></td> <td><div align="center">Defence Item</div> <div align="center"></div> <div align="center"></div></td> </tr>'; $query = "SELECT * FROM thugs WHERE userid={$ir['userid']}"; $rt=mysql_query($query); // query executed echo mysql_error(); // if any error is there that will be printed to the screen if ($rt) { while ($VT = mysql_fetch_array($rt)){ echo " <tr> <td>$VT[name]</td> <td>$VT[level] ($VT[exp] exp)</td> <td>$VT[attack]</td> <td>$VT[defend]</td> <td>$VT[aitme]</td> <td>$VT[ditem]</td> </tr>" ; } } else { echo " <tr> <td>N/A</td> <td>N/A</td> <td>N/A</td> <td>N/A</td> <td>N/A</td> <td>N/A</td> </tr>" ; } echo '</table>'; } else if ($action == hire) { echo '<form id="form1" name="form1" method="post" action="mythugs.php?action=hire2"> <label> [b]Name: [/b]<input type="text" name="name" id="name" /> </label> <label> <input type="submit" name="button" id="button" value=" hire thug ($'; echo $thugcost; echo ')" /> </label> </form>'; } else if ($action == hire2) { if ($ir['thugs'] >= $maxthugs) { echo 'you already have the max amount of thugs you cant have any more!'; $h->endpage(); EXIT; } if ($thugcost > $ir['money']) { echo 'you dont have enough money'; $h->endpage(); EXIT; } else { $name = htmlspecialchars($_POST[name]); $name = mysql_real_escape_string ($name); $db->query("UPDATE `users` SET `money`= `money` - {$thugcost}, `thugs` = `thugs` + 1"); $db->query("INSERT INTO thugs (name, userid) VALUES ('{$name}', '{$ir['userid']}')"); echo 'you broght a thug for $'; echo $thugcost; echo' <a href = "mythugs.php">BACK</a>'; $h->endpage(); EXIT; } } else if ($action == train) { echo 'Here you can train your thugs attack and defence stats'; echo '<form id="form1" name="form1" method="post" action="mythugs.php?action=train2"> <label> <select name="id" id="id">'; $trainingquery = "SELECT * FROM thugs WHERE userid = {$ir['userid']}"; $qw=mysql_query($trainingquery); // query executed while($TT=mysql_fetch_array($qw)){ echo '<option value="$TT[id]">'; echo $TT[name]; echo ' ('; echo $TT[level]; echo') </option>'; } echo ' </select> </label> <label> <select name="type" id="type"> <option value="attack">Train Attack</option> <option value="defend">Train Defence </option> </select> </label> <label> <input type="submit" name="button" id="button" value=" Train thug " /> </label> </form> '; } else if ($action == train2) { //checks if the user can train the thug if ($ir['thugtime'] < $thugtraintime) { echo "You can not train your thug, you can in {$ir['thugtime']} mins"; $h->endpage(); EXIT; } $thugid = mysql_real_escape_string($_POST[id]); $training = $db->query("SELECT level FROM thugs WHERE id = {$thugid}"); $mintrain = $training * 3; $maxtrain = $training * 10; $typeoftraining = mysql_real_escape_string($_POST[type]); $trainamount = mt_rand ($mintrain, $maxtrain); $db->query("UPDATE thugs SET `{$type}` = `{$type}` + `{$trainamount}` WHERE `thugid` = {$thugid}"); echo 'Your thug traied his ability to {$type} He gained {$trainamount} points'; } else if ($action == upgrade) { echo' here you can upgrade your thugs equipment'; echo '<form id="form1" name="form1" method="post" action="mythugs.php?action=upgrade2"> <label> <select name="id" id="id">'; $upgradequery = "SELECT * FROM thugs WHERE userid = {$ir['userid']}"; $rt=mysql_query($upgradequery); // query executed while($UT=mysql_fetch_array($rt)){ echo '<option value="'; echo $UT[id]; echo '">'; echo $UT[name]; echo' ('; echo $UT[level]; echo ') </option>'; } echo ' </select> </label> <label> <input type="submit" name="button" id="button" value=" Upgrade Thug " /> </label> </form> '; } else if ($action == upgrade2) { //they have selected a thug now lets select there new item $id = $_POST[id]; echo $id; $upgrade2query = "SELECT * FROM thugitems"; $rt=mysql_query($upgrade2query); // query executed while($U2T=mysql_fetch_array($rt)){ echo $U2T[name]; echo' - $'; echo $U2T[price] ; echo' ('; echo $U2T[type]; echo ' Item) <a href="mythugs.php?action=upgrade3&thugid='; echo $id; echo '&price='; echo $U2T[price]; echo '&id='; echo $U2T[id];echo '&name='; echo $U2T[name]; echo '&type='; echo $U2T[type]; echo '">BUY</a>'; } } else if ($action == upgrade3) { $item = mysql_real_escape_string($_GET[id]); $price = mysql_real_escape_string($_GET[price]); $type = mysql_real_escape_string($_GET[type]); $name = mysql_real_escape_string($_GET[name]); $thugid = mysql_real_escape_string($_GET[thugid]); $name = $db->query("SELECT name FROM thugitems WHERE id={$item}"); $price = $db->query("SELECT price FROM thugitems WHERE id={$item}"); if ($price > $ir['money']) { echo 'you dont have enough money to do this!!!'; $h->endpage(); EXIT; } $db->query("UPDATE `users` SET `money` = `money` - ". mysql_real_escape_string($_GET['price']) ." WHERE (`userid` = ". $ir['userid'] .")") or die($db->error()); if ($type == attack) { $db->query("UPDATE thugs SET `aitem` = '". mysql_real_escape_string($_GET['name']) ."' WHERE id={$thugid}"); } else if ($type == defend) { $db->query("UPDATE thugs SET `ditem` = '". mysql_real_escape_string($_GET['name']) ."' WHERE id={$thugid}"); } echo 'You have broght the item for your thug!'; } else { echo 'WTF this is an invalid action!!'; $h->endpage(); EXIT; } $h->endpage(); ?> also add on mainmenu.php a link to mythugs.php (<a href = "mythugs.php">Thugs</a> this was spose to be a paid mod but im giving it free so enjoy :D
-
Thugs havent added a mod in a while so here you go ... This mod will alow users to hire, train and upgrade there thugs. this is the core system as i will be relesing new features to this for example one will be a weekly income from your thugs as they go out and extort cash from businesses (soz my spelling isnt ne good :P). All vital values can be edited via the thug-globals.php. make a file called thugsqlinstaller.php, then run it, after that delet the file <?php include 'globals.php'; // alters user table mysql_query("ALTER TABLE `users` ADD `thugs` VARCHAR( 255 ) NOT NULL DEFAULT '0', ADD `hideout` VARCHAR( 255 ) NOT NULL DEFAULT '-1', ADD `thugtime` VARCHAR( 255 ) NOT NULL DEFAULT '5';"); //runs the main queries mysql_query("CREATE TABLE `thugitems` ( `id` int(11) unsigned NOT NULL auto_increment, `name` varchar(255) NOT NULL, `price` varchar(255) NOT NULL, `type` varchar(255) NOT NULL, `damage` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; "); mysql_query("CREATE TABLE `thugs` ( `id` int(11) unsigned NOT NULL auto_increment, `userid` varchar(255) NOT NULL, `name` varchar(255) NOT NULL, `defend` varchar(255) NOT NULL default '0', `attack` varchar(255) NOT NULL default '0', `aitem` varchar(255) NOT NULL default 'None', `ditem` varchar(255) NOT NULL default 'None', `exp` varchar(255) NOT NULL default '0', `level` varchar(255) NOT NULL default '1', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;"); echo 'Sql for thug mod installed!'; $h->endpage(); ?> Right make a file called thug-globals.php <?php /* * Thug script V1.0.0 * This script was made by: DAYO * THIS IS FULLY SUPPORTED * ONLY EDIT THE FEILDS MARKED IN THE EDIT ZONE * IF YOU EDIT THIS AND NEED ANY HELP MAIL DAYO ON THE CE FORUMS / MSN: [email][email protected][/email] * YOU CAN USE THE INSTALLER TO INSTALL THE SQL */ //////////////////////////////////////////////// // EDIT THESE VALES FOR UR GAME // //////////////////////////////////////////////// //Hideout cost - This is the cost to buy a hideout $hideoutcost = 25000; // thug cost - This is the cost to hire a thug $thugcost = 10000; // Max Thugs - This is the max amount of thugs a user can have. $maxthugs = 15; if ($ir['donatordays']) { // Time till user can train a thug (donator) - set this to a nuber like 5 so the user can only train ONE thug every 5 mins $thugtraintime = 5; } else { // Time till user can train a thug (normal user) - set this to a nuber like 5 so the user can only train ONE thug every 5 mins $thugtraintime = 10; } ?> Make file called staff_thugitems.php <?php include 'sglobals.php'; $action = $_GET[action]; if ($action == 'do') { $name=$_POST[name]; $type=$_POST[type]; $dd=$_POST[itemdd]; $price=$_POST[price]; $db->query("INSERT INTO thugitems (name, type, damage, price) VALUES ('{$name}', '{$type}', '{$dd}', '{$price}')"); echo 'Item added'; echo '<hr>'; } else { echo' <form id="form1" name="form1" method="post" action="staff_thugitems.php?action=do"> <label> Item Name <input type="text" name="name" id="name" /> Item Type </label> <label> <select name="type" id="type"> <option value="attack">Attack</option> <option value="defend">Defence</option> </select> </label> <label> Item Damage/Defence <input type="text" name="itemdd" id="itemdd" /> </label> <label></label> <label> Price <input type="text" name="price" id="price" /> </label> <label></label> <label> <input type="submit" name="button" id="button" value=" add item " /> </label> </form>'; } $h->endpage(); ?> more adding soon ...
-
Re: Yet another attack problem #1 for me. are you using a custom attck script?
-
Re: [McCodes v2] 100 Club! yea all of my mods from now on have a globals page where you can alter the values with a click of a button
-
Re: [Mccodes][V2] SMF Registration Intergration!!!!! yea just look thro the SMF register for the query they use and then edit it (just press ctrl + f and search INSERT
-
Re: [McCodes v2] 100 Club! well im gona do several mods while im at GT yarmouth this will be one of them, soz its taking so long ive been sooooo busy latley
-
Re: [Mccodes][V2] SMF Registration Intergration!!!!! i did have that working some where ive got to look throgh my HDs for it
-
Re: [Mccodes][V2] SMF Registration Intergration!!!!! when people register for your game it will automaticly register them for ur SMF forum
-
Re: hosp time safety from attack plus you can withdraw from bank while in hosp and can buy houses etc so if you are going to spend ?2,500,000 on a house smart ppl would go to hosp then buy the house
-
Can someone please explain how to do a total reset of my game?
Dayo replied to Harley's topic in Game Support
Re: Can someone please explain how to do a total reset of my game? why not just wipe userstats and user table only keeping the default settings (can be found in register.php) then the users are wiped and they get to keep donator days and items (would advise that if your game has loads of donators) also i would give the donators some cash and points (only $100,000 and 250 points) otherwise you will lose about 60% of them if you need any help i have already reset games with users -
Re: help with a chat i used that before doing anything i would say use smf forum insted of mccodes forum go here http://criminalexistence.com/ceforums/i ... ic=28082.0 do those steps then install your chat and intergrate it with smf (has a default option to)
-
Re: [mccodes V2] Free Game Template oh yea, i was at woprk and skim reading :roll:
-
Re: mccode style define good ... just search header or header.php in the search bar alsosearch layout and login
-
Re: Security of your game... what if you have a money/cryatal cap just add this in header if($ir['money'] > $mcap) { echo 'you have too much money you are only alowed ${$mcap}'; $h->endpage; EXIT; } if($ir['crystals'] > $ccap) { echo 'you have too much money you are only alowed ${$Ccap}'; $h->endpage; EXIT; } cos if you were smart you would send 6/10th of the cap to a enemy member/leader and get some 1 to send 5/10th then there leader would get feded automaticly. 2. i made a bank cap so members can only have 1-2bill 3.
-
Re: [mccode2] New echange temple nice idea, but why would some one want 2,000,000 donatyor days?
-
Re: [mccodes]mainmenu 2 help open up mainmenu.php fnd somat like if ($ir['jail']) { then find the right after that (may be 3/4 lines down ' } else { ' then move this after the ' } else { ' <a href = "explore.php"> Explore </a> soz if it dont make sence/is wrong i am at work and dont have the mainmenu.php script on me
-
Re: [mccodes V2] Free Game Template http://criminalexistence.com/ceforums/i ... ic=16667.0
-
Re: Drop Down User Bar Unfinsished THIS WONT WORK i know mccodes games that have 125,000 members, just think of loading those up ...
-
Add, Edit, Delete House Upgrades from Staff Panel
Dayo replied to Becon's topic in Free Modifications
Re: Add, Edit, Delete House Upgrades from Staff Panel simple awnser to that make it so you have to sell the house to pay for the wedding so they lose there house ... -
Re: [McCodes V2] Intimidate Witness (Donator Only) if you read it you hire heavys as in prison you get 1 call :wink:
-
Re: Layout Help whats the problem?
-
Re: [Mc Codes V2] Loanshark Mod ($7) what happens if you dont pay?