Jump to content
MakeWebGames

Organised Crimes in Redux


mike

Recommended Posts

Does anyone know how to create the organised crimes in the version 2.5.1 engine? I see it as an option in Gangs but I cannot find anywhere in the staff panel to create the crimes for it. I can create player crimes for one player but there is no options for making a crime an organised crime and the drop down in the gang panel is empty. A guide for this game engine would be nice 8^) Or a wiki or something LOL. Thanks!

Link to comment
Share on other sites

It stated Author: mod for 2.x credit to original author.

To be honest I cannot recall if I purchased anything like this a few yrs ago and I didnt think to search ive removed it just in case. I dont use it and therefore havnt tested it. But yeah the file is faulty.

It rang a bell that i had it and so I changed it to suit reflux. At the same time removing all the silly @intval.

Shows how very little the redux was tested. A entire file was overlooked? shameful

Edited by rulerofzu
Link to comment
Share on other sites

if it was a Free mod as i believe it was my edit of that file can be used by redux:

<?php
/*
       Engine: MC V2.5 (Redux)
       File: ogcrime.php
       Author: MakeWebGames.com
*/
if ( !defined($_CONFIG['define_code']) ) {
  echo 'This file cannot be accessed directly.';
  exit;
}
     if ( $ir['user_level'] != 2 ) {
  echo 'You cannot access this area.> <a href="'.gen_url('main',true,true).'">Go Back</a>';
  die($h->endpage());
     }
