Jump to content

Search the Community

Showing results for tags 'grpg-v1'.



More search options

  • 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

Found 56 results

  1. Version 1

    21 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.5

    With this heists module installed on your grpg game your users will be able to set up organised crimes based on what you create. ** Features ** Option to set up a heist. Option to invite members to the heist (no limit). Chat box for users to chat to each other in heist while they wait for leader to complete it. Option for heist leader to disband heist. Players have the option to leave the heist once joined. Option to complete the heist. *** Heist info *** Every user contributes there own power to the heist which is needed in order for the heist to be successful otherwise you will be going to jail. If you have a heist that requires 4 people and you have more than 4 people in your heist the money is deducted.

    $7.50

  3. -Gang Vault Mod For Generic RPG- Make a file gangpoints.php and add this:   <? /*Mod made by SlandDesign This is a Free Mod, Do not sell this! Any Errors contact me: mr_l_glover(AT)live(DOT)co(DOT)UK */ include 'header.php'; if ($user_class->gang != 0) { $gang_class = New Gang($user_class->gang); if($_POST['deposit'] != ""){ $amount = abs(intval($_POST['damount'])); if ($amount > $user_class->points) { echo Message("You do not have that many points."); } if ($amount < 1){ echo Message("Please enter a valid amount."); } if ($amount <= $user_class->points && $amount > 0) { echo Message("points deposited."); $newvault2 = $amount + $gang_class->vault2; $newpoints = $user_class->points - $amount; $result = mysql_query("UPDATE `grpgusers` SET `points` = '".$newpoints."' WHERE `id`='".$_SESSION['id']."'"); $result = mysql_query("UPDATE `gangs` SET `vault2` = '".$newvault2."' WHERE `id`='".$gang_class->id."'"); $user_class = new User($_SESSION['id']); $gang_class = New Gang($user_class->gang); } } if($_POST['withdraw'] != "" && $gang_class->leader == $user_class->username){ $amount = abs(intval($_POST['wamount'])); if ($amount > $gang_class->vault2) { echo Message("You do not have that much points in the vault."); } if ($amount < 1){ echo Message("Please enter a valid amount."); } if ($amount <= $gang_class->vault2 && $amount > 0) { echo Message("points withdrawn."); $newvault2 = $gang_class->vault2 - $amount; $newpoints = $user_class->points + $amount; $result = mysql_query("UPDATE `grpgusers` SET `points` = '".$newpoints."' WHERE `id`='".$_SESSION['id']."'"); $result = mysql_query("UPDATE `gangs` SET `vault2` = '".$newvault2."' WHERE `id`='".$gang_class->id."'"); $user_class = new User($_SESSION[' ']); $gang_class = New Gang($user_class->gang); } } echo "<tr><td class='contenthead'>[".$gang_class->tag."]".$gang_class->name." vault</td></tr><tr><td class='contentcontent'>"; ?> Welcome to the gang vault. There is currently <? echo $gang_class->vault2 ?> in the gang Points vault. <? if ($gang_class->leader == $user_class->username){ ?> <form method='post'><input type='text' name='wamount' value='<? echo $gang_class->vault2 ?>' size='10' maxlength='20'> <input type='submit' name='withdraw' value='Withdraw'></form> <? } ?> <form method='post'><input type='text' name='damount' value='<? echo $user_class->points ?>' size='10' maxlength='20'> <input type='submit' name='deposit' value='Deposit'></form> </td></tr> <? echo "<td><tr>"; } else { echo Message("You aren't in a gang."); } include 'footer.php'; ?> Save and close. Open gang.php and find: <td width='20%' align='center'>[url='gangvault.php']Vault[/url]</td>   Add under this: <td width='20%' align='center'>[url='gangpoints.php']Points Vault[/url]</td> Save and close. Open classes.php and find: $this->level = Get_The_Level($this->exp);   Add under: $this->vault2 = $worked['vault2'];   Save and close. Run this SQL: ALTER TABLE `gangs` ADD `vault2` BIGINT( 25 ) NOT NULL DEFAULT 0;   All done...If I've missed something please point it out =]
  4. [ATTACH=CONFIG]1343[/ATTACH]   It's free so no complaining :)    
  5. ags_cs4

    Set of Cards

    Version 1.0

    8 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

  6. Hi im looking to sell my game https://crime-city.co.uk Its built with the grpg v1 engine but converted to PDO::(V?), it has a brand new stunning design and layout along with tons of new mods, also includes some personal mods that i have built. I have been working on this site for a while now, its fully responsive, comes with cloudflare protection, ingame floating chat module, page speed and Yslow scored are all 95% and above. im just looking to sell up and move onto a new project, not looking for a large amount, offers welcome. Contact me on discord Mugzy#2559 or on MWG? have a great day! NOTE: could only add a few images so please feel free to enter the site and take a look
  7. I present to you: manageable permission-based staff ranks In the old system, they're hard-coded in. Any time you want to give a player/staff member access to something new, you must edit the code. In my new system, you simply edit their Staff Rank in the staff panel and access is granted/denied based on exactly what you want. Screenshots of how this works are available further down in another post (due to original site death). All it uses is 1 SQL table, an addition to the (grpg)users table, and a self-caching function to check staff permissions. I'm open to offers and comes with full installation, custom to your design
  8. Run this SQL through your database: [mysql] ALTER TABLE `grpgusers` ADD `vote` INT( 11 ) NOT NULL DEFAULT '1' [/mysql] Now open up classes.php and paste in the page: $this->vote = $worked['vote'];   now save and close now crate a new file call vote.php and copy the following codes and paste and save the page: <?php include 'header.php'; if ($_GET['spend'] == "energy"){ if($user_class->vote > 0) { $newvote = $user_class->vote - 1; $result = mysql_query("UPDATE `grpgusers` SET `vote` = '".$user_class->maxenergy."', `vote`='".$newvote."' WHERE `id`='".$_SESSION['id']."'"); echo Message("You spent a vote and refilled your energy."); } else { echo Message("You don't have enough vote, silly buns."); } } ?> <tr><td class="contenthead">Vote Shop</td></tr> <tr><td class="contentcontent"> Welcome to the Vote Shop, here you can spend your Vote on various things.</td></tr> <tr><td class="contentcontent"> <table> <tr> <td>[url='vote.php?spend=energy']Vote Energy[/url]</td> <td> - 1 Vote</td> </tr> </table> </td></tr> <?php include 'footer.php'; ?>
  9. This mod is a very simple mod that just shows the user what they have achieved. There is currently no rewards on this mod at the time being. milestones.php <?php //Made by 21lockdown //This wont damage or affect the code //Please don't remove it include "header.php"; $level = ($user_class->level >= 5); $level2 = ($user_class->level >= 10); $level3 = ($user_class->level >= 20); $level4 = ($user_class->level >= 50); $level5 = ($user_class->level >= 100); $crimetotal = ($user_class->crimetotal >= 10); $crimetotal2 = ($user_class->crimetotal >= 50); $crimetotal3 = ($user_class->crimetotal >= 500); $crimetotal4 = ($user_class->crimetotal >= 10000); $crimewon = ($user_class->crimesucceeded >= 10); $crimewon2 = ($user_class->crimesucceeded >= 50); $crimewon3 = ($user_class->crimesucceeded >= 500); $crimewon4 = ($user_class->crimesucceeded >= 5000); $crimewon5 = ($user_class->crimesucceeded >= 1000); $rm = ($user_class->rmdays >= 1); $strength = ($user_class->strength >= 1000); $strength2 = ($user_class->strength >= 50000); $strength3 = ($user_class->strength >= 1000000); ?> Here you can view your past milestones you have achieved <table class='topbar'> <tr> <td> <?php if($level){ echo "[img=/icons/accept.png] You have reached level 5"; } else { echo"[img=/icons/lock.png] Reach level 5 to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($level2){ echo "[img=/icons/accept.png] You have reached level 10"; } else { echo"[img=/icons/lock.png] Reach level 10 to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($level3){ echo "[img=/icons/accept.png] You have reached level 20"; } else { echo"[img=/icons/lock.png] Reach level 20 to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($level4){ echo "[img=/icons/accept.png] You have reached level 50"; } else { echo"[img=/icons/lock.png] Reach level 50 to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($level5){ echo "[img=/icons/accept.png] You have reached level 100"; } else { echo"[img=/icons/lock.png] Reach level 100 to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($crimetotal){ echo "[img=/icons/accept.png] You have done 10 crimes"; } else { echo"[img=/icons/lock.png] Do 10 crimes to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($crimetotal2){ echo "[img=/icons/accept.png] You have done 50 crimes"; } else { echo"[img=/icons/lock.png] Do 50 crimes to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($crimetotal3){ echo "[img=/icons/accept.png] You have done 500 crimes"; } else { echo"[img=/icons/lock.png] Do 500 crimes to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($crimetotal4){ echo "[img=/icons/accept.png] You have done 10000 crimes"; } else { echo"[img=/icons/lock.png] Do 10000 crimes to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($crimewon){ echo "[img=/icons/accept.png] You have completed 10 crimes successfully!"; } else { echo"[img=/icons/lock.png] Successfully complete 10 crimes to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($crimewon2){ echo "[img=/icons/accept.png] You have completed 50 crimes successfully!"; } else { echo"[img=/icons/lock.png] Successfully complete 50 crimes to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($crimewon3){ echo "[img=/icons/accept.png] You have completed 500 crimes successfully!"; } else { echo"[img=/icons/lock.png] Successfully complete 500 crimes to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($crimewon4){ echo "[img=/icons/accept.png] You have completed 5000 crimes successfully!"; } else { echo"[img=/icons/lock.png] Successfully complete 5000 crimes to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($crimewon5){ echo "[img=/icons/accept.png] You have completed 10000 crimes successfully!"; } else { echo"[img=/icons/lock.png] Successfully complete 10000 crimes to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($rm){ echo "[img=/icons/accept.png] You are an respected mobster!"; } else { echo"[img=/icons/lock.png] Become an respected mobster!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($strength){ echo "[img=/icons/accept.png] You have 1000 strength!"; } else { echo"[img=/icons/lock.png] Get 1000 strength!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($strength2){ echo "[img=/icons/accept.png] You have 50000 strength!"; } else { echo"[img=/icons/lock.png] Get 50000 strength!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($strength3){ echo "[img=/icons/accept.png] You have 1000000 strength!"; } else { echo"[img=/icons/lock.png] Get 1000000 strength!"; } ?> </td> </tr> </table> <?php include "footer.php"; ?>   You can download icons here and upload them to /icons/   Screenshot
  10. Hello, Here I have attached a new GitHub repo for the orginal gRPG. This version is free, but is not actively developed by myself or @Magictallguy. The script is not secure and use old deprecated MySQL functions, it also has a lot of bugs within the script. Any issues with the script please raise them on GitHub or if you want to fix the bug and submit this back on GitHub that would be much appreciated gRPG Repo
  11. I have not released anything free for a while so coded up this super simple lucky dip i noticed grpg doesn't have it and cant see it been released for free yet so here it is. SQL ALTER TABLE `grpgusers` ADD `lucky` int(2) NOT NULL default 1 open up classes.php and add this to the users class $this->lucky = $worked['lucky']; lucky.php <?php /* Module Name: Lucky Dip * Module Version: v1.00 * Module Price: $0.00 * Module Support: [email protected] */ include(__DIR__.'/header.php'); if(isset($_POST['tryluck'])) { if($user_class->money < 10000) echo Message('You don\'t have enough money to buy a lucky dip.'); else if($user_class->lucky == 0) echo Message('You have already done your lucky dip today.'); $money = mt_rand(0,20000); $points = mt_rand(0,5); $special = mt_rand(1,350); $newm = $user_class->money + $money; $newp = $user_class->points + $points; if($user_class->money >= 10000 && $user_class->lucky > 0) { if($special == 10) { $money = mt_rand(0,20000); $points = mt_rand(0,5); $money = $money * 2; $points = $points * 2; $newm = $user_class->money + $money; $newp = $user_class->points + $points; mysql_query("UPDATE `grpgusers` SET `money` = `money` - 10000 WHERE `id` = '$user_class->id'"); echo Message('Woa your really lucky today and doubled your gain.<br /> You gained '.$points.' points and $'.number_format($money).''); mysql_query("UPDATE `grpgusers` SET `money` = '$newm',`points` = '$newp',`lucky` = 0 WHERE `id` = '$user_class->id'"); } else { echo Message('You gained '.$points.' points and $'.number_format($money)); mysql_query("UPDATE `grpgusers` SET `money` = '$newm',`points` = '$newp',`lucky` = 0 WHERE `id` = '$user_class->id'"); mysql_query("UPDATE `grpgusers` SET `money` = `money` - '10000' WHERE `id` = '$user_class->id'"); } } } ?> <tr><td class="contenthead">Lucky Dip</td></tr> <tr><td class="contentcontent"> <i>So are you feeling lucky?? well for $10.000 you can take a shot at the luck dip.</i><br /> <i>You can win up to x2 the ticket prize and if your super lucky you can double that but only if your really lucky.</i><br /> </td></tr> <tr><td class="contentcontent"> <form method="post"> <input type="submit" name="tryluck" value="Try My Luck" /> </form> </td></tr>
  12. Same as Mccodes dice game, changed to work with GRPG. <?php include(DIRNAME(__FILE__) ."/header.php"); $maxbet = $user_class->level*500; $amount = (isset($_GET['bet'])) ? abs((int) $_GET['bet']) : ""; if (isset($_GET['bet'])) { if($amount > $user_class->money) { echo Message("You're trying to bet more than you have."); } elseif($amount > $maxbet) { echo Message("You have gone over the max allowed bet for your level ($".prettynum($maxbet).")."); } else { $slot[1] = abs((int) rand(1,6)); $slot[2] = abs((int) rand(1,6)); $slot[3] = abs((int) rand(1,6)); $slot[4] = abs((int) rand(1,6)); if($slot[1]==$slot[2] && $slot[2]==$slot[3] && $slot[3]==$slot[4]) { $won = $amount*12; $gain = $amount*11; mysql_query("UPDATE `grpgusers` SET `money` = `money` + ".$gain." WHERE `id` = '".$user_class->id."'"); echo Message("You took the dice and rolled them.<br /> You see the numbers: <strong>".$slot[1]." ".$slot[2]." ".$slot[3]." ".$slot[4]."</strong><br /> Your bet was: <strong>$".prettynum($amount)."</strong><br /> You won $".prettynum($won)." by rolling 4 numbers.<br /> After taking your bet you made $".prettynum($gain)." extra."); } else if (($slot[1] == $slot[2] && $slot[2] == $slot[3]) || ($slot[1] == $slot[3] && $slot[3] == $slot[4]) || ($slot[2] == $slot[3] && $slot[3] == $slot[4]) || ($slot[1] == $slot[2] && $slot[2] == $slot[4])) { $won=$amount*5; $gain=$amount*4; mysql_query("UPDATE `grpgusers` SET `money` = `money` + ".$gain." WHERE `id` = '".$user_class->id."'"); echo Message("You took the dice and rolled them.<br /> You see the numbers: <strong>".$slot[1]." ".$slot[2]." ".$slot[3]." ".$slot[4]."</strong><br /> Your bet was: <strong>$".prettynum($amount)."</strong><br /> You won $".prettynum($won)." by rolling 3 numbers.<br /> After taking your bet you made $".prettynum($gain)." extra."); } else { mysql_query("UPDATE `grpgusers` SET `money` = `money` - ".$amount." WHERE `id` = '".$user_class->id."'"); echo Message("Better luck next time. You just lost $".prettynum($amount)."!"); } } } ?> <tr> <td class="contenthead">Dice Game - Make a bet!</td> </tr> <tr> <td class="contentcontent"> Ready to try your luck? Play today!<br /> The max bet for your level is $<?php echo prettynum($maxbet); ?>.<br /> <form action='dice.php' method='get'> Bet: $<input type='text' name='bet' value='500' onkeyup="this.value=this.value.replace(/\D/g,'')" /><br /> <input type='submit' value='Roll!!' /> </form> </td></tr> <?php include(DIRNAME(__FILE__) ."/footer.php"); ?>
  13. Hi guys, This is a pretty basic hitlist that I have coded just to show my coding a little, took me around 2 hours to complete in total and I have tested the majority a little and it all seems to work from what I gather but I have not fully tested so their might be a little issue in there or two. Features: The ability to list a user for someone to do a hit on. The ability to give a prize to whoever does your hit. The ability to attack someone and complete the hit and get the prize. Installation Step One: Insert these SQL's into phpmyadmin: CREATE TABLE IF NOT EXISTS `hitlist` ( `id` INT(11) primary key auto_increment, `target` INT(11) default '0', `placed` INT(11) default '0', `reason` text, `prize` INT(11) default '0' ); Step Two: create a file called hitlist.php and paste the code in below: <?php include_once (__DIR__.'/header.php'); if($_POST['place'] != "") { $target = (array_key_exists('id', $_POST) && ctype_digit($_POST['id'])) ? $_POST['id'] : false; $reason = mysql_real_escape_string($_POST['reason']); $prize = (array_key_exists('prize', $_POST) && ctype_digit($_POST['prize'])) ? $_POST['prize'] : false; if(empty($target) || empty($reason) || empty($prize)) { echo Message("You must enter something into all fields."); } elseif($user_class->id == $target) { echo Message("You can not place a hit on yourself."); } elseif($user_class->money < $prize) { echo Message("You do not have the funds to place this hit"); } else { mysql_query("INSERT INTO `hitlist` (`id`, `target`, `reason`, `prize`, `placed`) VALUES ('', '$target', '$reason', '$prize', '".$user_class->id."')"); mysql_query("UPDATE `grpgusers` SET `money` = `money` - '$prize' WHERE `id` = ".$user_class->id.""); echo Message("You placed a hit on this user!"); } } if($_GET['action'] == "addlisting") { ?> <tr> <td class='contenthead' align='center' colspan='5'>Place A Hit</td> </tr> <tr> <td class='contentcontent' align='center' colspan='5'> <form method='POST'> Target User ID: <input type='text' name='id' placeholder='Target User ID' /><br /> Reason: <input type='text' name='reason' placeholder='Reason' /><br /> Prize: <input type='text' name='prize' placeholder='Prize' /><br /> <input type='submit' name='place' value='Place Hit' /> </form> </td> </tr> <?php } ?> <tr> <td class='contenthead' align='center' colspan='5'>Hitlist Listings</td> </tr> <tr> <td class='contentcontent' align='center' colspan='5'><a href="hitlist.php?action=addlisting">Add Listing</a></td> </tr> <tr> <td class='contentcontent' align='center' width='20%'>Target</td> <td class='contentcontent' align='center' width='20%'>Place By</td> <td class='contentcontent' align='center' width='20%'>Reason</td> <td class='contentcontent' align='center' width='20%'>Prize</td> <td class='contentcontent' align='center' width='20%'>Complete</td> </tr> <?php $find_hits = mysql_query("SELECT `id` FROM `hitlist`"); if(mysql_num_rows($find_hits) == 0) { ?> <tr> <td class='contentcontent' align='center' colspan='5'>There are no hitlistings at this moment in time.</td> </tr> </table> <?php } while($fetch_hits = mysql_fetch_array($find_hits)) { $Hitlist = new Hitlist($fetch_hits['id']); $Placed = new User($Hitlist->placed); $Target = new User($Hitlist->target); ?> <tr> <td class='contentcontent' align='center'><?php echo $Target->formattedname; ?></td> <td class='contentcontent' align='center'><?php echo $Placed->formattedname; ?></td> <td class='contentcontent' align='center'><?php echo $Hitlist->reason; ?></td> <td class='contentcontent' align='center'><?php echo $Hitlist->prize; ?></td> <td class='contentcontent' align='center'><a href="attack.php?attack=<?php echo $Target->id; ?>">Do Hit</td> </tr> <?php } ?> </table> <?php include_once (__DIR__.'/footer.php'); ?> Step Three Open up classes.php and just above class User_Stats { paste: class Hitlist { public function Hitlist($id) { $result = mysql_query("SELECT * FROM `hitlist` WHERE `id` = '$id'"); $worked = mysql_fetch_array($result); $this->id = $worked['id']; $this->target = $worked['target']; $this->reason = $worked['reason']; $this->placed = $worked['placed']; $this->prize = $worked['prize']; } } Then open up your attack.php file and paste into the attack won section: //--------------------HITLIST---------------------------------- $hitlist = mysql_query("SELECT * FROM `hitlist`"); while($fetch_hitlist = mysql_fetch_array($hitlist)) { $Hitlist = new Hitlist($fetch_hitlist['id']); if($attack_person->id == $Hitlist->id) { if($user_class->id != $Hitlist->placed) { echo Message("You completed the hit on ".$attack_person->formattedname." and won $".$Hitlist->prize."!"); mysql_query("DELETE FROM `hitlist` WHERE `id` = ".$Hitlist->id."") or (die(mysql_error())); mysql_query("UPDATE `grpgusers` SET `money` = `money` + ".$fetch_hitlist['prize']." WHERE `id` = ".$user_class->id.""); Send_Event($attack_person->id, ''.$user_class->username.' Completed a bounty on you.'); Send_Event($Hitlist->placed, ''.$user_class->username.' Completed your bounty on '.$attack_person->formattedname.'.'); } } } //--------------------HITLIST END------------------------------ And that should be everything! If you find any errors or issues then please let me know and I will ammend them as soon as possible.
  14. add this into classes $this->announcement = $worked['announcement'];   and add this where you want it to show   <?php if($user_class->announcement > 0) { ?> <a class="leftmenu" href="announcement.php">Announcement [<?php echo $user_class->announcement; ?>]</a> <?php } else { ?> <a class="leftmenu" href="announcement.php">Announcement [0]</a> <?php } ?>   sql CREATE TABLE IF NOT EXISTS `announcements` ( `id` int(11) NOT NULL AUTO_INCREMENT, `poster` int(11) NOT NULL DEFAULT '0', `message` varchar(255) NOT NULL DEFAULT '', `postime` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;   announcement.php <?php include(__DIR__.'/header.php'); if(isset($_POST['newannounce'])) { $_POST['newmessage'] = isset($_POST['newmessage']) && strlen($_POST['newmessage']) > 0 ? mysql_real_escape_string($_POST['newmessage']) : null; if(empty($_POST['newmessage'])) { echo Message('You did not enter a valid announcement.'); include(__DIR__.'/footer.php'); exit; } else { echo Message('You have posted your announcement.'); mysql_query("INSERT INTO `announcements` (`id`, `poster`, `message`, `postime`)"." VALUES (NULL, '$user_class->id', '".$_POST['newmessage']."', '".time()."')"); mysql_query("UPDATE `grpgusers` SET `announcement` = `announcement` + 1"); } } ?> <tr><td class='contenthead'>Announcements</td></tr> <tr><td class='contentcontent'> <table width=100% cellspacing='1'> <tr style='background:gray'> <th>Poster</th> <th>Message</th> <th>time</th> </tr> <?php if($user_class->announcement > 0) { $update = mysql_query("UPDATE `grpgusers` SET `announcement` = 0 WHERE `id` = '".$user_class->id."'"); } $res = mysql_query("SELECT * FROM `announcements` ORDER BY `postime`"); while($row = mysql_fetch_array($res)) { $poster = new User($row['poster']); echo "<tr> <td>".$poster->formattedname."</td> <td width='50%'>".$row['message']."</td> <td>".date('H:i:s d/m/Y', $row['postime'])."</td> </tr>"; } echo "</table>"; ?> </td></tr> <?php if($user_class->admin) { ?> <tr><td class='contenthead'>Add Announcement</td></tr> <tr><td class='contentcontent'> <form method='post'> <table width='100%'> <tr> <th>Message</th> <td><textarea name='newmessage' rows='10' cols='60'></textarea></td> </tr> <tr> <td><input type='submit' name='newannounce' value='Post' /></td> </tr> </table> </form> </td></tr> <?php } include(__DIR__.'/footer.php'); ?>
  15. Hope you guys enjoy   <?php include 'spheader.php'; if ($user_class->admin != 1) { echo Message("You are not authorized to be here."); include 'footer.php'; die(); } ?> <tr><td class="contenthead">Staff Logs</td></tr> <tr><td class="contentcontent"> <? $result = mysql_query("SELECT * FROM `events` ORDER BY id DESC LIMIT 50"); echo "<table width=100%><tr align='center'><td class=contenthead><b>ID</b></td><td class=contenthead><b>Time</b></td><td class=contenthead><b>To</b></td><td class=contenthead><b>Text</b></td></tr>"; while($line = mysql_fetch_array($result, MYSQL_ASSOC)) { $to= Get_Username($line['to']); echo "<tr align=center><td class=contentcontent>".$line['id']."</td><td class=contentcontent>".date(F." ".d.", ".Y." ".g.":".i.":".sa,$line['timesent'])."</td><td class=contentcontent><a href=profiles.php?id=".$line['to'].">". $to."</a></td><td class=contentcontent>".$line['text']."</td></tr>"; } echo "</table>"; include 'footer.php'; ?>
  16. So i got bored and wanted to have a go at doing a lottery module i think it turned out all right in the end Lets start with the SQL files   CREATE TABLE IF NOT EXISTS `lottery` ( `lotofund` int(30) NOT NULL DEFAULT '0', `tickets` int(30) NOT NULL DEFAULT '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; INSERT INTO `lottery` (`lotofund`, `tickets`) VALUES (0, 0); CREATE TABLE IF NOT EXISTS `lottery_players` ( `user` int(30) NOT NULL DEFAULT '0', `tickets` int(10) NOT NULL DEFAULT '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; CREATE TABLE IF NOT EXISTS `lotowinners` ( `user` int(20) NOT NULL DEFAULT '0', `amountwon` int(50) NOT NULL DEFAULT '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; CREATE TABLE IF NOT EXISTS `lottery_config` ( `ticketprice` int(30) NOT NULL DEFAULT '0', `maxtickets` int(30) NOT NULL DEFAULT '0', `pagedisable` enum('Yes','No') NOT NULL DEFAULT 'No' ) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO `lottery_config` (`ticketprice`, `maxtickets`, `pagedisable`) VALUES (1000, 10, 'No'); ALTER TABLE `grpgusers` ADD `tickets` INT(30) NOT NULL DEFAULT 0;   open up classes.php and add this to the user class $this->tickets = $worked['tickets'];   You can add this to your style sheet if you have one if not add it into the header.php .infobox { background: #101010; width: 200px; height: auto; border: 1px solid gray; border-radius: 5px; padding: 10px; float: left; text-align: center; } .otherbox { background: #101010; width: 400px; height: auto; border: 1px solid gray; border-radius: 5px; padding: 4px; float: right; text-align: center; } .buysection,.infobox { margin-top: 5px; } .btn { background: #585858; width: auto; height: auto; border: 1px solid black; border-radius: 3px; } .input { background: #202020; color: #FFFFFF; border: 1px solid black; padding: 1px; }   Ok now time for the files. lottery.php <?php include(__DIR__.'/header.php'); $res = mysql_query("SELECT * FROM `lottery`"); $row = mysql_fetch_array($res); $checkp = mysql_query("SELECT * FROM `lottery_players` WHERE `user` = ".$user_class->id); $num = mysql_num_rows($checkp); $checkt = mysql_fetch_array($checkp); $config = mysql_query("SELECT * FROM `lottery_config`"); $worked = mysql_fetch_array($config); if($worked['pagedisable'] == 'Yes') { echo Message('Admin has disabled the Lottery Page.'); include_once(__DIR__.'/footer.php'); exit; } $_POST['amount'] = isset($_POST['amount']) && ctype_digit($_POST['amount']) ? abs(intval($_POST['amount'])) : null; if(array_key_exists('buy', $_POST)) { if(empty($_POST['amount'])) { echo Message("You didn't enter a valid amount"); include(__DIR__ . '/footer.php'); exit; } $cost = $worked['ticketprice'] * $_POST['amount']; $usercash = $user_class->money - $cost; $tickets = $user_class->tickets + $_POST['amount']; $loto = $row['lotofund'] + $cost; $ltick = $row['tickets'] + $_POST['amount']; $deficit = $worked['maxtickets'] - $user_class->tickets; $havetick = $checkt['tickets'] + $_POST['amount']; if($tickets > $worked['maxtickets']) { echo Message('The max tickets is '.number_format($worked['maxtickets']).'. This means you can only buy '.number_format($worked['maxtickets'] - $user_class->tickets).' more ticket'.($deficit == 1 ? '' : 's')); include_once(__DIR__.'/footer.php'); exit; } if($_POST['amount'] > $worked['maxtickets']) { echo Message('You can only purchase '.number_format($worked['maxtickets'])); include_once(__DIR__.'/footer.php'); exit; } if($user_class->money < $worked['ticketprice']) { echo Message('You cant afford '.number_format($_POST['amount']).' tickets. It costs $'.number_format($worked['ticketprice'] * $_POST['amount'])); include_once(__DIR__.'/footer.php'); exit; } if($user_class->tickets > $worked['maxtickets']) { echo Message('You have already purchased max tickets which is '.number_format($worked['maxtickets'])); include_once(__DIR__.'/footer.php'); exit; } if($user_class->money >= $worked['ticketprice'] && $_POST['amount'] <= $worked['maxtickets']) { if($num) { echo Message('You have purchase '.$_POST['amount'].' lottery tickets for $'.number_format($cost)); mysql_query("UPDATE `grpgusers` SET `money` = ".$usercash.", `tickets` = ".$tickets." WHERE `id` = ".$user_class->id); mysql_query("UPDATE `lottery` SET `lotofund` = ".$loto.", `tickets` = ".$ltick); mysql_query("UPDATE `lottery_players` SET `tickets` = ".$havetick." WHERE `user` = ".$user_class->id); } else { echo Message('You have purchase '.$_POST['amount'].' lottery tickets for $'.number_format($cost)); mysql_query("UPDATE `grpgusers` SET `money` = ".$usercash.", `tickets` = ".$tickets." WHERE `id` = ".$user_class->id); mysql_query("UPDATE `lottery` SET `lotofund` = ".$loto.", `tickets` = ".$ltick); mysql_query("INSERT INTO `lottery_players` VALUES('$user_class->id',".$_POST['amount'].")"); } } } ?> <tr><td class="contenthead">Lottery</td></tr> <tr><td class="contentcontent"> <div class="infobox"> <span>Welcome to the lottery</span> <span>Each ticket costs $<?php echo number_format($worked['ticketprice']); ?></span> <span>Maximum of <?php echo number_format($worked['maxtickets']); ?> tickets per person</span> </div> <div class="otherbox"> <span>Lottery Fund: $<?php echo number_format($row['lotofund']); ?></span> <span>Tickets Purchased: <?php echo number_format($row['tickets']); ?></span> </div> </td></tr> <tr><td class="contentcontent"> <div class="buysection"> <form method="post"> [buy Tickets] <input type="text" name="amount" value="1" maxlength="2" /> <input type="submit" name="buy" value="Buy Ticket" /> </form> </div> </td></tr> <tr><td class="contenthead">Previous Winners</td></tr> <tr><td class="contentcontent"> <?php $win = mysql_query("SELECT * FROM `lotowinners`"); $check = mysql_num_rows($win); while($row = mysql_fetch_array($win)) { $user = new User($row['user']); if($check == 0) { echo "<div class='infobox'><span>There has been no previous Winners</span></div>"; } else { echo " <table class='infobox'> <tr> <td>".$user->formattedname." - $".number_format($row['amountwon'])."</td> </tr>"; } echo "</table>"; } ?> </td></tr>   lottery_config.php <?php include(__DIR__.'/header.php'); $allowed = array(1,2); if($user_class->id != in_array(1,$allowed)) { echo Message('You are not allowed here.'); include_once(__DIR__.'/footer.php'); exit; } $res = mysql_query("SELECT * FROM `lottery_config"); $row = mysql_fetch_array($res); if(isset($_POST['disable'])) { if($row['pagedisable'] == 'No') { echo Message('You have disabled the lottery page'); mysql_query("UPDATE `lottery_config` SET `pagedisable` = 'Yes' WHERE `pagedisable` = 'No'"); } else if($row['pagedisable'] == 'Yes') { echo Message('You have enabled the lottery page.'); mysql_query("UPDATE `lottery_config` SET `pagedisable` = 'No' WHERE `pagedisable` = 'Yes'"); } } $_POST['price'] = isset($_POST['price']) && ctype_digit($_POST['price']) ? abs(intval($_POST['price'])) : null; if(isset($_POST['setprice'])) { if(empty($_POST['price'])) { echo Message('Invalid Price'); include_once(__DIR__.'/footer.php'); exit; } if(!is_numeric($_POST['price'])) { echo Message('Price must be a number.'); include_once(__DIR__.'/footer.php'); exit; } if($_POST['price'] == $row['ticketprice']) { echo Message('It is already set to that nothing has changed.'); include_once(__DIR__.'/footer.php'); } if($_POST['price'] != $row['ticketprice']) { echo Message('You have updated the price to $'.number_format($_POST['price'])); mysql_query("UPDATE `lottery_config` SET `ticketprice` = ".$_POST['price']); } } $_POST['tickets'] = isset($_POST['tickets']) && ctype_digit($_POST['tickets']) ? abs(intval($_POST['tickets'])) : null; if(isset($_POST['settickets'])) { if(empty($_POST['tickets'])) { echo Message('Invalid Price'); include_once(__DIR__.'/footer.php'); exit; } if(!is_numeric($_POST['tickets'])) { echo Message('Tickets must be a number.'); include_once(__DIR__.'/footer.php'); exit; } if($_POST['ticketprice'] == $_POST['tickets']) { echo Message('It is already set to this so nothing has changed.'); include_once(__DIR__.'/footer.php'); } if($_POST['tickets'] != $row['maxtickets']) { echo Message('You have updated the max tickets to '.number_format($_POST['tickets'])); mysql_query("UPDATE `lottery_config` SET `maxtickets` = ".$_POST['tickets']); } } ?> <tr><td class="contenthead">Lottery Panel</td></tr> <tr><td class="contentcontent"> <table width="100%" style="background: #101010" cellpadding="5"> <tr> <td> <span>Disable/Enable Lottery Page<span> <form method="post"> <?php if($row['pagedisable'] == 'No') { echo ' <input type="submit" name="disable" class="btn" value="Disable Page" />'; } if($row['pagedisable'] == 'Yes') { echo ' <input type="submit" name="disable" class="btn" value="Enable Page" />'; } ?> </form> </td> </tr> <tr> <td> <hr> <i>Set Ticket Price</i> <form method="post"> Price: <input type="text" name="price" value="0" class="input" /> <input type="submit" name="setprice" class="btn" value="Set Ticket Price" /> </form> </td> </tr> <tr> <td> <hr> <i>Set Max Tickets per person</i> <form method="post"> Max Tickets: <input type="text" name="tickets" value="0" class="input" /> <input type="submit" name="settickets" class="btn" value="Set Max Tickets" /> </form> </td> </tr> </table> </td></tr>   lot_cron.php <?php include('dbcon.php'); include('classes.php'); if(isset($_GET['code']) != 'Your code here') { echo "<span style='color:red'><h2>Error</h2></span>"; exit; } else { $res = mysql_query("SELECT * FROM `lottery_players` ORDER BY RAND() LIMIT 1"); $checkwinner = mysql_num_rows($res); while($row = mysql_fetch_array($res)) { if($checkwinner == 0) { } else { $winner = new User($row['user']); $check = mysql_query("SELECT * FROM `lottery`"); $worked = mysql_fetch_array($check); Send_Event($winner->id, "Congrats you have won the lottery your prize is $".number_format($worked['lotofund'])); mysql_query("UPDATE `grpgusers` SET `money` = `money` + {$worked['lotofund']} WHERE `id` = ".$winner->id); mysql_query("UPDATE `lottery` SET `lotofund` = '0',`tickets` = '0'"); mysql_query("UPDATE `grpgusers` SET `tickets` = '0' WHERE `tickets` > '0'"); mysql_query("INSERT INTO `lotowinners` VALUES('$winner->id',".$worked['lotofund'].")"); mysql_query("TRUNCATE TABLE `lottery_players`"); } } } ?>   ok some screenshots [ATTACH=CONFIG]1372[/ATTACH][ATTACH=CONFIG]1373[/ATTACH][ATTACH=CONFIG]1374[/ATTACH]
  17. [ATTACH=CONFIG]1586[/ATTACH][ATTACH=CONFIG]1587[/ATTACH]This is my first mod I have released to the public and I am fairly pants at coding. So all feedback is welcome. It should be secure but it is not 100% tested Save this as addnews.php <? include "header.php"; if ($user_class->admin <1){ echo "You do not have permission to be here"; die(); include "footer.php"; } if ($_GET['post'] == 1){ echo "<font color=red>Successfully added a news article</font>"; $news = mysql_real_escape_string($_POST['news']); $title = mysql_real_escape_string($_POST['title']); $sql=mysql_query("INSERT INTO `news` (user, title, news, time) VALUES (\"$user_class->username\", \"$title\", \"$news\", \"".time()."\")"); } ?> <form method="post" action="addnews.php?post=1"> <table width="100%"> <tr> <td width="100%"> Add a news article</td> <tr> <td width="100">Title</td> <tr> <td><input name="title" type="text" id="title"></td> <tr> <td width="100">News</td> <tr> <td width=""><textarea name="news" cols="66" rows="5">Enter New News Here</textarea></td> </tr> <tr> <td width="100"> </td> <td> </td> </tr> <tr> <td align="center"> <input name="add" type="submit" id="add" value="Submit"> </td> </tr> <tr> <td>Rules</td> <tr> <td>The rules to use the newspaper are as follows: 1)No swearing<br> 2)Only game related info including updates<br> 3)No naming and shaming only good factors towards users<br> 4)Run a comp post it on here<br> </td> </table> </form> </td></tr>   This next page you can call what ever you like as long as you remember to add it to the city or menu   <? include "header.php"; include "bbcodes.php"; ?> <table class="contentcontent" width="100%"> <tr><td width="25%">Username</td><td width="25%">Title</td><td width="25%">News</td><td width="25%">Time</td> <? $sql= mysql_query("SELECT * FROM `news` ORDER BY `time` ASC LIMIT 15"); while($row= mysql_fetch_assoc($sql, MYSQL_ASSOC)) { ?> <table class="contentcontent" width="100%" height="100px"> <tr><td width=25%><? echo $row['user'];?></td><td width=25%><? echo $row['title'];?><td width="25%"><? echo $row['news'];?> <td width="25%"><? echo howlongago($row['time']);"</table>"?></td></table> <? } ?>     The sql tables -- -- Table structure for table `news` -- CREATE TABLE IF NOT EXISTS `news` ( `id` int(10) NOT NULL AUTO_INCREMENT, `user` text COLLATE latin1_general_ci NOT NULL, `title` text COLLATE latin1_general_ci NOT NULL, `news` text COLLATE latin1_general_ci NOT NULL, `time` int(100) NOT NULL, UNIQUE KEY `id` (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=25 ;
  18. Another freebie for yous guys/girls nothing special ok lets stat with the sql first CREATE TABLE IF NOT EXISTS `npc_bots` ( `id` int(20) NOT NULL AUTO_INCREMENT, `npc_name` varchar(30) COLLATE latin1_general_ci NOT NULL, `level` int(11) NOT NULL DEFAULT '0', `strength` int(11) NOT NULL DEFAULT '0', `defense` int(11) NOT NULL DEFAULT '0', `speed` int(11) NOT NULL DEFAULT '0', `hosp` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1 ;   npc.php <?php include(__DIR__.'/header.php'); function display($id) { $check = mysql_query("SELECT `hosp` FROM `npc_bots` WHERE `id` = ".$id); $true = mysql_fetch_array($check); if($true['hosp'] > 0) { return "<span style='color:red'>Dead</span>"; } else { return "<span style='color:green'>Alive</span>"; } } function displaystats($id) { $check = mysql_query("SELECT `strength`,`speed`,`defense` FROM `npc_bots` WHERE `id` = ".$id); $true = mysql_fetch_array($check); $total = $true['strength'] + $true['defense'] + $true['speed']; return number_format($total); } $_GET['ID'] = isset($_GET['ID']) && ctype_digit($_GET['ID']) ? abs(intval($_GET['ID'])) : null; if(isset($_GET['attack'])) { $res = mysql_query("SELECT `hosp`,`strength`,`speed`,`defense`,`npc_name` FROM `npc_bots` WHERE `id` = ".$_GET['ID']); $num = mysql_num_rows($res); $row = mysql_fetch_array($res); if($row['hosp'] > 0) { echo Message('You can not attack this npc as he is already dead.'); include(__DIR__.'/footer.php'); exit; } if($num < 1) { echo Message('Invalid ID'); include(__DIR__.'/footer.php'); exit; } if($user_class->energypercent < 25) { echo Message('You need to have atleast 25% energy to attack a npc'); include(__DIR__.'/footer.php'); exit; } $newenergy = $user_class->energy - floor($user_class->energy * .25); if($user_class->energypercent > 25) { if($user_class->strength > $row['strength'] && $user_class->defense > $row['defense']) { echo Message('You take a shot at '.$row['npc_name'].' and hit him in the head You killed the npc.'); mysql_query("UPDATE `npc_bots` SET `hosp` = '20' WHERE `id` = ".$_GET['ID']); mysql_query("UPDATE `grpgusers` SET `money` = `money` + '500', `energy` = ".$newenergy." WHERE `id` = ".$_SESSION['id']); } if($user_class->strength < $row['strength'] && $user_class->defense < $row['defense']) { echo Message('You hit '.$row['npc_name'].' in the leg as he was falling to the ground he fired 1 last bullet and killed you.'); mysql_query("UPDATE `grpgusers` SET `hospital` = '1200', `energy` = ".$newenergy." WHERE `id` = ".$_SESSION['id']); } } } ?> <tr><td class="contenthead">NPC Page</td></tr> <tr><td class="contentcontent"> <table width="75%"> <tr style='background:gray'> <th>NPC</th> <th>Level</th> <th>Total Stats</th> <th>Alive/Dead</th> <th>Time Left</th> <th> </th> </tr> <?php $res = mysql_query("SELECT * FROM `npc_bots` ORDER BY `id`"); while($row = mysql_fetch_array($res)) { echo "<tr style='background:#181818'> <td>{$row['npc_name']}</td> <td>{$row['level']}</td> <td>".displaystats($row['id'])."</td> <td>".display($row['id'])."</td> <td>{$row['hosp']} minutes</td> <td><a href='npc.php?attack&ID={$row['id']}'>Attack NPC</a></td> </tr>"; } ?> </table> </td></tr> <?php include(__DIR__.'/footer.php'); ?>   staff_npc.php <?php include(__DIR__.'/header.php'); $_POST['name'] = isset($_POST['name']) && strlen($_POST['name']) > 0 ? mysql_real_escape_string($_POST['name']) : null; $_POST['level'] = isset($_POST['level']) && ctype_digit($_POST['level']) ? abs(intval($_POST['level'])) : null; $_POST['strength'] = isset($_POST['strength']) && ctype_digit($_POST['strength']) ? abs(intval($_POST['strength'])) : null; $_POST['defense'] = isset($_POST['defense']) && ctype_digit($_POST['defense']) ? abs(intval($_POST['defense'])) : null; $_POST['speed'] = isset($_POST['speed']) && ctype_digit($_POST['speed']) ? abs(intval($_POST['speed'])) : null; if(!$user_class->admin) { echo Message('Admins Only.'); include(__DIR__.'/footer.php'); exit; } if(isset($_POST['create'])) { $res = mysql_query("SELECT * FROM `npc_bots`"); $row = mysql_fetch_array($res); if(empty($_POST['name'])) { echo Message('Invalid Name.'); include(__DIR__.'/footer.php'); exit; } if(empty($_POST['level'])) { echo Message('Invalid Level.'); include(__DIR__.'/footer.php'); exit; } if(empty($_POST['strength'])) { echo Message('Invalid Strength.'); include(__DIR__.'/footer.php'); exit; } if(empty($_POST['defense'])) { echo Message('Invalid Defense.'); include(__DIR__.'/footer.php'); exit; } if(empty($_POST['speed'])) { echo Message('Invalid Speed.'); include(__DIR__.'/footer.php'); exit; } if(!is_numeric($_POST['level'])) { echo Message('Level Must be a number.'); include(__DIR__.'/footer.php'); exit; } if(!is_numeric($_POST['strength'])) { echo Message('Strength Must be a number.'); include(__DIR__.'/footer.php'); exit; } if($_POST['name'] != $row['npc_name']) { echo Message('Npc character created.'); mysql_query("INSERT INTO `npc_bots` VALUES(NULL,'".$_POST['name']."', '".$_POST['level']."','".$_POST['strength']."',".$_POST['defense'].",".$_POST['speed'].",'0')"); } else { echo Message('You already have a npc with this name.'); include(__DIR__.'/footer.php'); exit; } } ?> <tr><td class="contenthead">NPC Creator</td></tr> <tr><td class="contentcontent"> <table width="75%"> <form method="post"> <tr> <td>NPC Name: <input type="text" name="name" /></td> </tr> <tr> <td>Level: <input type="text" name="level" /></td> </tr> <tr> <td>Strength: <input type="text" name="strength" /></td> </tr> <tr> <td>Defense: <input type="text" name="defense" /></td> </tr> <tr> <td>Speed: <input type="text" name="speed" /></td> </tr> <tr> <td><input type="submit" name="create" value="Create NPC" /></td> </tr> </form> </table> </td></tr>   open up updates.php and add this into the min cron   mysql_query("UPDATE `npc_bots` SET `hosp` = `hosp` - 1 WHERE `hosp` > 0");
  19. Description: This will add tables around the cities and show each city population in a column. 1. Replace the whole of bus.php with this   <? include 'header.php'; if ($_GET['go'] != "") { $error = ($user_class->jail > 0) ? "You can't get on a bus if you are in jail." : $error; $error = ($user_class->hospital > 0) ? "You can't get on a bus if you are in the hospital." : $error; $error = ($_GET['go'] == $user_class->city) ? "You are already there." : $error; $result = mysql_query("SELECT * FROM `cities` WHERE `id`='".$_GET['go']."'"); $worked = mysql_fetch_array($result); $error = ($worked['name'] == "") ? "That city doesn't exist." : $error; $error = ($user_class->level < $worked['levelreq']) ? "You are not a high enough level to go there." : $error; $error = ($user_class->money < 3000) ? "You can't afford a bus ticket." : $error; if (!isset($error)){ $newmoney = $user_class->money - 3000; $result = mysql_query("UPDATE `grpgusers` SET `city` = '".$_GET['go']."', `money` = '".$newmoney."' WHERE `id` = '".$user_class->id."'"); $user_class = new User($_SESSION[' ']); echo Message("You successfully paid $3,000 and arrived at your destination."); } else { echo Message($error); } } ?> <tr><td class="contenthead">Bus Station</td></tr> <tr><td class="contentcontent">Tired of <?= $user_class->cityname ?>? For $3,000 you can get a bus ticket to anywhere you want to go. <table width="100%" border="0" cellspacing="0" cellpadding="3" cellpadding="3"> <tr> <td><strong>City</strong></td> <td><strong>Level</strong></td> <td><strong>Population</strong></td> <td><strong>Action</strong></td> </tr> <?php $result = mysql_query("SELECT * FROM `cities` ORDER BY `levelreq` ASC"); //get population while($line = mysql_fetch_array($result, MYSQL_ASSOC)) { $pop = mysql_query("SELECT * FROM `grpgusers` WHERE `city`='".$line['id']."'") or trigger_error(mysql_error(),E_USER_ERROR); $totalpop = mysql_num_rows($pop); echo "<tr> <td>".$line['name']."</td> <td>".$line['levelreq']."</td> <td>".$totalpop."</td> <td class=profilebuttons width=90px><a href='bus.php?go=".$line['id']."'>Buy Ticket</a></td> "; } echo '</td></tr>'; include 'footer.php'; ?>
  20. has anyone got the spheader.php=staffpanel for grpg as I do not have it for some reason
  21. This is my first free mod for grpg any issues or that post here and ill fix them. SQL First ALTER TABLE `grpgusers` ADD `booze` int(20) NOT NULL default 0 CREATE TABLE IF NOT EXISTS `planning` ( `id` int(20) NOT NULL AUTO_INCREMENT, `userid` int(20) NOT NULL DEFAULT '0', `type` varchar(255) COLLATE latin1_general_ci NOT NULL DEFAULT '', `time` int(50) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1; CREATE TABLE IF NOT EXISTS `hideouts` ( `id` int(20) NOT NULL AUTO_INCREMENT, `userid` int(20) NOT NULL DEFAULT '0', `hideoutlvl` int(20) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1 ; CREATE TABLE IF NOT EXISTS `mymaterials` ( `id` int(20) NOT NULL AUTO_INCREMENT, `userid` int(20) NOT NULL DEFAULT '0', `itemid` int(20) NOT NULL DEFAULT '0', `howmany` int(20) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=8; CREATE TABLE IF NOT EXISTS `materials` ( `id` int(20) NOT NULL AUTO_INCREMENT, `material_name` varchar(255) COLLATE latin1_general_ci DEFAULT '', `material_price` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=8 ; INSERT INTO `materials` (`id`, `material_name`, `material_price`) VALUES (1, 'Heavy Duty Bag', 200), (2, 'Rubber Bands', 60), (3, 'Oranges', 10), (4, 'Fruit Cocktail', 500), (5, 'Sugar Cubes', 100), (6, 'Ketchup', 80), (7, 'Water', 0);   hideout.php <?php include('header.php'); $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : null; switch($_GET['action']) { case "buy": buy_materials(); break; case "start": start_brewing(); break; default: prison_officer(); break; } function prison_officer() { global $user_class; ?> <tr><td class='contenthead'>Prison Officer</td></tr> <tr><td class='contentcontent'> <?php $select = mysql_query("SELECT `id`,`userid`,`hideoutlvl` FROM `hideouts` WHERE `userid` = ".$user_class->id); $row = mysql_fetch_array($select); if($row['userid'] == $user_class->id) echo Message('You already have a hideout'); ?> <p>So you wanna buy this cell well give me a offer.</p> <form method='post'> <input type='text' name='amount' /> <input type='submit' name='bribeguard' value='Bribe' /> </form> <?php if($_POST['bribeguard']){ $bribe = round(1000 * 10 / 5); $lose = .03; $newmoney = $user_class->money - $_POST['amount'] * $lose; $newmoney1 = $user_class->money - $_POST['amount']; $_POST['amount'] = isset($_POST['amount']) && ctype_digit($_POST['amount']) ? abs(intval($_POST['amount'])) : null; if($user_class->money == 0) { echo Message('You dont have any money'); } if(empty($_POST['amount'])) { echo Message('Invalid Format'); } if($_POST['amount'] < $bribe) { mysql_query("UPDATE `grpgusers` SET `money` = '".$newmoney."' WHERE `money` > 0 AND`id` = '".$user_class->id."'"); echo Message("HAHAHA what do you call that. you lose 3% of your money."); } else if($_POST['amount'] >= $bribe) { mysql_query("UPDATE `grpgusers` SET `money` = '".$newmoney1."' WHERE `id` = '".$user_class->id."'"); mysql_query("INSERT INTO `hideouts` (`userid`, `hideoutlvl`)"."VALUES ('".$user_class->id."', '1')"); echo Message('You paid $'.number_format($_POST["amount"]).'<br /> The guard likes the bribe and gives you the hideout.'); } } ?> </td></tr> <?php } function buy_materials() { global $user_class; ?> <tr><td class='contenthead'>Cell Mates</td></tr> <tr><td class='contentcontent'> <p>You ask arround for some of the materials you need to start brewing.</p> <?php $select = mysql_query("SELECT `id`,`material_name`,`material_price` FROM `materials` ORDER BY RAND()"); if(mysql_num_rows($select)) { $row = mysql_fetch_array($select); $select2 = mysql_query("SELECT * FROM `mymaterials` WHERE `itemid` = ".$row['id'].""); $row2 = mysql_fetch_array($select2); echo " ".$row['material_name']." <br /> $".number_format($row['material_price'])." <form method='post'><input type='submit' name='buymaterial' value='Buy' /></form>"; } if(isset($_POST['buymaterial'])) { if($row['id'] == $row2['itemid']) { echo Message('You already have one of those only 1 at a time.'); } if($row['material_price'] > $user_class->money) { echo Message('You dont have enough money for '.$row['material_name'].'.'); } else { echo Message('You have purchased '.$row['material_name'].' for $'.number_format($row['material_price']).''); mysql_query("UPDATE `grpgusers` SET `money` = `money` - '".$row['material_price']."' WHERE `id` = '$user_class->id'"); mysql_query("INSERT INTO `mymaterials` (`userid`, `itemid`, `howmany`)"."VALUES ('$user_class->id', '".$row['id']."', '1')"); } } ?> </td></tr> <?php } function start_brewing() { global $user_class; ?> <tr><td class='contenthead'>Welcome to your hideout.</td></tr> <tr><td class='contentcontent'> <table width='100%'> <tr> <td> <?php $select = mysql_query("SELECT * FROM `materials`"); while($row = mysql_fetch_array($select)) { $select2 = mysql_query("SELECT * FROM `mymaterials` WHERE `itemid` = ".$row['id']." AND `userid` = ".$user_class->id.""); $row2 = mysql_fetch_array($select2); if($row['id'] == $row2['itemid']) { echo Message('You set everything up and start brewing up some booze.'); mysql_query("INSERT INTO `planning` (`userid`, `type`, `time`)"."VALUES ('$user_class->id', 'Fruit Punch', 168)"); mysql_query("DELETE FROM `mymaterials` WHERE `userid` = ".$user_class->id); } else { echo Message('You dont own the required items'); } } ?> </td> </tr> </table> </td></tr> <?php } ?>   Open up classes and add   $this->booze = $worked['booze'];   and last the cron file i used a file but if you want you could add it into rollover.php if you feel up to it :)   <?php if(!isset($_GET['code']) || $_GET['code'] != 'ENTER CODE HERE') exit; include('dbcon.php'); include('classes.php'); $result = mysql_query("SELECT `id`,`rmdays`,`booze` FROM `grpgusers`"); while($line = mysql_fetch_array($result)) { $user = new User($line['id']); $select = mysql_query("SELECT * FROM `planning` WHERE `userid` = ".$user->id); $worked = mysql_fetch_array($select); $select2 = mysql_query("SELECT `hideoutlvl` FROM `hideouts` WHERE `userid` = ".$user->id); $worked2 = mysql_fetch_array($select2); if($worked['time'] > 0) { mysql_query("UPDATE `planning` SET `time` = `time` - 24 WHERE `time` > 0 AND `userid` = ".$user->id); echo Message('Success Cron has worked 24 hours have been taken off your time.'); } if($user->rmdays > 0) { $increase = 1; } else { $increase = 0; } if($worked['time'] < 1) { $units = round(20 * $worked2['hideoutlvl'] * $increase); mysql_query("UPDATE `grpgusers` SET `booze` = `booze` + $units WHERE `id` = ".$user->id); Send_Event($worked['userid'], "After a long wait your booze is complete. You made $units booze."); mysql_query("DELETE FROM `planning` WHERE `time` < 1"); } } ?>
  22. you will need to make a face book Developers page you can make it here https://developers.facebook.com/apps   make a file facebook.php     <?php if (!function_exists('curl_init')) { throw new Exception('Facebook needs the CURL PHP extension.'); } if (!function_exists('json_decode')) { throw new Exception('Facebook needs the JSON PHP extension.'); } /** * Thrown when an API call returns an exception. * * @author Naitik Shah <[email protected]> */ class FacebookApiException extends Exception { /** * The result from the API server that represents the exception information. */ protected $result; /** * Make a new API Exception with the given result. * * @param Array $result the result from the API server */ public function __construct($result) { $this->result = $result; $code = isset($result['error_code']) ? $result['error_code'] : 0; if (isset($result['error_description'])) { // OAuth 2.0 Draft 10 style $msg = $result['error_description']; } else if (isset($result['error']) && is_array($result['error'])) { // OAuth 2.0 Draft 00 style $msg = $result['error']['message']; } else if (isset($result['error_msg'])) { // Rest server style $msg = $result['error_msg']; } else { $msg = 'Unknown Error. Check getResult()'; } parent::__construct($msg, $code); } /** * Return the associated result object returned by the API server. * * @returns Array the result from the API server */ public function getResult() { return $this->result; } /** * Returns the associated type for the error. This will default to * 'Exception' when a type is not available. * * @return String */ public function getType() { if (isset($this->result['error'])) { $error = $this->result['error']; if (is_string($error)) { // OAuth 2.0 Draft 10 style return $error; } else if (is_array($error)) { // OAuth 2.0 Draft 00 style if (isset($error['type'])) { return $error['type']; } } } return 'Exception'; } /** * To make debugging easier. * * @returns String the string representation of the error */ public function __toString() { $str = $this->getType() . ': '; if ($this->code != 0) { $str .= $this->code . ': '; } return $str . $this->message; } } /** * Provides access to the Facebook Platform. * * @author Naitik Shah <[email protected]> */ class Facebook { /** * Version. */ const VERSION = '2.1.2'; /** * Default options for curl. */ public static $CURL_OPTS = array( CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 60, CURLOPT_USERAGENT => 'facebook-php-2.0', ); /** * List of query parameters that get automatically dropped when rebuilding * the current URL. */ protected static $DROP_QUERY_PARAMS = array( 'session', 'signed_request', ); /** * Maps aliases to Facebook domains. */ public static $DOMAIN_MAP = array( 'api' => 'https://api.facebook.com/', 'api_read' => 'https://api-read.facebook.com/', 'graph' => 'https://graph.facebook.com/', 'www' => 'https://www.facebook.com/', ); /** * The Application ID. */ protected $appId; /** * The Application API Secret. */ protected $apiSecret; /** * The active user session, if one is available. */ protected $session; /** * The data from the signed_request token. */ protected $signedRequest; /** * Indicates that we already loaded the session as best as we could. */ protected $sessionLoaded = false; /** * Indicates if Cookie support should be enabled. */ protected $cookieSupport = false; /** * Base domain for the Cookie. */ protected $baseDomain = ''; /** * Indicates if the CURL based @ syntax for file uploads is enabled. */ protected $fileUploadSupport = false; /** * Initialize a Facebook Application. * * The configuration: * - appId: the application ID * - secret: the application secret * - cookie: (optional) boolean true to enable cookie support * - domain: (optional) domain for the cookie * - fileUpload: (optional) boolean indicating if file uploads are enabled * * @param Array $config the application configuration */ public function __construct($config) { $this->setAppId($config['appId']); $this->setApiSecret($config['secret']); if (isset($config['cookie'])) { $this->setCookieSupport($config['cookie']); } if (isset($config['domain'])) { $this->setBaseDomain($config['domain']); } if (isset($config['fileUpload'])) { $this->setFileUploadSupport($config['fileUpload']); } } /** * Set the Application ID. * * @param String $appId the Application ID */ public function setAppId($appId) { $this->appId = $appId; return $this; } /** * Get the Application ID. * * @return String the Application ID */ public function getAppId() { return $this->appId; } /** * Set the API Secret. * * @param String $appId the API Secret */ public function setApiSecret($apiSecret) { $this->apiSecret = $apiSecret; return $this; } /** * Get the API Secret. * * @return String the API Secret */ public function getApiSecret() { return $this->apiSecret; } /** * Set the Cookie Support status. * * @param Boolean $cookieSupport the Cookie Support status */ public function setCookieSupport($cookieSupport) { $this->cookieSupport = $cookieSupport; return $this; } /** * Get the Cookie Support status. * * @return Boolean the Cookie Support status */ public function useCookieSupport() { return $this->cookieSupport; } /** * Set the base domain for the Cookie. * * @param String $domain the base domain */ public function setBaseDomain($domain) { $this->baseDomain = $domain; return $this; } /** * Get the base domain for the Cookie. * * @return String the base domain */ public function getBaseDomain() { return $this->baseDomain; } /** * Set the file upload support status. * * @param String $domain the base domain */ public function setFileUploadSupport($fileUploadSupport) { $this->fileUploadSupport = $fileUploadSupport; return $this; } /** * Get the file upload support status. * * @return String the base domain */ public function useFileUploadSupport() { return $this->fileUploadSupport; } /** * Get the data from a signed_request token * * @return String the base domain */ public function getSignedRequest() { if (!$this->signedRequest) { if (isset($_REQUEST['signed_request'])) { $this->signedRequest = $this->parseSignedRequest( $_REQUEST['signed_request']); } } return $this->signedRequest; } /** * Set the Session. * * @param Array $session the session * @param Boolean $write_cookie indicate if a cookie should be written. this * value is ignored if cookie support has been disabled. */ public function setSession($session=null, $write_cookie=true) { $session = $this->validateSessionObject($session); $this->sessionLoaded = true; $this->session = $session; if ($write_cookie) { $this->setCookieFromSession($session); } return $this; } /** * Get the session object. This will automatically look for a signed session * sent via the signed_request, Cookie or Query Parameters if needed. * * @return Array the session */ public function getSession() { if (!$this->sessionLoaded) { $session = null; $write_cookie = true; // try loading session from signed_request in $_REQUEST $signedRequest = $this->getSignedRequest(); if ($signedRequest) { // sig is good, use the signedRequest $session = $this->createSessionFromSignedRequest($signedRequest); } // try loading session from $_REQUEST if (!$session && isset($_REQUEST['session'])) { $session = json_decode( get_magic_quotes_gpc() ? stripslashes($_REQUEST['session']) : $_REQUEST['session'], true ); $session = $this->validateSessionObject($session); } // try loading session from cookie if necessary if (!$session && $this->useCookieSupport()) { $cookieName = $this->getSessionCookieName(); if (isset($_COOKIE[$cookieName])) { $session = array(); parse_str(trim( get_magic_quotes_gpc() ? stripslashes($_COOKIE[$cookieName]) : $_COOKIE[$cookieName], '"' ), $session); $session = $this->validateSessionObject($session); // write only if we need to delete a invalid session cookie $write_cookie = empty($session); } } $this->setSession($session, $write_cookie); } return $this->session; } /** * Get the UID from the session. * * @return String the UID if available */ public function getUser() { $session = $this->getSession(); return $session ? $session['uid'] : null; } /** * Gets a OAuth access token. * * @return String the access token */ public function getAccessToken() { $session = $this->getSession(); // either user session signed, or app signed if ($session) { return $session['access_token']; } else { return $this->getAppId() .'|'. $this->getApiSecret(); } } /** * Get a Login URL for use with redirects. By default, full page redirect is * assumed. If you are using the generated URL with a window.open() call in * JavaScript, you can pass in display=popup as part of the $params. * * The parameters: * - next: the url to go to after a successful login * - cancel_url: the url to go to after the user cancels * - req_perms: comma separated list of requested extended perms * - display: can be "page" (default, full page) or "popup" * * @param Array $params provide custom parameters * @return String the URL for the login flow */ public function getLoginUrl($params=array()) { $currentUrl = $this->getCurrentUrl(); return $this->getUrl( 'www', 'login.php', array_merge(array( 'api_key' => $this->getAppId(), 'cancel_url' => $currentUrl, 'display' => 'page', 'fbconnect' => 1, 'next' => $currentUrl, 'return_session' => 1, 'session_version' => 3, 'v' => '1.0', ), $params) ); } /** * Get a Logout URL suitable for use with redirects. * * The parameters: * - next: the url to go to after a successful logout * * @param Array $params provide custom parameters * @return String the URL for the logout flow */ public function getLogoutUrl($params=array()) { return $this->getUrl( 'www', 'logout.php', array_merge(array( 'next' => $this->getCurrentUrl(), 'access_token' => $this->getAccessToken(), ), $params) ); } /** * Get a login status URL to fetch the status from facebook. * * The parameters: * - ok_session: the URL to go to if a session is found * - no_session: the URL to go to if the user is not connected * - no_user: the URL to go to if the user is not signed into facebook * * @param Array $params provide custom parameters * @return String the URL for the logout flow */ public function getLoginStatusUrl($params=array()) { return $this->getUrl( 'www', 'extern/login_status.php', array_merge(array( 'api_key' => $this->getAppId(), 'no_session' => $this->getCurrentUrl(), 'no_user' => $this->getCurrentUrl(), 'ok_session' => $this->getCurrentUrl(), 'session_version' => 3, ), $params) ); } /** * Make an API call. * * @param Array $params the API call parameters * @return the decoded response */ public function api(/* polymorphic */) { $args = func_get_args(); if (is_array($args[0])) { return $this->_restserver($args[0]); } else { return call_user_func_array(array($this, '_graph'), $args); } } /** * Invoke the old restserver.php endpoint. * * @param Array $params method call object * @return the decoded response object * @throws FacebookApiException */ protected function _restserver($params) { // generic application level parameters $params['api_key'] = $this->getAppId(); $params['format'] = 'json-strings'; $result = json_decode($this->_oauthRequest( $this->getApiUrl($params['method']), $params ), true); // results are returned, errors are thrown if (is_array($result) && isset($result['error_code'])) { throw new FacebookApiException($result); } return $result; } /** * Invoke the Graph API. * * @param String $path the path (required) * @param String $method the http method (default 'GET') * @param Array $params the query/post data * @return the decoded response object * @throws FacebookApiException */ protected function _graph($path, $method='GET', $params=array()) { if (is_array($method) && empty($params)) { $params = $method; $method = 'GET'; } $params['method'] = $method; // method override as we always do a POST $result = json_decode($this->_oauthRequest( $this->getUrl('graph', $path), $params ), true); // results are returned, errors are thrown if (is_array($result) && isset($result['error'])) { $e = new FacebookApiException($result); switch ($e->getType()) { // OAuth 2.0 Draft 00 style case 'OAuthException': // OAuth 2.0 Draft 10 style case 'invalid_token': $this->setSession(null); } throw $e; } return $result; } /** * Make a OAuth Request * * @param String $path the path (required) * @param Array $params the query/post data * @return the decoded response object * @throws FacebookApiException */ protected function _oauthRequest($url, $params) { if (!isset($params['access_token'])) { $params['access_token'] = $this->getAccessToken(); } // json_encode all params values that are not strings foreach ($params as $key => $value) { if (!is_string($value)) { $params[$key] = json_encode($value); } } return $this->makeRequest($url, $params); } /** * Makes an HTTP request. This method can be overriden by subclasses if * developers want to do fancier things or use something other than curl to * make the request. * * @param String $url the URL to make the request to * @param Array $params the parameters to use for the POST body * @param CurlHandler $ch optional initialized curl handle * @return String the response text */ protected function makeRequest($url, $params, $ch=null) { if (!$ch) { $ch = curl_init(); } $opts = self::$CURL_OPTS; if ($this->useFileUploadSupport()) { $opts[CURLOPT_POSTFIELDS] = $params; } else { $opts[CURLOPT_POSTFIELDS] = http_build_query($params, null, '&'); } $opts[CURLOPT_URL] = $url; // disable the 'Expect: 100-continue' behaviour. This causes CURL to wait // for 2 seconds if the server does not support this header. if (isset($opts[CURLOPT_HTTPHEADER])) { $existing_headers = $opts[CURLOPT_HTTPHEADER]; $existing_headers[] = 'Expect:'; $opts[CURLOPT_HTTPHEADER] = $existing_headers; } else { $opts[CURLOPT_HTTPHEADER] = array('Expect:'); } curl_setopt_array($ch, $opts); $result = curl_exec($ch); if ($result === false) { $e = new FacebookApiException(array( 'error_code' => curl_errno($ch), 'error' => array( 'message' => curl_error($ch), 'type' => 'CurlException', ), )); curl_close($ch); throw $e; } curl_close($ch); return $result; } /** * The name of the Cookie that contains the session. * * @return String the cookie name */ protected function getSessionCookieName() { return 'fbs_' . $this->getAppId(); } /** * Set a JS Cookie based on the _passed in_ session. It does not use the * currently stored session -- you need to explicitly pass it in. * * @param Array $session the session to use for setting the cookie */ protected function setCookieFromSession($session=null) { if (!$this->useCookieSupport()) { return; } $cookieName = $this->getSessionCookieName(); $value = 'deleted'; $expires = time() - 3600; $domain = $this->getBaseDomain(); if ($session) { $value = '"' . http_build_query($session, null, '&') . '"'; if (isset($session['base_domain'])) { $domain = $session['base_domain']; } $expires = $session['expires']; } // prepend dot if a domain is found if ($domain) { $domain = '.' . $domain; } // if an existing cookie is not set, we dont need to delete it if ($value == 'deleted' && empty($_COOKIE[$cookieName])) { return; } if (headers_sent()) { self::errorLog('Could not set cookie. Headers already sent.'); // ignore for code coverage as we will never be able to setcookie in a CLI // environment // @codeCoverageIgnoreStart } else { setcookie($cookieName, $value, $expires, '/', $domain); } // @codeCoverageIgnoreEnd } /** * Validates a session_version=3 style session object. * * @param Array $session the session object * @return Array the session object if it validates, null otherwise */ protected function validateSessionObject($session) { // make sure some essential fields exist if (is_array($session) && isset($session['uid']) && isset($session['access_token']) && isset($session['sig'])) { // validate the signature $session_without_sig = $session; unset($session_without_sig['sig']); $expected_sig = self::generateSignature( $session_without_sig, $this->getApiSecret() ); if ($session['sig'] != $expected_sig) { self::errorLog('Got invalid session signature in cookie.'); $session = null; } // check expiry time } else { $session = null; } return $session; } /** * Returns something that looks like our JS session object from the * signed token's data * * TODO: Nuke this once the login flow uses OAuth2 * * @param Array the output of getSignedRequest * @return Array Something that will work as a session */ protected function createSessionFromSignedRequest($data) { if (!isset($data['oauth_token'])) { return null; } $session = array( 'uid' => $data['user_id'], 'access_token' => $data['oauth_token'], 'expires' => $data['expires'], ); // put a real sig, so that validateSignature works $session['sig'] = self::generateSignature( $session, $this->getApiSecret() ); return $session; } /** * Parses a signed_request and validates the signature. * Then saves it in $this->signed_data * * @param String A signed token * @param Boolean Should we remove the parts of the payload that * are used by the algorithm? * @return Array the payload inside it or null if the sig is wrong */ protected function parseSignedRequest($signed_request) { list($encoded_sig, $payload) = explode('.', $signed_request, 2); // decode the data $sig = self::base64UrlDecode($encoded_sig); $data = json_decode(self::base64UrlDecode($payload), true); if (strtoupper($data['algorithm']) !== 'HMAC-SHA256') { self::errorLog('Unknown algorithm. Expected HMAC-SHA256'); return null; } // check sig $expected_sig = hash_hmac('sha256', $payload, $this->getApiSecret(), $raw = true); if ($sig !== $expected_sig) { self::errorLog('Bad Signed JSON signature!'); return null; } return $data; } /** * Build the URL for api given parameters. * * @param $method String the method name. * @return String the URL for the given parameters */ protected function getApiUrl($method) { static $READ_ONLY_CALLS = array('admin.getallocation' => 1, 'admin.getappproperties' => 1, 'admin.getbannedusers' => 1, 'admin.getlivestreamvialink' => 1, 'admin.getmetrics' => 1, 'admin.getrestrictioninfo' => 1, 'application.getpublicinfo' => 1, 'auth.getapppublickey' => 1, 'auth.getsession' => 1, 'auth.getsignedpublicsessiondata' => 1, 'comments.get' => 1, 'connect.getunconnectedfriendscount' => 1, 'dashboard.getactivity' => 1, 'dashboard.getcount' => 1, 'dashboard.getglobalnews' => 1, 'dashboard.getnews' => 1, 'dashboard.multigetcount' => 1, 'dashboard.multigetnews' => 1, 'data.getcookies' => 1, 'events.get' => 1, 'events.getmembers' => 1, 'fbml.getcustomtags' => 1, 'feed.getappfriendstories' => 1, 'feed.getregisteredtemplatebundlebyid' => 1, 'feed.getregisteredtemplatebundles' => 1, 'fql.multiquery' => 1, 'fql.query' => 1, 'friends.arefriends' => 1, 'friends.get' => 1, 'friends.getappusers' => 1, 'friends.getlists' => 1, 'friends.getmutualfriends' => 1, 'gifts.get' => 1, 'groups.get' => 1, 'groups.getmembers' => 1, 'intl.gettranslations' => 1, 'links.get' => 1, 'notes.get' => 1, 'notifications.get' => 1, 'pages.getinfo' => 1, 'pages.isadmin' => 1, 'pages.isappadded' => 1, 'pages.isfan' => 1, 'permissions.checkavailableapiaccess' => 1, 'permissions.checkgrantedapiaccess' => 1, 'photos.get' => 1, 'photos.getalbums' => 1, 'photos.gettags' => 1, 'profile.getinfo' => 1, 'profile.getinfooptions' => 1, 'stream.get' => 1, 'stream.getcomments' => 1, 'stream.getfilters' => 1, 'users.getinfo' => 1, 'users.getloggedinuser' => 1, 'users.getstandardinfo' => 1, 'users.hasapppermission' => 1, 'users.isappuser' => 1, 'users.isverified' => 1, 'video.getuploadlimits' => 1); $name = 'api'; if (isset($READ_ONLY_CALLS[strtolower($method)])) { $name = 'api_read'; } return self::getUrl($name, 'restserver.php'); } /** * Build the URL for given domain alias, path and parameters. * * @param $name String the name of the domain * @param $path String optional path (without a leading slash) * @param $params Array optional query parameters * @return String the URL for the given parameters */ protected function getUrl($name, $path='', $params=array()) { $url = self::$DOMAIN_MAP[$name]; if ($path) { if ($path[0] === '/') { $path = substr($path, 1); } $url .= $path; } if ($params) { $url .= '?' . http_build_query($params, null, '&'); } return $url; } /** * Returns the Current URL, stripping it of known FB parameters that should * not persist. * * @return String the current URL */ protected function getCurrentUrl() { $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://'; $currentUrl = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $parts = parse_url($currentUrl); // drop known fb params $query = ''; if (!empty($parts['query'])) { $params = array(); parse_str($parts['query'], $params); foreach(self::$DROP_QUERY_PARAMS as $key) { unset($params[$key]); } if (!empty($params)) { $query = '?' . http_build_query($params, null, '&'); } } // use port if non default $port = isset($parts['port']) && (($protocol === 'http://' && $parts['port'] !== 80) || ($protocol === 'https://' && $parts['port'] !== 443)) ? ':' . $parts['port'] : ''; // rebuild return $protocol . $parts['host'] . $port . $parts['path'] . $query; } /** * Generate a signature for the given params and secret. * * @param Array $params the parameters to sign * @param String $secret the secret to sign with * @return String the generated signature */ protected static function generateSignature($params, $secret) { // work with sorted data ksort($params); // generate the base string $base_string = ''; foreach($params as $key => $value) { $base_string .= $key . '=' . $value; } $base_string .= $secret; return md5($base_string); } /** * Prints to the error log if you aren't in command line mode. * * @param String log message */ protected static function errorLog($msg) { // disable error log if we are running in a CLI environment // @codeCoverageIgnoreStart if (php_sapi_name() != 'cli') { error_log($msg); } // uncomment this if you want to see the errors on the page // print 'error_log: '.$msg."\n"; // @codeCoverageIgnoreEnd } /** * Base64 encoding that doesn't need to be urlencode()ed. * Exactly the same as base64_encode except it uses * - instead of + * _ instead of / * * @param String base64UrlEncodeded string */ protected static function base64UrlDecode($input) { return base64_decode(strtr($input, '-_', '+/')); } }   now add this in your register.php at the top of the page just under include'..........'; define('FACEBOOK_APP_ID', 'your app id '); // Place your App Id here define('FACEBOOK_SECRET', 'your app secret');   add this next to your registration form <iframe src="https://www.facebook.com/plugins/registration? client_id=477610595606636& redirect_uri=http://www.mafia-outlawz.com/facebookreg.php& fields=name,gender,password,email" scrolling="auto" frameborder="no" style="border:none" allowtransparency="true" width="100%" height="330"> </iframe>   now make a page facebookreg.php and add this in it if you dont use salted hash then you will need to remove the hash password and stuff and change the db table name   <?php include_once(DIRNAME(__FILE__) . '/nliheader.php'); define('FACEBOOK_APP_ID', ---------'); // Place your App Id here define('FACEBOOK_SECRET',' -----------'); // Place your App Secret Here // No need to change the function body function parse_signed_request($signed_request, $secret) { list($encoded_sig, $payload) = explode('.', $signed_request, 2); // decode the data $sig = base64_url_decode($encoded_sig); $data = json_decode(base64_url_decode($payload), true); if (strtoupper($data['algorithm']) !== 'HMAC-SHA256') { error_log('Unknown algorithm. Expected HMAC-SHA256'); return null; } // check sig $expected_sig = hash_hmac('sha256', $payload, $secret, $raw = true); if ($sig !== $expected_sig) { error_log('Bad Signed JSON signature!'); return null; } return $data; } function base64_url_decode($input) { return base64_decode(strtr($input, '-_', '+/')); } if ($_REQUEST) { $response = parse_signed_request($_REQUEST['signed_request'], FACEBOOK_SECRET); $name = $response["registration"]["name"]; $email = $response["registration"]["email"]; $password = $response["registration"]["password"]; $gender = $response["registration"]["gender"]; // Inserting into users table $IP = $_SERVER['REMOTE_ADDR']; $checkuser = mysql_query("SELECT * FROM `users` WHERE `username`='$name'"); $username_exist = mysql_num_rows($checkuser); $checkuser = mysql_query("SELECT * FROM `users` WHERE `ip`='$IP'"); $ip = mysql_num_rows($checkuser); $checkuser = mysql_query("SELECT * FROM `users` WHERE `email`='$email'"); $email = mysql_num_rows($checkuser); if($username_exist > 0){ $message .= "<div>I'm sorry but the username you chose has already been taken. Please pick another one.</div>"; }if($email > 0){ $message .= "<div>the email you have giveing us seem to be getting used on this game.</div>"; } if($ip > 0){ $message .= "<div>you already have an account on mafia-outlawz by making more than one account with out admin knowing of this all your account will be banned </div>"; } if(strlen($name) < 4 or strlen($name) > 20){ $message .= "<div>The username you chose has " . strlen($name) . " characters. You need to have between 4 and 20 characters.</div>"; }if(strlen($password) < 8 or strlen($password) > 20){ $message .= "<div>The password you chose has " . strlen($password) . " characters. You need to have between 8 and 20 characters.</div>"; }if ( empty($name) ) { $message .= "You did not enter a name"; } if (isset($message)) { echo message($message); include 'nlifooter.php'; die(); } $signuptime = time(); $salt = '**jj*dj!JjKLld39277DkklLLjdhs0298()$**[email protected]!kdjakLLkLkdDJDAlaAe8!!ddjsKKslsdkAJGLKSJDkkslk(2l2774399LDksjJJs'; $salted_hash = hash("sha512", ($salt . $password)); $result= sprintf("INSERT INTO `users` (ip, username, password, email, signuptime, online, password1, hashpass )"."VALUES ('".$_SERVER['REMOTE_ADDR']."', '$name', '$password', '$email', '$signuptime', '$signuptime' ,'$password', '{$salted_hash}')", mysql_real_escape_string($users), mysql_real_escape_string($ip), mysql_real_escape_string($name), mysql_real_escape_string($password), mysql_real_escape_string($email), mysql_real_escape_string($signuptime), mysql_real_escape_string($lastactive), mysql_real_escape_string($password1), mysql_real_escape_string($hashpass), mysql_real_escape_string($cook)); mysql_query($result); if($result){ $resultgt = mysql_query("SELECT * FROM `users` WHERE `username`='$name'"); $worked = mysql_fetch_array($resultgt); $user_class = new User($worked['id']); $password = $worked['password1']; $saltedhash = hash("sha512", ($salt . $password)); if($worked['hashpass'] == $saltedhash){ $_SESSION['id'] = $worked['id']; echo Message('Your account has been created successfully! and loggin in <meta http-equiv="refresh" content="0; url=index.php">.'); }} else { // Error in storing } } else { echo '$_REQUEST is empty'; }include_once(DIRNAME(__FILE__) . '/nlifooter.php'); ?>       good luck getting it going as it took me over 2 weeks to get it to work
  23. First, in phpmyadmin, add this to your database: And in rollover.php, scroll right down and add this to the list... Thirdly in classes.php, add this...  If you don't know where to put this, you should put this just after "$this->marijuana = $worked['marijuana'];" (without the quotes). Then create a file named "dailyreward.php", and add this code in: Thanks, any feedback is appreciated.
  24. I made or well attempted to make a different 50/50 Chance, but I can't seem to get it to work right.. It works, but when someone tries to match my bet it doesn't do anything.. And when I try to remove my bet, nothing.. Can someone fix it for me, lol   <?php include (DIRNAME(__FILE__) . '/header.php'); echo "<div class='content'><h3>50/50 Chance</h3>"; if($_GET['match'] != ""){ $result = mysql_query("SELECT * FROM `5050chance` WHERE `id` = '".$_GET['match']."'"); $worked = mysql_fetch_array($result); $betAmount = $worked['betAmount']; $chance = new User($worked['owner_id']); if($worked['betType'] == 1){ if($betAmount > $user_class->money){ echo " <p>You don't have enough to match their bet. <br><br> <a href='5050chance.php'>Back</a></p></div>"; die(); } elseif($betAmount <= $user_class->money){ $newmoney = $user_class->money - $betAmount; $result = mysql_query("UPDATE `users` SET `money` = '".$newmoney."' WHERE `id` = '".$user_class->id."'"); $user_class = new User($_SESSION['id']); $winner = rand(0,1); if($winner == 0){ //original poster wins echo " <p>You lost the bet. <br><br> <a href='5050chance.php'>Back</a></p></div>"; die(); $betAmount = $betAmount * 2; $newmoney = $user_class->money + $betAmount; $result = mysql_query("UPDATE `users` SET `money` = '".$newmoney."' WHERE `id` = '".$user_class->id."'"); Send_Event($chance->id, "You won your $".$betAmount." bet."); } else { //the person who accepted the bid won echo " <p>You won the bet. <br><br> <a href='5050chance.php'>Back</a></p></div>"; die(); $betAmount = $betAmount * 2; $newmoney = $user_class->money + $betAmount; $result = mysql_query("UPDATE `users` SET `money` = '".$newmoney."' WHERE `id` = '".$user_class->id."'"); Send_Event($chance->id, "You lost your $".$betAmount." bet."); } $result = mysql_query("DELETE FROM `5050chance` WHERE `id` = '".$_GET['match']."'") or die(mysql_error()); } } elseif($worked['betType'] == 2){ if($betAmount > $user_class->points){ echo " <p>You don't have enough to match their bet. <br><br> <a href='5050chance.php'>Back</a></p></div>"; die(); } elseif($betAmount <= $user_class->money){ $newpoints = $user_class->points - $betAmount; $result = mysql_query("UPDATE `users` SET `points` = '".$newpoints."' WHERE `id` = '".$user_class->id."'"); $user_class = new User($_SESSION['id']); $winner = rand(0,1); if($winner == 0){ //original poster wins echo " <p>You lost ",$betAmount." points from the bet. <br><br> <a href='5050chance.php'>Back</a></p></div>"; die(); $betAmount = $betAmount * 2; $newpoints = $user_class->money + $betAmount; $result = mysql_query("UPDATE `users` SET `points` = '".$newpoints."' WHERE `id` = '".$user_class->id."'"); Send_Event($chance->id, "You won your $".$betAmount." bet."); } else { //the person who accepted the bid won echo " <p>You won ".$betAmount." points from the bet. <br><br> <a href='5050chance.php'>Back</a></p></div>"; die(); $betAmount = $betAmount * 2; $newpoints = $user_class->points + $betAmount; $result = mysql_query("UPDATE `users` SET `points` = '".$newpoints."' WHERE `id` = '".$user_class->id."'"); Send_Event($chance->id, "You lost your $".$betAmount." bet."); } $result = mysql_query("DELETE FROM `5050chance` WHERE `id` = '".$_GET['match']."'") or die(mysql_error()); } } } if($_GET['remove'] != ""){ $result = mysql_query("SELECT * FROM `5050chance` WHERE `id` = '".$_GET['remove']."'"); $worked = mysql_fetch_array($result); if($row['betType'] == 1){ $newmoney = $user_class->money + $row['betAmount']; $result1 = mysql_query("UPDATE `users` SET `money` = '".$newmoney."' WHERE `id` = '".$user_class->id."'") or die(mysql_error()); $result2 = mysql_query("DELETE FROM `5050chance` WHERE `id` = '".$_GET['remove']."'") or die(mysql_error()); } elseif($row['betType'] == 2){ $newpoints = $user_class->points + $row['betAmount']; $result1 = mysql_query("UPDATE `users` SET `points` = '".$newpoints."' WHERE `id` = '".$user_class->id."'") or die(mysql_error()); $result2 = mysql_query("DELETE FROM `5050chance` WHERE `id` = '".$_GET['remove']."'") or die(mysql_error()); } } if(isset($_POST['betMoney'])){ $betAmount = abs(@intval($_POST['betAmount'])); if($betAmount > $user_class->money){ echo " <p>You can't bet more than you have. <br><br> <a href='5050chance.php'>Back</a></p></div>"; die(); } elseif($betAmount < 99){ echo " <p>You can't bet less than the minimum. <br><br> <a href='5050chance.php'>Back</a></p></div>"; die(); } elseif($betAmount > 9999){ echo " <p>You can't bet more than the maximum. <br><br> <a href='5050chance.php'>Back</a></p></div>"; die(); } else { $newmoney = $user_class->money - $betAmount; $result = mysql_query("INSERT INTO `5050chance` (`owner_id`, `betAmount`, `betType`)"."VALUES ('".$user_class->id."', '".$betAmount."', '1')") or die(mysql_error()); $result = mysql_query("UPDATE `users` SET `money` = '".$newmoney."' WHERE `id` = '".$user_class->id."'"); $user_class = new User($_SESSION[' ']); echo " <p>You have successfully placed a bet. <br><br> <a href='5050chance.php'>Back</a></p></div>"; die(); } } if(isset($_POST['betPoints'])){ $betAmount = abs(@intval($_POST['betAmount'])); if($betAmount > $user_class->points){ echo " <p>You can't bet more than you have. <br><br> <a href='5050chance.php'>Back</a></p></div>"; die(); } elseif($betAmount < 9){ echo " <p>You can't bet less than the minimum. <br><br> <a href='5050chance.php'>Back</a></p></div>"; die(); } elseif($betAmount > 999){ echo " <p>You can't bet more than the maximum. <br><br> <a href='5050chance.php'>Back</a></p></div>"; die(); } else { $newpoints = $user_class->points - $betAmount; $result = mysql_query("INSERT INTO `5050chance` (`owner_id`, `betAmount`, `betType`)"."VALUES ('".$user_class->id."', '".$betAmount."', '2')") or die(mysql_error()); $result = mysql_query("UPDATE `users` SET `points` = '".$newpoints."' WHERE `id` = '".$user_class->id."'"); $user_class = new User($_SESSION[' ']); echo " <p>You have successfully placed a bet. <br><br> <a href='5050chance.php'>Back</a></p></div>"; die(); } } ?> <p align='center'> Try your luck at 50/50- either place a bet of your own or match someone else's!<br /> If you win, you end up with 100% of the pot. </p> <table width='100%'> <tr> <td width='50%'><h4>Money</h4></td> <td width='50%'><h4>Points</h4></td> </tr> <tr> <form method='post'> <td align='center'> <input type='text' name='betAmount' size='14' maxlength='10' value='0.00'> <input type='submit' name='betMoney' value='Bet'> <br /> min: $100.00<br /> max: $10,000.00 </td> </form> <form method='post'> <td align='center'> <input type='text' name='betAmount' size='14' maxlength='6' value='0'> <input type='submit' name='betPoints' value='Bet'> <br /> min: 10<br /> max: 1,000 </td> </form> </tr> </table> <table width='100%'> <tr> <td width='40%'><h4>Player</h4></td> <td width='40%'><h4>Bet</h4></td> <td width='20%'><h4>Action</h4></td> </tr> <?php $result = mysql_query("SELECT * FROM `5050chance` ORDER BY `id` DESC"); while ($row = mysql_fetch_array($result)){ $chance = new User($row['owner_id']); $betAmount = number_format($row['betAmount']); if($row['betType'] == 1) { $bet = "$"; } elseif($row['betType'] == 2){ $bet = ""; } if($row['betType'] == 1) { $betType = "<i>($".$betAmount.")</i>"; } elseif($row['betType'] == 2){ $betType = "points";} if($user_class->id == $row['owner_id']){ $betAction = "<a href='5050chance.php?remove=".$row['id']."'>remove</a>"; } else { $betAction = "<a href='5050chance.php?match=".$row['id']."'>match</a>"; } echo " <tr> <td align='center'>".$chance->formattedname."</td> <td align='center'>".$bet."".$betAmount." ".$betType."</td> <td align='center'>".$betAction."</td> </tr>"; } ?> </table> </div><!-- end .content -->
  25. a other free layout some idea for layout would be great can post more   http://www.crocko.com/D7FD215883F94011AF789AB67EB46F95/layout.psd screen shot http://prntscr.com/8vi9o
×
×
  • Create New...