Jump to content
MakeWebGames

Create a Business mod (my first mod)


-BRAIDZ-

Recommended Posts

[MENTION=68406]-BRAIDZ-[/MENTION], at least you assume you're crap at coding, despite everyone already knows that (don't take it badly, it is not the intention), and sniko also knows we all started basically the same way... sucking at it.

Despite sniko's post is correct, there are other ways (and he knows that) to say things, and looking back, you are not much different from him.

And I don't think anyone "complained" that way about him, at least that I can recall, making an effort to learn is far better than most of the users that are/were floating around here, and the best way to actually learn.

My suggestion, take your time learning, basic questions/doubts/whatever sure, but... only if you get stuck.

Try to learn by yourself, resources are basically unlimited.

Yeah well that's true, I will eventually get there, why give up, when I could actually get somewhere with it, it's just I'm having no luck at all this this mod aha!

But everyone else has put it on their game and it seems to work for them...

Link to comment
Share on other sites

  • Replies 73
  • Created
  • Last Reply

Top Posters In This Topic

My advice, don't even bother with MC Codes, it's a terrible way of coding..

Just try and make some one page scripts and get functionality out of that. Start to include other files after and build up that way.

Always use up-to-date technologies like PDO, classes, interfaces and traits as well.

Link to comment
Share on other sites

My advice, don't even bother with MC Codes, it's a terrible way of coding..

Just try and make some one page scripts and get functionality out of that. Start to include other files after and build up that way.

Always use up-to-date technologies like PDO, classes, interfaces and traits as well.

Thanks, I got my mod working with the help of [MENTION=53425]Magictallguy[/MENTION] thanks mate

Link to comment
Share on other sites

Braidz, are you 100% sure you did this? Something about this makes me feel like you found the Mod, and now are trying to pass it as yours in hope that one will help you fix it up as you are 'releasing' it to the public for 'free'. Watching you from your previous threads would give me little confidence that you would know where to start on coding on a mod.

Link to comment
Share on other sites

Braidz, are you 100% sure you did this? Something about this makes me feel like you found the Mod, and now are trying to pass it as yours in hope that one will help you fix it up as you are 'releasing' it to the public for 'free'. Watching you from your previous threads would give me little confidence that you would know where to start on coding on a mod.

Yes it is mine.

You can think what you want to think.

But have you seen any other mods like this in the past? No.

So how could I steal a Mod that hasn't been produced yet.

I coded it, it took me around a month to do, yes I've asked for help with previous mods that yes I have found on here.

But this is purely my work, I watched some tutorials, took notice of other codes, and slowly started learning.

Is there any problem with that?

No, I didn't think so, everyone has to start somewhere right?

Link to comment
Share on other sites

ditch ravens and move to mccodes v2.05b

I know I need to do that, but as I have stated in previous post, I do not have the money to pay $100 for a script.

I currently have my own personal expenses to pay.

I honestly wish I could afford it so I didn't have to fook around with Ravan's

Link to comment
Share on other sites

What I posted that. this mod. Came with ravanscript. And your claiming it as your own. but it's clear you didn't make it. Knowing you cant even solve a simple snippet sniko posted.

then I read all the thread and it's already been posted that this isn't your mod.

Link to comment
Share on other sites

What I posted that. this mod. Came with ravanscript. And your claiming it as your own. but it's clear you didn't make it. Knowing you cant even solve a simple snippet sniko posted.

then I read all the thread and it's already been posted that this isn't your mod.

I didn't know it was from RavanScript, but I figured he didn't make it. It just doesn't make sense from the simple questions he was asking that he would know how to come together. Tutorial or not, the questions asked just last week were the most basic practices when one starts off in programming. Saying that, then you coming up here and trying to show us a complete mod but say you can get it to work but others can just doesn't make any sense at all. Nice try.

Link to comment
Share on other sites

What I posted that. this mod. Came with ravanscript. And your claiming it as your own. but it's clear you didn't make it. Knowing you cant even solve a simple snippet sniko posted.

then I read all the thread and it's already been posted that this isn't your mod.

