Jump to content

JasonTB

Members
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

0 Neutral

About JasonTB

  • Rank
    Beginner

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thank you for the suggests. I believe I understood it all and made the changes you suggested to both files.   On robdealer.php it did work without apostrophes but when I did it for corner.php the query would fail because the word "on" so I implemented on there not thinking I did the same on robdealer.php but thank you for pointing those few things out.
  2. Thanks for the input man I add in what you mention and also you made me think what if they could add a negative number so I look into fixing that also
  3. Rob a Local Dealer: This mod allows your members to rob a dealer once a day. There are three dealers weed, crack and heroin dealer. Depending on a chance the dealer can kill the player and put them in the hospital for 20 mins. The Corner: Where users have a chance to sell the drugs they took but also can get busted or robbed for their drugs. Run SQL: Copy Below or PasteBIN ALTER TABLE `users` ADD `rld` INT(1) NOT NULL ALTER TABLE `users` ADD `weed` INT(11) NOT NULL, ALTER TABLE `users` ADD `crack` INT(11) NOT NULL, ALTER TABLE `users` ADD `heroin` INT(11) NOT NULL Create file robdealer.php: Copy Below or PasteBIN <?php /* * Module Maker: JasonTB * Module Name: Rob a Local Dealer * Module Support: [email protected] or JasonTB on MWG */ require(__DIR__.'/globals.php'); $error = ' '; if($ir['hospital'] > 0){ $error .= "You can not rob a dealer while in the hospital. " ; } if($ir['jail'] > 0){ $error .= "You can not rob a dealer while in the jail. "; } if ($ir['rld'] != 0){ $error .= "You can only rob the local deals once a day."; } if($error <> ' ') { echo $error; $h->endpage(); exit; } if (!$_GET['action']){ echo"<h3>Rob a Local Dealer</h3><br /> You drove around the neighbor hood and notices three different dealers selling different things.<br /> Who would you like to rob?<br /> <a href='robdealer.php?action=weed'>Weed Dealer</a>   <a href='robdealer.php?action=crack'>Crack Dealer</a>   <a href='robdealer.php?action=heroin'>Heroin Dealer</a>"; } elseif ($_GET['action'] == 'weed'){ global $db, $ir, $c, $userid; $chance = rand(1, 10); $steal1 = rand(30, 125); if($chance < 6){ echo"The weed dealer seen you watching from down the block,<br /> without taking a chance he opens fires on you putting you in the hospital for 20 mins."; $db->query("UPDATE users SET hospital = hospital +20, hospreason = 'Shot by Weed Dealer', rld = 1 WHERE userid = {$ir['userid']}"); } else{ echo"You run up on the weed dealer and put your gun to his head,<br /> he drops all his drugs and runs away you pick up {$steal1} grams and disappear."; $db->query("UPDATE users SET weed = weed + {$steal1}, rld = 1 WHERE userid = {$ir['userid']}"); } } elseif ($_GET['action'] == 'crack'){ global $db, $ir, $c, $userid; $chance = rand(1, 10); $steal2 = rand(10, 50); if($chance < 4){ echo"The crack dealer seen you watching from down the block,<br /> without taking a chance he opens fires on you putting you in the hospital for 20 mins"; $db->query("UPDATE users SET hospital = hospital +20, hospreason = 'Shot by Crack Dealer', rld = 1 WHERE userid = {$ir['userid']}"); } else{ echo"You run up on the crack dealer and put your gun to his head,<br /> he dopes all his drugs and runs away you pick up {$steal2} ounces and disappear."; $db->query("UPDATE users SET crack = crack + {$steal2}, rld = 1 WHERE userid = {$ir['userid']}"); } } elseif ($_GET['action'] == 'heroin'){ global $db, $ir, $c, $userid; $chance = rand(1, 10); $steal3 = rand(5, 25); if($chance < 2){ echo"The heroin dealer seen you watching from down the block,<br /> without taking a chance he opens fires on you putting you in the hospital for 20 mins"; $db->query("UPDATE users SET hospital = hospital +20, hospreason = 'Shot by Heroin Dealer', rld = 1 WHERE userid = {$ir['userid']}"); } else{ echo"You run up on the heroin dealer and put your gun to his head,<br /> he dopes all his drugs and runs away you pick up {$steal3} grams and disappear."; $db->query("UPDATE users SET heroin = herion + {$steal3}, rld = 1 WHERE userid = {$ir['userid']}"); } } $h->endpage(); Create file corner.php: Copy Below or PasteBIN <?php /* * Module Maker: JasonTB * Module Name: The Corner * Module Support: [email protected] or JasonTB on MWG */ require(__DIR__.'/globals.php'); $error = ' '; if($ir['hospital'] > 0){ $error .= "You can not rob a dealer while in the hospital. " ; } if($ir['jail'] > 0){ $error .= "You can not rob a dealer while in the jail. "; } if($error <> ' ') { echo $error; $h->endpage(); exit; } if (!$_GET['sell']) { echo"<h3>The Corner</h3><br /> You bout to head down to the corner to get rid of the drugs you have.<br /> How much you going to take with you?<br><br> <form action='corner.php?sell=weed' method='post'> Weed: <input type='text' name='weed' value='{$ir['weed']}' /> <input type='submit' value='Sell' /></form><br> <form action='corner.php?sell=crack' method='post'> Crack: <input type='text' name='crack' value='{$ir['crack']}' /> <input type='submit' value='Sell' /></form><br> <form action='corner.php?sell=heroin' method='post'> Heroin: <input type='text' name='heroin' value='{$ir['heroin']}' /> <input type='submit' value='Sell' /></form>"; } if ($_GET['sell'] == 'weed'){ global $db, $ir, $c, $userid; $amt1 = isset($_POST['weed']) && ctype_digit($_POST['weed']) ? abs(intval($_POST['weed'])) : 0; $gain1 = $_POST['weed'] * 1000; $chance = rand(1, 10); if ($ir['weed'] <= 0){ echo "You have no weed to sell on the corner<br> <a href='corner.php'>Go Back</a>"; } elseif (empty($amt1)){ echo"You didn't bring any weed.<br> <a href='corner.php'>Go Back</a>"; } elseif ($amt1 <= 0){ echo"You didn't bring any weed.<br> <a href='corner.php'>Go Back</a>"; } elseif($chance >= 4){ echo"Two hippies come up to you asking for weed you give them $amt1 grams,<br> in return they give you ".money_formatter($gain1)."."; $db->query("UPDATE users SET money = money + {$gain1}, weed = weed - {$amt1} WHERE userid = {$ir['userid']}"); } elseif($chance == 1){ echo"Two men dressed in ripped up clothes ask if you have weed you have them $amt1 grams,<br> they grab your arm and slap handcuffs on you and take you to jail for 20 mins."; $db->query("UPDATE users SET jail = 20, jail_reason = 'Busted on The Corner', weed = weed - {$amt1} WHERE userid = {$ir['userid']}"); } else{ echo"Two thugs come up to you and tell you to hand over your drugs,<br> you do in return they put a bullet in your chest putting you in the hospital for 20 mins."; $db->query("UPDATE users SET hospital = 20, hospreason = 'Robbed on The Corner', weed = weed - {$amt1} WHERE userid = {$ir['userid']}"); } } if ($_GET['sell'] == 'crack'){ global $db, $ir, $c, $userid; $amt2 = isset($_POST['crack']) && ctype_digit($_POST['crack']) ? abs(intval($_POST['crack'])) : 0; $gain2 = $_POST['crack'] * 2500; $chance = rand(1, 10); if ($ir['crack'] <= 0){ echo "You have no crack to sell on the corner<br> <a href='corner.php'>Go Back</a>"; } elseif (empty($amt2)){ echo"You didn't bring any crack.<br> <a href='corner.php'>Go Back</a>"; } elseif ($amt2 <= 0){ echo"You didn't bring any crack.<br> <a href='corner.php'>Go Back</a>"; } elseif($chance >= 4){ echo"Two crack head come up to you asking for weed you give them $amt2 ounces,<br> in return they give you ".money_formatter($gain2)."."; $db->query("UPDATE users SET money = money + {$gain2}, crack = crack - {$amt2} WHERE userid = {$ir['userid']}"); } elseif($chance == 1){ echo"Two men dressed in ripped up clothes ask if you have crack you have them $amt1 ounces,<br> they grab your arm and slap handcuffs on you and take you to jail for 20 mins."; $db->query("UPDATE users SET jail = 20, jail_reason = 'Busted on The Corner', crack = crack - {$amt2} WHERE userid = {$ir['userid']}"); } else{ echo"Two thugs come up to you and tell you to hand over your drugs,<br> you do in return they put a bullet in your chest putting you in the hospital for 20 mins."; $db->query("UPDATE users SET hospital = 20, hospreason = 'Robbed on The Corner', crack = crack - {$amt2} WHERE userid = {$ir['userid']}"); } } if ($_GET['sell'] == 'heroin'){ global $db, $ir, $c, $userid; $amt3 = isset($_POST['heroin']) && ctype_digit($_POST['heroin']) ? abs(intval($_POST['heroin'])) : 0; $gain3 = $_POST['heroin'] * 5000; $chance = rand(1, 10); if ($ir['heroin'] <= 0){ echo "You have no heroin to sell on the corner<br> <a href='corner.php'>Go Back</a>"; } elseif (empty($amt3)){ echo"You didn't bring any heroin.<br> <a href='corner.php'>Go Back</a>"; } elseif ($amt3 <= 0){ echo"You didn't bring any heroin.<br> <a href='corner.php'>Go Back</a>"; } elseif($chance >= 4){ echo"Two druggies come up to you asking for heroin you give them $amt3 grams,<br> in return they give you ".money_formatter($gain3)."."; $db->query("UPDATE users SET money = money + {$gain3}, heroin = heroin - {$amt3} WHERE userid = {$ir['userid']}"); } elseif($chance == 1){ echo"Two men dressed in ripped up clothes ask if you have heroin you have them $amt3 grams,<br> they grab your arm and slap handcuffs on you and take you to jail for 20 mins."; $db->query("UPDATE users SET jail = 20, jail_reason = 'Busted on The Corner', heroin = heroin - {$amt3} WHERE userid = {$ir['userid']}"); } else{ echo"Two thugs come up to you and tell you to hand over your drugs,<br> you do in return they put a bullet in your chest putting you in the hospital for 20 mins."; $db->query("UPDATE users SET hospital = 20, hospreason = 'Robbed on The Corner', heroin = heroin - {$amt3} WHERE userid = {$ir['userid']}"); } } $h->endpage(); Edit Your Day Cron File: Copy Below or PasteBIN $db->query("UPDATE users SET rld = 0"); This is the first mod I've ever made so if there is things I can tweak please let me know. I tested it and didn't find anything wrong but like I said this is my first mod ever so there maybe some flaws. Edit Notes: Added in the little security check NonStopCoding Suggested Also fixed it so user cant sell negative amount of drugs Added and cleaned up spots as G7470 Suggested
  4. It is whatever I just wanted to post that it still works, just incase someone needed help getting it to work you know but thanks man.   So you want me to take this guys work and the little tweaking I did and make a new post
  5. Do you need help with it? PM me what you are stuck on and maybe i can help figure it out.
  6. Another cool one is snow I did not make this but figured I share because you can google and find it and its close to winter time. Make a .js called jquery.snow.min.js copy paste this into the file /** * jquery.snow - jQuery Snow Effect Plugin * * Available under MIT licence * * @version 1 (21. Jan 2012) * [MENTION=68990]Auth[/MENTION]or Ivan Lazarevic * @requires jQuery * @see [url]http://workshop.rs[/url] * * @params minSize - min size of snowflake, 10 by default * @params maxSize - max size of snowflake, 20 by default * @params newOn - frequency in ms of appearing of new snowflake, 500 by default * @params flakeColor - color of snowflake, #FFFFFF by default * @example $.fn.snow({ maxSize: 200, newOn: 1000 }); */ (function($){$.fn.snow=function(options){var $flake=$('<div id="flake" />').css({'position':'absolute','top':'-50px'}).html('❄'),documentHeight=$(document).height(),documentWidth=$(document).width(), defaults={minSize:10,maxSize:15,newOn:500,flakeColor:"#FFFFFF"},options=$.extend({},defaults,options);var interval=setInterval(function(){var startPositionLeft=Math.random()*documentWidth-100, startOpacity=0.5+Math.random(),sizeFlake=options.minSize+Math.random()*options.maxSize,endPositionTop=documentHeight-40,endPositionLeft=startPositionLeft-100+Math.random()*200, durationFall=documentHeight*10+Math.random()*5000;$flake.clone().appendTo('body').css({left:startPositionLeft,opacity:startOpacity, 'font-size':sizeFlake,color:options.flakeColor}).animate({top:endPositionTop,left:endPositionLeft,opacity:0.2},durationFall,'linear', function(){$(this).remove()});},options.newOn);};})(jQuery);   Now place that file in your js folder Place this before </head> in your header.php <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"></script> <script src="../js/jquery.snow.min.js"></script>   Now to activate it you can place this also before </head> or right after it <script> $(document).ready( function(){ $.fn.snow(); }); </script>
  7. Took me a sec to look at but got it to work 8yrs later gw
×
×
  • Create New...