Jump to content
MakeWebGames

Search the Community

Showing results for tags 'mccode-v1'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Community
    • News and Announcements
    • Introductions
    • Feedback and Site Support
    • Collaboration Experiences
  • General Development Central
    • General
    • Game Support
    • Game Projects
    • Services
    • Web Developement
    • Art and Content
  • Game Engines
    • MCCodes
    • Generic RPG
    • Gangster Legends
    • Other Game Engines
  • Technics
    • PHP
    • MySQL, Oracle, Postgress or other DB
    • Web Design
    • Programming Tools, Software and much more
    • Other Programming
    • Linux and Webservers
    • JavaScript
  • Misc
    • General Gaming Discussion
    • Chit Chat
    • Fun & Games
    • Tech News
    • Question of the day
    • Media Entertainment (FKA Tv Shows)

Categories

  • MCCodes v2
    • Free
    • Paid
  • GRPG
  • Gangster Legends V2
    • Modules
    • Themes
  • Graphics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Location


Interests


Occupation


Website

  1. Version 1

    34 downloads

    this back ground i made last year for a game with a bunch of stuff, but thay never paid for my work so here its Need Help?: contact me here or in discord (PHPkiller#5602). Donations?: BTC: 1BxYTrbnunSBG5AmBMyobPkCByWLhAPck4 ETH: 0xD26EE454C3068132dB5ef2E27b86d0C6c138cEc9 DASH: XvUa3A52DywoLgYnTXHTw1goRWyw5T6sRn
    Free
  2. Version 1.0

    11 downloads

    this set of cards for use either blackjack or high/low ... the set contain 3 PSD (front, back, icons type), the set of cards, the fonts used ps: you can add a logo to all cards just scroll down inside the front_card.psd file and make the 2 text layers visible and edit them to your game name abrv (2 letters max), do the same in the back_card.psd file + you can add a sub text for black jack or high/low ... Need Help?: contact me here or in discord (PHPkiller#5602). Donations?: BTC: 1BxYTrbnunSBG5AmBMyobPkCByWLhAPck4 ETH: 0xD26EE454C3068132dB5ef2E27b86d0C6c138cEc9 DASH: XvUa3A52DywoLgYnTXHTw1goRWyw5T6sRn
    Free
  3. today i wanted to change the stupid html mainmenu to somthing good and easy to edit any time so the idea i got was to use multidimensional arrays for fast edit and flexibility. want to learn more? read this topic screenshot: Lets get started in my code i wanted to get flexible links so i can show them when you are in jail or hospital or donators or no mater what condition is with small edits , so in my array i added 2 key one for hospital and one for jail, and the array looks like this array( "icon" => "fas fa-home", "link" => "index.php", "title" => "Home", "class" => "", "jail" => true, "hospital" => true, ), so as you can see we have 6 keys 4 of them are for the link html code and the last 2 are our conditions true mean that the link show, and false mean the link is hidden on that condition so lest keep going the idea was so i can show 3 sections 2 are always shown and 1 for only doantors only so i made an array like this: array( "title" => "Navigation", "donator" => false, "links" => array() ), array( "title" => "Donators Only", "donator" => true, "links" => array() ), array( "title" => "Other", "donator" => false, "links" => array() ) we can see we have 3 keys , one for the name of the section, one for our condition which is donator, the last is the array of our links that we worked on them before now lets go to the loop to show our sections foreach ($navigations as $navigation){ if ($ir['donatordays']<1 and $navigation['donator'] == true){ }else{ echo '<br><h3>'.$navigation['title'].'</h3><ul>'; foreach ($navigation['links'] as $link){ if ($ir['jail'] > time() and $link['jail'] == false){} elseif ($ir['hospital'] > time() and $link['hospital'] == false){} else{ echo '<li><a class="'.$link['class'].'" href="'.$link['link'].'"><i class="'.$link['icon'].'"></i>'.$link['title'].'</a></li>'; } } echo '</ul>'; } } so we stored our multidimensional array in a variable named $navigations and we lopped it using foreach we added a condition for 'donatordays' if its true it wont show that section. inside the first foreach we added another foreach to loop our list of links using our 'links' key $navigation['links'] from the first foreach. as you can see we have 2 condition 1 for jail which is big than the current timestamp(my game use timestamp not minutes crons) while the value from the array key "jail" = false, the same thing for hospital. while we have nothing printed inside that if/else of both condition of jail/hospital so that it wont show any link when the condition is true. a full code if you get lost in the way ? $navigations = array( array( "title" => "Navigation", "donator" => false, "links" => array( array( "icon" => "fas fa-home", "link" => "index.php", "title" => "Home", "class" => "", "jail" => true, "hospital" => true, ), array( "icon" => "fas fa-home", "link" => "index.php", "title" => "hidden when in jail", "class" => "", "jail" => false, "hospital" => true, ), array( "icon" => "fas fa-home", "link" => "index.php", "title" => "hidden when in hospital", "class" => "", "jail" => true, "hospital" => false, ), array( "icon" => "fas fa-home", "link" => "index.php", "title" => "hidden for both", "class" => "", "jail" => false, "hospital" => false, ), ) ), array( "title" => "Donators Only", "donator" => true, "links" => array( array( "icon" => "fas fa-user-friends", "link" => "index.php", "title" => "Friends List", "class" => "", "jail" => true, "hospital" => true, ), ) ), array( "title" => "Other", "donator" => false, "links" => array( array( "icon" => "fas fa-power-off", "link" => "logout.php", "title" => "Logout", "class" => "logout", "jail" => true, "hospital" => true, ), ) ) ); foreach ($navigations as $navigation){ if ($ir['donatordays']<1 and $navigation['donator'] == true){ }else{ echo '<br><h3>'.$navigation['title'].'</h3><ul>'; foreach ($navigation['links'] as $link){ if ($ir['jail'] > time() and $link['jail'] == false){} elseif ($ir['hospital'] > time() and $link['hospital'] == false){} else{ echo '<li><a class="'.$link['class'].'" href="'.$link['link'].'"><i class="'.$link['icon'].'"></i>'.$link['title'].'</a></li>'; } } echo '</ul>'; } } in the end this way will make it east to add condition to each link or section with out having to make the html code more confusing by adding more if/else statments PS: this my first time writing an article in english so bear with me
  4. Hey guys, I'm sure this is pathetically easy and I feel like a real ass posting the question but I've been trying to get a gang tag to show next to the username in the header for quite awhile and just can't seem to get it. This is what I've tried, maybe someone can help me out with where i'm going wrong here. in header.php I added $tag = mysql_fetch_object(mysql_query("SELECT gangPREF FROM gangs WHERE gangID = ".$ir['gang']." "));   right after global $ir, $set;   then, I went down to <td width="25%" valign="top"> [b]Name:[/b] $gn{$u} [{$ir['userid']}] $d [b]Level:[/b] {$ir['level']} [b]Money: [/b] {$fm} [b]Points:[/b] {$crs}   and I added [{$tag}] right in front of $gn{$u}.   Is there any chance someone would be willing to help me out with where I'm going wrong here? I would greatly appreciate it!
  5. FFS i just got logged out now I gotta retype this shit! Note: MD you killin me f00l -> The message exceeds the maximum allowed length (20000 characters). itmsalegraph.php <?php require_once("gdgraph.php"); include "myconnect.php"; global $c; $gdg = new GDGraph(500,300,'',255); $_GET['ID']=abs(intval($_GET['ID'])); $test=mysql_query("SELECT price FROM itmmarketsales WHERE itmID={$_GET['ID']} ORDER BY time ASC",$c); $i=0; While ($tester=mysql_fetch_array($test)) { $pr[$i] = $tester['price']; $i=$i+1; } $arr = Array( 'Price' => Array($pr[0],$pr[1],$pr[2],$pr[3],$pr[4],$pr[5],$pr[6],$pr[7],$pr[8],$pr[9],$pr[10],$pr[11],$pr[12],$pr[13],$pr[14]) ); $colors = Array( 'Price' => Array(50,50,50,50,50,50,50,50,50,50,50,50,50,50,50) ); $thicknesses = Array( 'Price' => 8 ); //Example 1 $gdg->line_graph($arr, $colors,'','','','',$thicknesses,0,0,200); ?>   gdgraph.php (not mine but open gl) had to be deleted so I could post get it here: http://makko.com.mx/gden.php in item info page add $test=mysql_query("SELECT price,time FROM itmmarketsales WHERE itmID={$_GET['ID']} ORDER BY time DESC",$c); print"<table width=75% align=center class=content><tr style='background: gray;color:#EDE275;'><th colspan=4>[b]Looking up recent sales of {$id['itmname']}[/b]</th></tr><tr style='background: gray;color:#EDE275;'> <th>Last 15 Sale Prices</th><th>Sales Graph</th></tr>"; if (mysql_num_rows($test) < 1) {print "<tr style='background: gray;color:#EDE275;'><th colspan=2>No Recent Sales</th></tr></table>";} else {print"<tr><td valign=top><table align=center class=content width=100% valign=top><tr style='background: gray;color:#EDE275;'><th>Date</th><th>Price</th></tr>"; while ($testee=mysql_fetch_array($test)) { $date=date('F j, Y g:i a',$testee['time']); $price=money_formatter($testee['price']); print"<tr><td>$date</td><td>$price</td></tr>"; } print "</table></td><td align=center valign=top>[img=itmsalegraph.php?ID={$_GET[]</td></tr></table>";}   in item market after the money is taken from the user add mysql_query("INSERT INTO itmmarketsales VALUES ({$r['imITEM']},{$r['imPRICE']},unix_timestamp())",$c); $che=mysql_query("SELECT itmID from itmmarketsales WHERE itmID = {$r['imITEM']}",$c); If (mysql_num_rows($che) > 15) { mysql_query("Delete FROM itmmarketsales ORDER BY time ASC LIMIT 1"); }   SQL for it CREATE TABLE IF NOT EXISTS `itmmarketsales` ( `itmID` int(11) NOT NULL, `price` int(11) NOT NULL, `time` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1;   tested and working for mccode lite bastardized edition (aka my game :p). If anyone asks how to convert it for v2 they are not allowed to have it xD you can see it working on my game http://www.lostcity.cc demo / demo1 <-- for the demo account
  6. i have been searching the site for info but after hours of reading i decided to make this post. i have tried different ways but cant seem to make my cron files to work. i am only posting the minute file cause its the shortest and the code line is pretty much the same for each. any help i will be greatful for . thank you require_once(dirname(__FILE__) . "/../mysqli.php"); $cron_code = '* * * * * curl public_html/cron_minute.php?code=672bb9f5a0b168da99fbbf74980175ecd'; if ($argc == 2) { if ($argv[1] != $cron_code) { exit; } } else if (!isset($_GET['code']) || $_GET['code'] !== $cron_code) { exit; } mysqli_query("UPDATE users SET hospital=hospital-1 WHERE hospital>0", $c);
  7. Hello MWGC! I am excited about the relaunch. I am currently working on my game after some years of being away. Right now we are in a beta state and welcome all members to try out the game. I believe that the game is close to a stable stage but I can't really say so without testers. Prior to the relaunch of MWG, the game was being exposed to players who were new to grpg but some existing users. What i ask if for you to give feedback here or as a message in game with any issues or vulnerabilities so I can make sure the game is good to go for an official launch. Mobster Story was built on the free copy of grpg via git. (Link in forum). What makes MS stand out a little is the new Drug Smuggling Mod that was added at the beginning of the year. So please feel free to join up, once you reach level 5 min send me a message and I will award you a Brief Case so that you can smuggle some drugs city to city for a profit ? https://mobsterstory.com - Thanks dave, thank you members of MWG. so excited ? LOL
  8. I found this hangman script while surfing thar netZ. I did not make this mod, I am just posting it since I thought it was cool... hangman.php <?php session_start(); 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']); $cm=money_formatter($ir['sneaps'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); $Category = "Web Programming"; # list of words (phrases) to guess below, separated by new line $list = "JAVA BEANS XBOX PLAYSTATION WILL POTION CALL OF DUTY TELEVISION COMPUTER CAMERA IPOD TELEPHONE ZOMBIE LAPTOP MYSQL DATABASE LOL CRIMINAL EXISTENCE MIRC MICROSOFT KEYBOARD BIKE"; # make sure that any characters to be used in $list are in either # $alpha OR $additional_letters, but not in both. It may not work if you change fonts. # You can use either upper OR lower case of each, but not both cases of the same letter. # below ($alpha) is the alphabet letters to guess from. # you can add international (non-English) letters, in any order, such as in: # $alpha = "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝŸABCDEFGHIJKLMNOPQRSTUVWXYZ"; $alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; # below ($additional_letters) are extra characters given in words; '?' does not work # these characters are automatically filled in if in the word/phrase to guess $additional_letters = " -.,;!?%&0123456789"; #========= do not edit below here ====================================================== echo<<<endHTML <HTML> <DIV ALIGN="center"> endHTML; $len_alpha = strlen($alpha); if(isset($_GET["n"])) $n=$_GET["n"]; if(isset($_GET["letters"])) $letters=$_GET["letters"]; if(!isset($letters)) $letters=""; if(isset($PHP_SELF)) $self=$PHP_SELF; else $self=$_SERVER["PHP_SELF"]; $links=""; $max=6; # maximum number of wrong # error_reporting(0); $list = strtoupper($list); $words = explode("\n",$list); srand ((double)microtime()*1000000); $all_letters=$letters.$additional_letters; $wrong = 0; echo "[b]Hangman[/b]"; if (!isset($n)) { $n = rand(1,count($words)) - 1; } $word_line=""; $word = trim($words[$n]); $done = 1; for ($x=0; $x < strlen($word); $x++) { if (strstr($all_letters, $word[$x])) { if ($word[$x]==" ") $word_line.=" "; else $word_line.=$word[$x]; } else { $word_line.="_<font size=1> </font>"; $done = 0; } } if (!$done) { for ($c=0; $c<$len_alpha; $c++) { if (strstr($letters, $alpha[$c])) { if (strstr($words[$n], $alpha[$c])) {$links .= "\n[b]$alpha[$c][/b] "; } else { $links .= "\n<FONT color=\"red\">$alpha[$c] </font>"; $wrong++; } } else { $links .= "\n<A HREF=\"$self?letters=$alpha[$c]$letters&n=$n\">$alpha[$c]</A> "; } } $nwrong=$wrong; if ($nwrong>6) $nwrong=6; echo "\n \n<IMG SRC=\"hangman_$nwrong.gif\" ALIGN=\"MIDDLE\" BORDER=0 WIDTH=100 HEIGHT=100 ALT=\"Wrong: $wrong out of $max\">\n"; if ($wrong >= $max) { $n++; if ($n>(count($words)-1)) $n=0; echo " <H1><font size=5>\n$word_line</font></H1>\n"; echo " <FONT color=\"red\"><BIG>SORRY, YOU ARE HANGED!!!</BIG></FONT> "; if (strstr($word, " ")) $term="phrase"; else $term="word"; echo "The $term was \"[b]$word[/b]\" \n"; echo "<A HREF=$self?n=$n>Play again.</A>\n\n"; } else { echo " # Wrong Guesses Left: [b]".($max-$wrong)."[/b] \n"; echo "<H1><font size=5>\n$word_line</font></H1>\n"; echo " Choose a letter: \n"; echo "$links\n"; } } else { $n++; # get next word if ($n>(count($words)-1)) $n=0; echo " <H1><font size=5>\n$word_line</font></H1>\n"; echo " [b]Congratulations!!! You win!!![/b] \n"; echo "<A HREF=$self?n=$n>Play again</A>\n\n"; } echo<<<endHTML </DIV></BODY></HTML> endHTML; ?> FYI:As you can tell, this mod is very exploitable via the url, that is why I did not add a rewardif you won. ScreenSHAWT: Images needed: hangman_1.gif hangman_2.gif hangman_3.gif hangman_4.gif hangman_5.gif hangman_6.gif Enjoy
  9. This is just a small bit of javascript so when users buy something from the shop it works out the total cost there to save the user working it out. Also when you click on the form it removes the default value and if they don't type anything puts it back when they remove focus. NOTE: The money format function isn't mine it was free from some site. Firstly put this (you must keep the ?> <? because it is not php): ?> <script language="Javascript" type="text/javascript"> //<![CDATA[ function moneyformat(num) { num = num.toString().replace(/\$|\,/g,''); if(isNaN(num)) num = "0"; sign = (num == (num = Math.abs(num))); num = Math.floor(num*100+0.50000000001); cents = num%100; num = Math.floor(num/100).toString(); if(cents<10) cents = "0" + cents; for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++) num = num.substring(0,num.length-(4*i+3))+','+ num.substring(num.length-(4*i+3)); return (((sign)?'':'-') + '$' + num); } function tot(id,a,b) { var c=a*Math.round(b); var d=moneyformat(c); document.getElementById("res" + id).innerHTML = d; } function clearText(thefield){ if (thefield.defaultValue==thefield.value) thefield.value = "" } function returnText(thefield){ if (thefield.value=='' || thefield.value==0) thefield.value = thefield.defaultValue } //]]> </script> <? Put it after: $qtwo=mysql_query("SELECT si.*,i.*,it.* FROM shopitems si LEFT JOIN items i ON si.sitemITEMID=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE si.sitemSHOP={$_GET['shop']} ORDER BY i.itmtype ASC, i.itmbuyprice ASC, i.itmname ASC",$c) or die(mysql_error()); $lt=""; Secondly, put: $buyprice=money_formatter($r['itmbuyprice']); $sellprice=money_formatter($r['itmsellprice']); ?><tr><td><?=$r['itmname']?></td><td><?=$r['itmdesc']?></td><td><?=$buyprice?></td><td><?=$sellprice?></td><td><form action='itembuy.php?ID=<?=$r['itmid']?>' name="shopbuy" method='post'> Qty: <input type='text' name='qty' value='1' onkeyup="tot(<?=$r['itmid']?>,<?=$r['itmbuyprice']?>,this.value);" onfocus="clearText(this);" onblur="returnText(this);" /><input type='submit' value='Buy' /></form><div id="res<?=$r['itmid']?>" align="center"><?=$buyprice?></div></td></tr> <? After: while($r=mysql_fetch_array($qtwo)) { if($lt!=$r['itmtypename']) { $lt=$r['itmtypename']; print"<tr style="background: gray;"><th colspan="5">{$lt}</th></tr>"; } Which replaces: print "\n<tr><td>{$r['itmname']}</td><td>{$r['itmdesc']}</td><td>\${$r['itmbuyprice']}</td><td>\${$r['itmsellprice']}</td><td><form action='itembuy.php?ID={$r['itmid']}' method='post'>Qty: <input type='text' name='qty' value='1' /><input type='submit' value='Buy' /></form></td></tr>"; It's tested and works so any problems are likly to be yours. You can see it in action on my site, Heres a screen shot:
  10. this is only a little mod, but as i aint that good its ok i suppose, but some1 might like it and use it, this allows the gang owner to set level requirements for users wishing to join the gang see on the view gang page before they join to save them putting it in descriptions ? ok open creategang.php and find $name=htmlspecialchars($_POST['name']); $desc=htmlspecialchars($_POST['desc']); $db->query("INSERT INTO gangs VALUES('','$name','$desc','','',0,0,1000,$userid,$userid,5,0,0,'')"); and replace with $name=htmlspecialchars($_POST['name']); $desc=htmlspecialchars($_POST['desc']); $req=htmlspecialchars($_POST['req']); $db->query("INSERT INTO gangs VALUES('','$name','$desc','$req','','',0,0,1000,$userid,$userid,5,0,0,'')"); the save and close, then open yourgang.php and find case "desc": gang_staff_desc(); break; and below add case "req": gang_staff_req(); break; and the link of course below "Change Gang Requirements. " then look for function gang_staff_desc() { global $db,$ir,$c,$userid,$gangdata; if($gangdata['gangPRESIDENT'] == $userid ) { if(isset($_POST['subm'])) { $_POST['vp']=str_replace(array("<", ">", "\n"), array("<", ">", " "), $_POST['vp']); $db->query("UPDATE gangs SET gangDESC='{$_POST['vp']}' WHERE gangID={$gangdata['gangID']}"); print "Gang description changed! [url='yourgang.php?action=staff']> Back[/url]"; } else { print "Current Description: {$gangdata['gangDESC']} <form action='yourgang.php?action=staff&act2=desc' method='post'> Enter the new description. <input type='hidden' name='subm' value='submit' /> Desc: <textarea name='vp' cols='40' rows='7'></textarea> <input type='submit' value='Change' /></form>"; } } } below that add function gang_staff_req() { global $db,$ir,$c,$userid,$gangdata; if($gangdata['gangPRESIDENT'] == $userid ) { if(isset($_POST['subm'])) { $_POST['vp']=str_replace(array("<", ">", "\n"), array("<", ">", " "), $_POST['vp']); $db->query("UPDATE gangs SET gangREQ='{$_POST['vp2']}' WHERE gangID={$gangdata['gangID']}"); print "Gang Requirements changed! [url='yourgang.php?action=staff']> Back[/url]"; } else { print "Current Requirements: {$gangdata['gangREQ']} <form action='yourgang.php?action=staff&act2=req' method='post'> Enter the new requirements. <input type='hidden' name='subm' value='submit' /> <textarea name='vp2' cols='40' rows='7'></textarea> <input type='submit' value='Change' /></form>"; } } } then save that file, then open gangs.php and look for [b]Description: [/b] {$gangdata['gangDESC']} below that add Requirements: [/b] {$gangdata['gangREQ']} then save that file then import this into your phpmyadmin ALTER TABLE `gangs` ADD `gangREQ` text NOT NULL
  11. Okay, I haven't coded PHP for a while but this should work fine (-crosses fingers-) I was reading over my old posts and came across someone asking for a Gang Decline Message on my "Gang Welcome Message" mod. (http://criminalexistence.com/ceforums/i ... pic=5246.0) So here it is: Basicly, When someones application is declined, the decline message that the gang PRESIDENT edits, so enjoy! Find in yourgang.php: case "desc": gang_staff_desc(); break; add under: case "dmsg": gang_staff_dmsg(); break; then find: [url='yourgang.php?action=staff&act2=massmailer']Mass Mail Gang[/url] add after [url='yourgang.php?action=staff&act2=wmsg']Decline Message[/url] then find: event_add($appdata['appUSER'],"Your application to join the {$gangdata['gangNAME']} gang was declined",$c); replace with event_add($appdata['appUSER'],"{$gangdata['gangDMSG']}",$c); then find function gang_staff_desc() { global $ir,$c,$userid,$gangdata; if($gangdata['gangPRESIDENT'] == $userid || $userid==1) { if(isset($_POST['subm'])) { $_POST['vp']=str_replace(array("<", ">", "\n"), array("<", ">", " "), $_POST['vp']); mysql_query("UPDATE gangs SET gangDESC='{$_POST['vp']}' WHERE gangID={$gangdata['gangID']}",$c); print "Gang description changed! [url='yourgang.php?action=staff']> Back[/url]"; } else { print "Current Description: {$gangdata['gangDESC']} <form action='yourgang.php?action=staff&act2=desc' method='post'> Enter the new description. <input type='hidden' name='subm' value='submit' /> Desc: <textarea name='vp' cols='40' rows='7'></textarea> <input type='submit' value='Change' /></form>"; } } } add under: function gang_staff_dmsg() { global $ir,$c,$userid,$gangdata; if($gangdata['gangPRESIDENT'] == $userid || $userid==1) { if(isset($_POST['subm'])) { $_POST['vp']=str_replace(array("<", ">", "\n"), array("<", ">", " "), $_POST['vp']); mysql_query("UPDATE gangs SET gangDMSG='{$_POST['vp']}' WHERE gangID={$gangdata['gangID']}",$c); print "Gang Decline Message Changed! [url='yourgang.php?action=staff']> Back[/url]"; } else { print "Current Decline Message: {$gangdata['gangDMSG']} <form action='yourgang.php?action=staff&act2=dmsg' method='post'> Enter the new message. <input type='hidden' name='subm' value='submit' /> Desc: <textarea name='vp' cols='40' rows='7'></textarea> <input type='submit' value='Change' /></form>"; } } } then in creategang.php find: mysql_query("INSERT INTO gangs VALUES('','$name','$desc','','',0,0,100,$userid,$userid,5,0,0,'')",$c); and replace with: mysql_query("INSERT INTO gangs VALUES('','$name','$desc','','','','',0,0,100,$userid,$userid,5,0,0,'')",$c); Do this SQL ALTER TABLE `gangs` ADD `gangDMSG` TEXT NOT NULL AFTER `gangDESC` If you use this +1 would be great (or +1 anyway :P) as Some losers thought its cool to put -1 so I don't want anyone getting the wrong impression of me from that karma stuff Thank you, Craig (If it doesn't work I'll edit it if you can tell me whats wrong or even give me the fix but it should be fine I hope)
  12. i dont know how most people do it but this is how i do it in your brave or energy cron add $gang=mysql_query("SELECT gangID FROM gangs WHERE gangRESPECT<0"); mysql_query("UPDATE users SET gang=0 WHERE gangID=$gang",$c); mysql_query("DELETE FROM gangs WHERE gangRESPECT<0",$c); and it should run that every 5 min or so if after it run there is a gang with 0 respect it will delete it and problems post here
  13. This kind of works it makes the hospital time countdown in seconds and minutes with a piece of java... (original java script found off google can't leave credit as can't find source again) only problem is as it calls the minutes left from the database if you refresh it will round back up to last minute... ie if you have 5 minutes 30 seconds left and refresh it will go back up to 6 till minute cron changes it to 5 minutes... (can't see a way round this except for using unix time stamps for time in hossy) anyway have a go and post what you think ok for the code... open hospital.php find   {$r['hospital']} minutes   replace with...   <html> <body> <div id='{$r['userid']}'></div> <div id='notifier'></div> <script type='text/javascript'> (function () { function display( notifier, str ) { document.getElementById(notifier).innerHTML = str; } function toMinuteAndSecond( x ) { return Math.floor(x/60) + ':' + (x%60<10?'0':'')+x%60; } function setTimer( remain, actions ) { var action; (function countdown() { display('{$r['userid']}', toMinuteAndSecond(remain)); if (action = actions[remain]) { action(); } if (remain > 0) { remain -= 1; setTimeout(arguments.callee, 1000); } })(); // End countdown } setTimer({$r['hospital']}*60, { }); })(); </script> </body> </html> minutes
  14. This is my first complete mod in a VERY long time i just started making games again if you want anything added or would like to add something feel free to do so run this in phpmyadmin -- -- Table structure for table `jobs` -- CREATE TABLE IF NOT EXISTS `jobs` ( `Jid` int(11) DEFAULT NULL, `Jname` varchar(255) NOT NULL, `Jlevel` int(11) NOT NULL, `Jpay` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `jobs` -- INSERT INTO `jobs` (`Jid`, `Jname`, `Jlevel`, `Jpay`) VALUES (1, 'job 1', 1, 100), (2, 'job 2', 5, 500); you will also have to add job and jobpay int 11 into the users table make a file called jobs.php and add this code <?php session_start(); 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.*,h.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN houses h ON h.hWILL=u.maxwill WHERE u.userid=$userid", $c) or die(mysql_error()); $ir = mysql_fetch_array($is); check_level(); $fm = money_formatter($ir['money']); $cm = money_formatter($ir['crystals'], ''); $lv = date('F j, Y, g:i a', $ir['laston']); $h->userdata($ir, $lv, $fm, $cm); $h->menuarea(); $_GET['id'] = abs((int) $_GET['id']); if (!isset($_GET['work'])) { $_GET['work'] = ''; } switch ($_GET['work']){ case 'apply': apply_job(); break; case 'hired': complete_job(); break; default: job_home(); break; } function job_home(){ global $ir,$userid,$c; $sql = sprintf("SELECT * FROM jobs ORDER BY Jid"); $sqll = sprintf("SELECT * FROM jobs WHERE Jid=%d",$ir['job']); echo "<table bgcolor='#c4c4c4' width='75%'>"; if($ir['job']) { $qq = mysql_query($sqll, $c); while($rr = mysql_fetch_array($qq)){ $jp = money_formatter($rr['Jpay']); echo "<tr><th colspan='4'>You currently work at {$rr['Jname']} making $jp a day.</th></td>"; } } echo "<tr><th>Job</th><th>Level</th><th>Pay</th><th>Apply</th></tr>"; $q = mysql_query($sql, $c); while($r = mysql_fetch_array($q)){ $jjp = money_formatter($r['Jpay']); echo "<tr align='center'><td>{$r['Jname']}</td><td>{$r['Jlevel']}</td><td>$jjp</td><td>"; if($r['Jlevel']<=$ir['level']){ echo "<a href='jobs.php?work=apply&id={$r['Jid']}'>Apply</a>"; } else {} echo "</tr>"; } echo "</table>"; } function apply_job(){ global $ir,$c,$userid,$h; $sql = sprintf("SELECT * FROM jobs WHERE Jid=%d",$_GET['id']); $q = mysql_query($sql, $c); while($r = mysql_fetch_array($q)) {if(!$ir['level'] <=$r['Jlevel']){ echo "Are you sure you would like to apply at {$r['Jname']}<br/> <a href='jobs.php?work=hired&id={$_GET['id']}'>Yes</a><br/><a href='jobs.php'>No</a>"; } else { echo "Your level is to low for this job"; } } } function complete_job(){ global $ir,$c,$userid,$h; $sql = sprintf("SELECT * FROM jobs WHERE Jid=%d",$_GET['id']); $q = mysql_query($sql, $c); while($r = mysql_fetch_array($q)){ if(!$ir['level'] <=$r['Jlevel']){ mysql_query("UPDATE users SET job={$_GET['id']}, jobpay={$r['Jpay']} WHERE userid=$userid", $c); echo "You got the job at {$r['Jname']}!<br/><a href='jobs.php'><font color='grey'>~</font> Back</a>"; } else { echo "Your level is to low for this job"; } } } $h->endpage(); ?> then add this in cron_day.php $work = sprintf("UPDATE users SET money=money +jobpay", $c) OR DIE(mysql_error()); $dowork = mysql_query($work); please give me your feedback let me know what you think about it im just learning how to secure things so please give me some info on that as well thank you
  15. I posted a screenshot of my layout a few days ago.. since then i had a few people message me asking how to make bars so this is how i do mine, their probably is a easier way but this works for me First make a folder called css inside that folder create a css file call it what you want. example.css add this code to the css file you just made /* note are written next to the main things you will change to fit your game */ .headerbars { background-color: black; /* The background color of your bar */ height: 12px; /* the height of your bar */ padding: 1px; /* your bars padding i use 1 */ width: 150px; /* your bars width */ margin: 0px 10px; /* makes the bar 10 pixels from the left */ border-style:solid; border-color: white; /* the border color of your bar */ border-width:1px; } .headerbars span { display: inline-block; height: 100%; } .barcolor span { background-color: green; /* your bars fill color */ } .headfont { font-weight:bold; color:#FFFFFF; /* color of the font above your bar */ margin: 0px 10px; /* plaves the font directly above the bar with the same align */ letter-spacing:0pt; word-spacing:0pt; font-size:12px; /* the size of the font */ text-align:left; /* fonts position */ font-family:trebuchet MS, sans-serif;line-height:1; }   next open header.php find this <hr /> <b>Energy:</b> {$enperc}%<br /> <img src='images/bargreen.gif' width=$enperc height=10><img src='images/barred.gif' width=$enopp height=10><br /> <b>Will:</b> {$wiperc}%<br /> <img src='images/bargreen.gif' width=$wiperc height=10><img src='images/barred.gif' width=$wiopp height=10><br /> <b>Brave:</b> {$ir['brave']}/{$ir['maxbrave']}<br /> <img src='images/bargreen.gif' width=$brperc height=10><img src='images/barred.gif' width=$bropp height=10><br /> <b>EXP:</b> {$experc}%<br /> <img src='images/bargreen.gif' width=$experc height=10><img src='images/barred.gif' width=$exopp height=10><br /> <b>Health:</b> {$hpperc}%<br /> <img src='images/bargreen.gif' width=$hpperc height=10><img src='images/barred.gif' width=$hpopp height=10><br /><hr /> <!-- Links -->   replace it with <link href='css/example.css' type='text/css' rel='stylesheet' /> <div class='headfont'>Energy: {$enperc}%</div> <div class="headerbars barcolor"> <span style="width: $enperc%"></span> </div> <br> <div class='headfont'>Brave: {$ir['brave']}/{$ir['maxbrave']}</div> <div class="headerbars barcolor"> <span style="width: $brperc%"></span> </div> <br> <div class='headfont'>Will: {$wiperc}%</div> <div class="headerbars barcolor"> <span style="width: $wiperc%"></span> </div> <br> <div class='headfont'>Health: {$hpperc}%</div> <div class="headerbars barcolor"> <span style="width: $hpperc%"></span> </div> <br> <div class='headfont'>Experiance: {$experc}%</div> <div class="headerbars barcolor"> <span style="width: $experc%"></span> </div>   The end result will be http://puu.sh/5XuPc.png if you want different color fills for your bars in the css file you made find .barcolor span { background-color: green; /* your bars fill color */ } copy it then paste it under the } part change the .barcolor to something like .barred you will have .barcolor span { background-color: green; /* your bars fill color */ } .barred span { background-color: green; /* your bars fill color */ } finally in header.php find the part like this <div class='headfont'>Will: {$wiperc}%</div> <div class="headerbars barcolor"> <span style="width: $wiperc%"></span> </div>   then change it to this <div class='headfont'>Will: {$wiperc}%</div> <div class="headerbars barred"> /* this is the part you changed */ <span style="width: $wiperc%"></span> </div>   hope this helps you guys out with your css bars =)
  16. Bear in mind that this is basic. I have tried my best to secure it however it may require a few little edits. Enjoy! Run SQL: ALTER TABLE users ADD forum_ban INT( 11 ) NOT NULL DEFAULT 0; ALTER TABLE users ADD forum_reason VARCHAR( 255 ) NOT NULL DEFAULT 0; ALTER TABLE users ADD posts INT( 11 ) NOT NULL DEFAULT 0; CREATE TABLE `forums_posts` ( `fpID` int(11) NOT NULL auto_increment, `fpTOPIC` int(11) NOT NULL default '0', `fpUSER` int(11) NOT NULL default '0', `fpTIME` int(11) NOT NULL default '0', `fpSUBJECT` varchar(255) NOT NULL default '', `fpPOST` text NOT NULL, `fpEDIT` int(11) NOT NULL default '0', PRIMARY KEY (`fpID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; CREATE TABLE `forums_sections` ( `fsID` int(11) NOT NULL auto_increment, `fsNAME` varchar(255) NOT NULL default '', `fsDESC` varchar(255) NOT NULL default '', `fsCREATOR` int(11) NOT NULL default '0', `fsPOSTS` int(11) NOT NULL, PRIMARY KEY (`fsID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; CREATE TABLE `forums_topics` ( `ftID` int(11) NOT NULL auto_increment, `ftFORUM` int(11) NOT NULL default '0', `ftNAME` varchar(255) NOT NULL default '', `ftDESC` varchar(255) NOT NULL default '', `ftUSER` int(11) NOT NULL default '0', `ftSTATUS` enum('open','locked') NOT NULL default 'open', `ftPOSTS` int(11) NOT NULL, PRIMARY KEY (`ftID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; Create forums.php <?php session_start(); 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(); print "<font face='Arial' size='4'>Forums</font><hr width='90%'>"; if ($ir['forum_ban']) { die (" You are banned from the forums for ".number_format($ir['forum_ban'])." more days. The reason for this is {$ir['forum_reason']}. <hr width='90%'>> [url='explore.php']Back[/url]<hr width='90%'>"); } switch ($_GET['view']) { case 'topic': view_topic(); break; case 'section': view_section(); break; case 'reply': reply_forum(); break; case 'edit': edit_reply(); break; case 'editpost': edit_message(); break; case 'newtopic': create_topic(); break; case 'newsect': create_section(); break; default: forums_index(); break; } function forums_index() { global $ir,$c,$userid,$h; $sql = sprintf("SELECT * FROM `forums_sections` fs LEFT JOIN `users` u ON (u.userid = fs.fsCREATOR) ORDER BY fs.fsID DESC"); $sql = mysql_query($sql); if ($ir['user_level'] == '2') { print "[[url='forums.php?view=newsect']Create Section[/url]] "; } print "<table width='90%' cellspacing='1'><tr bgcolor='#AAAAAA'><td colspan='4'>[b]Public Forums[/b]</td></tr>"; while($r = mysql_fetch_array($sql)) { print "<tr><td width='50%'>[url='forums.php?view=section&ID={$r[']{$r['fsNAME']}[/url] [size="1"][i]{$r['fsDESC']}[/i][/size]</td> <td width='25%'>Started by [url='viewuser.php?u={$r[']{$r['username']}[/url]</td> <td width='25%'>{$r['fsPOSTS']} Topics</td></tr>"; } print "</table><hr width='90%'>"; } function view_section() { global $ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $sql = sprintf("SELECT * FROM `forums_topics` ft LEFT JOIN `users` u ON (u.userid = ft.ftUSER) LEFT JOIN `forums_sections` fs ON (fs.fsID = ft.ftFORUM) WHERE (ft.ftFORUM = %u)", $_GET['ID']); $sql = mysql_query($sql); print "[[url='forums.php?view=newtopic']Create Topic[/url]] "; print "<table width='90%' cellspacing='1'><tr bgcolor='#AAAAAA'><td colspan='3'>[b][url='forums.php']Public Forums[/url][/b]</td></tr>"; while($r = mysql_fetch_array($sql)) { print "<tr><td width='50%'>[url='forums.php?view=topic&ID={$r[']{$r['ftNAME']}[/url] [size="1"][i]{$r['ftDESC']}[/i][/size]</td> <td width='25%'>Started by [url='viewuser.php?u={$r[']{$r['username']}[/url]</td> <td width='25%'>{$r['ftPOSTS']} Posts</td></tr>"; } print "</table><hr width='90%'>"; } function view_topic() { global $ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $sql = sprintf("SELECT * FROM `forums_posts` fp LEFT JOIN `users` u ON (u.userid = fp.fpUSER) LEFT JOIN `forums_topics` ft ON (ft.ftID = fp.fpTOPIC) LEFT JOIN `forums_sections` fs ON (fs.fsID = ft.ftFORUM) WHERE (fp.fpTOPIC = %u)", $_GET['ID']); $sql = mysql_query($sql); print "<table width='90%' cellspacing='1'>"; while($r = mysql_fetch_array($sql)) { print "<tr bgcolor='#AAAAAA'><td colspan='4'>[b][url='forums.php']Public Forums[/url] >> [url='forums.php?view=section&ID={$r[']{$r['fsNAME']}[/url] >> {$r['ftNAME']}[/b]</td></tr> <tr><td width='10%' valign='top'>[url='viewuser.php?u={$r[']{$r['username']}[/url] [{$r['userid']}] Level {$r['level']} {$r['posts']} Posts </td> <td width='90%' valign='top'> [b]Subject: [/b]{$r['fpSUBJECT']} "; if ($r['fpUSER'] == $ir['userid']) { print "[[url='forums.php?view=editpost&ID={$r[']Edit[/url]]"; } print " [i]Posted at >".date('F j Y, g:i:s a',$r['fpTIME'])."[/i] <hr />{$r['fpPOST']} </td> </tr>"; } print "</table> <form action='forums.php?view=reply' method='post'> [b]Reply to this Topic:[/b] <input type='hidden' name='ID' value='{$_GET['ID']}' /> Subject <input type='text' name='subject' /> Message <textarea name='message' cols='40' rows='7'></textarea> <input type='submit' value='Reply' /></form> <hr width='90%'>"; } function create_section() { global $ir,$c,$userid,$h; if($ir['user_level'] != '2') { print " You are not permitted to access this area of the forums. <hr width='90%'>> [url='explore.php']Back[/url]<hr width='90%'>"; } else if($_POST['name'] AND $_POST['description']) { $sql = sprintf("INSERT INTO `forums_sections` (`fsID`, `fsNAME`, `fsDESC`, `fsCREATOR`, `fsPOSTS`) VALUES ('NULL','%s', '%s', '%d', '%d')", mysql_real_escape_string($_POST['name']), mysql_real_escape_string($_POST['description']), $userid, 0); mysql_query($sql); print " The {$_POST['name']} forum section was successfully created. <hr width='90%'>> [url='forums.php']Back[/url]<hr width='90%'>"; } else { print " <form action='forums.php?view=newsect' method='post'> Create Forum Section: Name <input type='text' name='name' /> Description <textarea name='description' cols='40' rows='7'></textarea> <input type='submit' value='Create' /></form> <hr width='90%'>> [url='forums.php']Back[/url]<hr width='90%'>"; } } function create_topic() { global $ir,$c,$userid,$h; if($_POST['name'] AND $_POST['description'] AND $_POST['section'] AND $_POST['subject'] AND $_POST['message']) { $_POST['section'] = abs((int) $_POST['section']); $sql = sprintf("INSERT INTO `forums_topics` (`ftID`, `ftFORUM`, `ftNAME`, `ftDESC`, `ftUSER`) VALUES ('NULL','%d', '%s', '%s', '%d')", $_POST['section'], mysql_real_escape_string($_POST['name']), mysql_real_escape_string($_POST['description']), $userid); mysql_query($sql); $i = mysql_insert_id($c); $fm = sprintf("INSERT INTO `forums_posts` (`fpID`, `fpTOPIC`, `fpSUBJECT`, `fpPOST`, `fpUSER`, `fpTIME`) VALUES ('NULL','%d', '%s', '%s', '%d', '%d')", $i, mysql_real_escape_string($_POST['subject']), mysql_real_escape_string($_POST['message']), $userid, time()); mysql_query($fm); $upd = sprintf("UPDATE `forums_sections` SET fsPOSTS = fsPOSTS + 1 WHERE (`fsID` = %u)", $_POST['section']); mysql_query($upd); print " The {$_POST['name']} forum topic was successfully created. <hr width='90%'>> [url='forums.php']Back[/url]<hr width='90%'>"; } else { print " <form action='forums.php?view=newtopic' method='post'> Create Forum Topic: Name <input type='text' name='name' /> Forum <select name='section' type='dropdown'> <option value='0'>None</option>"; $q = sprintf("SELECT * FROM `forums_sections`",$c); $q = mysql_query($q); while($r = mysql_fetch_array($q)) { print "<option value='{$r['fsID']}'>{$r['fsNAME']}</option>"; } print "</select> Description <textarea name='description' cols='40' rows='7'></textarea> [b]First Message:[/b] Subject <input type='text' name='subject' /> Message <textarea name='message' cols='40' rows='7'></textarea> <input type='submit' value='Create' /></form> <hr width='90%'>> [url='forums.php']Back[/url]<hr width='90%'>"; } } function reply_forum() { global $ir,$c,$userid,$h; if($_POST['subject'] AND $_POST['message'] AND $_POST['ID']) { $_POST['ID'] = abs((int) $_POST['ID']); $sql = sprintf("INSERT INTO `forums_posts` (`fpID`, `fpTOPIC`, `fpSUBJECT`, `fpPOST`, `fpUSER`, `fpTIME`) VALUES ('NULL','%d', '%s', '%s', '%d', '%d')", $_POST['ID'], mysql_real_escape_string($_POST['subject']), mysql_real_escape_string($_POST['message']), $userid, time()); mysql_query($sql); $upd = sprintf("UPDATE `forums_topics` SET ftPOSTS = ftPOSTS + 1 WHERE (`ftID` = %u)", $_POST['ID']); mysql_query($upd); $upda = sprintf("UPDATE `users` SET posts = posts + 1 WHERE (`userid` = %u)", $ir['userid']); mysql_query($upda); print " Your reply was successfully posted. <hr width='90%'>> [url='forums.php?view=topic&ID={$_POST[']Back[/url]<hr width='90%'>"; } else { print " You missed one or more of the required fields. Go back and try again. <hr width='90%'>> [url='forums.php']Back[/url]<hr width='90%'>"; } } function edit_message() { global $ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $sql = sprintf("SELECT * FROM `forums_posts` WHERE (fpID = %u)", $_GET['ID']); $sql = mysql_query($sql); $r = mysql_fetch_array($sql); if ($ir['userid'] != $r['fpUSER']) { print " You are not the owner of this message. <hr width='90%'>> [url='forums.php']Back[/url]<hr width='90%'>"; } else { print "<form action='forums.php?view=edit&ID={$_GET['ID']}' method='post'> [b]Edit Message:[/b] Subject <input type='text' name='subject' value='{$r['fpSUBJECT']}' /> Message <textarea name='message' cols='40' rows='7'>{$r['fpPOST']}</textarea> <input type='submit' value='Edit' /></form> <hr width='90%'>> [url='forums.php']Back[/url]<hr width='90%'>"; } } function edit_reply() { global $ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $sql = sprintf("SELECT * FROM `forums_posts` WHERE (fpID = %u)", $_GET['ID']); $sql = mysql_query($sql); $r = mysql_fetch_array($sql); if ($ir['userid'] != $r['fpUSER']) { print " You are not the owner of this message. <hr width='90%'>> [url='forums.php']Back[/url]<hr width='90%'>"; } else if($_POST['subject'] AND $_POST['message'] AND $_GET['ID']) { $edit = sprintf("UPDATE `forums_posts` SET `fpSUBJECT` = '%s', `fpPOST` = '%s' WHERE (`fpID` = %u)", mysql_escape_string($_POST['subject']), mysql_escape_string($_POST['message']), $_GET['ID']); mysql_query($edit); print " Your post was successfully edited. <hr width='90%'>> [url='forums.php?view=topic&ID={$_GET[']Back[/url]<hr width='90%'>"; } else { print " You missed one or more of the required fields. Go back and try again. <hr width='90%'>> [url='forums.php']Back[/url]<hr width='90%'>"; } } $h->endpage(); ?>
  17. this is a very simple staff to to list first make a file called todo.php inside it put <?php session_start(); require "global****.php"; if ($_SESSION['loggedin'] == 0) { header("Location: login.php"); exit; } $userid = $_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysqlinformation.php"; global $c; $is = mysql_query( "SELECT u.*,us.*,h.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN houses h ON h.hWILL=u.maxwill WHERE u.userid=$userid", $c) or die(mysql_error()); $ir = mysql_fetch_array($is); check_level(); $fm = money_formatter($ir['money']); $cm = money_formatter($ir['crystals'], ''); $lv = date('F j, Y, g:i a', $ir['laston']); $h->userdata($ir, $lv, $fm, $cm); $h->menuarea(); switch ($_GET['action']) { case 'adddo': add_to_do(); break; case 'adddosub': add_to_sub(); break; default: a_home(); break; } function a_home() { global $ir, $userid, $h; if($ir['user_level'] >1) { $sql = sprintf("SELECT n.* FROM needsdone n ORDER BY status") or die(mysql_error()); [color=#000000][color=#0000BB]mysql_real_escape_string[/color][color=#007700]([/color][color=#0000BB]$_POST[/color][color=#007700][[/color][color=#DD0000]'name'[/color][color=#007700]]) [/color][/color] echo "<table width='65%'><tr><th>List</th><th>Status</th></tr>"; $q = mysql_query($sql); while($r = mysql_fetch_array($q)) { echo "<tr align='center'><td>{$r['doname']}</td><td>"; if ($r['status'] =='Complete') { echo "<font color='green'>{$r['status']}<\font>"; } else if ($r['status'] =='Started') {echo "<font color='yellow'>{$r['status']}<\font>"; } else { echo "<font color='Red'>{$r['status']}<\font>"; } Echo "</td></tr>"; } echo "<tr><th colspan='2' align='center'><a href='todo.php?action=adddo'>Add To List</a></th></tr></table>"; } else if($ir['user_level'] ==1) {echo "WHAT ARE YOU DOING! <br/>GET OUT NOW!!!!";} } function add_to_do() { echo "<table><tr><th>Add To The To Do List<\th><\tr> <tr><td align='center'><form action='todo.php?action=adddosub' method='post'> Name: <input type='text' name='name' /><br /> Status: <select type='dropdown' name='status'> <option value='Not Started'>Not Started</option> <option value='Started'>Started</option> <option value='Complete'>Complete</option></select><br/> <input type='submit' value='Add To List' /></form>"; } function add_to_sub() { if ($_POST['name'] == "") { echo "You did not fill out the form correctly"; } else if ($_POST['status'] == "") { echo "You did not fill out the form correctly"; } else { [color=#000000][color=#0000BB]mysql_real_escape_string[/color][color=#007700]([/color][color=#0000BB]$_POST[/color][color=#007700][[/color][color=#DD0000]'name'[/color][color=#007700]]) ;[/color][/color] mysql_query("INSERT INTO needsdone VALUES ('{$_POST['name']}', '{$_POST['status']}')") or die(mysql_error()); echo "Added to the to do list!<br/><Font color='grey'>~</font> <a href='todo.php'>back</a>"; } } $h->endpage(); ?> then run this query CREATE TABLE IF NOT EXISTS `needsdone` ( `doname` varchar(255) NOT NULL, `status` enum('Complete','Started','Not Started') NOT NULL DEFAULT 'Not Started' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; INSERT INTO `needsdone` (`doname`, `status`) VALUES ('test1', 'Complete'), ('test2', 'Started'), ('test3', 'Not Started');   then put this link where ever you would like it i recommend in the staff panel <a href='todo.php'>To Do List</a> and that is it if you guys have and ideas for it let me know i will see what i can do this is the first mod i have done in a long time i havent owned a game in roughly 6 years until now
  18. Info: This mod puts a nice little player-set user description on their profile.   Needed: -Edit two files. -Execute one SQL. -Create new file.   SQL: ALTER TABLE `users` ADD `userDESC` TEXT NOT NULL ;   Create userdesc.php Paste: Save, upload. Open preferences.php Find: [php]Display Pic Change   Add underneath: Change User Description   Save, upload. Open viewuser.php Find the user query at the top. Add in `userDESC`, Scroll down to the end of the file. Above the endpage, paste: echo " Player Description"; if ($r['userDESC']) { echo" {$r['userDESC']}"; } else { echo"This player does not have a user description set."; } echo "[Report Description to staff for advertising/inappropriate behavior/etc.]";   Save, upload! Questions or errors? Please let me know!
  19. This is just something simple I threw together because a couple of my players requested it. Hope someone else can get some use out of it. What it does: Adds a link on a users profile that takes you to that users location, and redirects you back to said users profile. Still charges a fee, and blocks users from traveling to a city above their level. travelto.php <?php /*================================== Travel To User Location By Cyanide [url]http://suburban-assault.com[/url] [url]http://infintium.net[/url] This is FREE software. ===================================*/ session_start(); 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']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); if($ir['money'] < 5000) { print "<center> <font color='red'>[b]ERROR:[/b]</font> You dont have enough money travel to this location. [url='viewuser.php?u={$_GET[']> Go Back[/url]"; $h->endpage(); exit(); } $ct=mysql_query("SELECT * FROM cities WHERE cityid='{$_GET['to']}'",$c) or die(mysql_error()); $to=mysql_fetch_array($ct); if($ir['level'] < $to['cityminlevel']) { print "<center> <font color='red'>[b]ERROR:[/b]</font> You cannot yet travel to this location. [url='viewuser.php?u={$_GET[']> Go Back[/url]"; $h->endpage(); exit(); } else { mysql_query("UPDATE users SET money=money-5000, location='{$_GET['to']}' WHERE userid=$userid",$c) or die(mysql_error()); print "<center>You have paid $5,000 and traveled to {$to['cityname']}. [url='viewuser.php?u={$_GET[']> Back to Users Profile[/url]"; $h->endpage(); exit(); } ?> Add this link where ever you want on viewuser.php: [url='travelto.php?to={$r['][Travel to Location][/url] :evil: Enjoy :evil:
  20. Haven't seen many new free mods around, lately, so I thought I would share this with everyone. It's a little twist on Streets to keep your players active while sitting in the hospital. Players get 50 steps per day, only to be used while in the hospital. While exploring the halls, they have a chance at refilling their energy, getting out of the hospital, nothing happening at all, or even increasing their hospital time. Just figured this is one more little feature to keep players busy. Hope you can find some use for it. SQL: ALTER TABLE `users` ADD `hsteps` INT( 11 ) NOT NULL DEFAULT 50; hospexplore.php: <?php /****************************************/ /*********** Created By Seker ***********/ /****************************************/ session_start(); 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']); $cm = money_formatter($ir['crystals'], ''); $lv = date('F j, Y, g:i a', $ir['laston']); $h->userdata($ir, $lv, $fm, $cm); $h->menuarea(); $hsteps = $ir['hsteps']; if (!$ir['hospital']) { echo " You are not in the hospital!<br /> <a href='index.php'>[Home]</a>"; exit($h->endpage()); } if ($ir['jail']) { echo " You cannot be here while in jail!<br /> <a href='index.php'>[Home]</a>"; exit($h->endpage()); } if ($ir['energy'] < 5) { echo " You do not have enough energy to explore the hospital!<br /> <a href='crystaltemple.php'>[Refill Energy]</a>"; exit($h->endpage()); } echo " <table width='70%' border='1'> <tr> <td align='center'> <b><u>Explore The Hospital</u></b> </td> </tr> <tr> <td align='center'> Explore the hospital! You never know what you'll find! </td> </tr> <tr> <td align='center'> It will cost you 5 energy, and you get 50 chances to explore each day! </td> </tr> <tr> <td align='center'> You can earn your release, or you can end up spending even longer in the hospital, so be careful! </td> </tr> </table> <table width='70%' border='1'> <tr> <td align='center'> You currently have {$hsteps} more chances to explore! Don't waste them! </td> </tr> <tr> <td align='center'>"; if ($ir['hsteps'] > 0) { echo " <a href='hospexplore.php?action=explore'>[Explore]</a> </td> </tr> </table>"; } else { echo " You have explored enough! Try again tomorrow!<br /> <a href='hospital.php'>[back]</a> </td> </tr> </table>"; } $_GET['action'] = mysql_real_escape_string( htmlentities(stripslashes($_GET['action']), ENT_QUOTES, 'ISO-8859-1')); switch ($_GET['action']) { case 'explore': do_explore(); break; } function do_explore() { global $ir, $h, $c, $userid; if (!$ir['hospital']) { echo " You are not in the hospital!<br /> <a href='index.php'>[Home]</a>"; exit($h->endpage()); } if ($ir['jail']) { echo " You cannot be here while in jail!<br /> <a href='index.php'>[Home]</a>"; exit($h->endpage()); } if ($ir['energy'] < 5) { echo " You do not have enough energy to explore the hospital!<br /> <a href='crystaltemple.php'>[Refill Energy]</a>"; exit($h->endpage()); } $result = rand(1,5); mysql_query("UPDATE users SET energy=energy-5,hsteps=hsteps-1 WHERE userid=$userid"); if ($result = 1) { mysql_query("UPDATE users SET hospital=hospital+5 WHERE userid=$userid"); echo " The doctor ordered bedrest! Your hospital time has increased!<br /> <a href='hospexplore.php?action=explore'>[Continue Exploring]</a><br /> <a href='hospital.php'>[back]</a>"; exit($h->endpage()); } else if ($result = 3) { mysql_query("UPDATE users SET energy=maxenergy WHERE userid=$userid"); echo " You stopped at the vending machine and got a coffee. You feel re-energized!<br /> <a href='hospexplore.php?action=explore'>[Continue Exploring]</a><br /> <a href='hospital.php'>[back]</a>"; exit($h->endpage()); } else if ($result = 5) { mysql_query("UPDATE users SET hospital=0 WHERE userid=$userid"); echo " You stumbled across the back exit! Time to get out of here!<br /> <a href='index.php'>[Home]</a>"; exit($h->endpage()); } else { echo " This hospital is huge! You haven't found anything, yet!<br /> <a href='hospexplore.php?action=explore'>[Continue Exploring]</a><br /> <a href='hospital.php'>[back]</a>"; exit($h->endpage()); } } $h->endpage(); Add to cron_day: mysql_query("UPDATE users SET hsteps=50"); Add somewhere in your hospital or wherever you want it: <a href='hospexplore.php'>Explore The Halls</a> Screenshot: [ATTACH=CONFIG]499[/ATTACH]
  21. I found this cool js code which will give you fireworks for your website could be useful for 4th july for american players just open up globals.php and on very last line add this code ?> <script type="text/javascript"> // <![CDATA[ var bits=80; // how many bits var speed=33; // how fast - smaller is faster var bangs=5; // how many can be launched simultaneously (note that using too many can slow the script down) var colours=new Array("#03f", "#f03", "#0e0", "#93f", "#0cf", "#f93", "#f0c"); // blue red green purple cyan orange pink /**************************** * Fireworks Effect * *(c)2004-14 mf2fm web-design* * http://www.mf2fm.com/rv * * DON'T EDIT BELOW THIS BOX * ****************************/ var bangheight=new Array(); var intensity=new Array(); var colour=new Array(); var Xpos=new Array(); var Ypos=new Array(); var dX=new Array(); var dY=new Array(); var stars=new Array(); var decay=new Array(); var swide=800; var shigh=600; var boddie; if (typeof('addRVLoadEvent')!='function') function addRVLoadEvent(funky) { var oldonload=window.onload; if (typeof(oldonload)!='function') window.onload=funky; else window.onload=function() { if (oldonload) oldonload(); funky(); } } addRVLoadEvent(light_blue_touchpaper); function light_blue_touchpaper() { if (document.getElementById) { var i; boddie=document.createElement("div"); boddie.style.position="fixed"; boddie.style.top="0px"; boddie.style.left="0px"; boddie.style.overflow="visible"; boddie.style.width="1px"; boddie.style.height="1px"; boddie.style.backgroundColor="transparent"; document.body.appendChild(boddie); set_width(); for (i=0; i<bangs; i++) { write_fire(i); launch(i); setInterval('stepthrough('+i+')', speed); } }} function write_fire(N) { var i, rlef, rdow; stars[N+'r']=createDiv('|', 12); boddie.appendChild(stars[N+'r']); for (i=bits*N; i<bits+bits*N; i++) { stars[i]=createDiv('*', 13); boddie.appendChild(stars[i]); } } function createDiv(char, size) { var div=document.createElement("div"); div.style.font=size+"px monospace"; div.style.position="absolute"; div.style.backgroundColor="transparent"; div.appendChild(document.createTextNode(char)); return (div); } function launch(N) { colour[N]=Math.floor(Math.random()*colours.length); Xpos[N+"r"]=swide*0.5; Ypos[N+"r"]=shigh-5; bangheight[N]=Math.round((0.5+Math.random())*shigh*0.4); dX[N+"r"]=(Math.random()-0.5)*swide/bangheight[N]; if (dX[N+"r"]>1.25) stars[N+"r"].firstChild.nodeValue="/"; else if (dX[N+"r"]<-1.25) stars[N+"r"].firstChild.nodeValue="\\"; else stars[N+"r"].firstChild.nodeValue="|"; stars[N+"r"].style.color=colours[colour[N]]; } function bang(N) { var i, Z, A=0; for (i=bits*N; i<bits+bits*N; i++) { Z=stars[i].style; Z.left=Xpos[i]+"px"; Z.top=Ypos[i]+"px"; if (decay[i]) decay[i]--; else A++; if (decay[i]==15) Z.fontSize="7px"; else if (decay[i]==7) Z.fontSize="2px"; else if (decay[i]==1) Z.visibility="hidden"; if (decay[i]>1 && Math.random()<.1) { Z.visibility="hidden"; setTimeout('stars['+i+'].style.visibility="visible"', speed-1); } Xpos[i]+=dX[i]; Ypos[i]+=(dY[i]+=1.25/intensity[N]); } if (A!=bits) setTimeout("bang("+N+")", speed); } function stepthrough(N) { var i, M, Z; var oldx=Xpos[N+"r"]; var oldy=Ypos[N+"r"]; Xpos[N+"r"]+=dX[N+"r"]; Ypos[N+"r"]-=4; if (Ypos[N+"r"]<bangheight[N]) { M=Math.floor(Math.random()*3*colours.length); intensity[N]=5+Math.random()*4; for (i=N*bits; i<bits+bits*N; i++) { Xpos[i]=Xpos[N+"r"]; Ypos[i]=Ypos[N+"r"]; dY[i]=(Math.random()-0.5)*intensity[N]; dX[i]=(Math.random()-0.5)*(intensity[N]-Math.abs(dY[i]))*1.25; decay[i]=16+Math.floor(Math.random()*16); Z=stars[i]; if (M<colours.length) Z.style.color=colours[i%2?colour[N]:M]; else if (M<2*colours.length) Z.style.color=colours[colour[N]]; else Z.style.color=colours[i%colours.length]; Z.style.fontSize="13px"; Z.style.visibility="visible"; } bang(N); launch(N); } stars[N+"r"].style.left=oldx+"px"; stars[N+"r"].style.top=oldy+"px"; } window.onresize=set_width; function set_width() { var sw_min=999999; var sh_min=999999; if (document.documentElement && document.documentElement.clientWidth) { if (document.documentElement.clientWidth>0) sw_min=document.documentElement.clientWidth; if (document.documentElement.clientHeight>0) sh_min=document.documentElement.clientHeight; } if (typeof(self.innerWidth)!="undefined" && self.innerWidth) { if (self.innerWidth>0 && self.innerWidth<sw_min) sw_min=self.innerWidth; if (self.innerHeight>0 && self.innerHeight<sh_min) sh_min=self.innerHeight; } if (document.body.clientWidth) { if (document.body.clientWidth>0 && document.body.clientWidth<sw_min) sw_min=document.body.clientWidth; if (document.body.clientHeight>0 && document.body.clientHeight<sh_min) sh_min=document.body.clientHeight; } if (sw_min==999999 || sh_min==999999) { sw_min=800; sh_min=600; } swide=sw_min; shigh=sh_min; } // ]]> </script> that’s it enjoy :)
  22. Here you go. Enjoy. Nothing impressive but sure beats paying $20 for it. Two variables at the top can be used to set a minimum bet and a max games amount. CREATE TABLE `chance` ( `logID` int( 20 ) NOT NULL AUTO_INCREMENT , `userID` int( 11 ) NOT NULL default '0', `amount` int( 11 ) NOT NULL default '0', `active` tinyint( 1 ) NOT NULL default '0', PRIMARY KEY ( `logID` ) ) ENGINE = MYISAM DEFAULT CHARSET = latin1; chance.php -Version 2.0- <?php include "globals.php"; $minbet=100; $maxg=10; echo "<big>50 / 50 Chance Game</big> "; function add_game() { global $ir,$c,$userid, $db, $minbet, $maxg; if(!isset($_POST['amt'])) { echo "<big>Adding a game</big> <form action='chance.php?add=1' method='post'> Amount $<input type='text' name='amt' size=10 maxlength=10> <input type='submit' value='Add!'></form> ($maxg games max per user) [url='chance.php']Back[/url]"; } else { $_POST['amt'] = abs((int) $_POST['amt']); if($_POST['amt'] < $minbet){echo "The minimum bet is $minbet [url='chance.php?add=1']Back[/url]";exit;} $checkcount=$db->query("SELECT logID FROM chance WHERE userID={$ir['userid']} and active=1"); if($db->num_rows($checkcount) > ($maxg-1)){echo "There is a maximum of $maxg games per user. [url='chance.php']Back[/url]";exit;} if($ir['money'] < $_POST['amt']){echo "You cannot afford that amount. [url='chance.php']Back[/url]";exit;} $db->query("UPDATE users SET money = money - {$_POST['amt']} WHERE userid = {$ir['userid']}"); $ir['money']=$ir['money'] - $_POST['amt']; $db->query("INSERT INTO chance VALUES ('', {$ir['userid']}, {$_POST['amt']}, 1)"); echo "Your game has been set. Good Luck. [url='chance.php']Back[/url]"; } } function view_games() { global $ir,$c,$userid, $db, $maxg; $q=$db->query("SELECT c.*, u.username FROM chance c left join users u on u.userid = c.userID WHERE c.active = 1 ORDER BY c.logID ASC"); echo "[url='chance.php?add=1']Add Game[/url] Table of users awaiting a challenge <table class='table' width=50%><tr><th>Game ID</th><th>User</th><th>Amount</th><th>Challenge</th><th>Cancel</th></tr>"; if($db->num_rows($q) < 1){echo "<tr><td colspan=5>There are currenly no challenges</td></tr>";} while($r=$db->fetch_row($q)) { echo "<tr><td>{$r['logID']}</td><td>[url='viewuser.php?u={$r[']{$r['username']}[/url] [{$r['userID']}]</td><td>".money_formatter($r['amount'])."</td><td>[url='chance.php?chal={$r[']Challenge[/url]</td><td>"; if($ir['userid']==$r['userID']){echo "[url='chance.php?cancel={$r[']Cancel[/url]";} echo "</td></tr>"; } echo "</table>"; } function dogame() { global $ir,$c,$userid, $db; $_GET['chal'] = abs((int) $_GET['chal']); $q=$db->query("SELECT c.*, u.username from chance c LEFT JOIN users u ON c.userID = u.userid Where c.logID={$_GET['chal']} AND c.active = 1 LIMIT 1"); if($db->num_rows($q) > 0) { $r=$db->fetch_row($q); if($ir['money'] < $r['amount']){echo "You cannot afford the challenge amount. [url='chance.php']Back[/url]";exit;} if($ir['userid'] == $r['userID']){echo "You cannot accept your own challenge. [url='chance.php']Back[/url]";exit;} if(rand(1,2) == 1) { $winner=$r['userID']; $loser=$ir['userid']; $winnername=$r['username']; $losername=$ir['username']; $tstring="Sorry, you Lost. Better luck next time. [url='chance.php']Back[/url]"; $db->query("UPDATE users SET money = money - {$r['amount']} WHERE userid={$ir['userid']}"); $db->query("UPDATE users SET money = money + ({$r['amount']} * 2) WHERE userid={$r['userID']}"); } else { $winner=$ir['userid']; $loser=$r['userID']; $winnername=$ir['username']; $losername=$r['username']; $tstring="You Won! Congratulations! You Won ".money_formatter($r['amount'])." [url='chance.php']Back[/url]"; $db->query("UPDATE users SET money = money + {$r['amount']} WHERE userid={$ir['userid']}"); } event_add($winner, "The game of ".money_formatter($r['amount'])." challenged by [url='viewuser.php?u={$r[']{$r['username']}[/url] was won by [url='viewuser.php?u={$winner}']{$winnername}[/url].", $c); event_add($loser, "The game of ".money_formatter($r['amount'])." challenged by [url='viewuser.php?u={$r[']{$r['username']}[/url] was won by [url='viewuser.php?u={$winner}']{$winnername}[/url].", $c); $db->query("UPDATE chance SET active = 0 WHERE logID={$_GET['chal']}"); echo $tstring; } else { echo "This game has either been cancelled or someone played before you got the chance. [url='chance.php']Back[/url]"; exit; } } function cancel() { global $ir,$c,$userid, $db; $_GET['cancel'] = abs((int) $_GET['cancel']); $q=$db->query("SELECT * from chance where logID={$_GET['cancel']} AND active = 1"); if($db->num_rows($q) > 0) { $r=$db->fetch_row($q); $db->query("UPDATE users SET money = money + {$r['amount']} WHERE userid = {$ir['userid']}"); $ir['money']=$ir['money'] + $r['amount']; $db->query("UPDATE chance SET active = -1 WHERE logID = {$_GET['cancel']}"); echo "The game has been cancelled, and your money has been returned. [url='chance.php']Back[/url]"; } else { echo "This game has already been canceled, does not exist, or someone already played. [url='chance.php']Back[/url]"; } } if(isset($_GET['cancel'])){cancel();} elseif(isset($_GET['chal'])){dogame();} elseif(isset($_GET['add'])){add_game();} else{view_games();} ?>   chance.php -Version 1.0- <?php /*----------------------------------------------------- -- 50/50 Chance (Free Source) -- Copyright held 2007-2008 UCC -- chance.php -----------------------------------------------------*/ session_start(); 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']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); $minbet=100; $maxg=10; echo "<big>50 / 50 Chance Game</big> "; function add_game() { global $ir,$c,$userid, $minbet, $maxg; if(!isset($_POST['amt'])) { echo "<big>Adding a game</big> <form action='chance.php?add=1' method='post'> Amount $<input type='text' name='amt' size=10 maxlength=10> <input type='submit' value='Add!'></form> ($maxg games max per user) [url='chance.php']Back[/url]"; } else { $_POST['amt'] = abs((int) $_POST['amt']); if($_POST['amt'] < $minbet){echo "The minimum bet is $minbet [url='chance.php?add=1']Back[/url]";exit;} $checkcount=mysql_query("SELECT logID FROM chance WHERE userID={$ir['userid']} and active=1"); if(mysql_num_rows($checkcount) > ($maxg-1)){echo "There is a maximum of $maxg games per user. [url='chance.php']Back[/url]";exit;} if($ir['money'] < $_POST['amt']){echo "You cannot afford that amount. [url='chance.php']Back[/url]";exit;} mysql_query("UPDATE users SET money = money - {$_POST['amt']} WHERE userid = {$ir['userid']}"); $ir['money']=$ir['money'] - $_POST['amt']; mysql_query("INSERT INTO chance VALUES ('', {$ir['userid']}, {$_POST['amt']}, 1)"); echo "Your game has been set. Good Luck. [url='chance.php']Back[/url]"; } } function view_games() { global $ir,$c,$userid, $maxg; $q=mysql_query("SELECT c.*, u.username FROM chance c left join users u on u.userid = c.userID WHERE c.active = 1 ORDER BY c.logID ASC"); echo "[url='chance.php?add=1']Add Game[/url] Table of users awaiting a challenge <table class='table' width=50%><tr><th>Game ID</th><th>User</th><th>Amount</th><th>Challenge</th><th>Cancel</th></tr>"; if(mysql_num_rows($q) < 1){echo "<tr><td colspan=5>There are currenly no challenges</td></tr>";} while($r=mysql_fetch_array($q)) { echo "<tr><td>{$r['logID']}</td><td>[url='viewuser.php?u={$r[']{$r['username']}[/url] [{$r['userID']}]</td><td>".money_formatter($r['amount'])."</td><td>[url='chance.php?chal={$r[']Challenge[/url]</td><td>"; if($ir['userid']==$r['userID']){echo "[url='chance.php?cancel={$r[']Cancel[/url]";} echo "</td></tr>"; } echo "</table>"; } function dogame() { global $ir,$c,$userid; $_GET['chal'] = abs((int) $_GET['chal']); $q=mysql_query("SELECT c.*, u.username from chance c LEFT JOIN users u ON c.userID = u.userid Where c.logID={$_GET['chal']} AND c.active = 1 LIMIT 1"); if(mysql_num_rows($q) > 0) { $r=mysql_fetch_array($q); if($ir['money'] < $r['amount']){echo "You cannot afford the challenge amount. [url='chance.php']Back[/url]";exit;} if($ir['userid'] == $r['userID']){echo "You cannot accept your own challenge. [url='chance.php']Back[/url]";exit;} if(rand(1,2) == 1) { $winner=$r['userID']; $loser=$ir['userid']; $winnername=$r['username']; $losername=$ir['username']; $tstring="Sorry, you Lost. Better luck next time. [url='chance.php']Back[/url]"; mysql_query("UPDATE users SET money = money - {$r['amount']} WHERE userid={$ir['userid']}"); mysql_query("UPDATE users SET money = money + ({$r['amount']} * 2) WHERE userid={$r['userID']}"); } else { $winner=$ir['userid']; $loser=$r['userID']; $winnername=$ir['username']; $losername=$r['username']; $tstring="You Won! Congratulations! You Won ".money_formatter($r['amount'])." [url='chance.php']Back[/url]"; mysql_query("UPDATE users SET money = money + {$r['amount']} WHERE userid={$ir['userid']}"); } event_add($winner, "The game of ".money_formatter($r['amount'])." challenged by [url='viewuser.php?u={$r[']{$r['username']}[/url] was won by [url='viewuser.php?u={$winner}']{$winnername}[/url].", $c); event_add($loser, "The game of ".money_formatter($r['amount'])." challenged by [url='viewuser.php?u={$r[']{$r['username']}[/url] was won by [url='viewuser.php?u={$winner}']{$winnername}[/url].", $c); mysql_query("UPDATE chance SET active = 0 WHERE logID={$_GET['chal']}"); echo $tstring; } else { echo "This game has either been cancelled or someone played before you got the chance. [url='chance.php']Back[/url]"; exit; } } function cancel() { global $ir,$c,$userid; $_GET['cancel'] = abs((int) $_GET['cancel']); $q=mysql_query("SELECT * from chance where logID={$_GET['cancel']} AND active = 1"); if(mysql_num_rows($q) > 0) { $r=mysql_fetch_array($q); mysql_query("UPDATE users SET money = money + {$r['amount']} WHERE userid = {$ir['userid']}"); $ir['money']=$ir['money'] + $r['amount']; mysql_query("UPDATE chance SET active = -1 WHERE logID = {$_GET['cancel']}"); echo "The game has been cancelled, and your money has been returned. [url='chance.php']Back[/url]"; } else { echo "This game has already been canceled, does not exist, or someone already played. [url='chance.php']Back[/url]"; } } if(isset($_GET['cancel'])){cancel();} elseif(isset($_GET['chal'])){dogame();} elseif(isset($_GET['add'])){add_game();} else{view_games();} ?>
  23. Ok, I know I posted this in Mod Requests after The Corpse requested it, but seeing as it's free, I thought I add it here too, so people will actually make use of it instead of it being hidden halfway through another topic. This mod gives a user a starter pack when they begin the game. It credits the user with money, donatordays, vip days or whatever you guys have in your game. It's easy to modify, and there's instructions in the file to help you. For V1 Find in explore.php print "[b]You begin exploring the area you're in, you see a bit that interests you.[/b] } Add under it if ($ir['donatorpack'] == 0) { print" <form action=starterkit.php><input type='submit' value='Claim your free Starter Kit now!'></form>"; } For V2 Find in explore.php if($ir['jail'] or $ir['hospital']) { die("This page cannot be accessed while in jail or hospital."); } Add under it if ($ir['donatorpack'] == 0) { print" <form action=starterkit.php><input type='submit' value='Claim your free Starter Kit now!'></form>"; } UPDATED(Ability to give out an item too!) For Both V1 and V2 (Made compatible) Then create a file called starterkit.php <?php /*----------------------------------------------------- -- Made by Akash for CE users -- Free Gift -- Mail [email][email protected][/email] if you need help or converting -----------------------------------------------------*/ if (file_exists('globals.php')) { require('. /globals.php'); } else { session_start(); 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(); } if ($ir['donatorpack']== 0) { print "Welcome to {$set['game_name']}, we hope you enjoy your stay and here is a complimentary pack from us to get you started."; //This is the writing they will get after clicking on the button in explore.php $sql = sprintf(" UPDATE `users` SET `money` = `money` + '%d', `crystals` = `crystals` + '%d', `donatordays` = `donatordays` + '%d', `vip` = `vip` + '%d', `donatorpack` = '%d' WHERE (`userid` = %u)", 10000, 100, 5, 5, 1, $userid); $db->query($sql); //Edit any of these to credit whatever you want e.g. instead of points, it may be crystals. Please DO NOT change the donatorpack=1 as this is part of the mod. Changing it may result in users claiming more than one pack. $itmid = 1; //This is the item ID, whatever item you want it to add, just type in the ID here. If you want a random item then replace $itmid = 1; with itmid=rand(1,100), with the numbers being whatever you want. mysql_query("INSERT INTO inventory VALUES('',$itmid,$userid,1)",$c); print" "; //You do not need to change anything here, unless you want more than one of the item to be given. In this case, just edit the 1 at the end to the quantity. event_add($userid,"You were given a complimentary starter kit to begin you off. We hope you enjoy your stay at {$set['game_name']} and please mail [url='viewuser.php?u=1'][b]<font color=red>Owner Name[/b]</font>[/url] for any help you need.",$c); //This is the event they will receive once they have been credited. Edit the Owner Name to the owner's name and if needed, the writing in the event. } else { die("You have already claimed your starter kit!"); //This simply ensures that the user does not claim more than one pack. } $h->endpage(); ?> EDIT:I just made the mod V1 and V2 compatible, all you need to do is change the $db->query into mysql_query AND: {$set['game_name']} into Your Game Name Then add the following sql ALTER TABLE `users` ADD `donatorpack` INT(11) NOT NULL DEFAULT '0'; And there it is, you're done :mrgreen: P.S If you would like to remove this feature after a few days in the game, the best way is just to empty the starterkit.php and remove the line from explore.php. However, if you want it done quickly, just use a query in phpMyAdmin that sets the field donatorpack in the users table to one. This will just make sure if anyone goes onto the starter pack file, that they will not get a pack, but just get a message saying you have got the pack already. Hope you like it, and please feel free to contact me on [email protected] for converting. Also, any bugs you may find, which I doubt, as it's been tested, just post them here. A final thing, if anyone can make this slightly more secure, then just post your version here. Thanks
  24. This is a advanced criminal record. Works like a charm and is very useful. :) 1) Execute Query CREATE TABLE `criminalrecord` ( `crime` INT( 11 ) NOT NULL auto_increment, `user` INT( 11 ) NOT NULL, `succeeded` INT( 11 ) NOT NULL, PRIMARY KEY (`crime`) ) TYPE=MYISAM ; 2) Create file "criminalrecord.php" <?php /*** oxidati0n's CRIMINAL RECORD FREE @ CRIMINALEXISTENCE ***/ session_start(); 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']); $cm=money_formatter($ir['crystals']); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); print "Criminal Record [url='criminal.php']Crimes[/url] "; $q=mysql_query("SELECT * FROM crimes ORDER BY crimeNAME DESC",$c); print "</pre> <table width="90%" border="1">Crime NameSucceededFailedTotalYou have no crimes logged ".$r['crimeNAME']." ".mysql_num_rows($q2)." [size="1"]$perc1%[/size] ".mysql_num_rows($q3)." $perc2% ".$RES." </table>";<br>$h->endpage();<br>?&g 3) replace docrime.php with this <?php //oxidati0n's criminal record mod. session_start(); 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(); $_GET['c']=abs((int) $_GET['c']); if(!$_GET['c']) { print "Invalid crime"; } else { $q=mysql_query("SELECT * FROM crimes WHERE crimeID={$_GET['c']}",$c); $r=mysql_fetch_array($q); if($ir['brave'] < $r['crimeBRAVE']) { print "You do not have enough Brave to perform this crime."; } else { $ec="\$sucrate=".str_replace(array("LEVEL","EXP","WILL","IQ"), array($ir['level'], $ir['exp'], $ir['will'], $ir['IQ']),$r['crimePERCFORM']).";"; eval($ec); print $r['crimeITEXT']; $ir['brave']-=$r['crimeBRAVE']; mysql_query("UPDATE users SET brave={$ir['brave']} WHERE userid=$userid",$c); if(rand(1,100) <= $sucrate) { print "".str_replace("{money}",$r['crimeSUCCESSMUNY'],$r['crimeSTEXT']).""; $ir['money']+=$r['crimeSUCCESSMUNY']; $ir['exp']+=$r['crimeEXP']; mysql_query("UPDATE users SET money={$ir['money']},exp={$ir['exp']} WHERE userid=$userid",$c); $succ=1; } else { print "".$r['crimeFTEXT'].""; $succ="0"; } print " [url='criminal.php']>Crimes[/url]"; } mysql_query("INSERT INTO `criminalrecord` (`crime`, `user`, `succeeded`) VALUES ('$_GET[c]', '$userid', '$succ');",$c); } $h->endpage(); ?> 4) open criminal.php and find where it says print "Crimes"; add below print "[url='criminalrecord.php']Criminal Record[/url] ";   There you go, your done! :) Works 100% Guaranteed!
  25. I need a little help with the please. It isn't crediting users the state nor taking the Honor Award off them. Can someone please have a look at this for me. <?php session_start(); require_once "globals.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; include_once "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']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); if(!$_GET['spend']) { print "Welcome to the Honor Award Exchange Center!<br /> You have <b>{$ir['honor']}</b> Honor Awards.<br /> What would you like to spend your Honor Awards on?<br /> <br /> <a href='HonorExchange.php?spend=IQ'>IQ - 100 IQ per Honor Award</a><br /> <a href='HonorExchange.php?spend=labour3'>Trade for Labour Points - 3,000 Labour Points per Honor Award</a><br /> <a href='HonorExchange.php?spend=guard3'>Trade for Defense - 3,000 Defense per Honor Award</a><br /> <a href='HonorExchange.php?spend=agility3'>Trade for Agility - 3,000 Speed per Honor Award</a><br /> <a href='HonorExchange.php?spend=strength3'>Trade for Strength - 3,000 strength per Honor Award</a><br /> <a href='HonorExchange.php?spend=money'>Money - \$2,000,000 per Honor Award</a><br />"; } else if($_GET['spend'] == 'IQ') { print "Type in the amount of Honor Awards you want to swap for IQ.<br /> You have <b>{$ir['honor']}</b> Honor Awards.<br /> One Honor Award = 100 IQ.<form action='HonorExchange.php?spend=IQ2' method='post'><input type='text' name='honor' /><br /><input type='submit' value='Swap' /></form>"; } else if($_GET['spend'] == 'IQ2') { $_POST['honor']=(int) $_POST['honor']; if($_POST['honor'] <= 0 || $_POST['honor'] > $ir['honor']) { print "Error, you either do not have enough Honor Awards or did not fill out the form.<br /> <a href='HonorExchange.php?spend=IQ'>Back</a>"; } else { $iqgain=$_POST['honor']*100; $_POST['honor']=strip_tags($_POST['honor']); $_POST['honor']=mny_stripfmt($_POST['honor']); $_POST['honor']=abs((int)($_POST['honor'])); mysql_query("UPDATE users SET honor=honor-{$_POST['honor']} WHERE userid=$userid",$c); mysql_query("UPDATE userstats SET IQ=IQ+$iqgain WHERE userid=$userid",$c); print "You traded {$_POST['honor']} Honor Awards for $iqgain IQ."; } } else if($_GET['spend'] == 'labour3') { print "Type in the amount of Honor Awards you want to swap for labour points.<br /> You have <b>{$ir['honor']}</b> Honor Awards.<br /> One Honor Award = 300,000 labour points.<form action='HonorExchange.php?spend=labour4' method='post'><input type='text' name='honor' /><br /><input type='submit' value='Swap' /></form>"; } else if($_GET['spend'] == 'labour4') { $_POST['honor']=(int) $_POST['honor']; if($_POST['honor'] <= 0 || $_POST['honor'] > $ir['honor']) { print "Error, you either do not have enough Honor Awards or did not fill out the form.<br /> <a href='HonorExchange.php?spend=labour3'>Back</a>"; } else { $labourgain=$_POST['honor']*3000; $_POST['honor']=strip_tags($_POST['honor']); $_POST['honor']=mny_stripfmt($_POST['honor'], ENT_QUOTES); $_POST['honor']=abs((int)($_POST['honor'])); mysql_query("UPDATE users SET honor=honor-{$_POST['honor']} WHERE userid=$userid",$c); mysql_query("UPDATE userstats SET labour=labour+$labourgain WHERE userid=$userid",$c); print "You traded {$_POST['honor']} Honor Awards for $labourgain labour points."; } } else if($_GET['spend'] == 'guard3') { print "Type in the amount of Honor Awards you want to swap for Defense.<br /> You have <b>{$ir['honor']}</b> Honor Awards.<br /> One Honor Award = 3,000 Defense.<form action='HonorExchange.php?spend=guard4' method='post'><input type='text' name='honor' /><br /><input type='submit' value='Swap' /></form>"; } else if($_GET['spend'] == 'guard4') { $_POST['honor']=(int) $_POST['honor']; $_POST['honor']=strip_tags($_POST['honor']); $_POST['honor']=mny_stripfmt($_POST['honor'], ENT_QUOTES); $_POST['honor']=abs((int)($_POST['honor'])); if($_POST['honor'] <= 0 || $_POST['honor'] > $ir['honor']) { print "Error, you either do not have enough Honor Awards or did not fill out the form.<br /> <a href='HonorExchange.php?spend=guard3'>Back</a>"; } else { $guardgain=$_POST['honor']*3000; $_POST['honor']=strip_tags($_POST['honor']); $_POST['honor']=mny_stripfmt($_POST['honor'], ENT_QUOTES); $_POST['honor']=abs((int)($_POST['honor'])); mysql_query("UPDATE users SET honor=honor-{$_POST['honor']} WHERE userid=$userid",$c); mysql_query("UPDATE userstats SET guard=guard+$guardgain WHERE userid=$userid",$c); print "You traded {$_POST['honor']} Honor Awards for $guardgain Defense."; } } else if($_GET['spend'] == 'agility3') { print "Type in the amount of Honor Awards you want to swap for Agility.<br /> You have <b>{$ir['honor']}</b> Honor Awards.<br /> One Honor Award = 3,000 Agility.<form action='HonorExchange.php?spend=agility4' method='post'><input type='text' name='honor' /><br /><input type='submit' value='Swap' /></form>"; } else if($_GET['spend'] == 'agility4') { $_POST['honor']=(int) $_POST['honor']; if($_POST['honor'] <= 0 || $_POST['honor'] > $ir['honor']) { print "Error, you either do not have enough Honor Awards or did not fill out the form.<br /> <a href='HonorExchange.php?spend=agility3'>Back</a>"; } else { $agilitygain=$_POST['honor']*3000; $_POST['honor']=strip_tags($_POST['honor']); $_POST['honor']=mny_stripfmt($_POST['honor'], ENT_QUOTES); $_POST['honor']=abs((int)($_POST['honor'])); mysql_query("UPDATE users SET honor=honor-{$_POST['honor']} WHERE userid=$userid",$c); mysql_query("UPDATE userstats SET agility=agility+$agilitygain WHERE userid=$userid",$c); print "You traded {$_POST['honor']} Honor Awards for $agilitygain Agility."; } } else if($_GET['spend'] == 'strength3') { print "Type in the amount of Honor Awards you want to swap for Strength.<br /> You have <b>{$ir['honor']}</b> Honor Awards.<br /> One Honor Award = 3,000 Strength.<form action='HonorExchange.php?spend=strength4' method='post'><input type='text' name='honor' /><br /><input type='submit' value='Swap' /></form>"; } else if($_GET['spend'] == 'strength4') { $_POST['honor']=(int) $_POST['honor']; if($_POST['honor'] <= 0 || $_POST['honor'] > $ir['honor']) { print "Error, you either do not have enough Honor Awards or did not fill out the form.<br /> <a href='HonorExchange.php?spend=strength3'>Back</a>"; } else { $strengthgain=$_POST['honor']*3000; $_POST['honor']=strip_tags($_POST['honor']); $_POST['honor']=mny_stripfmt($_POST['honor'], ENT_QUOTES); $_POST['honor']=abs((int)($_POST['honor'])); mysql_query("UPDATE users SET honor=honor-{$_POST['honor']} WHERE userid=$userid",$c); mysql_query("UPDATE userstats SET strength=strength+$strengthgain WHERE userid=$userid",$c); print "You traded {$_POST['honor']} Honor Awards for $strengthgain Strength."; } } else if($_GET['spend'] == 'money') { print "Type in the amount of Honor Awards you want to swap for \$\$\$.<br /> You have <b>{$ir['honor']}</b> Honor Awards.<br /> One Honor Award = \$2,000,000.<form action='HonorExchange.php?spend=money2' method='post'><input type='text' name='honor' /><br /><input type='submit' value='Swap' /></form>"; } else if($_GET['spend'] == 'money2') { $_POST['honor']=(int) $_POST['honor']; if($_POST['honor'] <= 0 || $_POST['honor'] > $ir['honor']) { print "Error, you either do not have enough Honor Awards or did not fill out the form.<br /> <a href='HonorExchange.php?spend=money'>Back</a>"; } else { $iqgain=$_POST['honor']*2000000; $_POST['honor']=strip_tags($_POST['honor']); $_POST['honor']=mny_stripfmt($_POST['honor'], ENT_QUOTES); $_POST['honor']=abs((int)($_POST['honor'])); $_POST['money']=strip_tags($_POST['money']); $_POST['money']=mny_stripfmt($_POST['money'], ENT_QUOTES); $_POST['money']=abs($_POST['money']); mysql_query("UPDATE users SET honor=honor-{$_POST['honor']},money=money+$iqgain WHERE userid=$userid",$c); print "You traded {$_POST['honor']} Honor Awards for \$$iqgain."; } } $h->endpage(); ?>
×
×
  • Create New...