**** off, how is it not my mod? This the first mod of this kind that there is.

And since when has Ravan's come out with a Mod like this? Never, so get your **** together and your facts straight, I will not sit here and be called a thief nor a liar, when I know full well it's my mod, if it wasn't my mod, and it's was already in Ravan's do you think I'd post it on here,asking for help getting it working.

No because it would already be ****ing working...

Grr people like you, piss me the **** off!!!

- - - Updated - - -

 

I didn't know it was from RavanScript, but I figured he didn't make it. It just doesn't make sense from the simple questions he was asking that he would know how to come together. Tutorial or not, the questions asked just last week were the most basic practices when one starts off in programming. Saying that, then you coming up here and trying to show us a complete mod but say you can get it to work but others can just doesn't make any sense at all. Nice try.

If that's what you think dickhead.

I know it's my mod, tell me where there is another mod exactly like this huh? There ****ing isn't.

Explain how I'd post someone else's mod that no one has made before? Because I guarantee you that you will not find another mod like this.

I think what you's are talking about is this

staff_jobs.php:

<?php

/**************************************************************************************************
| Software Name        : Ravan Scripts Online Mafia Game
| Software Author      : Ravan Soft Tech
| Software Version     : Version 2.0.1 Build 2101
| Website              : http://www.ravan.info/
| E-mail               : [email protected]
|**************************************************************************************************
| The source files are subject to the Ravan Scripts End-User License Agreement included in License Agreement.html
| The files in the package must not be distributed in whole or significant part.
| All code is copyrighted unless otherwise advised.
| Do Not Remove Powered By Ravan Scripts without permission .         
|**************************************************************************************************
| Copyright (c) 2010 Ravan Scripts . All rights reserved.
|**************************************************************************************************/