switch ( $_GET['action'] ) {
	case 'index': index(); break;
	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: index(); break;
}
function index() {
		global $ir;
      if ( $ir['user_level'] == 2 ) {
  echo '
<table class="table" cellpadding="1" cellspacing="1" width="70%" style="text-align: center;">
	<tr>
<th>Organised Gang Crimes</th>
	</tr>
	<tr>
<td>> <a href="'.gen_url('ogcrimes',true,true).'&action=newoc">New Organised Crime</a></td>
	</tr>
	<tr>
<td>> <a href="'.gen_url('ogcrimes',true,true).'&action=editoc">Edit Organised Crime</a></td>
	</tr>
	<tr>
<td>> <a href="'.gen_url('ogcrimes',true,true).'&action=deloc">Delete Organised Crime</a></td>
	</tr>
	<tr>
<td>> <a href="'.gen_url('ogcrimes',true,true).'&action=stopoc">Stop Organised Crime</a></td>
	</tr>
	<tr>
<th>> <a href="'.gen_url('main',true,true).'">Goto Main</a></th>
	</tr>
</table>
  ';
      }
}
function new_orgcrime_form() {
global $ir, $db;
  echo "
Adding a new organized crime.
<form action='".gen_url('ogcrimes',true,true)."&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 Crime' />
</form>
  ";
}
function new_orgcrime_submit() {
global $ir,$userid, $db;
	$name = ( isset($_POST['name'])&&preg_match("/^[a-z0-9_]+([\\s]{1}[a-z0-9_]|[a-z0-9_])+$/i", $_POST['name']) )?strip_tags($db->escape($_POST['name'])):'';
	$members = ( isset($_POST['members'])&&is_numeric($_POST['members']) )?abs(intval($_POST['members'])):1;
	$stext = ( isset($_POST['stext']) )?strip_tags($db->escape($_POST['stext'])):'';
	$sctext = ( isset($_POST['sctext']) )?strip_tags($db->escape($_POST['sctext'])):'';
	$ftext = ( isset($_POST['ftext']) )?strip_tags($db->escape($_POST['ftext'])):'';
	$minmoney = ( isset($_POST['minmoney'])&&is_numeric($_POST['minmoney']) )?abs(intval($_POST['minmoney'])):'';
	$maxmoney = ( isset($_POST['maxmoney'])&&is_numeric($_POST['maxmoney']) )?abs(intval($_POST['maxmoney'])):'';
      if ( empty($name) OR empty($members) OR empty($minmoney) OR empty($maxmoney) OR empty($stext) OR empty($sctext) OR empty($ftext) ) {
  echo 'One or more of the inputs seems to of the wrong format, please go back and try again.<br />> <a href="'.gen_url('ogcrimes',true,true).'&action=newoc">Go back</a>';
  die($h->endpage());
      }
$db->query("INSERT INTO `orgcrimes` (ocNAME, ocUSERS, ocSTARTTEXT, ocSUCCTEXT, ocFAILTEXT, ocMINMONEY, ocMAXMONEY) VALUES( '$name', '$members', '$stext', '$sctext', '$ftext', '$minmoney', '$maxmoney')");
  echo "Organized Crime created!";
	stafflog_add("Created orginized crime {$name}");
}
function edit_orgcrime_form() {
global $ir, $db;
  echo "
Editing Org Crime.
<form action='".gen_url('ogcrimes',true,true)."&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,$userid, $db,$h;
	$name = ( isset($_POST['name'])&&preg_match("/^[a-z0-9_]+([\\s]{1}[a-z0-9_]|[a-z0-9_])+$/i", $_POST['name']) )?strip_tags($db->escape($_POST['name'])):'';
	$members = ( isset($_POST['members'])&&is_numeric($_POST['members']) )?abs(intval($_POST['members'])):1;
	$stext = ( isset($_POST['stext']) )?strip_tags($db->escape($_POST['stext'])):'';
	$sctext = ( isset($_POST['sctext']) )?strip_tags($db->escape($_POST['sctext'])):'';
	$ftext = ( isset($_POST['ftext']) )?strip_tags($db->escape($_POST['ftext'])):'';
	$minmoney = ( isset($_POST['minmoney'])&&is_numeric($_POST['minmoney']) )?abs(intval($_POST['minmoney'])):'';
	$maxmoney = ( isset($_POST['maxmoney'])&&is_numeric($_POST['maxmoney']) )?abs(intval($_POST['maxmoney'])):'';
	$ocID = ( isset($_POST['ocID'])&&is_numeric($_POST['ocID']) )?abs(intval($_POST['ocID'])):'';
      if ( empty($ocID) OR empty($name) OR empty($members) OR empty($minmoney) OR empty($maxmoney) OR empty($stext) OR empty($sctext) OR empty($ftext) ) {
  echo 'One or more of the inputs seems to of the wrong format, please go back and try again.<br />> <a href="'.gen_url('ogcrimes',true,true).'&action=editoc">Go back</a>';
  die($h->endpage());
      }
$c_ogc = $db->query('SELECT `ocID` FROM `orgcrimes` WHERE `ocID` = '.$ocID);
      if ( $db->num_rows($c_ogc) == 0 ) {
  echo 'Organised Gang Crime doesn\'t exist.<br />> <a href="'.gen_url('ogcrimes',true,true).'&action=editoc">Go back</a>';
  die($h->endpage());
      }
$db->query("UPDATE `orgcrimes` SET `ocNAME`='$name', `ocUSERS`='$members', `ocSTARTTEXT`='$stext', `ocSUCCTEXT`='$sctext', `ocFAILTEXT`='$ftext', `ocMINMONEY`='$minmoney', `ocMAXMONEY`='$maxmoney' WHERE `ocID`={$ocID}");
  echo "Organized Crime edited!";
	stafflog_add("Edited Orginized crime {$name}");
}
function del_orgcrime_form() {
global $ir, $db;
  echo "
Deleting Org Crime.
<form action='".gen_url('ogcrimes',true,true)."&action=  delocsub' method='post'>
Org Crime: ".orgcrime_dropdown($c,'ocID')."
<input type='submit' value='Delete Orginized Crime' />
</form>
  ";
}
function del_orgcrime_submit() {
global $ir,$userid, $db;
	$ocID = ( isset($_POST['ocID'])&&is_numeric($_POST['ocID']) )?abs(intval($_POST['ocID'])):'';
$c_ogc = $db->query('SELECT `ocID` FROM `orgcrimes` WHERE `ocID` = '.$ocID);
      if ( $db->num_rows($c_ogc) == 0 ) {
  echo 'Organised Gang Crime doesn\'t exist.<br />> <a href="'.gen_url('ogcrimes',true,true).'&action=editoc">Go back</a>';
  die($h->endpage());
      }
$db->query("DELETE FROM `orgcrimes` WHERE `ocID`={$ocID}");
  echo "Organized Crime Deleted!</div>";
	stafflog_add("Deleted Orginized Crime ID: {$ocID}");
}
function stop_orgcrime_form() {
global $ir, $db;
  echo "
Stopping Org Crime
This allows you to stop any organized crimes associated with a gang
<form action='".gen_url('ogcrimes',true,true)."&action=  stopocsub' method='post'>
Gang: ".gang_dropdown($c,'gangID')."
<input type='submit' value='Stop Organized Crime' />
</form>
  ";
}
function stop_orgcrime_submit() {
global $ir,$userid, $db;
	$gangID = ( isset($_POST['gangID'])&&is_numeric($_POST['gangID']) )?abs(intval($_POST['gangID'])):'';
$c_gng = $db->query('SELECT `gangID` FROM `gangs` WHERE `gangID` = '.$gangID);
      if ( $db->num_rows($c_gng) == 0 ) {
  echo 'Gang doesn\'t exist.<br />> <a href="'.gen_url('ogcrimes',true,true).'&action=stopoc">Go back</a>';
  die($h->endpage());
      }
$db->query("UPDATE `gangs` SET `gangCRIME`='0', `gangCHOURS`='0' WHERE `gangID`={$gangID}");
  echo "Organized Crime Stopped!";
	stafflog_add("Stopped Organized Crime For Gang ID {$gangID}");
}
?>

