Jump to content
MakeWebGames

Recommended Posts

Posted

okay i have a gangs page where when i click orgnise crime the drop down list seems to eb empty when in the php my admin i added a test org crime any ideas?

here is the staff_gangs.php script for adding org crimes

function create_oc_form()
{
global $db,$ir,$c,$h,$userid;
if($ir['user_level'] != 2)
{
die('403');
}
print "
<form action='staff_gangs.php?action=createocsub' method='POST'>
<h4>Create OC</h4>
Name: <input type='text' name='ocNAME'/><br />

Minimum users for crime:
<br /> <input type='text' name='ocUSERS'/>

<br />Text: <br /><textarea rows=4 cols=40 name='ocSTARTTEXT'  /></textarea>

<br />Success Text: <br /><textarea rows=4 cols=40 name='ocSUCCTEXT'  /></textarea>

<br />Failure Text <br /><textarea rows=4 cols=40 name='ocFAILTEXT'  /></textarea>

<br />Minimum Possible Money <br /><input type='text' name='ocMINMONEY'/>

<br />Maximum Possible Money <br /><input type='text' name='ocMAXMONEY'/>

<br />Respect Gain <br /><input type='text' name='ocRESPECT'/>

<input type='submit' value='Create' />
</form>";
}
function create_oc_sub()
{
global $ir,$c,$userid,$db,$h;
if($ir['user_level'] != 2)
{
die('403');
}
$db->query("INSERT INTO orgcrimes VALUES('', '{$_POST['ocNAME']}', '{$_POST['ocUSERS']}', '{$_POST['ocSTARTTEXT']}', '{$_POST['ocSUCCTEXT']}', '{$_POST['ocFAILTEXT']}', '{$_POST['ocMINMONEY']}', '{$_POST['ocMAXMONEY']}')");
print "
The organised crime was successfully created.
<a href='staff_gangs.php?action=createoc'>>Back</a>

";
stafflog_add("Created Organise Crime: {$_POST['ocNAME']}");
}

 

and here is the your gangs.php bit

function gang_staff_orgcrimes()
{
global $db,$ir,$c,$userid,$gangdata;
$_POST['crime'] = abs((int) $_POST['crime']);
if($_POST['crime'])
{
if($gangdata['gangCRIME'] != 0)
{
print "Your gang is already doing a crime!";
}
else
{
$db->query("UPDATE gangs SET gangCRIME={$_POST['ocNAME']},gangCHOURS=24 WHERE gangID={$ir['gang']}");
print "You have started to plan this crime. It will take 24 hours.";
}
}
else
{
print "<h3>Organised Crimes</h3>
<form action='yourgang.php?action=staff&act2=crimes' method='post'>Choose a crime that your gang should commit.

<select name='crime' type='dropdown'>";
$cnt=$db->query("SELECT username FROM users WHERE gang={$gangdata['gangID']}");
$membs=$db->num_rows($cnt);
$q=$db->query("SELECT * FROM orgcrimes WHERE ocUSERS <= $membs");
while($r=$db->fetch_row($q))
{
print "<option value='{$r['ocID']}'>{$r['ocNAME']} ({$r['ocUSERS']} members needed)</option>";
}
print "</select>
<input type='submit' value='Commit' /></form>";
}

 

please help me im nooby in coding but making a effort

  • 3 months later...
  • 3 months later...
Posted

I am joing the ranks with these guys..... Same problem here. Organised crimes are going to the database but not showing in the dropdown so your gang can do the crime. Can anyone shed some light on this? Thanks in advance.

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...