include "sglobals.php";
if($ir['user_level'] > 2)
{
die("403");
}
//This contains shop stuffs
switch($_GET['action'])
{
case 'newjob': newjob(); break;
case 'jobedit': jobedit(); break;
case 'newjobrank': newjobrank(); break;
case 'jobrankedit': jobrankedit(); break;
case 'jobdele': jobdele(); break;
case 'jobrankdele': jobrankdele(); break;
default: print "Error: This script requires an action."; break;
}
function newjob()
{
global $db,$ir,$userid;
if ( $_POST['jNAME']) {
$db->query("INSERT INTO jobs VALUES('','{$_POST['jNAME']}', 0, '{$_POST['jDESC']}', '{$_POST['jOWNER']}')");
$i=$db->insert_id();
$db->query("INSERT INTO jobranks VALUES('', '{$_POST['jrNAME']}', $i, {$_POST['jrPAY']}, {$_POST['jrIQG']}, {$_POST['jrLABOURG']}, {$_POST['jrSTRG']}, {$_POST['jrIQN']}, {$_POST['jrLABOURN']}, {$_POST['jrSTRN']})");
$j=$db->insert_id();
$db->query("UPDATE jobs SET jFIRST=$j WHERE jID=$i");
print "Job created!<br>
";
}
else {
print <<<EOF

<div class='generalinfo_txt'>
<div><img src='images/info_left.jpg' alt='' /></div>
<div class='info_mid'><h2 style='padding-top:10px;'> Add New Job</h2></div>
<div><img src='images/info_right.jpg' alt='' /></div> </div>
<div class='generalinfo_simple'><br> <br><br>
<form action='staff_jobs.php?action=newjob' method='post'>
<b>Job Name:</b> <input type='text' STYLE='color: black;  background-color: white;' name='jNAME' /><br>
<b>Job Description:</b> <input type='text' STYLE='color: black;  background-color: white;' name='jDESC' /><br>
<b>Job Owner:</b> <input type='text' STYLE='color: black;  background-color: white;' name='jOWNER' /><br>
<hr><b>First Job Rank:</b><br>
<b>Rank Name:</b> <input type='text' STYLE='color: black;  background-color: white;' name='jrNAME' /><br>
<b>Pays:</b> <input type='text' STYLE='color: black;  background-color: white;' name='jrPAY' /><br>
<b>Gains:</b> Str: <input type='text' STYLE='color: black;  background-color: white;' name='jrSTRG' size=3 maxlength=3> Lab: <input type='text' STYLE='color: black;  background-color: white;' name='jrLABOURG' size=3 maxlength=3> IQ: <input type='text' STYLE='color: black;  background-color: white;' name='jrIQG' size=3 maxlength=3><br>
<b>Reqs:</b> Str: <input type='text' STYLE='color: black;  background-color: white;' name='jrSTRN' size=5 maxlength=5> Lab: <input type='text' STYLE='color: black;  background-color: white;' name='jrLABOURN' size=5 maxlength=5> IQ: <input type='text' STYLE='color: black;  background-color: white;' name='jrIQN' size=5 maxlength=5><br>
<input type='submit' STYLE='color: black;  background-color: white;' value='Create Job' /></form></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>
EOF;
}
}
function jobedit()
{
global $db,$ir,$userid;
if ( $_POST['stage2']) {
$db->query("UPDATE jobs SET jNAME='{$_POST['jNAME']}', jDESC='{$_POST['jDESC']}', jOWNER='{$_POST['jOWNER']}', jFIRST={$_POST['jFIRST']} WHERE jID={$_POST['jID']}");
print "Job updated!<br>
";
}
else if ( $_POST['stage1']) {
$q=$db->query("SELECT * FROM jobs WHERE jID={$_POST['jID']}");
$r=$db->fetch_row($q);
print <<<EOF

<div class='generalinfo_txt'>
<div><img src='images/info_left.jpg' alt='' /></div>
<div class='info_mid'><h2 style='padding-top:10px;'> Users Online</h2></div>
<div><img src='images/info_right.jpg' alt='' /></div> </div>
<div class='generalinfo_simple'><br> <br><br>
<form action='staff_jobs.php?action=jobedit' method='post'>
<input type='hidden' name='stage2' value='1'>
<input type='hidden' name='jID' value='{$_POST['jID']}'>
<b>Job Name:</b> <input type='text' STYLE='color: black;  background-color: white;' name='jNAME' value='{$r['jNAME']}'><br>
<b>Job Description:</b> <input type='text' STYLE='color: black;  background-color: white;' name='jDESC' value='{$r['jDESC']}'><br>
<b>Job Owner:</b> <input type='text' STYLE='color: black;  background-color: white;' name='jOWNER' value='{$r['jOWNER']}'><br>
<b>First Job Rank:</b> 
EOF;
print jobrank_dropdown($c,'jFIRST',$r['jFIRST']);
print <<<EOF
<br>
<input type='submit' STYLE='color: black;  background-color: white;' value='Edit' />
</form></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>
EOF;
}
else
{
print <<<EOF

<div class='generalinfo_txt'>
<div><img src='images/info_left.jpg' alt='' /></div>
<div class='info_mid'><h2 style='padding-top:10px;'> Select a job to edit</h2></div>
<div><img src='images/info_right.jpg' alt='' /></div> </div>
<div class='generalinfo_simple'><br> <br><br>
<form action='staff_jobs.php?action=jobedit' method='post'>
<input type='hidden' name='stage1' value='1'>
Select a job to edit.<br>
EOF;
print job_dropdown($c, 'jID', -1);
print <<<EOF
<br>
<input type='submit' STYLE='color: black;  background-color: white;' value='Edit Job' />
</form></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>
EOF;
}
}
function newjobrank()
{
global $db,$ir,$userid;
if ( $_POST['jrNAME']) {
$db->query("INSERT INTO jobranks VALUES('', '{$_POST['jrNAME']}', {$_POST['jrJOB']}, {$_POST['jrPAY']}, {$_POST['jrIQG']}, {$_POST['jrLABOURG']}, {$_POST['jrSTRG']}, {$_POST['jrIQN']}, {$_POST['jrLABOURN']}, {$_POST['jrSTRN']})");
print "Job rank created!<br>
";
}
else {
print <<<EOF

<div class='generalinfo_txt'>
<div><img src='images/info_left.jpg' alt='' /></div>
<div class='info_mid'><h2 style='padding-top:10px;'> New Job Rank</h2></div>
<div><img src='images/info_right.jpg' alt='' /></div> </div>
<div class='generalinfo_simple'><br> <br><br>
<form action='staff_jobs.php?action=newjobrank' method='post'>
<b>Rank Name:</b> <input type='text' STYLE='color: black;  background-color: white;' name='jrNAME' /><br>
<b>Pays:</b> <input type='text' STYLE='color: black;  background-color: white;' name='jrPAY' /><br>
<b>Job:</b> 
EOF;
print job_dropdown($c,"jrJOB", -1);
print <<<EOF
<br>
<b>Gains:</b> Str: <input type='text' STYLE='color: black;  background-color: white;' name='jrSTRG' size=3 maxlength=3> Lab: <input type='text' STYLE='color: black;  background-color: white;' name='jrLABOURG' size=3 maxlength=3> IQ: <input type='text' STYLE='color: black;  background-color: white;' name='jrIQG' size=3 maxlength=3><br>
<b>Reqs:</b> Str: <input type='text' STYLE='color: black;  background-color: white;' name='jrSTRN' size=5 maxlength=5> Lab: <input type='text' STYLE='color: black;  background-color: white;' name='jrLABOURN' size=5 maxlength=5> IQ: <input type='text' STYLE='color: black;  background-color: white;' name='jrIQN' size=5 maxlength=5><br>
<input type='submit' STYLE='color: black;  background-color: white;' value='Create Job Rank' /></form> </div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>
EOF;
}
}
function jobrankedit()
{
global $db,$ir,$userid;
if ( $_POST['stage2']) {
$db->query("UPDATE jobranks SET jrNAME='{$_POST['jrNAME']}', jrJOB = {$_POST['jrJOB']}, jrPAY= {$_POST['jrPAY']}, jrIQG={$_POST['jrIQG']}, jrLABOURG={$_POST['jrLABOURG']}, jrSTRG={$_POST['jrSTRG']}, jrIQN={$_POST['jrIQN']}, jrLABOURN={$_POST['jrLABOURN']}, jrSTRN={$_POST['jrSTRN']}WHERE jrID={$_POST['jrID']}");
print "Job rank updated!<br>
";
}
else if ( $_POST['stage1']) {
$q=$db->query("SELECT * FROM jobranks WHERE jrID={$_POST['jrID']}");
$r=$db->fetch_row($q);
print <<<EOF

<div class='generalinfo_txt'>
<div><img src='images/info_left.jpg' alt='' /></div>
<div class='info_mid'><h2 style='padding-top:10px;'> Edit Job Rank</h2></div>
<div><img src='images/info_right.jpg' alt='' /></div> </div>
<div class='generalinfo_simple'><br> <br><br>
<form action='staff_jobs.php?action=jobrankedit' method='post'>
<input type='hidden' name='stage2' value='1'>
<input type='hidden' name='jrID' value='{$_POST['jrID']}'>
<b>Job Rank Name:</b> <input type='text' STYLE='color: black;  background-color: white;' name='jrNAME' value='{$r['jrNAME']}'><br>
<b>Job:</b> 
EOF;
print job_dropdown($c,'jrJOB',$r['jrJOB']);
print <<<EOF
<br>
<b>Pays:</b> <input type='text' STYLE='color: black;  background-color: white;' name='jrPAY' value='{$r['jrPAY']}' /><br>
<b>Gains:</b> Str: <input type='text' STYLE='color: black;  background-color: white;' name='jrSTRG' size=3 maxlength=3 value='{$r['jrSTRG']}'> Lab: <input type='text' STYLE='color: black;  background-color: white;' name='jrLABOURG' size=3 maxlength=3 value='{$r['jrLABOURG']}'> IQ: <input type='text' STYLE='color: black;  background-color: white;' name='jrIQG' size=3 maxlength=3 value='{$r['jrIQG']}'><br>
<b>Reqs:</b> Str: <input type='text' STYLE='color: black;  background-color: white;' name='jrSTRN' size=5 maxlength=5 value='{$r['jrSTRN']}'> Lab: <input type='text' STYLE='color: black;  background-color: white;' name='jrLABOURN' size=5 maxlength=5 value='{$r['jrLABOURN']}'> IQ: <input type='text' STYLE='color: black;  background-color: white;' name='jrIQN' size=5 maxlength=5 value='{$r['jrIQN']}'><br>
<b>Job:</b>
<input type='submit' STYLE='color: black;  background-color: white;' value='Edit' />
</form></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>
EOF;
}
else
{
print <<<EOF
<form action='staff_jobs.php?action=jobrankedit' method='post'>
<input type='hidden' name='stage1' value='1'>

<div class='generalinfo_txt'>
<div><img src='images/info_left.jpg' alt='' /></div>
<div class='info_mid'><h2 style='padding-top:10px;'> Select a Job Rank to edit</h2></div>
<div><img src='images/info_right.jpg' alt='' /></div> </div>
<div class='generalinfo_simple'><br> <br><br>


EOF;
print jobrank_dropdown($c, 'jrID', -1);
print <<<EOF
<br>
<input type='submit' STYLE='color: black;  background-color: white;' value='Edit Job Rank' />
</form> </div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>
EOF;
}
}
function jobrankdele()
{
global $db,$ir,$userid;
if ( $_POST['stage1']) {
$q=$db->query("SELECT * FROM jobranks WHERE jrID={$_POST['jrID']}");
$jr=$db->fetch_row($q);
$_POST['jID']=$jr['jrJOB'];
$db->query("DELETE FROM jobranks WHERE jrID={$_POST['jrID']}");
print "Job rank successfully deleted!<br>";
$db->query("UPDATE users u LEFT JOIN jobs j ON u.job=j.jID SET u.jobrank=j.jFIRST WHERE u.job={$_POST['jID']} and u.jobrank={$_POST['jrID']}");
$q=$db->query("SELECT * FROM jobs WHERE jFIRST={$_POST['jrID']}");
if($db->num_rows($q))
{
$r=$db->fetch_row($q);
print "<b>Warning!</b> The Job {$r['jNAME']} now has no first rank! Please go edit it and include a first rank.<br>";

}
}
else
{
print <<<EOF
<form action='staff_jobs.php?action=jobrankdele' method='post'>
<input type='hidden' name='stage1' value='1'>

<div class='generalinfo_txt'>
<div><img src='images/info_left.jpg' alt='' /></div>
<div class='info_mid'><h2 style='padding-top:10px;'> Select a job rank to delete</h2></div>
<div><img src='images/info_right.jpg' alt='' /></div> </div>
<div class='generalinfo_simple'><br> <br><br>

EOF;
print jobrank_dropdown($c, 'jrID', -1);
print <<<EOF
<br>
<input type='submit' STYLE='color: black;  background-color: white;' value='Delete Job Rank' />
</form></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>
EOF;
}
}
function jobdele()
{
global $db,$ir,$userid;
if ( $_POST['stage1']) {
$db->query("DELETE FROM jobs WHERE jID={$_POST['jID']}");
print "Job rank successfully deleted!<br>";
$db->query("DELETE FROM jobranks WHERE jrJOB={$_POST['jID']}");
print mysql_affected_rows()." job ranks deleted.<br>";
$db->query("UPDATE users SET job=0,jobrank=0 WHERE job={$_POST['jID']}");
}
else
{
print <<<EOF
<form action='staff_jobs.php?action=jobdele' method='post'>
<input type='hidden' name='stage1' value='1'>
<div class='generalinfo_txt'>
<div><img src='images/info_left.jpg' alt='' /></div>
<div class='info_mid'><h2 style='padding-top:10px;'> Select a job to delete</h2></div>
<div><img src='images/info_right.jpg' alt='' /></div> </div>
<div class='generalinfo_simple'><br> <br><br>
EOF;
print job_dropdown($c, 'jID', -1);
print <<<EOF
<br>
<input type='submit' STYLE='color: black;  background-color: white;' value='Delete Job' />
</form></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>
EOF;
}
}
function report_clear()
{
global $db,$db,$ir,$c,$h,$userid;
if($ir['user_level'] > 3)
{
die("403");
}
$_GET['ID'] = abs((int) $_GET['ID']);
stafflog_add("Cleared player report ID {$_GET['ID']}");
$db->query("DELETE FROM preports WHERE prID={$_GET['ID']}");
print "Report cleared and deleted!<br />
<a href='staff_users.php?action=reportsview'>> Back</a>";
}
$h->endpage();
?>

