
Joshua
Members-
Posts
1,271 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by Joshua
-
Richards Business Mod--Fixed With a few Things added.
Joshua replied to Joshua's topic in Free Modifications
business_manage.php <?php include_once (DIRNAME(__FILE__). '/globals.php'); global $db,$ir; echo '<p class="heading">Manage Company</p>'; $fetch_business = $db->query(sprintf("SELECT * FROM `businesses` LEFT JOIN `businesses_classes` ON (`classId` = `busClass`) WHERE (`busDirector` = '%u')", $ir['userid'])); if(!$db->num_rows($fetch_business)) { echo 'You do not own a Company right now!'; $h->endpage(); exit; } else { $inf = $db->fetch_row($fetch_business); } switch ($_GET['p']) { case 'new_name': new_business_name(); break; case 'new_banner': new_business_banner(); break; case 'new_rank': edit_member_rank(); break; case 'new_salary': edit_member_salary(); break; case 'view_vault': view_vault(); break; case 'donate_cash': donate_cash(); break; case 'withdraw_mula': withdraw_mula(); break; case 'debt': sort_debt(); break; case 'bankrupt': bankrupt_business(); break; case 'credit_member': credit_member(); break; case 'view_apps': manage_applications(); break; case 'kick_out': kick_member(); break; case 'upgrade': upgrade_business(); break; case 'change_desc': change_description(); break; case 'secupgrade': secure_business(); break; default: business_index(); break; } function business_index() { global $ir, $inf, $db; if($inf['busDebt']) { echo 'This Company is in debt of \$'.number_format($inf['busDebt']).' right now. Click [url="business_manage.php?p=debt"]here[/url] to sort it out. To bankrupt and close down the Company, click [url="business_manage.php?p=bankrupt"]here[/url] to complete proceedings.'; } else { echo ' <table width="300" bgcolor="black" border="2"> <tr> <td colspan="100%"><center> [b]Manage Your Company:[/b]</center></td></tr> <tr><td>[url="business_manage.php?p=new_name"]Edit Company name[/url]</td> <td>[url="business_manage.php?p=change_desc"]Edit description[/url]</td></tr> <tr><td>[url="business_manage.php?p=new_banner"]Change company banner[/url]</td> <td>[url="business_manage.php?p=credit_member"]Credit cash to employee[/url]</td></tr> <td>[url="business_manage.php?p=view_apps"]Manage applications[/url]</td> <td>[url="business_manage.php?p=new_rank"]Edit employees rank[/url]</td></tr> <td>[url="business_manage.php?p=upgrade"]Upgrade The Company size[/url]</td> <td>[url="business_manage.php?p=new_salary"]Change employee salary[/url]</td></tr> <td>[url="business_manage.php?p=kick_out"]Kick employee out[/url] </td> <td>[url="business_manage.php?p=view_vault"]View company vault[/url]</td></tr> <td>[url="business_manage.php?p=bankrupt"]Bankrupt the Company[/url]</td> <td>[url="business_manage.php?p=secupgrade"]Hire Security[/url] </td> </tr> </table>'; } } function new_business_name() { global $ir, $inf, $db; $_POST['name'] = $db->escape(stripslashes($_POST['name'])); if(!$_POST['name']) { echo '<form action="business_manage.php?p=new_name" method="post"> <p align="center"> [b]You are changing the Company name of the '.stripslashes($inf['busName']).' Company.[/b] Please enter a new name in the input box below and click \'Change name\' to submit the new name. <input type="text" name="name" /> <input type="submit" value="Change name" /> </p> </form>'; } else { $check = $db->query(sprintf("SELECT * FROM `businesses` WHERE (`busName` = '%s')", $_POST['name'])); if(!$db->num_rows($check)) { $db->query(sprintf("UPDATE `businesses` SET `busName` = '%s' WHERE `busId` = '%u'", $_POST['name'], $inf['busId'])); echo 'The Company name was changed to '.$_POST['name'].'!'; business_alert($inf['busId'], "The Company name was changed to ".$_POST['name']."."); } else { echo 'Sorry this Company name is in use at this time.'; } } } function new_business_banner() { global $ir, $inf, $db; if(!$_POST['banner']) { echo '<form action="business_manage.php?p=new_banner" method="post"> <p align="center"> [b]You are changing the banner of the '.stripslashes($inf['busName']).' Company.[/b] Please enter a new banner image location in the input box below and click \'Change banner\' to submit the new image. [b]Current image:[/b] '; if($inf['busImage']) { echo '[img='.stripslashes($inf['busImage']).']'; } else { echo '[img=dimg.jpg]'; } echo ' New image: <input type="text" name="banner" size="50" /> <input type="submit" value="Change banner" /> </p> </form>'; } else { $db->query(sprintf("UPDATE `businesses` SET `busImage` = '%s' WHERE `busId` = '%u'", stripslashes($_POST['banner']), $inf['busId'])); echo 'The Company banner was updated.'; business_alert($inf['busId'], "The Company banner has been updated."); } } function edit_member_rank() { global $ir, $inf, $db; $_POST['member'] = abs(@intval($_POST['member'])); $_POST['rank'] = abs(@intval($_POST['rank'])); if(!$_POST['member'] || !$_POST['rank']) { echo '<form action="business_manage.php?p=new_rank" method="post"> <p align="center"> [b]Set the Company rank:[/b] Company employee: <select name="member"> <option value="0">None</option>'; $select_members = $db->query(sprintf("SELECT * FROM `businesses_members` LEFT JOIN `users` ON (`userid` = `bmembMember`) WHERE (`bmembBusiness` = '%u') ORDER BY `bmembId` ASC", $inf['busId'])); while($sm = $db->fetch_row($select_members)) { echo '<option value="'.$sm['userid'].'">'.stripslashes($sm['username']).'</option>'; } echo '</select> Company rank: <select name="rank"> <option value="0">None</option>'; $select_ranks = $db->query(sprintf("SELECT * FROM `businesses_ranks` WHERE (`rankClass` = '%u') ORDER BY `rankId` ASC", $inf['classId'])); while($sr = $db->fetch_row($select_ranks)) { echo '<option value="'.$sr['rankId'].'">'.stripslashes($sr['rankName']).'</option>'; } echo '</select> <input type="submit" value="Change rank" /></p> </form>'; } else { $select_member = $db->query(sprintf("SELECT * FROM `businesses_members` WHERE (`bmembMember` = '%u') AND (`bmembBusiness` = '%u')", $_POST['member'], $inf['busId'])); if(!$db->num_rows($select_member)) { echo 'You cannot edit the rank of this employee.'; } else { $select_cash = $db->query(sprintf("SELECT * FROM `businesses_ranks` WHERE (`rankId` = '%u')", $_POST['rank'])); $realname = $db->query(sprintf("SELECT * FROM `users` WHERE (`userid` = '%u')", $_POST['member'])); $sc = $db->fetch_row($select_cash); $thename = $db->fetch_row($realname); $realrank = $db->query(sprintf("SELECT * FROM `businesses_ranks` WHERE (`rankId` = '%u')", $_POST['rank'])); $rname = $db->fetch_row($realrank); echo 'This member\'s rank was updated.'; $db->query(sprintf("UPDATE `businesses_members` SET `bmembRank` = '%d', `bmembCash` = '%d' WHERE (`bmembMember` = '%u')", $_POST['rank'], $sc['rankCash'], $_POST['member'])); business_alert($inf['busId'], " ".$thename['username']."\'s rank was changed to ".$rname['rankName']."."); } } } function edit_member_salary() { global $ir, $inf, $db; $_POST['member'] = abs(@intval($_POST['member'])); $_POST['salary'] = abs(@intval($_POST['salary'])); if(!$_POST['member'] || !$_POST['salary']) { echo '<form action="business_manage.php?p=new_salary" method="post"> <p align="center"> [b]Set the new Company salary:[/b] Company employee: <select name="member"> <option value="0">None</option>'; $select_members = $db->query(sprintf("SELECT * FROM `businesses_members` LEFT JOIN `users` ON (`userid` = `bmembMember`) WHERE (`bmembBusiness` = '%u') ORDER BY `bmembId` ASC", $inf['busId'])); while($sm = $db->fetch_row($select_members)) { echo '<option value="'.$sm['userid'].'">'.stripslashes($sm['username']).'</option>'; } echo '</select> Salary amount: <input type="text" name="salary" size="8" maxlength="6" /> <input type="submit" value="Change salary" /></p> </form>'; } else { $select_member = $db->query(sprintf("SELECT * FROM `businesses_members` WHERE (`bmembMember` = %u) AND (`bmembBusiness` = %u)", $_POST['member'], $inf['busId'])); if(!$db->num_rows($select_member)) { echo 'You cannot edit the salary of this employee.'; } else { echo 'This employee\'s salary was updated to £'.number_format($_POST['salary']).'.'; $realname = $db->query(sprintf("SELECT * FROM `users` WHERE (`userid` = '%u')", $_POST['member'])); $thename = $db->fetch_row($realname); $db->query(sprintf("UPDATE `businesses_members` SET `bmembCash` = '%d' WHERE (`bmembMember` = '%u')", $_POST['salary'], $_POST['member'])); business_alert($inf['busId'], "".$thename['username']."\'s salary was changed to ".number_format($_POST['salary'])."."); } } } function view_vault() { global $ir, $inf, $db; echo '<form action="business_manage.php?p=donate_cash" method="post"> Your Company has '.number_format($inf['busCash']).' secured in it\'s vault. [b]Donate cash:[/b] Cash amount: <input type="text" name="cash" /> <input type="submit" value="Donate cash"></form> <form action="business_manage.php?p=withdraw_mula" method="post"> [b]Withdraw cash:[/b] Cash amount: <input type="text" name="mula" /> <input type="submit" value="Withdraw cash">'; } function sort_debt() { global $ir, $inf, $db; $_POST['cash'] = abs(@intval($_POST['cash'])); if($_POST['cash'] > 0) { if($_POST['cash'] > $ir['money']) { echo 'You do not have enough cash to sort out that amount of debt.'; } else if($_POST['cash'] > $inf['busDebt']) { echo 'The Company does not owe that much cash in debt.'; } else { $db->query(sprintf("UPDATE `users` SET `money` = `money` - '%d' WHERE `userid` = '%u'", $_POST['cash'], $ir['userid'])); $db->query(sprintf("UPDATE `businesses` SET `busDebt` = `busDebt` - '%d' WHERE `busId` = '%u'", $_POST['cash'], $inf['busId'])); echo 'You have cleared up '.number_format($_POST['cash']).' of the Company debt.'; business_alert($inf['busId'], "".$ir['username']." paid ".number_format($_POST['cash'])." of the Company debt."); -
Richards Business Mod--Fixed With a few Things added.
Joshua replied to Joshua's topic in Free Modifications
business_cron.php <?php include "config.php"; include "global_func.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die(""); } define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $set=array(); $settq=$db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } $db->query("UPDATE `businesses` SET `brank` = '100000' WHERE `brank` > '100000'"); $select_businesses = $db->query("SELECT * FROM `businesses` LEFT JOIN `businesses_classes` ON (`classId` = `busClass`) ORDER BY `busId` ASC"); while($bs=$db->fetch_row($select_businesses)) { $amount = $db->num_rows($db->query(sprintf("SELECT * FROM `businesses_members` WHERE `bmembBusiness` = '%u'", $bs['busId']))); $active = $db->num_rows($db->query(sprintf("SELECT * FROM `users` WHERE `business` = '%u' AND active='%d'", $bs['busId'], 1))); $new_customers = ($bs['brank']*($active)+ rand(10, 20)*$bs['classCost'] / 200); $new_profit = (($new_customers)+ rand(110, 990)); $new_rank = ($bs['classId']*($active)/2); $db->query(sprintf("UPDATE `businesses` SET `busYCust` = `busCust`, `busYProfit` = `busProfit`, `busCust` = '%d', `busProfit` = '%d', `busCash` = '%d' WHERE `busId` = '%u'", $new_customers, $new_profit, ($new_profit + $bs['busCash']), $bs['busId'])); $db->query(sprintf("UPDATE `businesses` SET `busDays` = `busDays` + '1'")); $db->query(sprintf("UPDATE `users` SET `activedays` = `activedays` + '1' WHERE `active` = '1'")); $db->query(sprintf("UPDATE `users` SET `active` = '0' WHERE `active` = '1'")); $db->query(sprintf("UPDATE `businesses` SET `brank` = `brank` + '%d' WHERE `busId` = '%u'", $new_rank, $bs['busId'])); $fetch_members = $db->query(sprintf("SELECT * FROM `businesses_members` LEFT JOIN `users` ON (`userid` = `bmembMember`) LEFT JOIN `businesses_ranks` ON (`rankId` = `bmembRank`) WHERE `bmembBusiness` = '%u'", $bs['busId'])) OR die('Cron not run'); $db->query("UPDATE userstats SET labour = labour + 50, IQ = IQ + 50, strength = strength + 50 WHERE userid = {$bs['busDirector']}"); $db->query("UPDATE users SET comppoints = comppoints + 1 WHERE userid = {$bs['busDirector']}"); while($fm=$db->fetch_row($fetch_members)) { $db->query(sprintf("UPDATE `userstats` SET `{$fm['rankPrim']}` = `{$fm['rankPrim']}` + '%.6f', `{$fm['rankSec']}` = `{$fm['rankSec']}` + '%.6f' WHERE (`userid` = '%u')", $fm['rankPGain'], $fm['rankSGain'], $fm['userid'])) OR die('Cron not run'); $db->query(sprintf("UPDATE `users` SET `money` = `money` + '%d' WHERE `userid` = '%u'", $fm['bmembCash'], $fm['userid'])) OR die('Cron not run'); $db->query(sprintf("UPDATE `users` SET `comppoints` = `comppoints` + '1' WHERE `userid` = '%u'", $fm['userid'])) OR die('Cron not run'); if($bs['busCash'] < $fm['bmembCash']) { $text = "Member ID {$fm['bmembMember']} was not paid their \$".number_format($fm['bmembCash'])." due to lack of funds." OR die('Cron not run'); $db->query(sprintf("INSERT INTO `businesses_alerts` (`alertId`, `alertBusiness`, `alertText`, `alertTime`) VALUES ('NULL', '%u', '%s', '%d')", $bs['busId'], $text, time())) OR die('Cron not run'); $db->query(sprintf("UPDATE `businesses` SET `busDebt` = `busDebt` + '%d' WHERE `busId` = '%u'", $fm['bmembCash'], $bs['busId'])) OR die('Cron not run'); } else { $db->query(sprintf("UPDATE `businesses` SET `busCash` = `busCash` - '%d' WHERE `busId` = '%u'", $fm['bmembCash'], $bs['busId'])) OR die('Cron not run'); } } if($bs['busDebt'] > $bs['classCost']) { $send_event = $db->query(sprintf("SELECT `bmembMember` FROM WHERE `bmembBusiness` = '%u' ORDER BY `bmembId` DESC", $bs['busId'])) OR die('Cron not run') ; while($se=$db->fetch_row($send_event)) { $text = "The {$bs['busName']} business went bankrupt\, all members have been made redundent." OR die('Cron not run'); insert_event($se['bmembMember'], $text); } $db->query(sprintf("DELETE FROM `businesses_members` WHERE (`bmembBusiness` = '%u')", $bs['busId'])) OR die('Cron not run'); $db->query(sprintf("DELETE FROM `businesses` WHERE (`busId` = '%u')", $bs['busId'])) OR die('Cron not run'); } } ?> business_view.php <?php include_once (DIRNAME(__FILE__). '/globals.php'); echo '<p class="heading">Companies [url="business_create.php"][b]Create a Company Here[/b][/url]</p>'; switch ($_GET['page']) { case 'class': view_class(); break; case 'profile': view_profile(); break; case 'sendapp': send_application(); break; case 'rob': rob_business(); break; default: business_index(); break; } function business_index() { global $ir,$db; echo '<p align="center"> [b]Company Classes:[/b] <table width="600">'; $fetch_classes = $db->query("SELECT * FROM `businesses_classes` ORDER BY `classId` ASC"); while($r = $db->fetch_row($fetch_classes)) { echo ' <tr> <td width="275" align="right">'.stripslashes($r['className']).' •</td> <td width="50"></td> <td width="275" align="left">> [url="business_view.php?page=class&id='.$r['classId'].'"]View '.stripslashes($r['className']).' companies[/url]</td> </tr>'; } echo '</table> </p>'; } function view_class() { global $ir,$db; $_GET ['id'] = abs(@intval($_GET['id'])); if($_GET['id']) { $fetch_class = $db->query(sprintf("SELECT * FROM `businesses_classes` WHERE (`classId` = '%u')", $_GET['id'])); if(!$db->num_rows($fetch_class)) { echo 'You cannot view a company class that doesn\'t exist.'; } else { $r = $db->fetch_row($fetch_class); echo '<hr width="600"> <p align="center"> [b]'.stripslashes($r['className']).':[/b] [i]'.stripslashes($r['classDesc']).'[/i] <hr width="600"> <p align="center"> [b]Companies:[/b] The '.stripslashes($r['className']).' company is small and starts with a maximum of [b]'.number_format($r['classMembers']).'[/b] members until it has been upgraded. The total start up cost of a '.stripslashes($r['className']).' company is £'.number_format($r['classCost']).'.</p> <hr width="600"> <table width="600" class="table"> <tr> <th colspan="4">'.stripslashes($r['className']).' ranks</th> </tr>'; $fetch_ranks = $db->query(sprintf("SELECT * FROM `businesses_ranks` WHERE `rankClass` = '%u'", $_GET['id'])); while($rn = $db->fetch_row($fetch_ranks)) { echo ' <tr> <td width="25%">[b]Rank:[/b] '.stripslashes($rn['rankName']).'</td> <td width="20%">[b]Primary stat:[/b] '.stripslashes($rn['rankPrim']).'</td> <td width="20%">[b]Secondary stat:[/b] '.stripslashes($rn['rankSec']).'</td> <td width="45%">[b]Stat gain:[/b] '.$rn['rankPGain'].' '.stripslashes($rn['rankPrim']).' and '.$rn['rankSGain'].' '.stripslashes($rn['rankSec']).'</td> </tr>'; } echo '</table> <hr width="600"> <table width="600" class="table"> <tr> <th colspan="3">'.stripslashes($r['className']).' companies</th> </tr>'; $bus_rating = $db->query("SELECT `busCash` FROM `businesses`"); $ttl_profit = 0; while($fetch_cash = $db->fetch_row($bus_rating)) { $ttl_profit += ($fetch_cash['busCash'] + 1); } $fetch_businesses = $db->query(sprintf("SELECT * FROM `businesses` LEFT JOIN `users` ON (`userid` = `busDirector`) WHERE `busClass` = '%u'", $_GET['id'])); while($fb = $db->fetch_row($fetch_businesses)) { if($fb['brank'] < 1000) { $stars='[img=donator.gif]'; } if($fb['brank'] > 1000) { $stars='[img=donator.gif] [img=donator.gif]'; } if($fb['brank'] > 5000) { $stars='[img=donator.gif] [img=donator.gif] [img=donator.gif]'; } if($fb['brank'] >= 35000) { $stars='[img=donator.gif] [img=donator.gif] [img=donator.gif] [img=donator.gif]'; } if($fb['brank'] >= 100000) { $stars='[img=donator.gif] [img=donator.gif] [img=donator.gif] [img=donator.gif] [img=donator.gif]'; } $rate = (int) ((($fb['busCash'] + 1) / $ttl_profit * 100) / 20); echo ' <tr> <td width="85%">[url="business_view.php?page=profile&id='.$fb['busId'].'"][b]'.stripslashes($fb['busName']).'[/b][/url] - [url="viewuser.php?u='.$fb['userid'].'"][i]'.stripslashes($fb['username']).'[/i][/url] '.$stars.'</td> </tr>'; } echo '</table> <hr width="600">'; } } else { echo 'You did not select a company class to view.'; } } function view_profile() { global $ir,$db; $_GET['id'] = abs(@intval($_GET['id'])); if($_GET['id']) { $fetch_business = $db->query(sprintf("SELECT * FROM `businesses` LEFT JOIN `businesses_classes` ON (`classId` = `busClass`) LEFT JOIN `users` ON (`userid` = `busDirector`) WHERE (`busId` = '%u')", $_GET['id'])); if(!$db->num_rows($fetch_business)) { echo 'You cannot view a company that doesn\'t exist.'; } else { $r = $db->fetch_row($fetch_business); echo '<hr width="400"> <table width="400" class="table"> <tr> <th colspan="2">Details of '.stripslashes($r['busName']).' - '.stripslashes($r['className']).'</th> </tr> <tr height="100"> <td colspan="2" valign="middle" align="center">'; if($r['busImage']) { echo '[img='.stripslashes($r['busImage']).']'; } else { echo '[img=dimg.jpg]'; } if($r['brank'] < 1000) { $stars='[img=donator.gif]'; } if($r['brank'] > 1000) { $stars='[img=donator.gif] [img=donator.gif]'; } if($r['brank'] >= 5000) { $stars='[img=donator.gif] [img=donator.gif] [img=donator.gif]'; } if($r['brank'] > 35000) { $stars='[img=donator.gif] [img=donator.gif] [img=donator.gif] [img=donator.gif]'; } if($r['brank'] > 100000) { $stars='[img=donator.gif] [img=donator.gif] [img=donator.gif] [img=donator.gif] [img=donator.gif]'; } echo '</td></tr> <tr> <td colspan="2"><center>[b]<u>Company Rank[/b]</u> '.$stars.'</center></td> </tr> <tr> <th colspan="2">Further information</th> </tr> <tr height="150"> <td colspan="2" valign="middle" align="center"> <table width="200"> <tr> <td> [b]Class:[/b] '.stripslashes($r['className']).' [b]Director:[/b] [url="viewuser.php?u='.$r['userid'].'"]'.stripslashes($r['username']).'[/url] [b]Todays profit:[/b] £'.number_format($r['busProfit']).' [b]Yesterdays profit:[/b] £'.number_format($r['busYProfit']).' [b]Todays customers:[/b] '.number_format($r['busCust']).' [b]Yesterdays customers:[/b] '.number_format($r['busYCust']).' </td> </tr> </table> </td> </tr> <tr> <th colspan="2">'.stripslashes($r['busName']).' members</th> </tr> <tr> <td width="50%">[b]Name:[/b] [url="viewuser.php?u='.$r['userid'].'"]'.stripslashes($r['username']).'[/url]</td> <td width="50%">[b]Rank:[/b] Director (None)</td> </tr>'; $fetch_members = $db->query(sprintf("SELECT * FROM `businesses_members` LEFT JOIN `users` ON (`userid` = `bmembMember`) LEFT JOIN `businesses_ranks` ON (`rankId` = `bmembRank`) WHERE `bmembBusiness` = '%u'", $_GET['id'])); while($fm = $db->fetch_row($fetch_members)) { echo ' <tr> <td width="50%">[b]Name:[/b] [url="viewuser.php?u='.$fm['userid'].'"]'.stripslashes($fm['username']).'[/url]</td> <td width="50%">[b]Rank:[/b] '.stripslashes($fm['rankName']).' (£'.number_format($fm['bmembCash']).')</td> </tr>'; } echo '</table> <hr width="400"> [url="business_view.php?page=sendapp&id='.$_GET['id'].'"]Send application[/url] [url="business_view.php?page=rob&id='.$_GET['id'].'"]Attempt Robbery[/url] '; } } else { echo 'You did not select a company to view.'; } } function send_application() { global $ir,$db; $_GET['id'] = abs(@intval($_GET['id'])); if($ir['job']) { echo 'You Have A Job'; exit; } $check_bus = $db->query(sprintf("SELECT * FROM `businesses` WHERE (`busId` = '%u')", $_GET['id'])); $check_app = $db->query(sprintf("SELECT * FROM `businesses_apps` WHERE (`appMember` = '%u') AND (`appBusiness` = '%d')", $ir['userid'], $_GET['id'])); $check = $db->query(sprintf("SELECT * FROM `businesses` WHERE (`busDirector` = '%u')", $ir['userid'])); $check_member = $db->query(sprintf("SELECT * FROM `businesses_members` WHERE (`bmembMember` = '%u')", $ir['userid'])); if(!$db->num_rows($check_bus)) { echo 'You cannot send an application to a non-existant company.'; } else if($db->num_rows($check) || $db->num_rows($check_member)) { echo '<font color=red><blink>You are part of a company right now, leave before sending an application to a new one.</blink></font>'; } else if($db->num_rows($check_app)) { echo 'You have a sent application to this company right now, wait for a responce.'; } else if(!$_GET['id']) { echo 'You did not choose a company to send an application to.'; } else if($_POST['application']) { $app = str_replace(array("\n"), array(" "), strip_tags($_POST['application'])); $string_app = mysql_real_escape_string($app); $db->query(sprintf("INSERT INTO `businesses_apps` (`appId`, `appMember`, `appBusiness`, `appText`, `appTime`) VALUES ('NULL','%d', '%u', '%s', '%d')", $ir['userid'], $_GET['id'], $string_app, time())); echo 'Your application was sent to the selected company, a responce will be given from the director soon.'; } else { $r = $db->fetch_row($check_bus); echo '<form action="business_view.php?page=sendapp&id='.$_GET['id'].'" method="post"> <p align="center"> [b]Enter an application below to send a request to the director of '.stripslashes($r['busName']).'.[/b] You can send one application at a time, wait for the result of that application before sending another. If the company director is not active, it might take a while for the application to be managed, So it could be worth speaking with the director before submitting a new application to the company. Entering a detailed application will increase the chance of having it accepted, but this is no guarantee. Your working stats will also be sent to the director of the company with the application to help them decide. Your application: <textarea type="text" name="application" s="40" rows="10" cols="70" maxlength="255"></textarea> <input type="submit" value="Submit application" /></p> </form>'; } } function rob_business() { global $ir,$db,$h,$userid; $_GET['id'] = abs(@intval($_GET['id'])); if($_GET['id']) { $fetch_business = $db->query(sprintf("SELECT * FROM `businesses` LEFT JOIN `businesses_classes` ON (`classId` = `busClass`) LEFT JOIN `users` ON (`userid` = `busDirector`) WHERE (`busId` = '%u')", $_GET['id'])); if(!$db->num_rows($fetch_business)) { echo 'You cannot rob a company that doesn\'t exist.'; } else { $r = $db->fetch_row($fetch_business); if($ir['rob'] < 1) { echo 'You cannot attempt to rob a company more than once a day!'; $h->endpage(); exit; } if($ir['userid'] == $r['busDirector']) { echo 'Why would you attempt to rob your own company?'; $h->endpage(); exit; } else { if($ir['robskill'] <= $r['busCash']) { print "While attempting to break into the business, greedy with plans of large bucks. You fail to notice the police car driving by. Just as you crack the lock and begin to head inside you are knocked over the head. You wake up in jail with a raging headache and the discovery YOU WERE CAUGHT"; event_add($_GET['id'],"[url='viewuser.php?u=$userid']{$ir['username']}[/url] Attempted to Rob your Business but was caught."); $jailtime=mt_rand(10,40); $query = sprintf('UPDATE users SET jail = jail +%u, jail_reason = "Failed to Rob %s.", rob = 0 WHERE userid = %u', $jailtime, $r['busName'], $userid); $db->query($query); $db->query("UPDATE businesses SET bussecurity = bussecurity + 1 WHERE busId = {$_GET['id']}"); $db->query("UPDATE userstats SET robskill = robskill - 1 WHERE userid = $userid"); } else if($ir['robskill'] > $r['busCash']) { $rando = mt_rand(10,25); $cash = round($r['busCash']/$rando); print "After scoping out the latest company for a few days, you decide now is your chance to do some damage. You sneak up to the backdoor after dark and jiggle the lock. With a bit of luck on your side, the door is unlocked. You sneak in flashlight in hand and head for the vault. Noticing the lack of security in this place you are hopeful someone hasn't beat you to the punch. As you enter the dark office where the stash of cash is located it would appear luck is on your side twice! The owner left the key to the safe on his desk! You quickly grab the cash and bolt. You earned yourself a nice smooth $cash cash."; $db->query("UPDATE users SET meony = money + $cash, rob = 0 WHERE userid = $userid"); $db->query("UPDATE userstats SET robskill = robskill + 1 WHERE userid = $userid"); $db->query("UPDATE businesses SET busCash = busCash - $cash, bussecurity = bussecurity - 1 WHERE busId = {$_GET['id']}"); } } } } } $h->endpage(); ?> -
Richards Business Mod--Fixed With a few Things added.
Joshua replied to Joshua's topic in Free Modifications
business_create.php <?php include_once (DIRNAME(__FILE__). '/globals.php'); global $db,$ir; $check = $db->query(sprintf("SELECT * FROM `businesses` WHERE (`busDirector` = '%u')", $ir['userid'])); $check_member = $db->query(sprintf("SELECT * FROM `businesses_members` WHERE (`bmembMember` = '%u')", $ir['userid'])); if($ir['level'] < 5) { die ('You must be at least Level 5 to begin a Company.'); } if($db->num_rows($check) || $db->num_rows($check_member)) { die ('You are part of a job/company at this time, leave to start a new one.'); } echo '<p class="heading">Create Company</p>'; $_POST['name'] = mysql_real_escape_string($_POST['name']); $_POST['class'] = abs(@intval($_POST['class'])); if($_POST['name'] AND $_POST['class']) { $fetch_class = $db->query(sprintf("SELECT * FROM `businesses_classes` WHERE (`classId` = '%u')", $_POST['class'])); $check = $db->query(sprintf("SELECT * FROM `businesses` WHERE (`busDirector` = '%u')", abs(@intval($ir['userid'])))); $check_member = $db->query(sprintf("SELECT * FROM `businesses_members` WHERE (`bmembMember` = '%u')", abs(@intval($ir['userid'])))); if(!$db->num_rows($fetch_class)) { echo 'You cannot start a business in a class that doesn\'t exist.'; } else { $r = $db->fetch_row($fetch_class); if($ir['level'] < 5) { echo 'You must be at least Level 5 to begin a Company.'; } else if($ir['money'] < $r['classCost']) { echo 'You cannot afford to start a business of this class right now.'; } else if($db->num_rows($check) || $db->num_rows($check_member)) { echo 'You are part of a business at this time, leave to start a new one.'; } else { $db->query(sprintf("INSERT INTO `businesses` (`busId`, `busName`, `busClass`, `busDirector`, `busEmployees`) VALUES ('NULL','%s', '%d', '%u', '%u')", stripslashes($_POST['name']), $_POST['class'], abs(@intval($ir['userid'])), $r['classMembers'])); $db->query(sprintf("UPDATE `users` SET `money` = `money` - '%d' WHERE `userid` = '%u'", $r['classCost'], abs(@intval($ir['userid'])))); $check = $db->query(sprintf("SELECT * FROM `businesses` WHERE (`busDirector` = '%u')", abs(@intval($ir['userid'])))); $direct = $db->fetch_row($check); $db->query(sprintf("UPDATE `users` SET `business` = '%u' WHERE `userid` = '%u'", $direct['busId'], abs(@intval($ir['userid'])))); echo 'The '.$_POST['name'].' business was created.'; } } } else { echo '<form action="business_create.php" method="post"> <p align="center"> [b]Create a new business:[/b] Please enter a name for the new business below, then select a class. Business name: <input type="text" name="name" /> Business class: <select name="class"> <option value="0">None</option>'; $select_classes = $db->query("SELECT * FROM `businesses_classes` ORDER BY `classCost` ASC"); while($c = $db->fetch_row($select_classes)) { echo '<option value="'.$c['classId'].'">'.stripslashes($c['className']).' (\$'.number_format($c['classCost']).')</option>'; } echo '</select> <input type="submit" value="Create business" /></p> </form>'; } $h->endpage(); ?> business_home.php <?php include_once (DIRNAME(__FILE__). '/globals.php'); include_once (DIRNAME(__FILE__). '/bbcode_parser.php'); global $ir,$db; echo '<p class="heading">Your Job<hr width="50%"></p>'; $check = $db->query(sprintf("SELECT * FROM `businesses_members` WHERE (`bmembMember` = '%u')", $ir['userid'])); $check_two = $db->query(sprintf("SELECT * FROM `businesses` WHERE (`busDirector` = '%u')", $ir['userid'])); if(!$db->num_rows($check_two) AND !$db->num_rows($check)) { echo 'You are not a member of a Company right now, come back another time.'; $h->endpage(); exit; } else { $r = $db->fetch_row($check); $b = $db->fetch_row($check_two); $fetch_business = $db->query(sprintf("SELECT * FROM `businesses` LEFT JOIN `businesses_classes` ON (`classId` = `busClass`) WHERE (`busId` = '%u') OR (`busId` = '%u')", $r['bmembBusiness'], $b['busId'])); if(!$db->num_rows($fetch_business)) { echo 'This Company does not exist at this time, please come back later.'; $h->endpage(); exit; } else { $inf = $db->fetch_row($fetch_business); } } switch ($_GET['p']) { case 'leave_business': leave_business(); break; case 'view_members': view_members(); break; case 'donate_cash': donate_cash(); break; case 'view_vault': view_vault(); break; default: business_index(); break; } function business_index() { global $ir, $inf, $db; echo '[b]'.stripslashes($inf['busName']).' options:[/b] '; if($inf['busDirector'] == $ir['userid']) { echo '[url="business_manage.php"]Manage Company[/url] '; } else { echo '[url="business_home.php?p=view_vault"]Donate to the Company[/url] '; echo '[url="business_home.php?p=leave_business"]Leave the Company[/url] '; } echo '[url="business_home.php?p=view_members"]View members[/url] '; $fetch_business = $db->query(sprintf("SELECT * FROM `businesses` LEFT JOIN `businesses_classes` ON (`classId` = `busClass`) LEFT JOIN `users` ON (`userid` = `busDirector`) WHERE (`busId` = '%u')", abs((int) $inf['busId']))); if(!$db->num_rows($fetch_business)) { echo 'You cannot view a Company that doesn\'t exist .'; } else { $r = $db->fetch_row($fetch_business); $fetch_memberinfo = $db->query(sprintf("SELECT * FROM `businesses_members` WHERE `bmembMember` = '%u'", $ir['userid'])); $mem = $db->fetch_row($fetch_memberinfo); $realrank = $db->query(sprintf("SELECT * FROM `businesses_ranks` WHERE (`rankId` = '%u')", $mem['bmembRank'])); $rname = $db->fetch_row($realrank); if($mem['bmembRank'] == 0) { $rank='dont have an assigned rank'; } else { $rank='work as a '.($rname['rankName']).''; } if($mem['bmembCash'] >= 0){ $mcash='£'.number_format($mem['bmembCash']).''; } if(!$rname['rankPGain'] AND !$rname['rankPrim'] AND !$rname['rankSGain'] AND !$rname['rankSec']) { $gaininfo='You also receive 50 labour, 50 intelligence and 50 strength every day.'; } else { $gaininfo='You also receive '.($rname['rankPGain']).' '.($rname['rankPrim']).' and '.($rname['rankSGain']).' '.($rname['rankSec']).' every day.'; } if($mem['bmembRank'] == 0) { $gaininfo='You also receive 0 labour, 0 intelligence and 0 strength every day.'; } if($ir['userid'] == $r['busDirector']) { $rank='are the owner'; } if($ir['userid'] == $r['busDirector']) { $gaininfo='You also receive 50 labour, 50 intelligence and 50 strength every day.'; } echo '<hr width="50%"> You currently '.stripslashes($rank).' at '.stripslashes($r['busName']).' which is owned by [url="viewuser.php?u='.$r['userid'].'"]'.stripslashes($r['username']).'[/url]. You are paid '.($mcash).' at midnight TIL time every day! '.($gaininfo).' <hr width="50%"> <table width="50%" class="table"> <tr> <th colspan="2">Details of '.stripslashes($r['busName']).' - '.stripslashes($r['className']).'</th> </tr> <tr> <td colspan="2"><center>'.($r['busDesc']).'</center></td> </tr> <tr height="100"> <td colspan="2" valign="middle" align="center">'; if($r['busImage']) { echo '[img='.stripslashes($r['busImage']).']'; } else { echo '[img=dimg.jpg]'; } if($r['brank'] < 1000) { $stars='[img=job_star.gif]'; } if($r['brank'] > 1000) { $stars='[img=job_star.gif] [img=job_star.gif]'; } if($r['brank'] > 5000) { $stars='[img=job_star.gif] [img=job_star.gif] [img=job_star.gif]'; } if($r['brank'] > 35000) { $stars='[img=job_star.gif] [img=job_star.gif] [img=job_star.gif] [img=job_star.gif]'; } if($r['brank'] > 100000) { $stars='[img=job_star.gif] [img=job_star.gif] [img=job_star.gif] [img=job_star.gif] [img=job_star.gif]'; } $fetch_members = $db->num_rows($db->query(sprintf("SELECT * FROM `businesses_members` WHERE `bmembBusiness` = '%u'", $r['busId']))); $fetch_memberinfo = $db->query(sprintf("SELECT * FROM `businesses_members` WHERE `bmembMember` = '%u'", $ir['userid'])); $mem = $db->fetch_row($fetch_memberinfo); $cd = $db->query(sprintf("SELECT * FROM `userstats` WHERE `userid` = '%u'", $ir['userid'])); $fstats = $db->fetch_row($cd); $realrank = $db->query(sprintf("SELECT * FROM `businesses_ranks` WHERE (`rankId` = '%u')", $mem['bmembRank'])); $rname = $db->fetch_row($realrank); if($mem['bmembRank'] <= 0) { $rank='None'; } else { $rank=''.($rname['rankName']).''; } if($mem['bmembCash'] == 0) { $mcash='$<font color=red>-'.number_format($mem['bmembCash']).'</font>'; } else if($mem['bmembCash'] > 0) { $mcash='<font color=green>+'.number_format($mem['bmembCash']).'</font>'; } echo '</td></tr> <tr> <td colspan="2"><center>[b]<u>Company Rank[/b]</u> '.$stars.'</center></td> </tr> <tr> <th colspan="2">Further information</th> </tr> <tr height="150"> <td colspan="2" valign="middle" align="center"> <table width="100%"> <tr> <td> [b]Type:[/b] '.stripslashes($r['className']).' [b]Director:[/b] [url="viewuser.php?u='.$r['userid'].'"]'.stripslashes($r['username']).'[/url] [b]Company bank:[/b] $'.number_format($r['busCash']).' [b]Employees:[/b] '.number_format($fetch_members).'/'.($r['busEmployees']).' [b]Days old:[/b] '.number_format($r['busDays']).' </td> <td> [b]Your details[/b] [b]Rank: [/b]'.stripslashes($rank).'[/b] [b]Income: [/b]'.($mcash).' [b]labour: [/b]'.number_format($fstats['labour']).' [b]Intelligence: [/b]'.number_format($fstats['IQ']).' [b]Strength:[/b] '.number_format($fstats['strength']).' [b]Company points:[/b] '.number_format($ir['comppoints']).' [[url="companyspecials.php"]Use[/url]] </td> </tr> <tr> <td> [b]Todays profit:[/b] £'.number_format($r['busProfit']).' [b]Yesterdays profit:[/b] £'.number_format($r['busYProfit']).' [b]Todays customers:[/b] '.number_format($r['busCust']).' [b]Yesterdays customers:[/b] '.number_format($r['busYCust']).' <center></td> </tr> </table>'; } echo ' <table width="100%" class="table"> <tr> <th>Action</th> <th>Time</th> </tr>'; $business_alerts = $db->query(sprintf("SELECT * FROM `businesses_alerts` WHERE `alertBusiness` = '%u' ORDER BY `alertTime` DESC LIMIT 25", $inf['busId'])); while($ba = $db->fetch_row($business_alerts)) { echo ' <tr> <td width="50%">'.stripslashes($ba['alertText']).'</td> <td width="20%">'.date('d-m-Y, g:i:s A', $ba['alertTime']).'</td> </tr>'; } echo '</table></table>'; } function view_vault() { global $ir, $inf, $db; echo '<form action="business_home.php?p=donate_cash" method="post"> Your Company has '.number_format($inf['busCash']).' secured in it\'s vault. [b]Donate cash:[/b] Cash amount: <input type="text" name="cash" /> <input type="submit" value="Donate cash"></form>'; } function donate_cash() { global $ir, $inf, $db; $_POST['cash'] = abs(@intval($_POST['cash'])); if($_POST['cash'] > 0) { if($_POST['cash'] > $ir['money']) { echo 'You do not have enough cash to donate this much to the Company.'; } else { $db->query(sprintf("UPDATE `users` SET `money` = `money` - '%d' WHERE `userid` = '%u'", $_POST['cash'], $ir['userid'])); $db->query(sprintf("UPDATE `businesses` SET `busCash` = `busCash` + '%d' WHERE `busId` = '%u'", $_POST['cash'], $inf['busId'])); echo 'You have donated \$'.number_format($_POST['cash']).' to the Company.'; business_alert($inf['busId'], "".$ir['username']." donated $".number_format($_POST['cash'])." to the Company."); } } else { echo 'You missed one or more of the required fields.'; } } function leave_business() { global $ir, $inf, $db; if($inf['busDirector'] != $ir['userid']) { if(!$_GET['confirm']) { echo 'You are about to leave the '.$inf['busName'].' Company. Please confirm this action. [url="business_home.php?p=leave_business&confirm=1"]Leave the Company[/url]'; } else { $db->query(sprintf("DELETE FROM `businesses_members` WHERE (`bmembMember` = '%u')", $ir['userid'])); $db->query(sprintf("UPDATE `users` SET `business` = '0' WHERE (`userid` = '%u')", $ir['userid'])); echo 'You have decided to leave the Company.'; } } else { echo 'You cannot leave the Company while still the director.'; } } function view_members() { global $ir, $inf, $db; echo '<table width="60%" class="table"> <tr> <th width="50%">Member name</th> <th width="50%">Job rank</th> </tr>'; $fetch_members = $db->query(sprintf("SELECT * FROM `businesses_members` LEFT JOIN `users` ON (`userid` = `bmembMember`) LEFT JOIN `businesses_ranks` ON (`rankId` = `bmembRank`) WHERE `bmembBusiness` = '%u'", $inf['busId'])); while($fm = $db->fetch_row($fetch_members)) { echo ' <tr> <td>[url="viewuser.php?u='.$fm['userid'].'"]'.stripslashes($fm['username']).'[/url] ['.$fm['userid'].']</td> <td>'.stripslashes($fm['rankName']).' (£'.number_format($fm['bmembCash']).')</td> </tr>'; } echo '</table>'; } $h->endpage(); ?> -
***EDIT**** This Post is updated Frequently to save you from having to scroll through all the other posts :) As promised, I've went through and fixed everything I could find as well as add some missing functions (Such as Donate to Business and Withdraw from Vault) Also fixed the small error where people could use the +9999- bank hack and credit themselves a large amount of cash. Again, I did not make this mod I just fixed it and added a few things. BludClart helped with a few additions of his own, Hope you guys enjoy it. Any problems let me know and I'll try and find what's wrong, again, this is fully functional on my game and I havent found a bug yet. Start off with the SQLS CREATE TABLE IF NOT EXISTS `businesses` ( `busId` int(11) NOT NULL auto_increment, `busName` varchar(255) NOT NULL, `busClass` int(11) NOT NULL, `busDirector` int(11) NOT NULL, `busProfit` bigint(25) NOT NULL, `busYProfit` bigint(25) NOT NULL, `busCust` int(11) NOT NULL, `busYCust` int(11) NOT NULL, `busCash` int(11) NOT NULL, `busDebt` int(11) NOT NULL, `busImage` varchar(255) NOT NULL, `busDays` bigint(32) NOT NULL default '0', `busEmployees` int(11) NOT NULL default '0', `brank` int(11) NOT NULL default '0', `busDesc` varchar(50) NOT NULL, `bussecurity` int(11) NOT NULL default '0', PRIMARY KEY (`busId`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; CREATE TABLE IF NOT EXISTS `businesses_alerts` ( `alertId` int(11) NOT NULL auto_increment, `alertBusiness` int(11) NOT NULL default '0', `alertTime` int(11) NOT NULL default '0', `alertText` text NOT NULL, PRIMARY KEY (`alertId`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=19 ; CREATE TABLE IF NOT EXISTS `businesses_apps` ( `appId` int(11) NOT NULL auto_increment, `appMember` int(11) NOT NULL, `appBusiness` int(11) NOT NULL, `appText` text NOT NULL, `appTime` int(11) NOT NULL, PRIMARY KEY (`appId`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ; CREATE TABLE IF NOT EXISTS `businesses_classes` ( `classId` int(11) NOT NULL auto_increment, `className` varchar(255) NOT NULL, `classDesc` text NOT NULL, `classMembers` int(11) NOT NULL, `classCost` int(11) NOT NULL, PRIMARY KEY (`classId`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; -- -- Dumping data for table `businesses_classes` -- INSERT INTO `businesses_classes` (`classId`, `className`, `classDesc`, `classMembers`, `classCost`) VALUES (1, 'Fireworks stand', 'Our customers will explode in delight with our fireworks. Great for holidays or any special event.', 4, 500000), (2, 'Hair salon', 'A hair salon is a place where one goes to get their hair cut, as well as styled, highlighted or coloured.', 4, 750000), (3, 'Law firm', 'A law firm is a business entity formed by one or more lawyers to engage in the practice of law. The money made is determined by the work hours the company sells. The amount of employees will increase this, aswell as the hired lawyers stats.', 6, 4000000), (4, 'Flower shop', 'A store where flowers are purchased.', 4, 100000), (5, 'Car dealership', 'Our customers need transportation. Sell them our best and send them on their way.', 8, 6000000), (6, 'Football Club', 'Lead the way with your team and become the champions.', 10, 12000000); CREATE TABLE IF NOT EXISTS `businesses_members` ( `bmembId` int(11) NOT NULL auto_increment, `bmembMember` int(11) NOT NULL, `bmembBusiness` int(11) NOT NULL default '0', `bmembCash` int(11) NOT NULL, `bmembRank` int(11) NOT NULL default '0', `bmembDays` bigint(32) NOT NULL default '0', PRIMARY KEY (`bmembId`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; CREATE TABLE IF NOT EXISTS `businesses_ranks` ( `rankId` int(11) NOT NULL auto_increment, `rankName` varchar(255) NOT NULL, `rankClass` int(11) NOT NULL, `rankCash` int(11) NOT NULL, `rankPrim` enum('labour','IQ','strength') NOT NULL, `rankSec` enum('labour','IQ','strength') NOT NULL, `rankPGain` decimal(11,2) NOT NULL, `rankSGain` decimal(11,2) NOT NULL, PRIMARY KEY (`rankId`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=18 ; -- -- Dumping data for table `businesses_ranks` -- INSERT INTO `businesses_ranks` (`rankId`, `rankName`, `rankClass`, `rankCash`, `rankPrim`, `rankSec`, `rankPGain`, `rankSGain`) VALUES (1, 'Sales person', 1, 1000, 'IQ', 'labour', '30.50', '15.25'), (2, 'Product manager', 1, 2500, 'labour', 'strength', '20.00', '10.00'), (3, 'Cashier', 1, 5000, 'IQ', 'strength', '25.00', '12.00'), (4, 'Stylist', 2, 800, 'IQ', 'labour', '25.00', '12.50'), (5, 'Cleaner', 2, 1400, 'labour', 'strength', '20.00', '10.00'), (6, 'Shampooist', 2, 2100, 'strength', 'labour', '25.00', '12.50'), (7, 'Lawyer', 3, 1200, 'IQ', 'labour', '40.00', '20.00'), (8, 'Cleaner', 3, 800, 'labour', 'strength', '20.00', '10.00'), (9, 'Receptionist', 3, 600, 'IQ', 'labour', '30.00', '15.00'), (10, 'Florist', 4, 500, 'labour', 'strength', '25.00', '12.50'), (11, 'Cleaner', 4, 750, 'labour', 'IQ', '20.00', '10.00'), (12, 'Salesman', 5, 3400, 'labour', 'strength', '30.00', '15.00'), (13, 'Cleaner', 5, 1400, 'labour', 'strength', '20.00', '10.00'), (14, 'Receptionist', 5, 900, 'IQ', 'labour', '34.00', '17.00'), (15, 'Referee', 6, 3150, 'labour', 'strength', '15.00', '10.00'), (16, 'Player', 6, 3500, 'labour', 'IQ', '28.00', '7.00'), (17, 'Goal Keeper', 6, 3100, 'labour', 'strength', '25.00', '7.00'); CREATE TABLE IF NOT EXISTS `compspecials` ( `csID` int(11) NOT NULL auto_increment, `csNAME` varchar(255) NOT NULL default '', `csJOB` int(11) NOT NULL default '0', `csCOST` int(11) NOT NULL default '0', `csMONEY` int(11) NOT NULL default '0', `csCRYSTALS` int(11) NOT NULL default '0', `csITEM` int(11) NOT NULL default '0', `csENDU` int(11) NOT NULL default '0', `csIQ` int(11) NOT NULL default '0', `csLABOUR` int(11) NOT NULL default '0', `csSTR` int(11) NOT NULL default '0', PRIMARY KEY (`csID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; ALTER TABLE `users` ADD `comppoints` INT(11) NOT NULL DEFAULT '0'; ALTER TABLE `users` ADD `business` INT(11) NOT NULL DEFAULT '0'; ALTER TABLE `users` ADD `active` INT(11) NOT NULL DEFAULT '0'; ALTER TABLE `users` ADD `activedays` INT(11) NOT NULL DEFAULT '0'; Add this QUERY to Loggedin.php I'd say right under globals $db->query("UPDATE users SET active=1 WHERE userid=$userid"); OPEN global_func.php find ?> above add function business_alert($business, $text) { mysql_query(sprintf("INSERT INTO `businesses_alerts` (`alertId`, `alertBusiness`, `alertText`, `alertTime`) VALUES ('NULL', '%u', '%s', '%d')", $business, $text, time())); } A lot more coming..........
-
He's done a lot of work himself, but he employees help as well, yes I mean that game. He's a good guy :)
-
I have. I've added a lot to this mod but not on my game, waiting on owner to log on and i'll go get a copy of it
-
Martin was telling me about this earlier, sounds promising :)
-
E for effort but you missed a few $_POSTS that need to be secured from the bank hack. Just deposited 2.4 mill into bank vault and had 0 cash on me :P Not sure about the banner peice either as it could be exploited. I have been working on modifying this version as well as adding an option to remove money from the business vault >< I'll post when it's finished.
-
Update on this mod. Someone I know elsewhere is wanting to do a large free mod to get his name out there so he can start selling mods. He offered to do this one for me as I'm a bit tied up. So when he does it i'll post it up here with his permission :P
-
He was telling Gucci that ; closes the array since he was asking about it :p
-
Off and On, been working on several things >,<
-
Na it's alright man. Wasn't a big issue, i actually made the mod on accident and just stuck it up there to see if maybe "off chance" i'd make a dollar or two off it. No biggy, Good mod man :)
-
job snin off mod wanted, will pay for a good one.
Joshua replied to Mcfarlin's topic in Requests & In Production
^ works to I stick to what i know, if it isnt broke............... =P -
ISO money
-
job snin off mod wanted, will pay for a good one.
Joshua replied to Mcfarlin's topic in Requests & In Production
$star=$db->query("SELECT * FROM jobs WHERE userid=$userid"); $job=$db->fetch_row($star); if($job['jobrank'] = certain rank) { $image= "<image here>" } elseif( etc etc then print out $image w/e you want image to appear. -
It was a paid mod lol though i'm betting now it won't sell lol ;-)
-
lol it's basically my hunger thingy reversed :D
-
ooh ooh oh..no i got that :P
-
on my game i have these errors can anyone help?
Joshua replied to kaine-'s topic in General Discussion
Think he's on v1 curt -
yea it's as simple as a simple if statement on the pages you don't want them to access when they are hungry :)
-
Actually the way this works Is when you eat, your hunger bar fills up a.k.a your full level :P
-
Ok so I'm going to offer 3 packages like this simply because i have to make some money. 1. The Ultimate Characther Class Mod. This enables you multiple differant characther classes upon registration. Each charachter class will start off with certain stats in a set town of your choice. Staff_Cities option where you can create cities for races and decide which races are allowed in those cities on creation. Staff_Items option, where you can create items of various types and upon creation decide which Race will be able to use them. Injection/Disease--Where after winning an attack or a random event, users become infected with a disease where their stats will decrease if that is your wish, or other options, using the crons. Vaccines can be made to cure this and reverse the process.-----Normally 30.00USD(but added 2 new features) 2. Hunger Mod. Another Energy Bar for your game Users will lose their hunger slowly as the game progresses. After hunger gets to low, they wil have to find food/buy food in order to get their hunger back up. Certain activities will be denied if they havent eaten. Normally 5.00 USD 3. Advanced Jobs Select What type Of job they are to do, How many hours they must work this job before they are paid, what their reward is upon completion. If a user quits the job before it is over, they aren't paid anything. Sudo realistic to me, i enjoy this mod. Normally 10.00 USD, this week only 5.00 USD. 4. Advanced Farming Mod. Via Admin Panel you will be able to create Acres of Land available in cities of your choice. Users will then be able to purchase these acres of land to farm on. They will be able to buy seeds to plant on these acres, and at the end of the week, they will be able to cash in their crops. There is a chance crops will die and users won't make as much as they'd hoped. However, They can also purchase Fertilizers to help the farms in their development. Chance for diseased Harvest etc. A land Market where users can barter / sell their land instead of cropping. Normally 30.00 USD 5. Cig Shop, Cig Market. Cig on/Off. Depending on which Gambling Mods you have "I suggest Seanybobs BlackJack", Users will gamble in Jail to win Cigarrettes. Cigarrettes will be used in a Jail Only shop to purchase rare items you make (this goes good with quest mod and workshop mod as well) There is an Option in jail to turn on / off the ability for users to bust you out, i have it default set as can't be busted. Simple click yes/no will change status. A cigarrette Market, Where users can trade/swap cigarrettes. Can add more features for Cigs depending on what you want them to be used for. Normally -10.00 USD Ok, so 5 of my better mods Total Value of them all is between 75-85.00 USD depending on my mood >,< I'm willing to sell as a package deal, all 5 of these for 60.00 USD paypable to Paypal. I'm ONLY selling 3 of these sets. All these mods come with Full Support. If you are interested you can make payments to [email protected] via Paypal. Thanks for the read, and remember, if you have any mods you are looking to have done, pm me :)
-
How do you disable Errors from appearing on screen?
Joshua replied to Joshua's topic in Game Support
I used MTG's function for class_db_mysql.php It doesnt show errors to anyone other than ID 1. <3 -
Its a mod, where you do work hourly. Each time you finish it, you gain stats and money, this come with a staff file, so you can build, edit and delete them at your hearts content. It also come with a DHTML toolkit, which was from an open-source site. So when your mouse goes over a sertan part, a box comes up and says what is needed. This would also be a good little thing to have around your site. This runs on crons, you need one new table in the db, 2 new rows in the users table. And two new files, work.php and staff_work.php. This mod comes with full support. payment to [email protected] 5.00 USD.