-
Posts
2,491 -
Joined
-
Last visited
-
Days Won
196
Content Type
Profiles
Forums
Events
Everything posted by Dayo
-
Re: [McCodes][v2] Event Layout Mod yea ive thort about it b4 its just geting my self motivated enough to do it :P
-
Re: [McCodes][v2] Event Layout Mod yea would be easy but not reli needed
-
Re: [mccodes][V2]changable currency mod yea that looks good i would do that but CBA :P off topic no offence but y havent you got a better template? if i were to register i would take 1 look and close the window it looks so unatractive
-
Re: [mccodes][V2]changable currency mod im making an admin CP for this so you dont have to manualy add diffrent currencys and change there conversion plus im gona do it so if you travel from one country to the other it will automaticly change it so if you were in england it would be GBP then if you went to china it would be YEN good idea or not cos im not gona do it if no 1 would use
-
Re: [MC-Codes][V2]Thugs (core system) you could add somat to cron day like mysql_query("UPDATE users SET thugmoneyclaim = 1"); then add somat like this to mythugs.php after if($action==''){ if($ir['thugmoneyclaim']) { echo 'Gather money for today'; then add this before the last '} else {' at the bottom of the page else if ($action==collect){ if($ir['thugmoneyclaim']) { $rand= mt_rand(100,750); $money = $ir['thugs']*$rand; $db->query("UPDATE users SET money =money+$money WHERE userid = userid) } else {echo'you have already gathred your money today!';} } btw i just done this on my ipod so it may not work
-
Re: hour_cron.php HELP!!! you have two $db->query("UPDATE gangs SET gangCHOURS=gangCHOURS-1 WHERE gangCRIME>0",$c); queries delet one of them (to finf press ctrl + F
-
Re: [mccodes][V2]changable currency mod meh cant be botthred to do it atm im atm work
-
Re: [mccodes][V2]changable currency mod i did only use one function ... also about security all this does is turn a string into another string so 100 looks like $100
-
Currency Mod havent posted in a while here you go this mod will replace the current money_formatter in the global functions file along with 2 sql edits and a few php edits this will allow your members to have diffrent currencys these are USD, GBP, YEN, EURO PLUS they have the current conversion rate so if you had usd and changed to yen you money wouldent be 100 it would be 9800. :D all you do is go throgh your scripts and money format any HTML values of money e.g. echo' buy gun for $500 and attacke with it'; would be echo' buy gun for '.money_formatter(500).' and attacke with it'; REMOVE THE $ that 500 will become the currency you have plus the conversion rate too :D DO NOT ALTER ANY FILES UNLESS YOU HAVE BACKED THEM UP YOU COULD ALSO BACK UP YOUR DB BUT NOT NESASARY AS THERE IS VERY LITTLE SQL IN THIS MOD Run SQLs ALTER TABLE `users` ADD `cur` VARCHAR( 5 ) NOT NULL UPDATE `users` SET `cur`='USD' OPEN prefrences.php FIND [url='preferences.php?action=forumchange']Forum Info Change[/url] add after [url='preferences.php?action=curchange']Change Currency[/url] FIND case 'sexchange2': do_sex_change(); break; ADD AFTER case 'curchange': curchange1(); break; case 'curchange2': curchange2(); break; FIND $h->endpage(); ?> Add before function curchange1(){ echo 'you can change your currency here for an exchange rate of '.money_formatter(7500).'! <form id="form1" name="form1" method="post" action="preferences.php?action=curchange2"> <label> <select name="select" id="select"> <option value="GBP">Great British Pound</option> <option value="USD">United States Dollar</option> <option value="EUR">Euro</option> <option value="YEN">Yen</option> </select> </label> <label> <input type="submit" value=" Exchange ('.money_formatter(7500).') " /> </label> </form>'; } function curchange2(){ global $db, $ir,$c,$userid,$h; if ($ir['money'] >= 7500) { $cur=$_POST['select']; echo 'your currancy has been changed'; $db->query("UPDATE users SET cur = '{$cur}', `money` = `money`-7500 WHERE userid={$ir['userid']}"); } else { echo 'you dont have enough money!'; } } OPEN global-functions.php FIND function money_formatter($muny,$symb='$') { return $symb.number_format($muny); } replace with function money_formatter($money) { global $ir; /* +---------------+ | NOTES - READ! | +---------------+ when adding this function to your game moneyformat every single price in your game eg if you have shops, jail break etc... just find the html text and wrap moneyformatter(); around it use '. and .' or ". and." depending on what the echo/print is using DO NOT DO IT ON THE MYSQL_QUERY FUNCTIONS or with IF/ELSE ONLY DO THIS TO HTML TEXT!! this si so if you have 1 usd and you wanted to spend it and your currency was yen it would take away 98 usd from your bank/hand!! please note DONT DO THIS if you are a beginer at php it can possably f**k up yur game if done wrongly too add currencys add the shorted version eg USD and the symbol $ so it would be like this 'USD'=>'$', then add the conversion rate PLEASE note i have done the currencys throgh xe.com (12.JUNE.2009) compared to the USD also dont forget to add <option value='currency shortned values eg USD'>'currency name'</option> to the change currancy file if you want me to install this onto your site i charge $1.00 USD per page i edit i also chage $1.00USD to add new currancys */ $cur=$ir['cur']; $set = array ( "USD" => '$', "GBP" => '£', "YEN" => '¥', "EUR" => '€' ); $converter = array( 'USD'=>'1', 'EUR'=>'0.715416', 'YEN'=>'98.1855', 'GBP'=>'0.609824' ); $money=$money*$converter[$cur]; $money=number_format($money); $cash= $set[$cur].$money; return $cash; } when adding this function to your game moneyformat every single price in your game eg if you have shops, jail break etc... just find the html text and wrap moneyformatter(); around it use '. and .' or ". and." depending on what the echo/print is using DO NOT DO IT ON THE MYSQL_QUERY FUNCTIONS or with IF/ELSE ONLY DO THIS TO HTML TEXT!! this si so if you have 1 usd and you wanted to spend it and your currency was yen it would take away 98 usd from your bank/hand!! please note DONT DO THIS if you are a beginer at php it can possably f**k up yur game if done wrongly too add currencys add the shorted version eg USD and the symbol $ so it would be like this 'USD'=>'$', then add the conversion rate PLEASE note i have done the currencys throgh xe.com (12.JUNE.2009) compared to the USD also dont forget to add <option value='currency shortned values eg USD'>'currency name'</option> to the change currancy file if you want me to install this onto your site i charge $1.00 USD per page i edit i also chage $1.00USD to add new currancys enjoy, Dayo ps sorry about the spelling most of this was done on my ipod so forgive me :D
-
Re: [mccodes V2] Nuclear Bomb $chance= 25000; // you get a 1 in 25000 chance of sucsess change the '25000' to what you like $info= ;// put the info about the bomb here $random=mt_rand(1, $chance) if ($random==1){ echo 'You see a US naval cargo ship docked up in your local port, you sneek on to it and shoot the guards as they sip on there herbal tea you look throgh the ships cargo finaly you find a bomb and walk off with it into the night.<a href ='.$SERVER[php_SELF].'?action=info>info</a>'; mysql_query("UPDATE users SET `bomb`=`bomb`+1 WHERE userid={$ir['userid']}"); } if($action==info) { echo' <script>alert("'.$info.'");</script>'; } Wools looking thro that I forgot to add the "echo" :p still untested as I'm on my iPod and can't save a php file yet:( (me 1 know of one? :p)
-
Re: [MCCODES v2] Attack restriction What do u mean? you have np clue
-
Re: [mccodes V2] Nuclear Bomb insted of a cron use somthing like this: $chance= 25000; // you get a 1 in 25000 chance of sucsess change the '25000' to what you like $info= ;// put the info about the bomb here $random=mt_rand(1, $chance) if ($random==1){ echo 'You see a US naval cargo ship docked up in your local port, you sneek on to it and shoot the guards as they sip on there herbal tea you look throgh the ships cargo finaly you find a bomb and walk off with it into the night.<a href ='.$SERVER[php_SELF].'?action=info>info</a>'; mysql_query("UPDATE users SET `bomb`=`bomb`+1 WHERE userid={$ir['userid']}"); } if($action==info) { <script>alert("'.$info.'");</script> } add that to header NOT TESTED!!!
-
Re: [MCCODES v2] Attack restriction add this $lvlcheck=$ir['level]-$r['level']; if ($lvlcheck >=4) { echo 'your level is too high to attack this person!'; $h->endpage(); EXIT;} put that after while($r=mysql_fetch_array($mw)) { may work not sure
-
Re: [V2] Email Admin - OutofGameEmail you dont need the tags before the <?php include 'globals.php'; plus the </body> </html> if it is to be embeded into the mccodes game if not there would be a spam issue also i would do a anti spam so let them email once a day so add somat like if ($ir['sentemail']>0) {echo 'you can only email once a day';} then add mysql_query("UPDATE users SET sentemail=1"); because on games i know they would be geting 100s of emails a day
-
Re: [MC-Codes][V2]Thugs (core system) yes im adding a way to get money from it soon its just ive been so busy wit a level exams it would be very easy to add stuff ur self
-
Re: Attack It wouldent be hard to edit it to allow all the stats I'll add them in it when I get a chancelatee on tomorow
-
Re: Attack http://criminalexistence.com/ceforums/i ... ic=27479.0 there is a 1 click attack
-
Re: Template god that google thing is soo old now, you didnt even give the right search content best bet for your template look throgh the paid modifiations, if im not busy ill do ya one
-
Re: [mccode] Simple user rating system v2 also if you dont want them to rate every day you can do it so they rate once every hour/five mins or even min
-
Re: [mccode] Simple user rating system v2 Replace Ratings: [url='rating.php?ID={$r['][img=thumbsup.gif][/url] [b]{$r['goodratings']}[/b] up, [url='rating.php?ID={$r['][img=thumbsdown.gif][/url][b]{$r['badratings']}[/b] down With $ratingtot=$r['goodratings'] - $r['badratings']; Ratings: [url='rating.php?ID={$r['][img=thumbsup.gif][/url] [b]'; if ($ratingtot >=0) {echo '<font color="green">';echo $ratingtot; echo '</font>';} else {echo '<font color="red">';echo $ratingtot; echo '</font>';} echo ' [/b][url='rating.php?ID={$r['] [img=thumbsdown.gif][/url]
-
Re: [McCodes][v2] Staff Menu Mod (1st Mod ive made) ill see what i can do for ya
-
Re: [MC-Codes][V2]Thugs (core system) pets?????
-
Re: [MC-Codes][V2]Thugs (core system) yea i was gona add a thug v thug attack system (thats why the level and stats and items r there) could be possable to hosp the user that lost
-
Re: [MC-Codes][V2]Thugs (core system) thanx
-
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(); ?>