There is a big difference in jobs and companies aka businesses.

So I think I might be owed an apology?

Edited by -BRAIDZ-
Link to comment
Share on other sites

<?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 '

<div class="generalinfo_txt">
<div><img src="images/info_left.jpg" alt="" /></div>
<div class="info_mid"><h2 style="padding-top:10px;"> Create a new business:</h2></div>
<div><img src="images/info_right.jpg" alt="" /></div> </div>
<div class="generalinfo_simple"><br> <br><br>

<form action="business_create.php" method="post">

Please enter a name for the new business below, then select a class.<br /><br />
Business name: <input type="text" name="name" /><br />
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><br /><br />
<input type="submit" value="Create business" /></p>
</form></div><div><img src="images/generalinfo_btm.jpg" alt="" /></div><br></div></div></div></div></div> ';
}
$h->endpage();
?>

 

What is this: $c['classId']

Just shh. We know you didn't code anything

[MENTION=68968]Ever[/MENTION]yone who knows the answer. please don't post.

Edited by Zettieee
Link to comment
Share on other sites

<?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 '

<div class="generalinfo_txt">
<div><img src="images/info_left.jpg" alt="" /></div>
<div class="info_mid"><h2 style="padding-top:10px;"> Create a new business:</h2></div>
<div><img src="images/info_right.jpg" alt="" /></div> </div>
<div class="generalinfo_simple"><br> <br><br>