Also it's secure... lol unlike the version you posted (shameful you forgot that huh (LOL))

Opps forgot the edits

global_func.php:

function orgcrime_dropdown ($connection,$ddname="ogID",$selected=-1) {
global $db;
	$ret="<select name='$ddname' type='dropdown'>";
$q = $db->query("SELECT `ocNAME`,`ocID` FROM `orgcrimes` ORDER BY `ocNAME` ASC");
    if($selected == -1) {
	$first = 0;
    } else {
	$first = 1;
    }
     while ( $r = $db->fetch_row($q) ) {
	$ret.="\n<option value='{$r['ocID']}'";
    if ( $selected == $r['crimeID'] || $first == 0 ) {
	$ret.=" selected='selected'";
	$first=1;
    } 
	$ret.=">{$r['ocNAME']}</option>";
}
	$ret.="\n</select>";
  return $ret;
}

function gang_dropdown($connection, $ddname = "gangID", $selected = -1)
{
   global $db;
   $ret = "<select name='$ddname' type='dropdown'>";
   $q =
           $db->query(
                   "SELECT `gangID`, `gangNAME`
   				 FROM `gangs`
   				 ORDER BY `gangNAME` 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>";
   }
   $db->free_result($q);
   $ret .= "\n</select>";
   return $ret;
}

and smenu.php:

<br />
<span style='font-weight: none;'><a href='".gen_url('ogcrimes',true,true)."'>Organised Crimes</a></span>

Add them in sufficient places.

Also edit staff.php and add:

                'ogcrimes' => 'Staff/ogcrimes.php',

into the file array.

Edited by Paul Evans
Link to comment
Share on other sites

Shows how very little the redux was tested. A entire file was overlooked? shameful

No, they didn't test properly at all. I have submited and re-submitted numerous trouble tickets since it came out. The first couple were fixed and seem to be working but there are numerous more I am still waiting on to be corrected. I would fix them myself or hire someone to but I feel mccodes should fix them properly or stop selling Redux until they can provide what they promise to their customers. Last Monday I was told 24 hours but I am learning 24 hours to me is different than 24 hours to mccodes.

Probably needed to be posted in a different thread but here are a few of the issues still pending:

1. Gang Crimes is missing .. Obviously 8^)

2. Attacking someone causes you to lose all experience and you get a running away message. Great intention to prevent players from just x'ing out of their browser but it isn't working as intended.

3. Cannot USE consumable items at all. Hard to have drinks if you cannot drink them.

4. Job Promotions cause a Query Error and don't work.

5. Forums are a mess. Only admins can add new topics and such. Very low limit on post character lengths.

