Cronwerks MCCode/MCCodes Forums

Please login or register.

Login with username, password and session length

News:

Have you purchased a mod and are struggling to install it? Cronwerks now installs mods for only $3/$2.50. Message Cronus to discuss the details or purchase.


This forum is now closed and has moved to a new location! Click here to find out why.
Pages: [1] 2

AuthorTopic: [mccodes-V2] Staff Organised Crimes  (Read 3749 times)

ak27

  • Basic Member
  • *
  • Reputation Power: 1
  • ak27 has no influence.
  • Offline Offline
  • Posts: 2
    • View Profile
    • Email
[mccodes-V2] Staff Organised Crimes
« on: February 10, 2009, 05:19:39 AM »
Note:, this script was not made by me but i am bringing it into the forum
          so dont let me take all the credit for this :)


First of all create a file called staff_orgcrimes.php
add this script into the file:
Code: [Select]
<?php
include "sglobals.php";
if(
$ir['user_level'] != 2)
{
die(
"403");
}
switch(
$_GET['action'])
{
case 
'newoc'new_orgcrime_form(); break;
case 
'newocsub'new_orgcrime_submit(); break;
case 
'editoc'edit_orgcrime_form(); break;
case 
'editocsub'edit_orgcrime_submit(); break;
case 
'deloc'del_orgcrime_form(); break;
case 
'delocsub'del_orgcrime_submit(); break;
case 
'stopoc'stop_orgcrime_form(); break;
case 
'stopocsub'stop_orgcrime_submit(); break;
default: print 
"Error: This script requires an action."; break;
}
function 
new_orgcrime_form()
{
global 
$ir$c$db;
print 
"Adding a new organized crime.<br />
<form action='staff_orgcrimes.php?action=newocsub' method='post'>
Org Crime Name: <input type='text' name='name' /><br />
Min. Members Needed: <input type='text' name='members' /><br />
Start Text: <textarea rows=4 cols=40 name='stext'  /></textarea><br />
Success Text: <textarea rows=4 cols=40 name='sctext'  /></textarea><br />
Failure Text : <textarea rows=4 cols=40 name='ftext'  /></textarea><br />
Min Success Money: <input type='text' name='minmoney' /><br />
Max Success Money: <input type='text' name='maxmoney' /><br />
<input type='submit' value='Create Orginized Crime' /></form>"
;
}
function 
new_orgcrime_submit()
{
global 
$ir,$c,$userid$db;
$db->query("INSERT INTO orgcrimes (ocNAME, ocUSERS, ocSTARTTEXT, ocSUCCTEXT, ocFAILTEXT, ocMINMONEY, ocMAXMONEY) VALUES( '{$_POST['name']}', '{$_POST['members']}', '{$_POST['stext']}', '{$_POST['sctext']}', '{$_POST['ftext']}', '{$_POST['minmoney']}', '{$_POST['maxmoney']}')");
print 
"Organized Crime created!";
stafflog_add("Created orginized crime {$_POST['name']}");
}
function 
edit_orgcrime_form()
{
global 
$ir$c$db;
print 
"Editing Org Crime.<br />
<form action='staff_orgcrimes.php?action=editocsub' method='post'>
Current Crime: "
.orgcrime_dropdown($c,'ocID')."<br />
New Org Crime Name: <input type='text' name='name' /><br />
New Min. Members Needed: <input type='text' name='members' /><br />
New Start Text: <textarea rows=4 cols=40 name='stext'  /></textarea><br />
New Success Text: <textarea rows=4 cols=40 name='sctext'  /></textarea><br />
New Failure Text : <textarea rows=4 cols=40 name='ftext'  /></textarea><br />
New Min Success Money: <input type='text' name='minmoney' /><br />
New Max Success Money: <input type='text' name='maxmoney' /><br />
<input type='submit' value='Edit Orginized Crime' /></form>"
;
}
function 
edit_orgcrime_submit()
{
global 
$ir,$c,$userid$db;
$db->query("UPDATE orgcrimes SET ocNAME='{$_POST['name']}', ocUSERS='{$_POST['members']}', ocSTARTTEXT='{$_POST['stext']}', ocSUCCTEXT='{$_POST['sctext']}', ocFAILTEXT='{$_POST['ftext']}', ocMINMONEY='{$_POST['minmoney']}', ocMAXMONEY='{$_POST['maxmoney']}' WHERE ocID={$_POST['ocID']}");
print 
"Organized Crime created!";
stafflog_add("Edited Orginized crime {$_POST['name']}");
}
function 
del_orgcrime_form()
{
global 
$ir$c$db;
print 
"Deleting Org Crime.<br />
<form action='staff_orgcrimes.php?action=delocsub' method='post'>
Org Crime: "
.orgcrime_dropdown($c,'ocID')."<br />
<input type='submit' value='Delete Orginized Crime' /></form>"
;
}
function 
del_orgcrime_submit()
{
global 
$ir,$c,$userid$db;
$db->query("DELETE FROM orgcrimes WHERE ocID={$_POST['ocID']}");
print 
"Organized Crime Deleted!";
stafflog_add("Deleted Orginized Crime ID: {$_POST['ocID']}");
}
function 
stop_orgcrime_form()
{
global 
$ir$c$db;
print 
"Stopping Org Crime<br />
This allows you to stop any organized crimes associated with a gang 
<form action='staff_orgcrimes.php?action=stopocsub' method='post'>
Gang: "
.gang_dropdown($c,'gangID')."<br />
<input type='submit' value='Stop Organized Crime' /></form>"
;
}
function 
stop_orgcrime_submit()
{
global 
$ir,$c,$userid$db;
$db->query("UPDATE gangs SET gangCRIME='0', gangCHOURS='0' WHERE gangID={$_POST['gangID']}");
print 
"Organized Crime Stopped!";
stafflog_add("Stopped Organized Crime For Gang ID {$_POST['gangID']}");
}
$h->endpage();
?>