<form action="business_create.php" method="post">

Please enter a name for the new business below, then select a class.<br /><br />
Business name: <input type="text" name="name" /><br />
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><br /><br />
<input type="submit" value="Create business" /></p>
</form></div><div><img src="images/generalinfo_btm.jpg" alt="" /></div><br></div></div></div></div></div> ';
}
$h->endpage();
?>

 

What is this: $c['classId']

Just shh. We know you didn't code anything

[MENTION=68968]Ever[/MENTION]yone who knows the answer. please don't post.

That is so a normal user can start their own company.

It does not state that staff can create a new business class.

There is a difference, I was making a staff mod so staff members can create Business classes, insted of doing it through the database.

So you shut up, I did code it, read both codes properly....

Link to comment
Share on other sites

Ravens doesn't have a staff panel for businesses. So he might of actually made this.

Thank you.

Also that snippet posted

Is states

if($ir['level'] < 5)

Not

if($ir['user_level'] < 2) 

Therefore, it is not a staff file.

And also it says

SELECT FROM

Not

INSERT INTO
Link to comment
Share on other sites

<?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 '

<div class="generalinfo_txt">
<div><img src="images/info_left.jpg" alt="" /></div>
<div class="info_mid"><h2 style="padding-top:10px;"> Create a new business:</h2></div>
<div><img src="images/info_right.jpg" alt="" /></div> </div>
<div class="generalinfo_simple"><br> <br><br>