There are probably more but I stopped testing until these are corrected.

Link to comment
Share on other sites

Greatly appreciated! Thanks Paul for all the work you have been putting into Redux as well. Hopefully the out-of-box version becomes usable soon so I can focus on moving forward with my learning project 8^)

Edited by mike
Link to comment
Share on other sites

Ok....

No.3 inventory file. line 96 change the gen_url to itemuse where it says iteminfo (CB/Dabs and whoever else must not have tested using items at all or you would have spotted that)

Also why they made the file so you can not have the item sell price as 0. When making an engine surely it would be for total flexibility.

No.2 attack. Actually the problem is in the header file. Line 25 change so it reads !in_array - god alive!!

JOBS....edit index.php

You will only see $housequery = 1;

which means these in the globals.php

$jobquery and $hospquery

are not actually called. Again stuff that could have been spotted if

1. They had tested the engine

2. The demo had actually had content in rather than being blank.

so add

$hospquery=1;

$jobquery=1;

Paul they are not fixed in 2.5.1 as I uploaded that before looking to fix the errors. Fair enough fix the demo but dont supply the fixes to everyone else.

Edited by rulerofzu
Link to comment
Share on other sites

CB has been the one that has contacted me a couple times about getting these fixed. My main concern and point is that they get fixed and released as a working engine and not one that will need to be fixed by those purchasing it. Apparently that has never been the case with any version of mccodes?

Hopefully I will get home tonight and take a look at these problems closer and maybe I can better explain the issues to mccodes .. maybe that's the problem .. I don't explain with enough information and details for them to realize whats wrong? Oh wait, but you guys get it so......

Link to comment
Share on other sites

Ive edited my post above with the fixes. However ive got a notepad list of mistakes which is steadily growing.

Seriously they need to pull it from being on sale and go through it again and fix it up or this is gonna be another mc2 package which is always full of errors left to the community to constantly on a weekly basis point to what needs fixing.

Edited by rulerofzu
Link to comment
Share on other sites

Mike on the redux sample website them issues seem to be fixed? so im guessing they have actually listened to you and fixed them.

Then why can't they simply take a moment to let me or someone else know they fixed them?! LOL, amazing. Well, as long as they are being fixed. I am getting mine fixed and A LOT is because of you and Zu and some others on this forum and for that a huge KUDOS! I just have an ethical issue with someone receiving money for a product that doesn't deliver and I submit all the trouble tickets and eventually post here when I get no reply from mccodes just in the hopes that future buyers of Redux don't repeat what I have had to do 8^)

I should be home tonight and I will apply all you guys have posted in this thread and test it out. Thanks!

Link to comment
Share on other sites

They missed a whole file? Kind of funny... anyone considered going through all the threads, making a list of issues, and sending it directly to dabs/cb? I don't believe they check the site ½ as much as they should.

Btw – The support is only 30 days, and frankly I have not heard a good word about it. Just a warning to anyone else.

Link to comment
Share on other sites

In my eyes the 30 day support will begin once I have a game engine that performs as advertised. That's the way it should be and they should be doing all they can to get it working before they continue to make sales.

Link to comment
Share on other sites

Ok....

No.3 inventory file. line 96 change the gen_url to itemuse where it says iteminfo (CB/Dabs and whoever else must not have tested using items at all or you would have spotted that)

Also why they made the file so you can not have the item sell price as 0. When making an engine surely it would be for total flexibility.

No.2 attack. Actually the problem is in the header file. Line 25 change so it reads !in_array - god alive!!

JOBS....edit index.php

You will only see $housequery = 1;

which means these in the globals.php

$jobquery and $hospquery

are not actually called. Again stuff that could have been spotted if

1. They had tested the engine

2. The demo had actually had content in rather than being blank.

so add

$hospquery=1;

$jobquery=1;

Paul they are not fixed in 2.5.1 as I uploaded that before looking to fix the errors. Fair enough fix the demo but dont supply the fixes to everyone else.

All working now .. Now adding Paul's gang crime mod. Thanks!

Weird .. after you attack someone a few times you stop getting experience for them .. by design I hope and not another bug .. to prevent farming players I suppose?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...