Then open global_func.php
and find:
Code: [Select]
function user_dropdown($connection,$ddname="user",$selected=-1)
{
global $db;
$ret="<select name='$ddname' type='dropdown'>";
$q=$db->query("SELECT * FROM users ORDER BY username ASC");
if($selected == -1) { $first=0; } else { $first=1; }
while($r=$db->fetch_row($q))
{
$ret.="\n<option value='{$r['userid']}'";
if ($selected == $r['userid'] || $first == 0) { $ret.=" selected='selected'";$first=1; }
$ret.= ">{$r['username']}</option>";
}
$ret.="\n</select>";
return $ret;
}

add below:

Code: [Select]
function orgcrime_dropdown($connection,$ddname="orgcrime",$selected=-1)
{
global $db;
$ret="<select name='$ddname' type='dropdown'>";
$q=$db->query("SELECT * FROM orgcrimes ORDER BY ocID ASC");
if($selected == -1) { $first=0; } else { $first=1; }
while($r=$db->fetch_row($q))
{
$ret.="\n<option value='{$r['ocID']}'";
if ($selected == $r['ocID'] || $first == 0) { $ret.=" selected='selected'";$first=1; }
$ret.= ">{$r['ocNAME']}</option>";
}
$ret.="\n</select>";
return $ret;
}
function gang_dropdown($connection,$ddname="gang",$selected=-1)
{
global $db;
$ret="<select name='$ddname' type='dropdown'>";
$q=$db->query("SELECT * FROM gangs ORDER BY gangID ASC");
if($selected == -1) { $first=0; } else { $first=1; }
while($r=$db->fetch_row($q))
{
$ret.="\n<option value='{$r['gangID']}'";
if ($selected == $r['gangID'] || $first == 0) { $ret.=" selected='selected'";$first=1; }
$ret.= ">{$r['gangNAME']}</option>";
}
$ret.="\n</select>";
return $ret;
}
(NOTE: You will need to add the gang feature above, it isn't a typing error)

Then open smenu.php
and find:

Code: [Select]
<hr /><b>Crimes</b><br />
&gt; <a href='staff_crimes.php?action=newcrime'>Create New Crime</a><br />
&gt; <a href='staff_crimes.php?action=editcrime'>Edit Crime</a><br />
&gt; <a href='staff_crimes.php?action=delcrime'>Delete Crime</a><br />
&gt; <a href='staff_crimes.php?action=newcrimegroup'>Create New Crime Group</a><br />
&gt; <a href='staff_crimes.php?action=editcrimegroup'>Edit Crime Group</a><br />
&gt; <a href='staff_crimes.php?action=delcrimegroup'>Delete Crime Group</a><br />
&gt; <a href='staff_crimes.php?action=reorder'>Reorder Crime Groups</a><br />
&gt; <a href='staff_crimes.php?action=newocform'>New Organized Crime</a><br />

Add below:

Code: [Select]
<hr /><b>Organized Crimes</b><br />
&gt; <a href='staff_orgcrimes.php?action=newoc'>Create New Org Crime</a><br />
&gt; <a href='staff_orgcrimes.php?action=editoc'>Edit Org Crime</a><br />
&gt; <a href='staff_orgcrimes.php?action=deloc'>Delete Org Crime</a><br />
&gt; <a href='staff_orgcrimes.php?action=stopoc'>Stop Organized Crime</a><br />

And Your done :), any Problems or Bugs post them here:
Thanks :   AK-27
« Last Edit: February 10, 2009, 05:53:24 AM by ak27 »
Logged

