-
Posts
2,657 -
Joined
-
Last visited
-
Days Won
74
Content Type
Profiles
Forums
Events
Everything posted by Uridium
-
Re: Have any mod ideas post here! if its ideas your after ;) 1 = get rid of all the stupid get rich quick ways. 2 = get rid of the ability for users to able to refill everything 3 = better installer so you can rename the game currency 4 = sort the attack.php page out for one that actually works 5 = add ability for NPCS to attack users aswell as users attacking NPCS 6 = Stop over ranked players being able to attack ver low ranked players ;) 7 = better table structures so the users table isnt so stressed 8 = finally fix all the sql injections and loop holes 9 = stop 12 year old kids buying mcc and posting crap on here ;)
-
Re: [mccode v2] Farming Gangsters and Mobsters are very busy these days :) I suppose farming helps them think :)
-
probably wont mean much to some people lol but ive decided to call it a day with MCC Only been here a short while and ive learnt a lot off here and have had some help from some great script writers. those being Zero-Affect, Killah and Radio-Active. I only made my scripts free too Annoy those that was selling them at the time.. But ive come to understand the hard work thats involved and the time theyve given to produce some great works.. Well anyway.. enough from me have Fun and I hope Everyone has a great Xmas and prosperous new year.. Illusions..
-
[mccode v2] Parse The Parcel - [Re-Programmed]
Uridium replied to Haunted Dawg's topic in Free Modifications
Re: [mccode v2] Parse The Parcel - [Re-Programmed] This mod doesnt just need to be used for Xmas by changing the text you can alter it to become useful at any time of the year. -
[mccode v2] Parse The Parcel - [Re-Programmed]
Uridium replied to Haunted Dawg's topic in Free Modifications
Re: [MCCodes V2] - Parse The Parcel - [Re-Programmed] Whey hey i will be glad to see this running smoothly ive had sleepless nights with this one.. I kinda bit off more than i could chew with this idea but did my best to make it a reality.. Its kind of annoying when you get an idea in your head one that wont go away so you think I KNOW i'll put it on a script which is easier said than done. The Theme Creator idea came when i was fed up of looking at the same screen layout day in day out. which im pleased to say with the help of KILLAH yet again ;) it was born and works great. You can see now why i never sell my scripts one coz even i dont trust em lol and two id be gutted if it didnt work when someone had paid their cash for it.. I have too seriously thank Killah and radio-Active for their enormous help with this silly idea of mine.. what you see today is just a script on a forum what you gain from it tomorrow is entirely up to you.... -
[mccode v2] Pass Parcel or Secret Santa [Working Copy]
Uridium replied to Uridium's topic in Free Modifications
Re: [Mccodes v2] Pass Parcel or Secret Santa [Working Copy] Waiting on MSN for ya -
[mccode v2] Pass Parcel or Secret Santa [Working Copy]
Uridium replied to Uridium's topic in Free Modifications
Re: [Mccodes v2] Pass Parcel or Secret Santa [Working Copy] which LINK are you pressing when you get the error -
[mccode v2] Pass Parcel or Secret Santa [Working Copy]
Uridium replied to Uridium's topic in Free Modifications
Re: [Mccodes v2] Pass Parcel or Secret Santa [Working Copy] I'll leave you too it obviously you seem to know more about it than me lol oh and regards the updated staff_parcel that you say ISNT correct how about using it and finding out :) -
[mccode v2] Pass Parcel or Secret Santa [Working Copy]
Uridium replied to Uridium's topic in Free Modifications
Re: [Mccodes v2] Pass Parcel or Secret Santa [Working Copy] Sorry for the delay had to test it first...... the sqls are the same with one extra. open inventory.php or items.php ADD $d=$db->query("SELECT * FROM users WHERE parcel=1",$c); $parceli=$db->fetch_row($d); if ($db->num_rows($parcel) == 0) { //Just kill me im not worth the space this line takes up aye } else { if ($db->num_rows($parcel) == 1) print"<h1>Your in Posession of a Parcel Click <h3>[url='wrapper.php?parcel=unwrap'] << here >></h3>[/url]<h1> to remove a layer</h1> <hr />"; } $inv=$db->query("SELECT iv.*,i.*,it.* FROM parcelinventory iv LEFT JOIN items i ON iv.parcelinv_itemid=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.parcelinv_userid={$userid} ORDER BY i.itmtype ASC, i.itmname ASC"); if ($db->num_rows($inv) == 0) { print ""; } Thanks to Radio-Active for this script :) Call this file wrapper.php <?php include "globals.php"; if($ir['parcel'] = 0) { die("You Dont have A Parcel"); exit; } $d = $db->query("SELECT `parcelinv_id`,`parcelinv_itemid`,`parcelinv_userid`,`parcelinv_qty` FROM parcelinventory WHERE parcelinv_qty = 1" ); $parcel=$db->fetch_row($d); switch($_GET['parcel']) { case 'unwrap': unwrap(); break; case 'unwrapdo': unwrapdo(); break; case 'takeprize': takeprize(); break; default: print "Error: This script requires an action."; break; } function unwrap() { global $db,$ir,$c,$userid,$parcelid; if($ir['parcel'] = 0) { die("You Dont have A Parcel"); exit; } $d = $db->query("SELECT `parcelid`,`parcelamount` FROM parcel" ); $select = $db->fetch_row($d); $bh = $db->query('SELECT `userid`,`username`,`parcel` FROM `users`'); $nh= $db->num_rows($bh); $nj= $db->fetch_row($bh); $nk = rand(1,$nh); if($ir['parcel'] > 0) { echo " Come back when you have something to unwrap"; die("403"); exit; } global $db,$ir,$c,$userid,$parcelid; $d = $db->query("SELECT `parcelid`,`parcelamount` FROM parcel" ); $select = $db->fetch_row($d); $bh = $db->query('SELECT `userid`,`username`,`parcel` FROM `users`'); $nh= $db->num_rows($bh); $nj= $db->fetch_row($bh); $nk = rand(1,$nh); if($ir['parcel'] = 0) { echo " Come back when you have something to unwrap"; //$h->endpage(); exit; } elseif ($ir['parcel'] = 1) { echo "<h3>Remove a Layer of Wrapping</h3> <form action='wrapper.php?parcel=unwrapdo' method='post'> <input type='hidden' name='unwrap'/> <input type='submit' value='Unwrap Present' /> </form>"; } } function unwrapdo() { global $db,$ir,$c,$userid,$parcelid; $d = $db->query("SELECT `parcelid`,`parcelamount` FROM parcel" ); $select = $db->fetch_row($d); $bh = $db->query('SELECT `userid`,`username`,`parcel` FROM `users`'); $nh= $db->num_rows($bh); $nj= $db->fetch_row($bh); $nk = rand(1,$nh); if($select['parcelamount'] > 1) { $parcel = "You removed a layer"; $db->query("DELETE FROM parcelinventory WHERE parcelinv_userid=$userid",$c); $db->query(sprintf("UPDATE `parcel` SET parcelamount = parcelamount - %d", 1 )); $db->query(sprintf("UPDATE users SET parcel = 0 WHERE userid = %d", $userid) ); $db->query(sprintf("UPDATE users SET parcel = %d WHERE userid = %d", 0, $nk ) ); $parcel = "You removed a layer"; } if($ir['parcel'] == 0) { echo " You dont have a parcel in your posession"; //$h->endpage(); exit; } else { echo " ".$parcel." "; } } function takeprize() { global $db,$ir,$c,$userid,$parcelid; if($ir['parcel'] = 0) { echo " You dont have a parcel in your posession"; $h->endpage(); exit; } else { $parcel = "You removed the last layer of the parcel, congratulations. Choose your prize <form action='wrapper.php?parcel=takeprize' method='post'> Your user ID: <input type='text' name='user' value='0' /> Choose Prize: ".item_dropdown($c,'item')." <input type='hidden' name='qty' value='1' /> <input type='submit' value='Accept Your Prize' /> <h1>WARNING!</h1> Do not refresh this page or you will lose your prize. </form>"; } $db->query(sprintf("INSERT INTO inventory (inv_id,inv_itemid,inv_userid,inv_qty) VALUES (%d,%u,%u,%d)", '', (int)$_POST['item'], (int)$_POST['item'], 1 ) ); $db->query(sprintf("UPDATE parcelinventory SET parcelinv_qty=0 WHERE parcelinv_userid = %d ", $userid ) ); echo "<h1>Check your Inventory for your Prize</h1>"; event_add($_POST['user'],"You Received {$_POST['qty']} parcel ID {$_POST['item']} to user ID {$_POST['user']}",$c); stafflog_add("Gave {$_POST['qty']} of parcel ID {$_POST['item']} to user ID {$_POST['user']}"); $db->query(sprintf("UPDATE parcelinventory SET parcelinv_qty=0 WHERE parcelinv_userid= %d", $userid) ); } $h->endpage(); ?> RESTRUCTURED staff panel for parcels call this file staff_parcel.php <?php include "sglobals.php"; //This contains parcel stuffs switch($_GET['action']) { case 'newparcel': new_parcel_form(); break; case 'newparcelub': new_parcel_submit(); break; case 'giveparcel': give_parcel_form(); break; case 'giveparcelub': give_parcel_submit(); break; case 'killparcel': kill_parcel_form(); break; case 'killparcelub': kill_parcel_submit(); break; case 'editparcel': edit_parcel_begin(); break; case 'editparcelform': edit_parcel_form(); break; case 'editparcelub': edit_parcel_sub(); break; case 'newparceltype': newparceltype(); break; case 'editparceltype': editparceltype(); break; case 'editparceltypeform': editparceltypeform(); break; case 'editparceltypesub': editparceltypesub(); break; case 'delparceltype': delparceltype(); break; case 'delparceltypesub': delparceltypesub(); break; case 'whosgotit': whosgotit(); break; default: print "Error: This script requires an action."; break; } function new_parcel_form() { global $db,$ir,$c; if($ir['user_level'] > 2) { die("403"); } print "<h3>Adding an parcel to the game</h3><form action='staff_parcel.php?action=newparcelub' method='post'> parcel ID: <input type='text' name='parcelid' value='' /> parcel Name: <input type='text' name='parcelname' value='' /> parcel Desc.: <input type='text' name='parceldesc' value='' /> wrapper Amount: <input type='text' name='parcelamount' /> parcel Prize: ".item_dropdown($c,'parcelprize')." [b]parcel Pics[/b] If you cannot find an Image put default.jpg in the text area <input type='text' name='parcelpic' value='default.jpg' /><hr /> <input type='submit' value='Add parcel To Game' /></form>"; } function new_parcel_submit() { global $db,$ir,$c,$h; if($ir['user_level'] > 2) { die("403"); } if(!isset($_POST['parcelname']) || !isset($_POST['parceldesc'])) { print "You missed one or more of the fields. Please go back and try again. [url='staff_parcel.php?action=newparcel']> Back[/url]"; $h->endpage(); exit; } $parcelname=$db->escape($_POST['parcelname']); $parceldesc=$db->escape($_POST['parceldesc']); $parceltype=$db->escape($_POST['parceltype']); $parcelamount=$db->escape($_POST['parcelamount']); $parcelprize=$db->escape($_POST['parcelprize']); $parcelpic=$db->escape($_POST['parcelpic']); $m=$db->query("INSERT INTO parcel VALUES('','{$_POST['parcelid']}','$parcelname','$parceldesc','{$_POST['parcelamount']}', '{$_POST['parcelpic']}','{$_POST['parcelprize']}')"); print "The {$_POST['parcelname']} parcel was added to the game."; stafflog_add("Created parcel {$_POST['parcelname']}"); } function give_parcel_form() { global $db,$ir,$c; if($ir['user_level'] > 3) { die("403"); } print "<h3>Giving parcel To User</h3> <form action='staff_parcel.php?action=giveparcelub' method='post'> User: ".user_dropdown($c,'user')." parcel: ".parcelgift_dropdown($c,'parcelgift')." Quantity: <input type='text' name='qty' value='1' /> <input type='submit' value='Give parcel' /></form>"; } function give_parcel_submit() { global $db,$ir,$c; if($ir['user_level'] > 3) { die("403"); } $db->query("INSERT INTO parcelinventory VALUES('',{$_POST['parcelgift']},{$_POST['user']},{$_POST['qty']})",$c) or die(mysql_error()); print "You gave {$_POST['qty']} of parcel ID {$_POST['parcelgift']} to user ID {$_POST['user']}"; stafflog_add("Gave {$_POST['qty']} of parcel ID {$_POST['parcelgift']} to user ID {$_POST['user']}"); } function kill_parcel_form() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } print "<h3>Deleting parcel</h3> The parcel will be permanently removed from the game. <form action='staff_parcel.php?action=killparcelub' method='post'> parcel: ".parcel_dropdown($c,'parcel')." <input type='submit' value='Kill parcel' /></form>"; } function kill_parcel_submit() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM parcel WHERE parcelid={$_POST['parcel']}"); $parceli=$db->fetch_row($d); $db->query("DELETE FROM parcel WHERE parcelid={$_POST['parcel']}"); print "The {$parceli['parcelname']} parcel was removed from the game."; stafflog_add("Deleted parcel {$parceli['parcelname']}"); } function edit_parcel_begin() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } print "<h3>Editing parcel</h3> You can edit any aspect of this parcel. <form action='staff_parcel.php?action=editparcelform' method='post'> parcel: ".parcel_dropdown($c,'parcel')." <input type='submit' value='Edit parcel' /></form>"; } function edit_parcel_form() { global $db,$ir,$c,$h; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM parcel WHERE parcelid={$_POST['parcel']}"); $parceli=$db->fetch_row($d); print "<h3>Editing parcel</h3> <form action='staff_parcel.php?action=editparcelub' method='post'> <input type='hidden' name='parcelid' value='{$_POST['parcel']}' /> parcel Name: <input type='text' name='parcelname' value='{$parceli['parcelname']}' /> parcel Desc.: <input type='text' name='parceldesc' value='{$parceli['parceldesc']}' /> wrapper Amount: <input type='text' name='parcelamount' value='{$parceli['parcelamount']}' /> parcel Prize: ".item_dropdown($c,'parcelprize',$parceli['parcelprize'])." [b]parcel Pics[/b] <input type='text' name='parcelpic' value='{$parceli['parcelpic']}' /><hr /> <input type='submit' value='Edit parcel' /></form> <center>parcel Image Available [img=parcelpics/{$parceli[]"; } function edit_parcel_sub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } if(!isset($_POST['parcelname']) || !isset($_POST['parceldesc'])) { print "You missed one or more of the fields. Please go back and try again. [url='staff_parcel.php?action=editparcel']> Back[/url]"; $h->endpage(); exit; } $parcelname=$db->escape($_POST['parcelname']); $parceldesc=$db->escape($_POST['parceldesc']); $parceltype=$db->escape($_POST['parceltype']); $parcelamount=$db->escape($_POST['parcelamount']); $parcelprize=$db->escape($_POST['parcelprize']); $parcelpic=$db->escape($_POST['parcelpic']); $db->query("DELETE FROM parcel WHERE parcelid={$_POST['parcelid']}",$c); $m=$db->query("INSERT INTO parcel VALUES('','{$_POST['parcelid']}','$parcelname','$parceldesc','{$_POST['parcelamount']}', '{$_POST['parcelpic']}','{$_POST['parcelprize']}')"); print "The {$_POST['parcelname']} parcel was edited successfully."; stafflog_add("Edited parcel {$_POST['parcelname']}"); } function newparceltype() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } if($_POST['name']) { $db->query("INSERT INTO parceltypes VALUES(NULL, '{$_POST['name']}')"); print "parcel Type {$_POST['name']} added."; stafflog_add("Added parcel type {$_POST['name']}"); } else { print "<h3>Add parcel Type</h3><hr /> <form action='staff_parcel.php?action=newparceltype' method='post'> Name: <input type='text' name='name' /> <input type='submit' value='Add parcel Type' /></form>"; } } function editparceltype() { global $db,$ir,$c,$h,$userid; print "<h3>Remove parcel Type</h3><hr /> <form action='staff_parcel.php?action=editparceltypeform' method='post'> Name: ".parcel_dropdown($c,'parcel')." <input type='submit' value='Edit parcel Type' /></form> "; } function editparceltypeform() { global $db,$ir,$c,$h,$userid; $d=$db->query("SELECT * FROM parceltypes WHERE parceltypeid={$_POST['parceltypeid']}"); $parcelt=$db->fetch_row($d); print "<h3>Edit parcel Type</h3><hr /> <form action='staff_parcel.php?action=editparceltypesub' method='post'> <input type='hidden' name='parcelid' value='{$_POST['parcel']}' /> Name: <input type='text' name='parcelname' value='{$parcelt['parcelname']}' /> <input type='submit' value='Edit parcel Type' /></form> "; } function editparceltypesub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $db->query("DELETE FROM parceltype WHERE parcelid={$_POST['parceltypeid']}"); $db->query("INSERT INTO parceltype VALUES('{$_POST['parceltypeid']}', '{$_POST['parceltypename']}')"); print "The parceltype {$_POST['parceltypename']} has been edited."; stafflog_add("Edited parceltype {$_POST['parceltypename']}"); } function delparceltype() { global $db,$ir,$c,$h,$userid; print "<h3>Remove parcel Type</h3><hr /> <form action='staff_parcel.php?action=delparceltypesub' method='post'> Name: ".parceltype_dropdown($c,'parceltype')." <input type='submit' value='Remove parcel Type' /></form> "; } function delparceltypesub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM parceltypes WHERE parceltypeid={$_POST['parceltype']}"); $parcelt=$db->fetch_row($d); $db->query("DELETE FROM parceltypes WHERE parcelid={$_POST['parcelid']}"); print "The parceltype {$parcelt['parceltypename']} has been removed from the game."; stafflog_add("Deleted parceltype {$parcelt['parceltypename']}"); } function mass_give_parcel() { global $db,$ir,$c; print "<h3>Giving parcel To All Users</h3> <form action='staff_parcel.php?action=massparcelgivesub' method='post'> parcel: ".parcel_dropdown($c,'parcel')." Quantity: <input type='text' name='qty' value='1' /> <input type='submit' value='Mass Send' /></form>"; } function mass_give_parcel_sub() { global $db,$ir,$c; $q=mysql_query("SELECT * FROM users WHERE fedjail=0",$c); while($r=mysql_fetch_array($q)) { $db->query("INSERT INTO inventory VALUES('',{$_POST['parcel']},{$r['userid']},{$_POST['qty']})",$c) or die(mysql_error()); event_add($r['userid'],"All users were given an parcel {$_POST['parcel']}, Click [url='inventory.php']Here[/url] to check.",$c); print "parcel Sent To {$r['username']}</br>"; } print " <font color=blue>Mass parcel sending complete!</br></font>"; stafflog_add("Gave {$_POST['qty']} of parcel ID {$_POST['parcel']} to all users"); } function whosgotit() { global $db,$ir,$c,$userid; $q=mysql_query("SELECT parcelinv_qty=1 FROM parcelinventory WHERE parcelinv_userid=$userid",$c); while($r=$db->fetch_row($q)) { // Oh look a space aye } global $db,$ir,$c, $userid; $d=$db->query("SELECT parcelinv_qty=1 FROM parcelinventory WHERE parcelinv_userid=$userid",$c); $parcel=$db->fetch_row($d); } if($ir['parcel'] = 0) { die(" <h2><font color=yellow>Nobody has the Parcel</h2>"); } if($ir['parcel'] = 1) { die(" <h2><font color=yellow>{$ir['username']} Has The Parcel at the moment</h2>"); } $h->endpage(); ?> add the following to your users tabel ALTER TABLE users ADD parcel INT (11) DEFAULT '0' No Need For a Cronjob.. -
[mccode v2] Themecreator 100% Completed Working Copy
Uridium replied to Uridium's topic in Free Modifications
Re: [mccode v2] Themecreator 100% Completed Working Copy the top and bottom values are Numerical only the middle is charcters so 1 new theme loook 1 -
[mccode v2] Pass Parcel or Secret Santa [Working Copy]
Uridium replied to Uridium's topic in Free Modifications
Re: [Mccodes v2] Pass Parcel or Secret Santa [Working Copy] Dont worry I havent forgot about this Post im still on the case ;) Big thanks to Radio_Active though for his generous help on the project :) Im hoping to have the working copy and i mean WORKING copy posted later today.. Probably wont have as many functions as i did declare thats coz MCC's crap.. lol and im a crap coder :) Reason for edit FAT FINGERS... -
[mccode v2] Pass Parcel or Secret Santa [Working Copy]
Uridium replied to Uridium's topic in Free Modifications
Re: [Mccodes v2] Pass Parcel or Secret Santa [Working Copy] Sorry about that guys it was finished up until the point i found a bug which is causing issues I have removed the ability to get a reward from the above script until i can find a cure for it.. But adding the script as it is now will not harm anything and will be easier for you when ive completed the wrapper.php file.. -
[mccode v2] Pass Parcel or Secret Santa [Working Copy]
Uridium replied to Uridium's topic in Free Modifications
Re: [Mccodes v2] Pass Parcel or Secret Santa [Working Copy] IGNORE THE staff_parcel.php Above and use this one.... <?php include "sglobals.php"; //This contains parcel stuffs switch($_GET['action']) { case 'newparcel': new_parcel_form(); break; case 'newparcelub': new_parcel_submit(); break; case 'giveparcel': give_parcel_form(); break; case 'giveparcelub': give_parcel_submit(); break; case 'killparcel': kill_parcel_form(); break; case 'killparcelub': kill_parcel_submit(); break; case 'editparcel': edit_parcel_begin(); break; case 'editparcelform': edit_parcel_form(); break; case 'editparcelub': edit_parcel_sub(); break; case 'newparceltype': newparceltype(); break; case 'editparceltype': editparceltype(); break; case 'editparceltypeform': editparceltypeform(); break; case 'editparceltypesub': editparceltypesub(); break; case 'delparceltype': delparceltype(); break; case 'delparceltypesub': delparceltypesub(); break; default: print "Error: This script requires an action."; break; } function new_parcel_form() { global $db,$ir,$c; if($ir['user_level'] > 2) { die("403"); } print "<h3>Adding an parcel to the game</h3><form action='staff_parcel.php?action=newparcelub' method='post'> parcel ID: <input type='text' name='parcelid' value='' /> parcel Name: <input type='text' name='parcelname' value='' /> parcel Desc.: <input type='text' name='parceldesc' value='' /> wrapper Amount: <input type='text' name='parcelamount' /> parcel Prize: ".item_dropdown($c,'parcelprize')." [b]parcel Pics[/b] If you cannot find an Image put default.jpg in the text area <input type='text' name='parcelpic' value='default.jpg' /><hr /> <input type='submit' value='Add parcel To Game' /></form>"; } function new_parcel_submit() { global $db,$ir,$c,$h; if($ir['user_level'] > 2) { die("403"); } if(!isset($_POST['parcelname']) || !isset($_POST['parceldesc'])) { print "You missed one or more of the fields. Please go back and try again. [url='staff_parcel.php?action=newparcel']> Back[/url]"; $h->endpage(); exit; } $parcelname=$db->escape($_POST['parcelname']); $parceldesc=$db->escape($_POST['parceldesc']); $parceltype=$db->escape($_POST['parceltype']); $parcelamount=$db->escape($_POST['parcelamount']); $parcelprize=$db->escape($_POST['parcelprize']); $parcelpic=$db->escape($_POST['parcelpic']); $m=$db->query("INSERT INTO parcel VALUES('','{$_POST['parcelid']}','$parcelname','$parceldesc','{$_POST['parcelamount']}', '{$_POST['parcelpic']}','{$_POST['parcelprize']}')"); print "The {$_POST['parcelname']} parcel was added to the game."; stafflog_add("Created parcel {$_POST['parcelname']}"); } function give_parcel_form() { global $db,$ir,$c; if($ir['user_level'] > 3) { die("403"); } print "<h3>Giving parcel To User</h3> <form action='staff_parcel.php?action=giveparcelub' method='post'> User: ".user_dropdown($c,'user')." parcel: ".parcelgift_dropdown($c,'parcelgift')." Quantity: <input type='text' name='qty' value='1' /> <input type='submit' value='Give parcel' /></form>"; } function give_parcel_submit() { global $db,$ir,$c; if($ir['user_level'] > 3) { die("403"); } $db->query("INSERT INTO parcelinventory VALUES('',{$_POST['parcelgift']},{$_POST['user']},{$_POST['qty']})",$c) or die(mysql_error()); print "You gave {$_POST['parcelgift']} of parcel ID {$_POST['parcelgift']} to user ID {$_POST['user']}"; stafflog_add("Gave {$_POST['qty']} of parcel ID {$_POST['parcelgift']} to user ID {$_POST['user']}"); } function kill_parcel_form() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } print "<h3>Deleting parcel</h3> The parcel will be permanently removed from the game. <form action='staff_parcel.php?action=killparcelub' method='post'> parcel: ".parcel_dropdown($c,'parcel')." <input type='submit' value='Kill parcel' /></form>"; } function kill_parcel_submit() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM parcel WHERE parcelid={$_POST['parcel']}"); $parceli=$db->fetch_row($d); $db->query("DELETE FROM parcel WHERE parcelid={$_POST['parcel']}"); print "The {$parceli['parcelname']} parcel was removed from the game."; stafflog_add("Deleted parcel {$parceli['parcelname']}"); } function edit_parcel_begin() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } print "<h3>Editing parcel</h3> You can edit any aspect of this parcel. <form action='staff_parcel.php?action=editparcelform' method='post'> parcel: ".parcel_dropdown($c,'parcel')." <input type='submit' value='Edit parcel' /></form>"; } function edit_parcel_form() { global $db,$ir,$c,$h; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM parcel WHERE parcelid={$_POST['parcel']}"); $parceli=$db->fetch_row($d); print "<h3>Editing parcel</h3> <form action='staff_parcel.php?action=editparcelub' method='post'> <input type='hidden' name='parcelid' value='{$_POST['parcel']}' /> parcel Name: <input type='text' name='parcelname' value='{$parceli['parcelname']}' /> parcel Desc.: <input type='text' name='parceldesc' value='{$parceli['parceldesc']}' /> wrapper Amount: <input type='text' name='parcelamount' value='{$parceli['parcelamount']}' /> parcel Prize: ".item_dropdown($c,'parcelprize',$parceli['parcelprize'])." [b]parcel Pics[/b] <input type='text' name='parcelpic' value='{$parceli['parcelpic']}' /><hr /> <input type='submit' value='Edit parcel' /></form> <center>parcel Image Available [img=parcelpics/{$parceli[]"; } function edit_parcel_sub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } if(!isset($_POST['parcelname']) || !isset($_POST['parceldesc'])) { print "You missed one or more of the fields. Please go back and try again. [url='staff_parcel.php?action=editparcel']> Back[/url]"; $h->endpage(); exit; } $parcelname=$db->escape($_POST['parcelname']); $parceldesc=$db->escape($_POST['parceldesc']); $parceltype=$db->escape($_POST['parceltype']); $parcelamount=$db->escape($_POST['parcelamount']); $parcelprize=$db->escape($_POST['parcelprize']); $parcelpic=$db->escape($_POST['parcelpic']); $db->query("DELETE FROM parcel WHERE parcelid={$_POST['parcelid']}",$c); $m=$db->query("INSERT INTO parcel VALUES('','{$_POST['parcelid']}','$parcelname','$parceldesc','{$_POST['parcelamount']}', '{$_POST['parcelpic']}','{$_POST['parcelprize']}')"); print "The {$_POST['parcelname']} parcel was edited successfully."; stafflog_add("Edited parcel {$_POST['parcelname']}"); } function newparceltype() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } if($_POST['name']) { $db->query("INSERT INTO parceltypes VALUES(NULL, '{$_POST['name']}')"); print "parcel Type {$_POST['name']} added."; stafflog_add("Added parcel type {$_POST['name']}"); } else { print "<h3>Add parcel Type</h3><hr /> <form action='staff_parcel.php?action=newparceltype' method='post'> Name: <input type='text' name='name' /> <input type='submit' value='Add parcel Type' /></form>"; } } function editparceltype() { global $db,$ir,$c,$h,$userid; print "<h3>Remove parcel Type</h3><hr /> <form action='staff_parcel.php?action=editparceltypeform' method='post'> Name: ".parcel_dropdown($c,'parcel')." <input type='submit' value='Edit parcel Type' /></form> "; } function editparceltypeform() { global $db,$ir,$c,$h,$userid; $d=$db->query("SELECT * FROM parceltypes WHERE parceltypeid={$_POST['parceltypeid']}"); $parcelt=$db->fetch_row($d); print "<h3>Edit parcel Type</h3><hr /> <form action='staff_parcel.php?action=editparceltypesub' method='post'> <input type='hidden' name='parcelid' value='{$_POST['parcel']}' /> Name: <input type='text' name='parcelname' value='{$parcelt['parcelname']}' /> <input type='submit' value='Edit parcel Type' /></form> "; } function editparceltypesub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $db->query("DELETE FROM parceltype WHERE parcelid={$_POST['parceltypeid']}"); $db->query("INSERT INTO parceltype VALUES('{$_POST['parceltypeid']}', '{$_POST['parceltypename']}')"); print "The parceltype {$_POST['parceltypename']} has been edited."; stafflog_add("Edited parceltype {$_POST['parceltypename']}"); } function delparceltype() { global $db,$ir,$c,$h,$userid; print "<h3>Remove parcel Type</h3><hr /> <form action='staff_parcel.php?action=delparceltypesub' method='post'> Name: ".parceltype_dropdown($c,'parceltype')." <input type='submit' value='Remove parcel Type' /></form> "; } function delparceltypesub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM parceltypes WHERE parceltypeid={$_POST['parceltype']}"); $parcelt=$db->fetch_row($d); $db->query("DELETE FROM parceltypes WHERE parcelid={$_POST['parcelid']}"); print "The parceltype {$parcelt['parceltypename']} has been removed from the game."; stafflog_add("Deleted parceltype {$parcelt['parceltypename']}"); } function mass_give_parcel() { global $db,$ir,$c; print "<h3>Giving parcel To All Users</h3> <form action='staff_parcel.php?action=massparcelgivesub' method='post'> parcel: ".parcel_dropdown($c,'parcel')." Quantity: <input type='text' name='qty' value='1' /> <input type='submit' value='Mass Send' /></form>"; } function mass_give_parcel_sub() { global $db,$ir,$c; $q=mysql_query("SELECT * FROM users WHERE fedjail=0",$c); while($r=mysql_fetch_array($q)) { $db->query("INSERT INTO inventory VALUES('',{$_POST['parcel']},{$r['userid']},{$_POST['qty']})",$c) or die(mysql_error()); event_add($r['userid'],"All users were given an parcel {$_POST['parcel']}, Click [url='inventory.php']Here[/url] to check.",$c); print "parcel Sent To {$r['username']}</br>"; } print " <font color=blue>Mass parcel sending complete!</br></font>"; stafflog_add("Gave {$_POST['qty']} of parcel ID {$_POST['parcel']} to all users"); } $h->endpage(); ?> ALSO add this to global_func.php function parceltype_dropdown($connection,$ddname="parceltype",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM parceltypes ORDER BY parceltypename ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['parceltypeid']}'"; if ($selected == $r['parceltypeid'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['parceltypename']}</option>"; } -
[mccode v2] Pass Parcel or Secret Santa [Working Copy]
Uridium replied to Uridium's topic in Free Modifications
Re: [Mccodes v2] Pass Parcel or Secret Santa [Working Copy] Ive got the drop down settings wrong will fix it and repost. -
[mccode v2] Pass Parcel or Secret Santa [Working Copy]
Uridium replied to Uridium's topic in Free Modifications
Re: [Mccodes v2] Pass Parcel or Secret Santa [Working Copy] Not as yet still working on the part to update user inventory with parcel gift.. also the Cron needs re-touching.. Just after i posted I found an error so erased the unworking parts from the wrapper.php -
[mccode v2] Pass Parcel or Secret Santa [Working Copy]
Uridium replied to Uridium's topic in Free Modifications
Re: [Mccodes v2] Pass Parcel or Secret Santa [Working Copy] open up inventory.php or items.php Add.... $parcel=$db->query("SELECT * FROM parcel WHERE parcelid=1"); if ($db->num_rows($parcel) == 0) { print "[b]You dont have a parcel yet![/b]"; } else { if ($db->num_rows($parcel) == 1) print"<h1>Youve found a Parcel Click <h3>[url='wrapper.php?action=unwrap'] << here >></h3>[/url]<h1> to remove a layer</h1> <hr />"; } $inv=$db->query("SELECT iv.*,i.*,it.* FROM parcelinventory iv LEFT JOIN items i ON iv.parcelinv_itemid=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.parcelinv_userid={$userid} ORDER BY i.itmtype ASC, i.itmname ASC"); if ($db->num_rows($inv) == 0) { print "[b]You have no Parcels![/b]"; } Now call this File wrapper.php <?php include "globals.php"; if($ir['parcelamount'] = 0) { print " Congratulations you opened the final Wrapper.."; } switch($_GET['action']) { case 'unwrap': unwrap(); break; case 'unwrapdo': unwrapdo(); break; default: print "Error: This script requires an action."; break; } function unwrap() { global $db,$ir,$c; $parcel=$db->query("SELECT * FROM parcel WHERE parcelid=1"); if($ir['parcel'] = 0) { die(" Come back when you have something to unwrap"); } if($ir['parcel'] = 1) { // hidden } print "<h3>Remove a Layer of Wrapping</h3> <form action='wrapper.php?action=unwrapdo' method='post'> <input type='hidden' name='unwrap' value='0' /> <input type='submit' value='Unwrap Present' /></form>"; } function unwrapdo() { global $db,$ir,$c; $db->query("UPDATE parcel SET parcelamount=parcelamount-1 WHERE parcelid=1"); print " You removed a layer! Sorry you were unsuccessful finding the prize.."; } $h->endpage(); ?> Open up global_func.php add this under the <?php function parcelgift_dropdown($connection,$ddname="parcelgift",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM parcel ORDER BY parcelname ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['parcelid']}'"; if ($selected == $r['parcelid'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['parcelname']}</option>"; } $ret.="\n</select>"; return $ret; } function parcel_dropdown($connection,$ddname="parcel",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM parcel ORDER BY parcelname ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['parceltypeid']}'"; if ($selected == $r['parceltypeid'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['parcelname']}</option>"; } $ret.="\n</select>"; return $ret; } -
This Mods Sends a Prcael when created by admin to a random user once a present has a lyer removed its moved onto the next member until the defined layers have been removed and the prize gained.... SQLS CREATE TABLE IF NOT EXISTS `parcel` ( `parcelid` int(11) NOT NULL auto_increment, `parceltype` int(11) NOT NULL default '0', `parcelname` varchar(255) collate latin1_general_ci NOT NULL default '', `parceldesc` text collate latin1_general_ci NOT NULL, `parcelamount` int(11) NOT NULL default '0', `parcelpic` varchar(255) collate latin1_general_ci NOT NULL default 'default.jpg', `parcelprize` int(11) NOT NULL default '0', PRIMARY KEY (`parcelid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=0 ; CREATE TABLE IF NOT EXISTS `parcelinventory` ( `parcelinv_id` int(11) NOT NULL auto_increment, `parcelinv_itemid` int(11) NOT NULL default '0', `parcelinv_userid` int(11) NOT NULL default '0', `parcelinv_qty` int(11) NOT NULL default '0', PRIMARY KEY (`parcelinv_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ; CREATE TABLE IF NOT EXISTS `parceltypes` ( `parceltypeid` int(11) NOT NULL auto_increment, `parceltypename` varchar(255) collate latin1_general_ci NOT NULL default '', `parcelamount` int(11) NOT NULL default '0', `parcelpic` varchar(255) collate latin1_general_ci NOT NULL default 'default.jpg', PRIMARY KEY (`parceltypeid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=0 ; Call this file staff_parcel.php <?php include "sglobals.php"; //This contains parcel stuffs switch($_GET['action']) { case 'newparcel': new_parcel_form(); break; case 'newparcelub': new_parcel_submit(); break; case 'giveparcel': give_parcel_form(); break; case 'giveparcelub': give_parcel_submit(); break; case 'killparcel': kill_parcel_form(); break; case 'killparcelub': kill_parcel_submit(); break; case 'editparcel': edit_parcel_begin(); break; case 'editparcelform': edit_parcel_form(); break; case 'editparcelub': edit_parcel_sub(); break; case 'newparceltype': newparceltype(); break; case 'editparceltype': editparceltype(); break; case 'editparceltypeform': editparceltypeform(); break; case 'editparceltypesub': editparceltypesub(); break; case 'delparceltype': delparceltype(); break; case 'delparceltypesub': delparceltypesub(); break; default: print "Error: This script requires an action."; break; } function new_parcel_form() { global $db,$ir,$c; if($ir['user_level'] > 2) { die("403"); } print "<h3>Adding an parcel to the game</h3><form action='staff_parcel.php?action=newparcelub' method='post'> parcel ID: <input type='text' name='parcelid' value='' /> parcel Name: <input type='text' name='parcelname' value='' /> parcel Desc.: <input type='text' name='parceldesc' value='' /> parcel Type: ".parcel_dropdown($c,'parceltype')." wrapper Amount: <input type='text' name='parcelamount' /> parcel Prize: ".item_dropdown($c,'parcelprize')." [b]parcel Pics[/b] If you cannot find an Image put default.jpg in the text area <input type='text' name='parcelpic' value='default.jpg' /><hr /> <input type='submit' value='Add parcel To Game' /></form>"; } function new_parcel_submit() { global $db,$ir,$c,$h; if($ir['user_level'] > 2) { die("403"); } if(!isset($_POST['parcelname']) || !isset($_POST['parceldesc'])) { print "You missed one or more of the fields. Please go back and try again. [url='staff_parcel.php?action=newparcel']> Back[/url]"; $h->endpage(); exit; } $parcelname=$db->escape($_POST['parcelname']); $parceldesc=$db->escape($_POST['parceldesc']); $parceltype=$db->escape($_POST['parceltype']); $parcelamount=$db->escape($_POST['parcelamount']); $parcelprize=$db->escape($_POST['parcelprize']); $parcelpic=$db->escape($_POST['parcelpic']); $m=$db->query("INSERT INTO parcel VALUES('','{$_POST['parcelid']}','$parcelname','$parceldesc','{$_POST['parcelamount']}', '{$_POST['parcelpic']}','{$_POST['parcelprize']}')"); print "The {$_POST['parcelname']} parcel was added to the game."; stafflog_add("Created parcel {$_POST['parcelname']}"); } function give_parcel_form() { global $db,$ir,$c; if($ir['user_level'] > 3) { die("403"); } print "<h3>Giving parcel To User</h3> <form action='staff_parcel.php?action=giveparcelub' method='post'> User: ".user_dropdown($c,'user')." parcel: ".parcelgift_dropdown($c,'parcelgift')." Quantity: <input type='text' name='qty' value='1' /> <input type='submit' value='Give parcel' /></form>"; } function give_parcel_submit() { global $db,$ir,$c; if($ir['user_level'] > 3) { die("403"); } $db->query("INSERT INTO parcelinventory VALUES('',{$_POST['parcelgift']},{$_POST['user']},{$_POST['qty']})",$c) or die(mysql_error()); print "You gave {$_POST['parcelgift']} of parcel ID {$_POST['parcelgift']} to user ID {$_POST['user']}"; stafflog_add("Gave {$_POST['qty']} of parcel ID {$_POST['parcelgift']} to user ID {$_POST['user']}"); } function kill_parcel_form() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } print "<h3>Deleting parcel</h3> The parcel will be permanently removed from the game. <form action='staff_parcel.php?action=killparcelub' method='post'> parcel: ".parcel_dropdown($c,'parcel')." <input type='submit' value='Kill parcel' /></form>"; } function kill_parcel_submit() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM parcel WHERE parcelid={$_POST['parcel']}"); $parceli=$db->fetch_row($d); $db->query("DELETE FROM parcel WHERE parcelid={$_POST['parcel']}"); $db->query("DELETE FROM parcelinventory WHERE parcelinv_parcelid={$_POST['parcel']}"); print "The {$parceli['parcelname']} parcel was removed from the game."; stafflog_add("Deleted parcel {$parceli['parcelname']}"); } function edit_parcel_begin() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } print "<h3>Editing parcel</h3> You can edit any aspect of this parcel. <form action='staff_parcel.php?action=editparcelform' method='post'> parcel: ".parcel_dropdown($c,'parcel')." <input type='submit' value='Edit parcel' /></form>"; } function edit_parcel_form() { global $db,$ir,$c,$h; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM parcel WHERE parcelid={$_POST['parcel']}"); $parceli=$db->fetch_row($d); print "<h3>Editing parcel</h3> <form action='staff_parcel.php?action=editparcelub' method='post'> <input type='hidden' name='parcelid' value='{$_POST['parcel']}' /> parcel Name: <input type='text' name='parcelname' value='{$parceli['parcelname']}' /> parcel Desc.: <input type='text' name='parceldesc' value='{$parceli['parceldesc']}' /> parcel Type: ".parcel_dropdown($c,'parceltype',$parceli['parceltype'])." wrapper Amount: <input type='text' name='parcelamount' value='{$parceli['parcelamount']}' /> parcel Prize: ".item_dropdown($c,'parcelprize',$parceli['parcelprize'])." [b]parcel Pics[/b] <input type='text' name='parcelpic' value='{$parceli['parcelpic']}' /><hr /> <input type='submit' value='Edit parcel' /></form> <center>parcel Image Available [img=parcelpics/{$parceli[]"; } function edit_parcel_sub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } if(!isset($_POST['parcelname']) || !isset($_POST['parceldesc'])) { print "You missed one or more of the fields. Please go back and try again. [url='staff_parcel.php?action=editparcel']> Back[/url]"; $h->endpage(); exit; } $parcelname=$db->escape($_POST['parcelname']); $parceldesc=$db->escape($_POST['parceldesc']); $parceltype=$db->escape($_POST['parceltype']); $parcelamount=$db->escape($_POST['parcelamount']); $parcelprize=$db->escape($_POST['parcelprize']); $parcelpic=$db->escape($_POST['parcelpic']); $m=$db->query("INSERT INTO parcel VALUES('','{$_POST['parcelid']}','$parcelname','$parceldesc','{$_POST['parcelamount']}', '{$_POST['parcelpic']}','{$_POST['parcelprize']}')"); print "The {$_POST['parcelname']} parcel was edited successfully."; stafflog_add("Edited parcel {$_POST['parcelname']}"); } function newparceltype() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } if($_POST['name']) { $db->query("INSERT INTO parceltypes VALUES(NULL, '{$_POST['name']}')"); print "parcel Type {$_POST['name']} added."; stafflog_add("Added parcel type {$_POST['name']}"); } else { print "<h3>Add parcel Type</h3><hr /> <form action='staff_parcel.php?action=newparceltype' method='post'> Name: <input type='text' name='name' /> <input type='submit' value='Add parcel Type' /></form>"; } } function editparceltype() { global $db,$ir,$c,$h,$userid; print "<h3>Remove parcel Type</h3><hr /> <form action='staff_parcel.php?action=editparceltypeform' method='post'> Name: ".parcel_dropdown($c,'parcel')." <input type='submit' value='Edit parcel Type' /></form> "; } function editparceltypeform() { global $db,$ir,$c,$h,$userid; $d=$db->query("SELECT * FROM parceltypes WHERE parceltypeid={$_POST['parceltype']}"); $parcelt=$db->fetch_row($d); print "<h3>Remove parcel Type</h3><hr /> <form action='staff_parcel.php?action=editparceltypesub' method='post'> <input type='hidden' name='parceltypeid' value='{$_POST['parceltype']}' /> Name: <input type='text' name='rename' value='{$parcelt['parceltypename']}' /> <input type='submit' value='Edit parcel Type' /></form> "; } function editparceltypesub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $db->query("DELETE FROM parceltypes WHERE parceltypeid={$_POST['parceltypeid']}"); $db->query("INSERT INTO parceltypes VALUES('{$_POST['parceltypeid']}', '{$_POST['rename']}')"); print "The parceltype {$_POST['rename']} has been edited."; stafflog_add("Edited parceltype {$_POST['rename']}"); } function delparceltype() { global $db,$ir,$c,$h,$userid; print "<h3>Remove parcel Type</h3><hr /> <form action='staff_parcel.php?action=delparceltypesub' method='post'> Name: ".parcel_dropdown($c,'parcel')." <input type='submit' value='Remove parcel Type' /></form> "; } function delparceltypesub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM parceltypes WHERE parceltypeid={$_POST['parceltype']}"); $parcelt=$db->fetch_row($d); $db->query("DELETE FROM parceltypes WHERE parceltypeid={$_POST['parceltype']}"); print "The parceltype {$parcelt['parceltypename']} has been removed from the game."; stafflog_add("Deleted parceltype {$parcelt['parceltypename']}"); } function mass_give_parcel() { global $db,$ir,$c; print "<h3>Giving parcel To All Users</h3> <form action='staff_parcel.php?action=massparcelgivesub' method='post'> parcel: ".parcel_dropdown($c,'parcel')." Quantity: <input type='text' name='qty' value='1' /> <input type='submit' value='Mass Send' /></form>"; } function mass_give_parcel_sub() { global $db,$ir,$c; $q=mysql_query("SELECT * FROM users WHERE fedjail=0",$c); while($r=mysql_fetch_array($q)) { $db->query("INSERT INTO inventory VALUES('',{$_POST['parcel']},{$r['userid']},{$_POST['qty']})",$c) or die(mysql_error()); event_add($r['userid'],"All users were given an parcel {$_POST['parcel']}, Click [url='inventory.php']Here[/url] to check.",$c); print "parcel Sent To {$r['username']}</br>"; } print " <font color=blue>Mass parcel sending complete!</br></font>"; stafflog_add("Gave {$_POST['qty']} of parcel ID {$_POST['parcel']} to all users"); } $h->endpage(); ?> add these links to smenu.php > [url='staff_parcel.php?action=newparcel']New Parcel[/url] > [url='staff_parcel.php?action=editparcel']Edit Parcel[/url] > [url='staff_parcel.php?action=killparcel']Delete A Parcel[/url] > [url='staff_parcel.php?action=newparceltype']Create Parcel Type[/url] > [url='staff_parcel.php?action=editparceltype']Edit Parcel Type[/url] > [url='staff_parcel.php?action=delparceltype']Delete A Parcel Type[/url] > [url='staff_parcel.php?action=giveparcel']Give Parcel To User[/url] PART 2 BELOW
-
Re: [mccode V2] City Pic xD The only reason i do my scripts that way with the use of the admin panel it saves the user constantly having to update php files.. they can do it straight from the site which saves time..
-
Re: [mccode V2] City Pic xD call this file staff_cities.php backup your old file 1st incase youve added extra than whats here.. <?php include "sglobals.php"; if($ir['user_level'] > 2) { echo '<font color="#ff0000">[b]Error![/b]</font>'; $h->endpage(); exit; } $_GET['action'] = isset($_GET['action']) && is_string($_GET['action']) ? strtolower(trim($_GET['action'])) : ""; switch($_GET['action']) { case "addcity": addcity(); break; case "editcity": editcity(); break; case "delcity": delcity(); break; default: print "<font color='#ff0000'>[b]Error! This script requires an action.[/b]</font>"; break; } function addcity() { global $db, $ir, $c, $h, $userid; $minlevel=abs((int) $_POST['minlevel']); $name=$_POST['name']; $desc=$_POST['desc']; $cityimage=$_POST['cityimage']; if($minlevel and $desc and $name) { $q=$db->query("SELECT * FROM cities WHERE cityname='{$name}'"); if($db->num_rows($q)) { print "Sorry, you cannot have two cities with the same name."; $h->endpage(); exit; } $db->query("INSERT INTO cities VALUES (NULL, '$name', '$desc', '$cityimage', '$minlevel')"); print "City {$name} added to the game."; stafflog_add("Created City $name"); } else { print "<h3>Add City</h3><hr /> <form action='staff_cities.php?action=addcity' method='post'> Name: <input type='text' name='name' /> Description: <input type='text' name='desc' /> City Image: <input type='text' name='cityimage' /> Minimum Level: <input type='text' name='minlevel' /> <input type='submit' value='Add City' /></form>"; } } function editcity() { global $db, $ir, $c, $h, $userid; switch($_POST['step']) { case "2": $minlevel=abs((int) $_POST['minlevel']); $name=$_POST['name']; $desc=$_POST['desc']; $cityimage=$_POST['cityimage']; $q=$db->query("SELECT * FROM cities WHERE cityname='{$name}' AND cityid!={$_POST['id']}"); if($db->num_rows($q)) { print "Sorry, you cannot have two cities with the same name."; $h->endpage(); exit; } $name=$_POST['name']; $q=$db->query("SELECT * FROM cities WHERE cityid={$_POST['id']}"); $old=$db->fetch_row($q); $db->query("UPDATE cities SET cityminlevel=$minlevel, citydesc='$desc', cityname='$name', cityimage='$cityimage' WHERE cityid={$_POST['id']}"); print "City $name was edited successfully."; stafflog_add("Edited city $name"); break; case "1": $q=$db->query("SELECT * FROM cities WHERE cityid={$_POST['city']}"); $old=$db->fetch_row($q); print "<h3>Editing a City</h3><hr /> <form action='staff_cities.php?action=editcity' method='post'> <input type='hidden' name='step' value='2' /> <input type='hidden' name='id' value='{$_POST['city']}' /> Name: <input type='text' name='name' value='{$old['cityname']}' /> Description: <input type='text' name='desc' value='{$old['citydesc']}' /> City Image: <input type='text' name='cityimage' value='{$old['cityimage']}' /> Minimum Level: <input type='text' name='minlevel' value='{$old['cityminlevel']}' /> <input type='submit' value='Edit City' /></form>"; break; default: print "<h3>Editing a City</h3><hr /> <form action='staff_cities.php?action=editcity' method='post'> <input type='hidden' name='step' value='1' /> City: ".location_dropdown($c, "city")." <input type='submit' value='Edit City' /></form>"; break; } } function delcity() { global $db,$ir,$c,$h,$userid; if($_POST['city']) { $q=$db->query("SELECT * FROM cities WHERE cityid={$_POST['city']}"); $old=$db->fetch_row($q); if($old['cityid']==1) { echo '<font color="#ff0000">[b]Error! This City Cannot Be Deleted.[/b]</font>'; $h->endpage(); exit; } $db->query("UPDATE users SET location=1 WHERE location={$old['cityid']}"); $db->query("UPDATE shops SET shopLOCATION=1 WHERE shopLOCATION={$old['cityid']}"); $db->query("DELETE FROM cities WHERE cityid={$old['cityid']}"); print "City {$old['cityname']} deleted."; stafflog_add("Deleted city {$old['cityname']}"); } else { print "<h3>Delete City</h3><hr /> Deleting a city is permanent - be sure. Any users and shops that are currently in the city you delete will be moved to the default city (ID 1).<form action='staff_cities.php?action=delcity' method='post'> City: ".location_dropdown($c, "city")." <input type='submit' value='Delete City' /></form>"; } } function report_clear() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 3) { echo '<font color="#ff0000">[b]Error! 403[/b]</font>'; $h->endpage(); exit; } $_GET['ID'] = abs((int) $_GET['ID']); stafflog_add("Cleared player report ID {$_GET['ID']}"); $db->query("DELETE FROM preports WHERE prID={$_GET['ID']}"); print "Report cleared and deleted! [url='staff_users.php?action=reportsview']> Back[/url]"; } $h->endpage(); ?> Now open up explore.php and add near the top $q=$db->query("SELECT u.*,c.* FROM users u LEFT JOIN cities c ON u.location=c.cityid WHERE u.userid=$userid"); $r=$db->fetch_row($q); print " <center><h2>Your Current Location is {$r['cityname']}</h2></center> <center><img src='cities/{$r['cityimage']'> </center>"; SQL ALTER TABLE `cities` ADD `cityimage` VARCHAR( 255 ) NOT NULL DEFAULT 'defaultcity.jpg'; create a folder on your FTP called cities this is where your images will be stored, Just to note upload the pic to the folder and when editing or adding a city with an image make sure you use the full title example default.jp or default.png or default.gif Obviously you dont have to call it default im just using that as an example.
-
Re: [mccode V2] City Pic xD I gotta say i tried this and i couldnt get it to work either,, i cant see how the location is called without the aid of an sql statemtent to begin with..... I did however make a working version whereby you add the image via the admin panel when adding a city or editing a city if anyone wants it,
-
Re: [MCcode V2] Item Info revamp! I think over the past few months the mods on here for free are outstanding if Dabomstew is to relase his Version 3 hes got a lot of catching up to do to make it better than V2 :)
-
[Mccodes v2] Pass The Parcel / Secret Santa
Uridium replied to Uridium's topic in Free Modifications
Re: [Mccodes v2] Pass The Parcel / Secret Santa This could well happen i was thnking of capping it when a user unwraps a sheet but if the game isnt as active as the amount of players registered then the parcel could end up never being opened -
[Mccodes v2] Pass The Parcel / Secret Santa
Uridium replied to Uridium's topic in Free Modifications
Re: [Mccodes v2] Pass The Parcel / Secret Santa These are all obsticles im trying to overcome Its possible to use a time stamp for those that have been active in the last 10 days Just means im having to redo the whole staff_items script so its able to do what i want it to do. -
[Mccodes v2] Pass The Parcel / Secret Santa
Uridium replied to Uridium's topic in Free Modifications
Re: [Mccodes v2] Pass The Parcel / Secret Santa if the user has it for more than 10 mins the cron job will randomly give it to someone else... -
I wanted to do something for Xmas but couldnt think of anything so i came up with a Cunning plan lol.. Pass the Parcel.. How will it work Firstly Staff give out a random parcel to a random member The parcel when clicked on will remove a layer of wrapping. Then it will be sent to another member who again unwraps another piece of the wrapper. There is a cron job involved with a time scale of 10 minutes if someone fails to unwrap in that time it goes on its merry way to the next person. Until all the wrappers have been removed and the prize is unvailed to the final person... Admin Section.. From the admin Section you can do a fair few things 1 that a parcel only be sent to Donators 2 a parcel only be sent to none Donators 3 a Parcel be sent to both none and donating members. 4 Choose how many layers the parcel has. 5 Insert an item into the parcel as the prize 6 View number of layers Currently removed from the parcel 7 View winners of the parcel... will add more as i go on but you get the basics ive started the script for this. and it should be ready before Thursday at the latest.......