<form action="business_create.php" method="post">

Please enter a name for the new business below, then select a class.<br /><br />
Business name: <input type="text" name="name" /><br />
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><br /><br />
<input type="submit" value="Create business" /></p>
</form></div><div><img src="images/generalinfo_btm.jpg" alt="" /></div><br></div></div></div></div></div> ';
}
$h->endpage();
?>

 

What is this: $c['classId']

Just shh. We know you didn't code anything

[MENTION=68968]Ever[/MENTION]yone who knows the answer. please don't post.

 

Also that snippet posted

Is states

if($ir['level'] < 5)

Not

if($ir['user_level'] < 2) 

Therefore, it is not a staff file.

And also it says

SELECT FROM

Not

INSERT INTO

 

Also, yes it does say create a Business, I see where you are confused,but this is a staff only feature, so staff members can create a new business class.

If you look at both codes, mine is businesses_classes, the one you posted Is just businesses.

So yes I did create this mod, no is no other mod out there where staff (admins) can create a new business class.

So say you wanted "Oil Rig" as a business, you can add that ect...

And also, classId is, just say Oil Rig, classId is 1 then that's what that mean, it is selecting the classId to insert it into the database "businesses"

I will take screenshots to prove my point.

I am correct, you are wrong

Edited by -BRAIDZ-
Link to comment
Share on other sites