03laceys

  • Basic Member
  • *
  • Reputation Power: 0
  • 03laceys has no influence.
  • Offline Offline
  • Posts: 34
    • View Profile
    • Email
Re: [mccodes-V2] Staff Organised Crimes
« Reply #1 on: February 10, 2009, 12:30:46 PM »
Made by who? Did you get permission to post?
Logged

Cronus

  • Administrator
  • Senior Member
  • *****
  • Reputation Power: 2901
  • Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!
  • Offline Offline
  • Posts: 550
    • MSN Messenger - preston__08@hotmail.com
    • View Profile
    • WWW
Re: [mccodes-V2] Staff Organised Crimes
« Reply #2 on: February 10, 2009, 01:53:53 PM »
laceys its not your job to verify every mod posted.
Until the owner comes and makes a complaint and it is proven, it stays.

Also, why do staff get their own OCs?
Seems strange to me lol.
Logged
My msn is preston__08@hotmail.com if anyone is interested, I am online frequently.

03laceys

  • Basic Member
  • *
  • Reputation Power: 0
  • 03laceys has no influence.
  • Offline Offline
  • Posts: 34
    • View Profile
    • Email
Re: [mccodes-V2] Staff Organised Crimes
« Reply #3 on: February 10, 2009, 05:12:16 PM »
laceys its not your job to verify every mod posted.
Until the owner comes and makes a complaint and it is proven, it stays.

Also, why do staff get their own OCs?
Seems strange to me lol.

Sorry cronus i just don't belive that they should be able to post codes that arn't thier's and i thought you would feel the same on this one. O well. (Looks like you could be getting many members if the forums run like that mate)
Logged

Cronus

  • Administrator
  • Senior Member
  • *****
  • Reputation Power: 2901
  • Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!
  • Offline Offline
  • Posts: 550
    • MSN Messenger - preston__08@hotmail.com
    • View Profile
    • WWW
Re: [mccodes-V2] Staff Organised Crimes
« Reply #4 on: February 10, 2009, 07:04:47 PM »
Like I said, it will be taken down, if it is shown to be another persons code.
Simply posting on every topic and saying "is this your code???" is not just cause.
Logged
My msn is preston__08@hotmail.com if anyone is interested, I am online frequently.

03laceys

  • Basic Member
  • *
  • Reputation Power: 0
  • 03laceys has no influence.
  • Offline Offline
  • Posts: 34
    • View Profile
    • Email
Re: [mccodes-V2] Staff Organised Crimes
« Reply #5 on: February 15, 2009, 02:28:23 PM »
Like I said, it will be taken down, if it is shown to be another persons code.
Simply posting on every topic and saying "is this your code???" is not just cause.

It was purley because he had already stated one of the mods wern't his and he had just found it on his PC, but hey your foums your choice mate ;)
Logged

