Jump to content
MakeWebGames

Feky

Members
  • Posts

    172
  • Joined

  • Last visited

    Never

Everything posted by Feky

  1. Re: Any chance for 10 seonds of your time?   you mean a delete function if the president were you leave the gang without anyone owning the gang then that would just leave an empty gang and post yourgang file so we could have a look.
  2. Re: Respect from orgcrimes   i have searched for blackdragon to ask him but it says no such member found
  3. Re: Respect from orgcrimes this is not the full mod lol i this is only for the people that already installed it before and i thought i would just add the respect addon also but if you feel i should remove it then i will
  4. i dont know if this has been done before but i made a tiny addon to the org crimes so user can set minimum and maximum respect for passing an oc staff_orgcrimes.php <?php //Please Keep This Notice //Copyright BlackDragon 2008 //Free For CE Members //DO NOT RE-DISTRIBUTE //staff_orgcrimes.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. <form action='staff_orgcrimes.php?action=newocsub' method='post'> Org Crime Name: <input type='text' name='name' /> Min. Members Needed: <input type='text' name='members' /> Start Text: <textarea rows=4 cols=40 name='stext' /></textarea> Success Text: <textarea rows=4 cols=40 name='sctext' /></textarea> Failure Text : <textarea rows=4 cols=40 name='ftext' /></textarea> Min Success Money: <input type='text' name='minmoney' /> Max Success Money: <input type='text' name='maxmoney' /> Min Success Respect: <input type='text' name='minrespect' /> Max Success Respect: <input type='text' name='maxrespect' /> <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, ocMINRESPECT, ocMAXRESPECT) VALUES( '{$_POST['name']}', '{$_POST['members']}', '{$_POST['stext']}', '{$_POST['sctext']}', '{$_POST['ftext']}', '{$_POST['minmoney']}', '{$_POST['maxmoney']}', '{$_POST['minrespect']}', '{$_POST['maxrespect']}')"); print "Organized Crime created!"; stafflog_add("Created orginized crime {$_POST['name']}"); } function edit_orgcrime_form() { global $ir, $c, $db; print "Editing Org Crime. <form action='staff_orgcrimes.php?action=editocsub' method='post'> Current Crime: ".orgcrime_dropdown($c,'ocID')." New Org Crime Name: <input type='text' name='name' /> New Min. Members Needed: <input type='text' name='members' /> New Start Text: <textarea rows=4 cols=40 name='stext' /></textarea> New Success Text: <textarea rows=4 cols=40 name='sctext' /></textarea> New Failure Text : <textarea rows=4 cols=40 name='ftext' /></textarea> New Min Success Money: <input type='text' name='minmoney' /> New Max Success Money: <input type='text' name='maxmoney' /> New Min Success Respect: <input type='text' name='minrespect' /> New Max Success Respect: <input type='text' name='maxrespect' /> <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']}', ocMINRESPECT='{$_POST['minrespect']}', ocMAXRESPECT='{$_POST['maxrespect']}' 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. <form action='staff_orgcrimes.php?action=delocsub' method='post'> Org Crime: ".orgcrime_dropdown($c,'ocID')." <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 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')." <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(); ?>   add this to your cron_hour.php $db->query("UPDATE gangs SET gangCHOURS=gangCHOURS-1 WHERE gangCRIME>0"); $q=$db->query("SELECT g.*,oc.* FROM gangs g LEFT JOIN orgcrimes oc ON g.gangCRIME=oc.ocID WHERE g.gangCRIME > 0 AND g.gangCHOURS = 0"); while($r=$db->fetch_row($q)) { $suc=rand(0,1); if($suc) { $log=$r['ocSTARTTEXT'].$r['ocSUCCTEXT']; $muny=(int) (rand($r['ocMINMONEY'],$r['ocMAXMONEY'])); $respt=(int) (rand($r['ocMINRESPECT'],$r['ocMAXRESPECT'])); $log=str_replace(array("{muny}","'"),array($muny,"''"),$log); $log=str_replace(array("{respt}","'"),array($respt,"''"),$log); $db->query("UPDATE gangs SET gangMONEY=gangMONEY+$muny,gangCRIME=0 WHERE gangID={$r['gangID']}"); $db->query("UPDATE gangs SET gangRESPECT=gangRESPECT+$respt,gangCRIME=0 WHERE gangID={$r['gangID']}"); $db->query("INSERT INTO oclogs VALUES ('',{$r['gangID']}, '$log', 'success', $muny, $respt, '{$r['ocNAME']}', unix_timestamp())"); $i=$db->insert_id(); $qm=$db->query("SELECT * FROM users WHERE gang={$r['gangID']}"); while($rm=$db->fetch_row($qm)) { event_add($rm['userid'],"Your Gang's Organised Crime Succeeded. Go [url='oclog.php?ID=$i']here[/url] to view the details.",$c); } } else { $log=$r['ocSTARTTEXT'].$r['ocFAILTEXT']; $muny=0; $respt=0; $log=str_replace(array("{muny}","'"),array($muny,"''"),$log); $log=str_replace(array("{respt}","'"),array($respt,"''"),$log); $db->query("UPDATE gangs SET gangCRIME=0 WHERE gangID={$r['gangID']}"); $db->query("INSERT INTO oclogs VALUES ('',{$r['gangID']}, '$log', 'failure', $muny, $respt, '{$r['ocNAME']}', unix_timestamp())"); $i=$db->insert_id(); $qm=$db->query("SELECT * FROM users WHERE gang={$r['gangID']}"); while($rm=$db->fetch_row($qm)) { event_add($rm['userid'],"Your Gang's Organised Crime Failed. Go [url='oclog.php?ID=$i']here[/url] to view the details.",$c); } } }   add this function function respect_formatter($respt,$ressymb='$') { return $ressymb.number_format($respt); }   under this function in global_func.php function money_formatter($muny,$symb='$') { return $symb.number_format($muny); }   ALTER TABLE `orgcrimes` ADD `ocMINRESPECT` INT( 11 ) NOT NULL DEFAULT '0' ALTER TABLE `orgcrimes` ADD `ocMAXRESPECT` INT( 11 ) NOT NULL DEFAULT '0' replace the old oclog.php with this one <?php include "globals.php"; $_GET['ID'] = abs((int) $_GET['ID']); if(!$_GET['ID']) { die ("Incorrect usage of file."); } $q=$db->query("SELECT * FROM oclogs WHERE oclID={$_GET['ID']}"); $r=$db->fetch_row($q); print "Here is the detailed view on this crime. [b]Crime:[/b] {$r['ocCRIMEN']} [b]Time Executed:[/b] ".date('F j, Y, g:i:s a',$r['ocTIME'])." {$r['oclLOG']} [b]Result:[/b] {$r['oclRESULT']} [b]Money Made:[/b] \${$r['oclMONEY']} Respect Gained :<b /> {$r['oclRESPECT']}"; $h->endpage(); ?>   ALTER TABLE `oclogs` ADD `oclRESPECT` INT( 11 ) NOT NULL DEFAULT '0'
  5. Re: Requesting - [Mccodes V2} Shared house mod i am using the multiple properties mod by richard and i tryed to place this bit of code in but it sets both player that are married as owners and no of them can sell the house so does anyone now how this code would be placed so it allows the owner to market the house if he wants and the spouse to only move in not market the house.   if($ir['married'] AND ($ir['shared'] != 'owner')) { print "You are living in your partner\'s house at this time, it cannot be sold."; $h->endpage(); exit; }   <?php include "globals.php"; print "<center><font size='4' face='Arial, Helvetica, sans-serif'>Your Properties</font><hr width=75%>"; switch($_GET['action']) { case 'market': market_house(); break; case 'give': send_house(); break; case 'move': move_house(); break; default: your_houses(); break; } function your_houses() { global $db,$ir,$c,$userid,$h; $q=$db->query("SELECT pr.*,h.* FROM properties pr LEFT JOIN houses h ON pr.prHOUSE=h.hID WHERE pr.prOWNER={$userid} ORDER BY h.hPRICE ASC",$c); if ($db->num_rows($q) == 0) { print "You have no houses."; } else { print "<table width=60% cellspacing=1>"; while($r=$db->fetch_row($q)) { print "<tr>"; $dfi=$db->query("SELECT * FROM users WHERE userid={$r['prOWNER']}",$c); $tb=$db->fetch_row($dfi); print "<td valign='center'> [b]Property: [/b]{$r['hNAME']} [b]Owner: [/b][url='viewuser.php?u={$tb[']{$tb['username']}[/url] [b]Will: [/b]{$r['hWILL']}</td> <td align='center'> [[url='properties.php?action=move&ID={$r[']Move In[/url]] "; $yd=$db->query("SELECT * FROM rentals WHERE reRENTER=$userid AND rePID={$r['prID']}",$c); $zf=$db->fetch_row($yd); $tr=$db->num_rows($yd); if ($r['hWILL'] != '100' && $tr == '0') { print " [[url='properties.php?action=market&ID={$r[']Market[/url]] [[url='properties.php?action=give&ID={$r[']Give[/url]] "; } $zf=$db->fetch_row($yd); $tr=$db->num_rows($yd); if ($tr) { print "[[url='properties.php?action=return&ID={$r[']Return[/url]] "; } $hprice=money_formatter($r['hPRICE']); print "</tr><tr><td height='10'></td></tr>"; } print "</table> "; } } function send_house() { global $db,$ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $yd=$db->query("SELECT * FROM rentals WHERE reRENTER=$userid AND rePID={$_GET['ID']}",$c); $zf=$db->fetch_row($yd); $tr=$db->num_rows($yd); if ($tr) { die (" This house has been rented! <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%> "); } if($_POST['user']) { $q=$db->query("SELECT pr.*,h.* FROM properties pr LEFT JOIN houses h ON pr.prHOUSE=h.hID WHERE pr.prID={$_GET['ID']} AND pr.prOWNER=$userid LIMIT 1",$c); if($db->num_rows($q)==0) { print " Invalid house ID <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } else { $r=$db->fetch_row($q); $m=$db->query("SELECT * FROM users WHERE userid={$_POST['user']} LIMIT 1",$c); if($db->num_rows($m) == 0) { print " You are trying to send to an invalid user! <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } else if (!$_GET['ID']) { print " This user does not exist. <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } else { $rm=$db->fetch_row($m); $db->query("UPDATE properties SET prOWNER={$_POST['user']} WHERE prID={$_GET['ID']}",$c); } print " You sent the {$r['hNAME']} to {$rm['username']}. <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; event_add($_POST['user'],"You received the {$r['hNAME']} from [url='viewuser.php?u=$userid']{$ir['username']}[/url]",$c,'transfer'); } } else if($_GET['ID']) { $id=$db->query("SELECT pr.*,h.* FROM properties pr LEFT JOIN houses h ON pr.prHOUSE=h.hID WHERE pr.prID={$_GET['ID']} AND pr.prOWNER=$userid LIMIT 1",$c); if($db->num_rows($id)==0) { print " Invalid house ID. <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } else if ($_GET['ID']==0) { print " This user does not exist. <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } else { $r=$db->fetch_row($id); print " [b]Enter the ID of the user you want to give the {$r['hNAME']} to.[/b] <form action='properties.php?action=give&ID={$_GET['ID']}' method='post'> <input type='hidden' name='ID' value='{$_GET['ID']}' />User ID: <input type='text' name='user' value='' /> <input type='submit' value='Give House' /></form> <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } } else { print " Invalid use of file. <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } } function market_house() { global $db,$ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $yd=$db->query("SELECT * FROM rentals WHERE reRENTER=$userid AND rePID={$_GET['ID']}",$c); $zf=$db->fetch_row($yd); $tr=$db->num_rows($yd); if ($tr) { die (" This house has been rented! <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%> "); } $_POST['price'] = abs((int) $_POST['price']); if($_POST['price']) { $q=$db->query("SELECT pr.*,h.* FROM properties pr LEFT JOIN houses h ON pr.prHOUSE=h.hID WHERE prID={$_GET['ID']} and prOWNER=$userid",$c); if($db->num_rows($q)==0) { print " Invalid House ID <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } else { $r=$db->fetch_row($q); $db->query("INSERT INTO propertymarket VALUES ('','$userid',{$_POST['price']},'{$r['hID']}')", $c); $db->query("DELETE FROM properties WHERE prID={$_GET['ID']}",$c); print " House added to market. <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } } else { $q=$db->query("SELECT * FROM properties WHERE prID={$_GET['ID']} and prOWNER=$userid",$c); if($db->num_rows($q)==0) { print " Invalid House ID <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } else { $r=$db->fetch_row($q); print " Adding a house to the property market... <form action='properties.php?action=market&ID={$_GET['ID']}' method='post'> <input type='hidden' name='ID' value='{$_GET['ID']}' /> Price: <input type='text' name='price' value='0' /> <input type='submit' value='Add' /></form> <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } } } function move_house() { global $db,$ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $q=$db->query("SELECT pr.*,h.* FROM properties pr LEFT JOIN houses h ON pr.prHOUSE=h.hID WHERE pr.prID={$_GET['ID']} AND pr.prOWNER=$userid LIMIT 1",$c); $r=$db->fetch_row($q); if ($r['prOWNER'] != $ir['userid']) { print " This house does not belong to you. <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } else { $mpq=$db->query("SELECT * FROM houses WHERE hWILL={$ir['maxwill']}",$c); $mp=$db->fetch_row($mpq); print " You moved into your {$r['hNAME']}! <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; $db->query("INSERT INTO `properties` (`prID`, `prOWNER`, `prHOUSE`) VALUES ('', '$userid', '{$mp['hID']}');",$c); $db->query("UPDATE users SET maxwill={$r['hWILL']},will=0 WHERE userid=$userid",$c); $db->query("DELETE FROM properties WHERE prID={$_GET['ID']}",$c); } } $h->endpage(); ?>
  6. Re: Requesting - [Mccodes V2} Shared house mod i dont think their is a free version of it and the ones people attempted at have too many bugs.
  7. Re: Awards Mod nice +1
  8. Re: Can someone help   ok sorry
  9. i had 2 problem with gangs names and one was with creategang.php and the other with gan_staff_name function in yourgang.php and i managed to fix the problem with creategang.php but cant figure out what i am doing wrong here so the problem is that before i messed around with the script it allowed the user to have same name gangs by leaving spaces before the gang here is the function.   function gang_staff_name() { global $db, $ir, $userid, $gangdata, $h, $leaders; if(in_array($userid, $leaders)) { if(isset($_POST['subm'])) { $_POST['subm'] = trim($_POST['subm']); $check=$db->query(sprintf("SELECT `gangNAME` FROM `gangs` WHERE `gangNAME` = '%s'", clean($_POST['name']))); if($db->num_rows($check)) { print "ERROR. [url='yourgang.php?action=staff']> Back[/url]"; $h->endpage(); exit; } $sql = sprintf("UPDATE gangs SET gangNAME = '%s' WHERE (gangID = %u)", clean($_POST['vp']), $gangdata['gangID']); $db->query($sql); echo "Gang name changed! [url='yourgang.php?action=staff']> Back[/url]"; } else { echo "Current Name: "; echo sprintf("%s ", format($gangdata['gangNAME'])); echo " <form action='yourgang.php?action=staff&act2=name' method='post'>"; echo "<input type='hidden' name='subm' value='submit' />"; echo "<table class='table' width='75%'>"; echo "<tr>"; echo "<th>New name</th>"; echo sprintf("<td style='text-align:center;'><input type='text' name='vp' value='%s' size='40%%' /></td>", format($gangdata['gangNAME'])); echo "</tr>"; echo "<tr>"; echo "<td colspan='2' style='text-align:center;'><input type='submit' value='Change' /></td>"; echo "</tr>"; echo "</table>"; echo "</form>"; } } }
  10. Re: Sell Your Gang VR1 nice +1
  11. Feky

    PHP Question

    Re: PHP Question thanks for the answers guys i just wanted to make sure i am in the right direction
  12. Feky

    PHP Question

    Where did you people learn php? did you do some course or just by internet tutorials and making your own scripts and testing them.
  13. Re: gang names problem   thanks +1
  14. Re: gang names problem does anyone know how to sort this please
  15. players can have same gang names by leaveing a space before the name can anyone help me fix this iv been trying to sort it but cant get around it this is the function gang_staff_name from yourgang.php function gang_staff_name() { global $db, $ir, $userid, $gangdata, $h, $leaders; if(in_array($userid, $leaders)) { if(isset($_POST['subm'])) { $sql = sprintf("UPDATE gangs SET gangNAME = '%s' WHERE (gangID = %u)", clean($_POST['vp']), $gangdata['gangID']); $db->query($sql); echo "Gang name changed! [url='yourgang.php?action=staff']> Back[/url]"; } else { echo "Current Name: "; echo sprintf("%s ", format($gangdata['gangNAME'])); echo " <form action='yourgang.php?action=staff&act2=name' method='post'>"; echo "<input type='hidden' name='subm' value='submit' />"; echo "<table class='table' width='75%'>"; echo "<tr>"; echo "<th>New name</th>"; echo sprintf("<td style='text-align:center;'><input type='text' name='vp' value='%s' size='40%%' /></td>", format($gangdata['gangNAME'])); echo "</tr>"; echo "<tr>"; echo "<td colspan='2' style='text-align:center;'><input type='submit' value='Change' /></td>"; echo "</tr>"; echo "</table>"; echo "</form>"; } } }   and this is creategang.php and both of these have the same problem <?php include(DIRNAME(__FILE__) . '/globals.php'); function format($str) { if(is_numeric($str)) { $str = number_format($str); } else { $str = nl2br($str); $str = stripslashes($str); } return $str; } function clean($string) { $string = mysql_real_escape_string($string); $string = htmlspecialchars($string); return $string; } if($ir['money'] < 1000) { echo "You don't have enough money. You need \$1,000."; $h->endpage(); exit; } if($ir['gang']) { echo "You're already in a gang!"; $h->endpage(); exit; } if(isset($_POST['name'])) { $check=$db->query(sprintf("SELECT `gangNAME` FROM `gangs` WHERE `gangNAME` = '%s'", clean($_POST['name']))); if($db->num_rows($check)) { print "ERROR. [url='creategang.php']> Back[/url]"; $h->endpage(); exit; } $name = clean($_POST['name'] = trim($_POST['name'])); $desc = clean($_POST['desc']); $sql = sprintf("INSERT INTO gangs (gangNAME, gangDESC, gangPREF, gangSUFF, gangMONEY, gangCRYSTALS, gangRESPECT, gangPRESIDENT, gangVICEPRES, gangCAPACITY) VALUES ('%s', '%s', '', '', 0, 0, 100, %u, %u, 5)", $name, $desc, $userid, $userid); $db->query($sql); $i = $db->insert_id(); $gang = sprintf("UPDATE users SET gang = %u, money = money - 1000 WHERE (userid = %u)", $i, $userid); $db->query($gang); echo "Gang created!"; } else { echo "<h3>Create A Gang</h3>"; echo "<form action='creategang.php' method='post'>"; echo "<input type='hidden' name='submit' value='1' />"; echo "Name:<input type='text' name='name' /> "; echo "Description: "; echo "<textarea name='desc' cols='40' rows='7'></textarea>"; echo " <input type='submit' value='Create Gang for \$1,000' />"; echo "</form>"; } $h->endpage(); ?>
  16. Re: help installing mccodes v1 its a redirect the problem could be you index.php or your host
  17. Re: help installing mccodes v1 any mccodes version at the start is full with bug and exploites lol to get a success game running you have to recode the entire engine
  18. Re: help installing mccodes v1 if you bought it from mccodes then use the installer and put your details in and if not then like i said up load the files and run the sql file in phpmyadmin manually its not that hard
  19. Re: help installing mccodes v1 up load all the files and run the sql manually
  20. Feky

    jobpoints bug

    Re: jobpoints bug nopr their is no zero it just says job points with no figure
  21. Re: phpjobscheduler for mccodes v2 use cron jobs not phpjobscheduler
  22. Feky

    help:(

    Re: help:(   lol you need to rename the index2.php to just index.php but make sure the game is installed and then you have to secure your site lol mccodes original has over 70 exploites and bugs
  23. Feky

    Name bug

    Re: Name bug yea i plus+ you and hound dawg lol
  24. Feky

    help:(

    Re: help:( also change the index2.php file name to index.php and install and delete the installer
  25. Feky

    Name bug

    Re: Name bug   thanks mate it work now +4 for you but +1 when ever i am on
×
×
  • Create New...