Also that snippet posted

Is states

if($ir['level'] < 5)

Not

if($ir['user_level'] < 2) 

Therefore, it is not a staff file.

And also it says

SELECT FROM

Not

INSERT INTO

 

Also, yes it does say create a Business, I see where you are confused,but this is a staff only feature, so staff members can create a new business class.

If you look at both codes, mine is businesses_classes, the one you posted Is just businesses.

So yes I did create this mod, no is no other mod out there where staff (admins) can create a new business class.

So say you wanted "Oil Rig" as a business, you can add that ect...

And also, classId is, just say Oil Rig, classId is 1 then that's what that mean, it is selecting the classId to insert it into the database "businesses"

I will take screenshots to prove my point.

I am correct, you are wrong

Hi you can't blame them from posting what they think (There have been tons of people here trying to sell others work yes i know your not selling it)

you have come here for help and posting insults like that. Instead of insulting people which honestly wont get you anyplace at all for example lets say you create another mod and need assistance i don't believe very many people will help you with the way your insulting people instead of this you should provide proof that you coded it so people cant throw accusations around.

Link to comment
Share on other sites

Hi you can't blame them from posting what they think (There have been tons of people here trying to sell others work yes i know your not selling it)

you have come here for help and posting insults like that. Instead of insulting people which honestly wont get you anyplace at all for example lets say you create another mod and need assistance i don't believe very many people will help you with the way your insulting people instead of this you should provide proof that you coded it so people cant throw accusations around.

Yes I see that, but I just hate people who sit there and say, oh you stole it. It's not yours.

Of Ravan's already coded it.

But I'm pretty sure you'd know yourself, there is no such staff mod like this.

I don't think people are reading my code.

Because I did stuff up the name of the post.

I did try rename it.

But I can't.

It should be something like "Create Business Class - Staff" or something along those lines.

I know myself that I coded it.

I ended up doing it into a single file, and it wouldn't work, then MTG updated it, and now it works, so I will not take full credit for this mod, as there are a fare few people whom tried to help me, which when I edit the thread, I will mention their names, because I can not take full credit, yes the original is my code, but others recoded it so it would work.

But as [MENTION=65371]sniko[/MENTION] stated, I didn't need to global it or anything.

I just learned from other codes.

And came up with this idea a few weeks ago, and have been writing it on a pad with a pen.

And then wrote it on here and it looked good

Link to comment
Share on other sites

Listen kid. YOU didn't create this mod. You cant even use a snippet.

Untill you prove otherwise. Your new name is Snippet Scripter.

You're more stupid than I thought, I did create this mod, where is there proof there's another mod exactly like this, that allows admins to create a new business class? There isn't, so get back in your box little boy

Link to comment
Share on other sites

I am still lost on this one though [MENTION=68406]-BRAIDZ-[/MENTION]. Is there more to this mod? Why does staff members need to create a new business class? Plus, if this is something for Raven script only, this forum doesn't support it. I know Raven will port to MCC and the other way around but MCC doesn't have the other file(s) that I think are missing. So in short, this mod is pretty useless

Link to comment
Share on other sites

I am still lost on this one though [MENTION=68406]-BRAIDZ-[/MENTION]. Is there more to this mod? Why does staff members need to create a new business class? Plus, if this is something for Raven script only, this forum doesn't support it. I know Raven will port to MCC and the other way around but MCC doesn't have the other file(s) that I think are missing. So in short, this mod is pretty useless

It saves doing it through the database, and also, this mod will support on both MCC & Ravan's, I'm quite sure, that there is no files missing.

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