Cronus

  • Administrator
  • Senior Member
  • *****
  • Reputation Power: 2901
  • Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!
  • Offline Offline
  • Posts: 550
    • MSN Messenger - preston__08@hotmail.com
    • View Profile
    • WWW
Re: [mccodes-V2] Staff Organised Crimes
« Reply #6 on: February 15, 2009, 04:17:56 PM »
If it was distributed freely to begin with, it can still be posted.
Logged
My msn is preston__08@hotmail.com if anyone is interested, I am online frequently.

03laceys

  • Basic Member
  • *
  • Reputation Power: 0
  • 03laceys has no influence.
  • Offline Offline
  • Posts: 34
    • View Profile
    • Email
Re: [mccodes-V2] Staff Organised Crimes
« Reply #7 on: February 15, 2009, 04:28:07 PM »
I can not verify that it wasn't but i can say one of the mods he posted i only know of it being released once by seanybob as a paid.
Logged

ReaSonZ

  • Basic Member
  • *
  • Reputation Power: 0
  • ReaSonZ has no influence.
  • Offline Offline
  • Posts: 8
    • View Profile
    • Email
Re: [mccodes-V2] Staff Organised Crimes
« Reply #8 on: February 25, 2009, 08:07:55 AM »
Was Posted By Halo On Ce Forums
Logged

Cronus

  • Administrator
  • Senior Member
  • *****
  • Reputation Power: 2901
  • Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!
  • Offline Offline
  • Posts: 550
    • MSN Messenger - preston__08@hotmail.com
    • View Profile
    • WWW
Re: [mccodes-V2] Staff Organised Crimes
« Reply #9 on: February 25, 2009, 11:06:41 AM »
Was Posted By Halo On Ce Forums
Was it a free mod?
Logged
My msn is preston__08@hotmail.com if anyone is interested, I am online frequently.

Tonka

  • Basic Member
  • *
  • Reputation Power: 0
  • Tonka has no influence.
  • Offline Offline
  • Posts: 4
  • World of Conflict Owner
    • MSN Messenger - tonka_ce@live.com
    • View Profile
    • WWW
Re: [mccodes-V2] Staff Organised Crimes
« Reply #10 on: February 25, 2009, 03:26:20 PM »
Logged

Cronus

  • Administrator
  • Senior Member
  • *****
  • Reputation Power: 2901
  • Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!
  • Offline Offline
  • Posts: 550
    • MSN Messenger - preston__08@hotmail.com
    • View Profile
    • WWW
Re: [mccodes-V2] Staff Organised Crimes
« Reply #11 on: February 26, 2009, 10:19:45 AM »
If anyone decides to use this and has errors please post it, it would be appreciated.
Logged
My msn is preston__08@hotmail.com if anyone is interested, I am online frequently.

Twist3d Fat3

  • Basic Member
  • *
  • Reputation Power: 52
  • Twist3d Fat3 has no influence.
  • Offline Offline
  • Posts: 42
    • View Profile
Re: [mccodes-V2] Staff Organised Crimes
« Reply #12 on: August 14, 2009, 02:16:19 AM »
Is this running on timestamps?
Logged

strats

  • Active Member
  • **
  • Reputation Power: 13
  • strats has no influence.
  • Offline Offline
  • Posts: 109
    • View Profile
Re: [mccodes-V2] Staff Organised Crimes
« Reply #13 on: September 07, 2009, 03:56:04 AM »
This is good but we need some crons lol
Logged

Diesel

  • Basic Member
  • *
  • Reputation Power: 6
  • Diesel has no influence.
  • Offline Offline
  • Posts: 14
    • View Profile
Re: [mccodes-V2] Staff Organised Crimes
« Reply #14 on: November 06, 2009, 06:04:25 PM »
Also, why do staff get their own OCs?
Seems strange to me lol.

I believe this is just a mod to add the options of adding, editing, deleting, etc. of organized crimes in the admin panel to keep the owners from having to go into the database to insert them manually. ;)
Logged
Pages: [1] 2
« previous next »
 


This forum is now closed and has moved to a new location! Click here to find out why.