
Parrot
Members-
Posts
10 -
Joined
-
Last visited
Never
Content Type
Profiles
Forums
Events
Everything posted by Parrot
-
Re: New type of Crimes!! No problem man this is just what I used on my game. I then brought it out because lots of people liked it. Turn it into whatever you like
-
Re: New type of Crimes!! Replace these dropdowns with your current crime ones in global_func.php function goodcall_dropdown($connection,$ddname="goodcalls",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM goodcalls ORDER BY callNAME ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['callID']}'"; if ($selected == $r['callID'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['callNAME']}</option>"; } $ret.="\n</select>"; return $ret; } function goodcallgroup_dropdown($connection,$ddname="goodcallgroup",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM goodcallgroups ORDER BY cgNAME ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['cgID']}'"; if ($selected == $r['cgID'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['cgNAME']}</option>"; } $ret.="\n</select>"; return $ret; } function badcall_dropdown($connection,$ddname="badcalls",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM badcalls ORDER BY callNAME ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['callID']}'"; if ($selected == $r['callID'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['callNAME']}</option>"; } $ret.="\n</select>"; return $ret; } function badcallgroup_dropdown($connection,$ddname="badcallgroups",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM badcallgroups ORDER BY cgNAME ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['cgID']}'"; if ($selected == $r['cgID'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['cgNAME']}</option>"; } $ret.="\n</select>"; return $ret; } Finally exchange this with your current mainmenu.php crime button If ($ir['coplevel'] == "Good Cop") { print "[url='goodcalls.php']Good Calls[/url] "; } Else if ($ir['coplevel'] == "Bad Cop") { print "[url='badcalls.php']Bad Calls[/url] "; }
-
Re: New type of Crimes!! Here is the preferences Add this case 'coplevel2': do_cop_level(); break; case 'coplevel': conf_cop_level(); break; Below case 'passchange2': do_pass_change(); break; case 'passchange': pass_change(); break; Add this anywhere in preferences.php function conf_cop_level() { global $ir,$c,$userid,$h; if($ir['coplevel'] == "Good Cop") { $cl="Bad Cop"; } else { $cl="Good Cop"; } print "Are you sure you want to become a $cl? [url='preferences.php?action=coplevel2']Yes[/url] | [url='preferences.php']No[/url]"; } function do_cop_level() { global $db,$ir,$c,$userid,$h; if($ir['coplevel'] == "Good Cop") { $cl="Bad Cop"; } else { $cl="Good Cop"; } $db->query("UPDATE users SET coplevel='$cl' WHERE userid=$userid"); print "Success, you are now $cl! [url='viewuser.php?u={$ir[']Back[/url]"; }
-
Re: New type of Crimes!! Add all of these into your mysql database as separate inquiries CREATE TABLE IF NOT EXISTS `badcallgroups` ( `cgID` int(11) NOT NULL AUTO_INCREMENT, `cgNAME` varchar(255) NOT NULL DEFAULT '', `cgORDER` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`cgID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=29 ; CREATE TABLE IF NOT EXISTS `badcalls` ( `callID` int(11) NOT NULL AUTO_INCREMENT, `callNAME` varchar(255) NOT NULL DEFAULT '', `callBRAVE` int(11) NOT NULL DEFAULT '0', `callPERCFORM` text NOT NULL, `callSUCCESSMUNY` int(11) NOT NULL DEFAULT '0', `callSUCCESSCRYS` int(11) NOT NULL DEFAULT '0', `callSUCCESSITEM` int(11) NOT NULL DEFAULT '0', `callGROUP` int(11) NOT NULL DEFAULT '0', `callITEXT` text NOT NULL, `callSTEXT` text NOT NULL, `callFTEXT` text NOT NULL, `callJTEXT` text NOT NULL, `callJAILTIME` int(10) NOT NULL DEFAULT '0', `callJREASON` varchar(255) NOT NULL DEFAULT '', `callXP` bigint(40) NOT NULL DEFAULT '0', PRIMARY KEY (`callID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=94 ; Here are the good tables CREATE TABLE IF NOT EXISTS `goodcallgroups` ( `cgID` int(11) NOT NULL AUTO_INCREMENT, `cgNAME` varchar(255) NOT NULL DEFAULT '', `cgORDER` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`cgID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=22 ; CREATE TABLE IF NOT EXISTS `goodcalls` ( `callID` int(11) NOT NULL AUTO_INCREMENT, `callNAME` varchar(255) NOT NULL DEFAULT '', `callBRAVE` int(11) NOT NULL DEFAULT '0', `callPERCFORM` text NOT NULL, `callSUCCESSMUNY` int(11) NOT NULL DEFAULT '0', `callSUCCESSCRYS` int(11) NOT NULL DEFAULT '0', `callSUCCESSITEM` int(11) NOT NULL DEFAULT '0', `callGROUP` int(11) NOT NULL DEFAULT '0', `callITEXT` text NOT NULL, `callSTEXT` text NOT NULL, `callFTEXT` text NOT NULL, `callJTEXT` text NOT NULL, `callJAILTIME` int(10) NOT NULL DEFAULT '0', `callJREASON` varchar(255) NOT NULL DEFAULT '', `callXP` bigint(40) NOT NULL DEFAULT '0', PRIMARY KEY (`callID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=97 ; Also add this query to the users table ALTER TABLE `users` ADD `coplevel` enum('Good Cop','Bad Cop') NOT NULL DEFAULT 'Good Cop';
-
Re: New type of Crimes!! create badcalls.php <?php /*----------------------------------------------------- -- Mono Country v1.0 BETA -- A product of DBS-entertainment -- Copyright held 2005 by Dabomstew -- badcalls.php -----------------------------------------------------*/ include "globals.php"; if($ir['coplevel'] == 'Good Cop') { die("You are a Good Cop. Why do you want to access Bad Cop Calls?"); } $q=mysql_query("SELECT * FROM badcallgroups ORDER by cgORDER ASC",$c); print "[b]Bad Cop Department[/b] <table width='75%'><tr><th>Bad Call</th><th>Cost</th><th>Do</th></tr>"; while($r=mysql_fetch_array($q)) { print "<tr style='background-color:gray'><td colspan='3'><font color=darkred>{$r['cgNAME']}</font></td></tr>"; $q2=mysql_query("SELECT * FROM badcalls WHERE callGROUP={$r['cgID']}",$c); while ($r2=mysql_fetch_array($q2)) { print "<tr><td>{$r2['callNAME']}</td><td>{$r2['callBRAVE']} Motive</td><td>[url='dobadcall.php?c={$r2[']Do[/url]</td></tr>"; } } ?> create dobadcall.php <?php /*----------------------------------------------------- -- Mono Country v1.0 BETA -- A product of DBS-entertainment -- Copyright held 2005 by Dabomstew -- INDEX.php -----------------------------------------------------*/ include "globals.php"; $_GET['c']=abs((int) $_GET['c']); if(!$_GET['c']) { print "Invalid bad call"; } else { $q=mysql_query("SELECT * FROM badcalls WHERE callID={$_GET['c']}",$c); $r=mysql_fetch_array($q); if($ir['brave'] < $r['callBRAVE']) { print "You do not have enough Motive to perform this bad call."; } else { $ec="\$sucrate=".str_replace(array("LEVEL","ITEM","CRYSTALS","EXP","WILL","IQ"), array($ir['level'], $ir['item'], $ir['crystals'], $ir['exp'], $ir['will'], $ir['IQ']),$r['callPERCFORM']).";"; eval($ec); print $r['callITEXT']; $ir['brave']-=$r['callBRAVE']; mysql_query("UPDATE users SET brave={$ir['brave']} WHERE userid=$userid",$c); if(rand(1,100) <= $sucrate) { print str_replace("{money}",$r['callSUCCESSMUNY'],$r['callSTEXT']); $ir['money']+=$r['callSUCCESSMUNY']; $ir['crystals']+=$r['callSUCCESSCRYS']; $ir['exp']+=(int) ($r['callSUCCESSMUNY']/8); $ir['item']=$r['callSUCCESSITEM']; mysql_query("UPDATE users SET money={$ir['money']},crystals={$ir['crystals']},exp={$ir['exp']} WHERE userid=$userid",$c); mysql_query("INSERT INTO inventory VALUES('',{$ir['item']}, $userid, 1)"); } else { print $r['callFTEXT']; print $r['callJTEXT']; $ir['jail']=$r['callJAILTIME']; $ir['jail_reason']=$r['callJREASON']; mysql_query("UPDATE users SET jail={$ir['jail']} WHERE userid=$userid",$c); mysql_query("UPDATE users SET jail_reason='Failed a Bad Call' WHERE userid=$userid",$c); } print " [url='dobadcall.php?c={$_GET[']Try Again[/url] [url='badcalls.php']Bad Calls[/url]"; } } $h->endpage(); ?> create dogoodcall.php <?php /*----------------------------------------------------- -- Mono Country v1.0 BETA -- A product of DBS-entertainment -- Copyright held 2005 by Dabomstew -- INDEX.php -----------------------------------------------------*/ include "globals.php"; $_GET['c']=abs((int) $_GET['c']); if(!$_GET['c']) { print "Invalid good call"; } else { $q=mysql_query("SELECT * FROM goodcalls WHERE callID={$_GET['c']}",$c); $r=mysql_fetch_array($q); if($ir['brave'] < $r['callBRAVE']) { print "You do not have enough Motive to perform this good call."; } else { $ec="\$sucrate=".str_replace(array("LEVEL","ITEM","CRYSTALS","EXP","WILL","IQ"), array($ir['level'], $ir['item'], $ir['crystals'], $ir['exp'], $ir['will'], $ir['IQ']),$r['callPERCFORM']).";"; eval($ec); print $r['callITEXT']; $ir['brave']-=$r['callBRAVE']; mysql_query("UPDATE users SET brave={$ir['brave']} WHERE userid=$userid",$c); if(rand(1,100) <= $sucrate) { print str_replace("{money}",$r['callSUCCESSMUNY'],$r['callSTEXT']); $ir['money']+=$r['callSUCCESSMUNY']; $ir['crystals']+=$r['callSUCCESSCRYS']; $ir['exp']+=(int) ($r['callSUCCESSMUNY']/8); $ir['item']=$r['callSUCCESSITEM']; mysql_query("UPDATE users SET money={$ir['money']},crystals={$ir['crystals']},exp={$ir['exp']} WHERE userid=$userid",$c); mysql_query("INSERT INTO inventory VALUES('',{$ir['item']}, $userid, 1)"); } else { print $r['callFTEXT']; print $r['callJTEXT']; $ir['jail']=$r['callJAILTIME']; $ir['jail_reason']=$r['callJREASON']; mysql_query("UPDATE users SET jail={$ir['jail']} WHERE userid=$userid",$c); mysql_query("UPDATE users SET jail_reason='Failed a Good Call' WHERE userid=$userid",$c); } print " [url='dogoodcall.php?c={$_GET[']Try Again[/url] [url='goodcalls.php']Good Calls[/url]"; } } $h->endpage(); ?> Add this to smenu.php in place of current crimes <hr />[b]Good Calls[/b] > [url='staff_goodcalls.php?action=newgoodcall']Create New Good Call[/url] > [url='staff_goodcalls.php?action=editgoodcall']Edit Good Call[/url] > [url='staff_goodcalls.php?action=delgoodcall']Delete Good Call[/url] > [url='staff_goodcalls.php?action=newgoodcallgroup']Create New Good Call Group[/url] > [url='staff_goodcalls.php?action=editgoodcallgroup']Edit Good Call Group[/url] > [url='staff_goodcalls.php?action=delgoodcallgroup']Delete Good Call Group[/url] > [url='staff_goodcalls.php?action=reorder']Reorder Good Call Groups[/url] <hr />[b]Bad Calls[/b] > [url='staff_badcalls.php?action=newbadcall']Create New Bad Call[/url] > [url='staff_badcalls.php?action=editbadcall']Edit Bad Call[/url] > [url='staff_badcalls.php?action=delbadcall']Delete Bad Call[/url] > [url='staff_badcalls.php?action=newbadcallgroup']Create New Bad Call Group[/url] > [url='staff_badcalls.php?action=editbadcallgroup']Edit Bad Call Group[/url] > [url='staff_badcalls.php?action=delbadcallgroup']Delete Bad Call Group[/url] > [url='staff_badcalls.php?action=reorder']Reorder Bad Call Groups[/url]
-
Re: New type of Crimes!! create staff_goodcalls.php <?php include "sglobals.php"; if($r['user_level'] == 2) { die("You are not allowed in this area... NICE TRY"); } //This contains course stuffs switch($_GET['action']) { case 'newgoodcall': new_goodcall_form(); break; case 'newgoodcallsub': new_goodcall_submit(); break; case 'editgoodcall': edit_goodcall_begin(); break; case 'editgoodcallform': edit_goodcall_form(); break; case 'editgoodcallsub': edit_goodcall_sub(); break; case 'delgoodcall': delgoodcall(); break; case 'newgoodcallgroup': new_goodcallgroup_form(); break; case 'newgoodcallgroupsub': new_goodcallgroup_submit(); break; case 'editgoodcallgroup': edit_goodcallgroup_begin(); break; case 'editgoodcallgroupform': edit_goodcallgroup_form(); break; case 'editgoodcallgroupsub': edit_goodcallgroup_sub(); break; case 'delgoodcallgroup': delgoodcallgroup(); break; case 'reorder': reorder_callgroups(); break; default: print "Error: This script requires an action."; break; } function new_goodcall_form() { global $ir, $c, $db; print "Adding a new good call. <form action='staff_goodcalls.php?action=newgoodcallsub' method='post'> Name: <input type='text' name='name' /> Call Cost: <input type='text' name='brave' /> Success % Formula: <input type='text' name='percform' value='((WILL*0.8)/2.5)+(LEVEL/4)' /> Success Money: <input type='text' name='money' /> Success Crystals: <input type='text' name='crys' /> Success Item: ".item2_dropdown($c, 'item')." Group: ".goodcallgroup_dropdown($c,'group')." Initial Text: <textarea rows=4 cols=40 name='itext' /></textarea> Success Text: <textarea rows=4 cols=40 name='stext' /></textarea> Failure Text: <textarea rows=4 cols=40 name='ftext' /></textarea> Reprimand Text: <textarea rows=4 cols=40 name='jtext' /></textarea> Reprimand Time: <input type='text' name='jailtime' /> Reprimand Reason: <input type='text' name='jailreason' /> Call XP Given: <input type='text' name='callxp' /> <input type='submit' value='Create Good Call' /></form>"; } function new_goodcall_submit() { global $ir,$c,$userid, $db; if($_POST['itemon'] != "on") { $_POST['item']=0; } $db->query("INSERT INTO goodcalls (callNAME, callBRAVE, callPERCFORM, callSUCCESSMUNY, callSUCCESSCRYS, callSUCCESSITEM, callGROUP, callITEXT, callSTEXT, callFTEXT, callJTEXT, callJAILTIME, callJREASON, callXP) VALUES( '{$_POST['name']}', '{$_POST['brave']}', '{$_POST['percform']}', '{$_POST['money']}', {$_POST['crys']}, {$_POST['item']}, '{$_POST['group']}', '{$_POST['itext']}', '{$_POST['stext']}', '{$_POST['ftext']}', '{$_POST['jtext']}', {$_POST['jailtime']}, '{$_POST['jailreason']}', {$_POST['callxp']})"); print "Good Call created!"; stafflog_add("Created good Call {$_POST['name']}"); } function edit_goodcall_begin() { global $ir,$c,$h,$userid,$db; print "<h3>Editing Good Call</h3> You can edit any aspect of this call. <form action='staff_goodcalls.php?action=editgoodcallform' method='post'> Call: ".goodcall_dropdown($c,'call')." <input type='submit' value='Edit Good Call' /></form>"; } function edit_goodcall_form() { global $ir,$c,$h,$userid,$db; $d=$db->query("SELECT * FROM goodcalls WHERE callID={$_POST['call']}"); $itemi=$db->fetch_row($d); print "<h3>Editing Good Call</h3> <form action='staff_goodcalls.php?action=editgoodcallsub' method='post'> <input type='hidden' name='callID' value='{$_POST['call']}' /> Name: <input type='text' name='callNAME' value='{$itemi['callNAME']}' /> Call Cost: <input type='text' name='callBRAVE' value='{$itemi['callBRAVE']}' /> Success % Formula: <input type='text' name='callPERCFORM' value='{$itemi['callPERCFORM']}' /> Success Money: <input type='text' name='callSUCCESSMUNY' value='{$itemi['callSUCCESSMUNY']}' /> Success Crystals: <input type='text' name='callSUCCESSCRYS' value='{$itemi['callSUCCESSCRYS']}' /> Success Item: ".item2_dropdown($c, 'callSUCCESSITEM', $itemi['callSUCCESSITEM'])." Group: ".goodcallgroup_dropdown($c,'callGROUP', $itemi['callGROUP'])." Initial Text: <textarea rows=4 cols=40 name='callITEXT' />{$itemi['callITEXT']}'</textarea> Success Text: <textarea rows=4 cols=40 name='callSTEXT' />{$itemi['callSTEXT']}</textarea> Failure Text: <textarea rows=4 cols=40 name='callFTEXT' />{$itemi['callFTEXT']} </textarea> Reprimand Text: <textarea rows=4 cols=40 name='callJTEXT' />{$itemi['callJTEXT']} </textarea> Reprimand Time: <input type='text' name='callJAILTIME' value='{$itemi['callJAILTIME']}' /> Reprimand Reason: <input type='text' name='callJREASON' value='{$itemi['callJREASON']}' /> Call XP Given: <input type='text' name='callXP' value='{$itemi['callXP']}' /> <input type='submit' value='Edit Good Call' /></form>"; } function edit_goodcall_sub() { global $ir,$c,$h,$userid, $db; $db->query("UPDATE goodcalls SET callNAME='{$_POST['callNAME']}', callBRAVE='{$_POST['callBRAVE']}', callPERCFORM='{$_POST['callPERCFORM']}', callSUCCESSMUNY='{$_POST['callSUCCESSMUNY']}', callSUCCESSCRYS='{$_POST['callSUCCESSCRYS']}', callSUCCESSITEM='{$_POST['callSUCCESSITEM']}', callGROUP='{$_POST['callGROUP']}', callITEXT='{$_POST['callITEXT']}', callSTEXT='{$_POST['callSTEXT']}', callFTEXT='{$_POST['callFTEXT']}', callJTEXT='{$_POST['callJTEXT']}', callJAILTIME={$_POST['callJAILTIME']}, callJREASON='{$_POST['callJREASON']}', callXP={$_POST['callXP']} WHERE callID={$_POST['callID']}"); print "Good Call edited..."; stafflog_add("Edited Good call {$_POST['callNAME']}"); } function delgoodcall() { global $ir,$c,$h,$userid, $db; switch ($_GET['step']) { default: echo "<h3>Deleting Good Call</h3> Here you can delete a good call. <form action='staff_goodcalls.php?action=delgoodcall&step=2' method='post'> Call: ".goodcall_dropdown($c,'call')." <input type='submit' value='Delete Good Call' /></form>"; break; case 2: $target = $_POST['call']; $d=$db->query("SELECT callNAME FROM goodcalls WHERE callID='$target'"); $itemi=$db->fetch_row($d); print "<h3>Confirm</h3> Delete call - ".$itemi["callNAME"]."? <form action='staff_goodcalls.php?action=delgoodcall&step=3' method='post'> <input type='hidden' name='callID' value='$target' /> <input type='submit' name='yesorno' value='Yes' /> <input type='submit' name='yesorno' value='No' onclick=\"window.location='staff_goodcalls.php?action=delgoodcall';\" /></form>"; break; case 3: $target = $_POST['callID']; if($_POST['yesorno']=='No') { die("Call not deleted. [url='staff_goodcalls.php?action=delgoodcall']>Back to main delete calls page.[/url]"); } if ($_POST['yesorno'] != ("No" || "Yes")) die('Eh'); $d=$db->query("SELECT callNAME FROM goodcalls WHERE callID='$target'"); $itemi=$db->fetch_row($d); $db->query("DELETE FROM goodcalls WHERE callID='$target'"); echo "Call {$itemi['callNAME']} Deleted. [url='staff_goodcalls.php?action=delgoodcall']>Back to main delete calls page.[/url]"; stafflog_add("Deleted good call {$itemi['callNAME']}"); break; } } function new_goodcallgroup_form() { global $ir, $c,$db; print "Adding a new good call group. <form action='staff_goodcalls.php?action=newgoodcallgroupsub' method='post'> Name: <input type='text' name='cgNAME' /> Order Number: <input type='text' name='cgORDER' /> <input type='submit' value='Create Call Group' /></form>"; } function new_goodcallgroup_submit() { global $ir,$c,$userid,$db; if(!isset($_POST['cgNAME']) || !isset($_POST['cgORDER'])) { print "You missed one or more of the required fields. Please go back and try again. [url='staff_goodcalls.php?action=newgoodcallgroup']> Back[/url]"; $h->endpage(); exit; } $db->query("INSERT INTO `goodcallgroups` (`cgNAME`, `cgORDER`) VALUES('{$_POST['cgNAME']}','{$_POST['cgORDER']}')"); print "Good Call Group created!"; stafflog_add("Created Good Call Group {$_POST['cgNAME']}"); } function edit_goodcallgroup_begin() { global $ir,$c,$h,$userid,$db; print "<h3>Editing A Good Call Group</h3> <form action='staff_goodcalls.php?action=editgoodcallgroupform' method='post'> Call Group: ".goodcallgroup_dropdown($c,'callGROUP')." <input type='submit' value='Edit Good Call Group' /></form>"; } function edit_goodcallgroup_form() { global $ir,$c,$h,$userid,$db; $d=$db->query("SELECT * FROM goodcallgroups WHERE cgID={$_POST['callGROUP']}"); $itemi=$db->fetch_row($d); print "<h3>Editing Good Call Group</h3> <form action='staff_goodcalls.php?action=editgoodcallgroupsub' method='post'> <input type='hidden' name='cgID' value='{$_POST['callGROUP']}' /> Name: <input type='text' name='cgNAME' value='{$itemi['cgNAME']}' /> Order Number: <input type='text' name='cgORDER' value='{$itemi['cgORDER']}' /> <input type='submit' value='Edit Good Call Group' /></form>"; } function edit_goodcallgroup_sub() { global $ir,$c,$h,$userid, $db; if(!isset($_POST['cgORDER']) || !isset($_POST['cgNAME'])) { print "You missed one or more of the required fields. Please go back and try again. [url='staff_goodcalls.php?action=editgoodcallgroup']> Back[/url]"; $h->endpage(); exit; } else { $db->query("UPDATE goodcallgroups SET cgNAME='{$_POST['cgNAME']}', cgORDER='{$_POST['cgORDER']}' WHERE cgID='{$_POST['cgID']}'"); print "Good Call Group edited..."; stafflog_add("Edited good Call Group {$_POST['cgNAME']}"); } } function delgoodcallgroup() { global $ir,$c,$h,$userid, $db; switch ($_GET['step']) { default: echo "<h3>Deleting Good Call Group</h3> <form action='staff_goodcalls.php?action=delgoodcallgroup&step=2' method='post' name='theform' onsubmit='return checkme();'> good Call Group: ".goodcallgroup_dropdown($c, 'callGROUP')." <input type='submit' value='Delete Good Call Group' /></form>"; break; case 2: $target = $_POST['callGROUP']; $d=$db->query("SELECT cgNAME FROM goodcallgroups WHERE cgID='$target'"); $itemi=$db->fetch_row($d); print "<h3>Confirm</h3> Delete good call group - ".$itemi["cgNAME"]."? <form action='staff_goodcalls.php?action=delgoodcallgroup&step=3' method='post'> <input type='hidden' name='cgID' value='$target' /> <input type='submit' name='yesorno' value='Yes' /> <input type='submit' name='yesorno' value='No' onclick=\"window.location='staff_goodcalls.php?action=delgoodcallgroup';\" /></form>"; break; case 3: $target = $_POST['cgID']; if($_POST['yesorno']=='No') { die("Good Call Group not deleted."); } if ($_POST['yesorno'] != ("No" || "Yes")) die('This shouldnt happen'); $d=$db->query("SELECT cgNAME FROM goodcallgroups WHERE cgID='$target'"); $itemi=$db->fetch_row($d); $db->query("DELETE FROM goodcallgroups WHERE cgID='{$_POST['cgID']}'"); stafflog_add("Deleted good call group {$itemi['cgNAME']}"); echo "Good Call Group deleted."; break; } } function reorder_callgroups() { global $db,$ir,$c,$h,$userid; if($_POST['submit']) { unset($_POST['submit']); $used=array(); foreach($_POST as $v) { if(in_array($v, $used)) { print "You have used the same order number twice! Go back and try again."; $h->endpage(); exit; } $used[]=$v; } foreach($_POST as $k => $v) { $cg=str_replace("order","", $k); if(is_numeric($cg)) { $db->query("UPDATE goodcallgroups SET cgORDER={$v} WHERE cgID={$cg}"); } } print "good Call group order updated!"; stafflog_add("Reordered good call groups"); } else { $q=$db->query("SELECT * FROM goodcallgroups ORDER BY cgORDER ASC, cgID ASC"); $rows=$db->num_rows($q); $i=0; print "<h3>Re-ordering good Call Groups</h3><hr /> <table width='80%' cellspacing='1' class='table'> <tr> <th>good Call Group</th> <th>Order</th> </tr> <form action='staff_goodcalls.php?action=reorder' method='post'> <input type='hidden' name='submit' value='1' />"; while($r=$db->fetch_row($q)) { $i++; print "<tr> <td>{$r['cgNAME']}</td> <td><select name='order{$r['cgID']}' type='dropdown'>"; for($j=1;$j<=$rows;$j++) { if($j == $i) { print "<option value='{$j}' selected='selected'>{$j}</option>"; } else { print "<option value='{$j}'>{$j}</option>"; } } print "</select></td></tr>"; } print "<tr> <td colspan='2' align='center'><input type='submit' value='Reorder' /></td> </tr></form></table>"; } } function report_clear() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] == 2 || $ir['user_level']== 3 || $ir['user_level'] == 6) { die("You are not allowed in this area... NICE TRY"); } $_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(); ?> create goodcalls.php <?php /*----------------------------------------------------- -- Mono Country v1.0 BETA -- A product of DBS-entertainment -- Copyright held 2005 by Dabomstew -- goodcalls.php -----------------------------------------------------*/ include "globals.php"; if($ir['coplevel'] == 'Bad Cop') { die("You are a Bad Cop. Why do you want to access Good Cop Calls?"); } $q=mysql_query("SELECT * FROM goodcallgroups ORDER by cgORDER ASC",$c); print "[b]Good Cop Department[/b] <table width='75%'><tr><th>Good Call</th><th>Cost</th><th>Do</th></tr>"; while($r=mysql_fetch_array($q)) { print "<tr style='background-color:gray'><td colspan='3'><font color=darkred>{$r['cgNAME']}</font></td></tr>"; $q2=mysql_query("SELECT * FROM goodcalls WHERE callGROUP={$r['cgID']}",$c); while ($r2=mysql_fetch_array($q2)) { print "<tr><td>{$r2['callNAME']}</td><td>{$r2['callBRAVE']} Motive</td><td>[url='dogoodcall.php?c={$r2[']Do[/url]</td></tr>"; } } ?>
-
This is my first CE mod. So let me know what you think. This new type will allow a user to choose whether they want to be a good cop or a bad cop. Each one has a different set of calls or crimes! create staff_badcalls.php <?php include "sglobals.php"; if($r['user_level'] == 2) { die("You are not allowed in this area... NICE TRY"); } //This contains course stuffs switch($_GET['action']) { case 'newbadcall': new_badcall_form(); break; case 'newbadcallsub': new_badcall_submit(); break; case 'editbadcall': edit_badcall_begin(); break; case 'editbadcallform': edit_badcall_form(); break; case 'editbadcallsub': edit_badcall_sub(); break; case 'delbadcall': delbadcall(); break; case 'newbadcallgroup': new_badcallgroup_form(); break; case 'newbadcallgroupsub': new_badcallgroup_submit(); break; case 'editbadcallgroup': edit_badcallgroup_begin(); break; case 'editbadcallgroupform': edit_badcallgroup_form(); break; case 'editbadcallgroupsub': edit_badcallgroup_sub(); break; case 'delbadcallgroup': delbadcallgroup(); break; case 'reorder': reorder_callgroups(); break; default: print "Error: This script requires an action."; break; } function new_badcall_form() { global $ir, $c, $db; print "Adding a new bad call. <form action='staff_badcalls.php?action=newbadcallsub' method='post'> Name: <input type='text' name='name' /> Call Cost: <input type='text' name='brave' /> Success % Formula: <input type='text' name='percform' value='((WILL*0.8)/2.5)+(LEVEL/4)' /> Success Money: <input type='text' name='money' /> Success Crystals: <input type='text' name='crys' /> Success Item: ".item2_dropdown($c, 'item')." Group: ".badcallgroup_dropdown($c,'group')." Initial Text: <textarea rows=4 cols=40 name='itext' /></textarea> Success Text: <textarea rows=4 cols=40 name='stext' /></textarea> Failure Text: <textarea rows=4 cols=40 name='ftext' /></textarea> Reprimand Text: <textarea rows=4 cols=40 name='jtext' /></textarea> Reprimand Time: <input type='text' name='jailtime' /> Reprimand Reason: <input type='text' name='jailreason' /> Call XP Given: <input type='text' name='callxp' /> <input type='submit' value='Create Bad Call' /></form>"; } function new_badcall_submit() { global $ir,$c,$userid, $db; if($_POST['itemon'] != "on") { $_POST['item']=0; } $db->query("INSERT INTO badcalls (callNAME, callBRAVE, callPERCFORM, callSUCCESSMUNY, callSUCCESSCRYS, callSUCCESSITEM, callGROUP, callITEXT, callSTEXT, callFTEXT, callJTEXT, callJAILTIME, callJREASON, callXP) VALUES( '{$_POST['name']}', '{$_POST['brave']}', '{$_POST['percform']}', '{$_POST['money']}', {$_POST['crys']}, {$_POST['item']}, '{$_POST['group']}', '{$_POST['itext']}', '{$_POST['stext']}', '{$_POST['ftext']}', '{$_POST['jtext']}', {$_POST['jailtime']}, '{$_POST['jailreason']}', {$_POST['callxp']})"); print "Bad Call created!"; stafflog_add("Created Bad Call {$_POST['name']}"); } function edit_badcall_begin() { global $ir,$c,$h,$userid,$db; print "<h3>Editing Bad Call</h3> You can edit any aspect of this call. <form action='staff_badcalls.php?action=editbadcallform' method='post'> Call: ".badcall_dropdown($c,'call')." <input type='submit' value='Edit Bad Call' /></form>"; } function edit_badcall_form() { global $ir,$c,$h,$userid,$db; $d=$db->query("SELECT * FROM badcalls WHERE callID={$_POST['call']}"); $itemi=$db->fetch_row($d); print "<h3>Editing Bad Call</h3> <form action='staff_badcalls.php?action=editbadcallsub' method='post'> <input type='hidden' name='callID' value='{$_POST['call']}' /> Name: <input type='text' name='callNAME' value='{$itemi['callNAME']}' /> Call Cost: <input type='text' name='callBRAVE' value='{$itemi['callBRAVE']}' /> Success % Formula: <input type='text' name='callPERCFORM' value='{$itemi['callPERCFORM']}' /> Success Money: <input type='text' name='callSUCCESSMUNY' value='{$itemi['callSUCCESSMUNY']}' /> Success Crystals: <input type='text' name='callSUCCESSCRYS' value='{$itemi['callSUCCESSCRYS']}' /> Success Item: ".item2_dropdown($c, 'callSUCCESSITEM', $itemi['callSUCCESSITEM'])." Group: ".badcallgroup_dropdown($c,'callGROUP', $itemi['callGROUP'])." Initial Text: <textarea rows=4 cols=40 name='callITEXT' />{$itemi['callITEXT']}'</textarea> Success Text: <textarea rows=4 cols=40 name='callSTEXT' />{$itemi['callSTEXT']}</textarea> Failure Text: <textarea rows=4 cols=40 name='callFTEXT' />{$itemi['callFTEXT']} </textarea> Reprimand Text: <textarea rows=4 cols=40 name='callJTEXT' />{$itemi['callJTEXT']} </textarea> Reprimand Time: <input type='text' name='callJAILTIME' value='{$itemi['callJAILTIME']}' /> Reprimand Reason: <input type='text' name='callJREASON' value='{$itemi['callJREASON']}' /> Call XP Given: <input type='text' name='callXP' value='{$itemi['callXP']}' /> <input type='submit' value='Edit Bad Call' /></form>"; } function edit_badcall_sub() { global $ir,$c,$h,$userid, $db; $db->query("UPDATE badcalls SET callNAME='{$_POST['callNAME']}', callBRAVE='{$_POST['callBRAVE']}', callPERCFORM='{$_POST['callPERCFORM']}', callSUCCESSMUNY='{$_POST['callSUCCESSMUNY']}', callSUCCESSCRYS='{$_POST['callSUCCESSCRYS']}', callSUCCESSITEM='{$_POST['callSUCCESSITEM']}', callGROUP='{$_POST['callGROUP']}', callITEXT='{$_POST['callITEXT']}', callSTEXT='{$_POST['callSTEXT']}', callFTEXT='{$_POST['callFTEXT']}', callJTEXT='{$_POST['callJTEXT']}', callJAILTIME={$_POST['callJAILTIME']}, callJREASON='{$_POST['callJREASON']}', callXP={$_POST['callXP']} WHERE callID={$_POST['callID']}"); print "Bad Call edited..."; stafflog_add("Edited bad call {$_POST['callNAME']}"); } function delbadcall() { global $ir,$c,$h,$userid, $db; switch ($_GET['step']) { default: echo "<h3>Deleting Bad Call</h3> Here you can delete a good call. <form action='staff_goodcalls.php?action=delgoodcall&step=2' method='post'> Call: ".goodcall_dropdown($c,'call')." <input type='submit' value='Delete Good Call' /></form>"; break; case 2: $target = $_POST['call']; $d=$db->query("SELECT callNAME FROM badcalls WHERE callID='$target'"); $itemi=$db->fetch_row($d); print "<h3>Confirm</h3> Delete call - ".$itemi["callNAME"]."? <form action='staff_badcalls.php?action=delbadcall&step=3' method='post'> <input type='hidden' name='callID' value='$target' /> <input type='submit' name='yesorno' value='Yes' /> <input type='submit' name='yesorno' value='No' onclick=\"window.location='staff_badcalls.php?action=delbadcall';\" /></form>"; break; case 3: $target = $_POST['callID']; if($_POST['yesorno']=='No') { die("Call not deleted. [url='staff_badcalls.php?action=delbadcall']>Back to main delete calls page.[/url]"); } if ($_POST['yesorno'] != ("No" || "Yes")) die('Eh'); $d=$db->query("SELECT callNAME FROM badcalls WHERE callID='$target'"); $itemi=$db->fetch_row($d); $db->query("DELETE FROM badcalls WHERE callID='$target'"); echo "Call {$itemi['callNAME']} Deleted. [url='staff_badcalls.php?action=delbadcall']>Back to main delete calls page.[/url]"; stafflog_add("Deleted bad call {$itemi['callNAME']}"); break; } } function new_badcallgroup_form() { global $ir, $c,$db; print "Adding a new bad call group. <form action='staff_badcalls.php?action=newbadcallgroupsub' method='post'> Name: <input type='text' name='cgNAME' /> Order Number: <input type='text' name='cgORDER' /> <input type='submit' value='Create Call Group' /></form>"; } function new_badcallgroup_submit() { global $ir,$c,$userid,$db; if(!isset($_POST['cgNAME']) || !isset($_POST['cgORDER'])) { print "You missed one or more of the required fields. Please go back and try again. [url='staff_badcalls.php?action=newbadcallgroup']> Back[/url]"; $h->endpage(); exit; } $db->query("INSERT INTO `badcallgroups` (`cgNAME`, `cgORDER`) VALUES('{$_POST['cgNAME']}','{$_POST['cgORDER']}')"); print "Good Call Group created!"; stafflog_add("Created Bad Call Group {$_POST['cgNAME']}"); } function edit_badcallgroup_begin() { global $ir,$c,$h,$userid,$db; print "<h3>Editing A Bad Call Group</h3> <form action='staff_badcalls.php?action=editbadcallgroupform' method='post'> Call Group: ".badcallgroup_dropdown($c,'callGROUP')." <input type='submit' value='Edit Bad Call Group' /></form>"; } function edit_badcallgroup_form() { global $ir,$c,$h,$userid,$db; $d=$db->query("SELECT * FROM badcallgroups WHERE cgID={$_POST['callGROUP']}"); $itemi=$db->fetch_row($d); print "<h3>Editing Bad Call Group</h3> <form action='staff_badcalls.php?action=editbadcallgroupsub' method='post'> <input type='hidden' name='cgID' value='{$_POST['callGROUP']}' /> Name: <input type='text' name='cgNAME' value='{$itemi['cgNAME']}' /> Order Number: <input type='text' name='cgORDER' value='{$itemi['cgORDER']}' /> <input type='submit' value='Edit Bad Call Group' /></form>"; } function edit_badcallgroup_sub() { global $ir,$c,$h,$userid, $db; if(!isset($_POST['cgORDER']) || !isset($_POST['cgNAME'])) { print "You missed one or more of the required fields. Please go back and try again. [url='staff_badcalls.php?action=editbadcallgroup']> Back[/url]"; $h->endpage(); exit; } else { $db->query("UPDATE badcallgroups SET cgNAME='{$_POST['cgNAME']}', cgORDER='{$_POST['cgORDER']}' WHERE cgID='{$_POST['cgID']}'"); print "Bad Call Group edited..."; stafflog_add("Edited Bad Call Group {$_POST['cgNAME']}"); } } function delbadcallgroup() { global $ir,$c,$h,$userid, $db; switch ($_GET['step']) { default: echo "<h3>Deleting Bad Call Group</h3> <form action='staff_badcalls.php?action=delbadcallgroup&step=2' method='post' name='theform' onsubmit='return checkme();'> Bad Call Group: ".badcallgroup_dropdown($c, 'callGROUP')." <input type='submit' value='Delete Bad Call Group' /></form>"; break; case 2: $target = $_POST['callGROUP']; $d=$db->query("SELECT cgNAME FROM badcallgroups WHERE cgID='$target'"); $itemi=$db->fetch_row($d); print "<h3>Confirm</h3> Delete bad call group - ".$itemi["cgNAME"]."? <form action='staff_badcalls.php?action=delbadcallgroup&step=3' method='post'> <input type='hidden' name='cgID' value='$target' /> <input type='submit' name='yesorno' value='Yes' /> <input type='submit' name='yesorno' value='No' onclick=\"window.location='staff_badcalls.php?action=delbadcallgroup';\" /></form>"; break; case 3: $target = $_POST['cgID']; if($_POST['yesorno']=='No') { die("Bad Call Group not deleted."); } if ($_POST['yesorno'] != ("No" || "Yes")) die('This shouldnt happen'); $d=$db->query("SELECT cgNAME FROM badcallgroups WHERE cgID='$target'"); $itemi=$db->fetch_row($d); $db->query("DELETE FROM badcallgroups WHERE cgID='{$_POST['cgID']}'"); stafflog_add("Deleted bad call group {$itemi['cgNAME']}"); echo "Bad Call Group deleted."; break; } } function reorder_callgroups() { global $db,$ir,$c,$h,$userid; if($_POST['submit']) { unset($_POST['submit']); $used=array(); foreach($_POST as $v) { if(in_array($v, $used)) { print "You have used the same order number twice! Go back and try again."; $h->endpage(); exit; } $used[]=$v; } foreach($_POST as $k => $v) { $cg=str_replace("order","", $k); if(is_numeric($cg)) { $db->query("UPDATE badcallgroups SET cgORDER={$v} WHERE cgID={$cg}"); } } print "Bad Call group order updated!"; stafflog_add("Reordered bad call groups"); } else { $q=$db->query("SELECT * FROM badcallgroups ORDER BY cgORDER ASC, cgID ASC"); $rows=$db->num_rows($q); $i=0; print "<h3>Re-ordering Bad Call Groups</h3><hr /> <table width='80%' cellspacing='1' class='table'> <tr> <th>Bad Call Group</th> <th>Order</th> </tr> <form action='staff_badcalls.php?action=reorder' method='post'> <input type='hidden' name='submit' value='1' />"; while($r=$db->fetch_row($q)) { $i++; print "<tr> <td>{$r['cgNAME']}</td> <td><select name='order{$r['cgID']}' type='dropdown'>"; for($j=1;$j<=$rows;$j++) { if($j == $i) { print "<option value='{$j}' selected='selected'>{$j}</option>"; } else { print "<option value='{$j}'>{$j}</option>"; } } print "</select></td></tr>"; } print "<tr> <td colspan='2' align='center'><input type='submit' value='Reorder' /></td> </tr></form></table>"; } } function report_clear() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] == 2 || $ir['user_level']== 3 || $ir['user_level'] == 6) { die("You are not allowed in this area... NICE TRY"); } $_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(); ?>
-
Re: Funney Error hey I can help give me the game url and I will get on and talk through there
-
Re: Funney Error You do not have to go into the database though. You can just edit it in the staff panel under edit crimes. The only problem you would have in editing from the staff panel is hard coded information.
-
Re: Funney Error Hey man I don't really understand the error game link? But If I understand what your saying something is not coded to read the amount of brave to be taken away for each Crime or you have messed up that crime in some way