
TheBigChief
Members-
Posts
76 -
Joined
-
Last visited
Never
Content Type
Profiles
Forums
Events
Everything posted by TheBigChief
-
Just added a little more to this mod: Create a folder named carpics on your file directory. [mysql] -- -- Table structure for table `cars` -- CREATE TABLE IF NOT EXISTS `cars` ( `id` int(11) NOT NULL AUTO_INCREMENT, `model` text NOT NULL, `make` text NOT NULL, `value` int(11) NOT NULL, `quantity` int(11) NOT NULL, `carpics` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ; [/mysql] Now using a modified Isomerizer uploadpics.php script create: uploadcarpics.php <?php /*----------------------------------------------------- -- Isomerizer -- Copyright held 2007-2008 ? Isomerizer.com -- uploadpic.php -----------------------------------------------------*/ require("sglobals.php"); if(empty($_FILES['imagefile'])) { echo ' Upload an image for your cars: <form name="imageuploader" method="post" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data"> [i]Path of Image:[/i] <input type="file" name="imagefile" /> <input type="submit" name="Submit" value="Upload Image" /> </form> (Max 10000 file bytes , Must be file extention gif, jpg, jpeg, png, bmp....) (Images are resized to 150 x 150) '; } else { //Edit below for max fb size of the pic $maxsize = 1000000; /*Basic security procedures*/ if(!$_SERVER['REQUEST_METHOD'] == "POST" || !isset($_SERVER['HTTP_USER_AGENT'])){ echo 'Hack Attempt!'; $h->endpage(); exit; } $headerinject = array("Content-Type:", "MIME-Version:", "Content-Transfer-Encoding:", "bcc:", "cc:"); foreach($_POST as $k => $v){ foreach($headerinject as $v2){ if(strpos($v, $v2) !== false){ logBadRequest(); header("HTTP/1.0 403 Forbidden"); exit; } } } /*What extensions can be used?*/ $valid = array('image/gif', 'image/png', 'image/pjpeg','image/jpeg', 'image/jpg'); /*If the extension isnt allowed...*/ if(!in_array($_FILES['imagefile']['type'], $valid)) { $type = strrchr($_FILES['imagefile']['name'], '.'); echo 'This file type '.$type.' is not allowed. [url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; $h->endpage(); exit; } /*Check image size*/ if ($_FILES['imagefile']['size'] > $maxsize) { echo 'Image to large [url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; $h->endpage(); exit; } $check = ''.$_FILES['imagefile']['tmp_name'].''; /*Check for .exe files*/ if (is_executable($check) || !is_file($check)) { echo 'The file '.$_FILES['imagefile']['name'].' seems to be harmful to the server [url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; @unlink($check); $h->endpage(); exit; } /*Now to create the correct image using php*/ if ($_FILES['imagefile']['type']=="image/jpeg") { $create = @ImageCreateFromJPEG(''.$_FILES['imagefile']['tmp_name'].''); $image = @Imagejpeg($create, 'carpics/'.$_FILES['imagefile']['name'].''); } if ($_FILES['imagefile']['type']=="image/png") { $create = @ImageCreateFromPNG(''.$_FILES['imagefile']['tmp_name'].''); $image = @Imagepng($create, 'carpics/'.$_FILES['imagefile']['name'].''); } if ($_FILES['imagefile']['type']=="image/jpg") { $create = @ImageCreateFromJPEG(''.$_FILES['imagefile']['tmp_name'].''); $image = @Imagejpeg($create, 'carpics/'.$_FILES['imagefile']['name'].''); } if ($_FILES['imagefile']['type']=="image/gif") { $create = @ImageCreateFromGIF(''.$_FILES['imagefile']['tmp_name'].''); $image = @Imagegif($create, 'carpics/'.$_FILES['imagefile']['name'].''); } if ($_FILES['imagefile']['type']=="image/pjpeg") { $create = @ImageCreateFromJPEG(''.$_FILES['imagefile']['tmp_name'].''); $image = @Imagejpeg($create, 'carpics/'.$_FILES['imagefile']['name'].''); } /*Destroy the php image*/ @unlink(''.$_FILES['imagefile']['tmp_name'].''); @ImageDestroy($create); /*If php could not create the image*/ if (!$create) { echo 'The image you are trying to upload seems to be corrupt please try again! [url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; $h->endpage(); exit; } $path = 'carpics/'; $pic = $_FILES['imagefile']['name']; $picture = $path.$pic; $oldpic = $ir['carpics']; /*Check to see if its already uploaded*/ if ($picture == $oldpic) { echo ' Image already uploaded![url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; $h->endpage(); exit; } /*Delete previous image to save space*/ $delete = @unlink($oldpic); if ($delete) { echo 'Previous image deleted from system... '; } if (!$delete) { echo 'No Previous image to be deleted... '; } $dataa = $_FILES['imagefile']['size']; $datab = $_FILES['imagefile']['type']; $datad = $_FILES['imagefile']['name']; /*Information for user*/ echo 'Old Image Location: '.$oldpic.' New Image Location: '.$picture.' Image Uploaded <u>Info:</u> Image Name: '.$datad.' Image Size: '.$dataa.' bytes Type: '.$datab.' [url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; /*Check DB*/ $check = mysql_query( sprintf("SELECT COUNT(*) FROM `cars` WHERE `carpics` = '%s'", mysql_real_escape_string($picture))); $checks = mysql_fetch_array($check); if ($checks['cnt'] > 0) { echo 'Please use another image name [url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; $h->endpage(); exit; } /*Update DB*/ mysql_query( sprintf("UPDATE `cars` SET `carpics` = '%s' WHERE `carpics` = %u", mysql_real_escape_string($picture), $userid)); } $h->endpage(); exit; ?> on staff_cars.php go to line 21, create a new line and add: $carpics = $_POST['carpics']; Find: $db->query("INSERT INTO cars VALUES('', '$model', '$make', '$value', '$quantity')"); Replace with: $db->query("INSERT INTO cars VALUES('', '$model', '$make', '$value', '$quantity' , '$carpics')"); Find: <input type='submit' value='Add Car' /></form> Below add: <hr /> If you have not yet uploaded an image you can do so by visiting the [url='uploadcarpics.php']<u>Image Uploader</u>[/url]"; In the editcar function (which if you followed me should be line 62) Find: $quantity=$_POST['quantity']; Below add: $carpics = $_POST['carpics']; Change line 72 which should be: $db->query("UPDATE cars SET value='$value', make='$make', model='$model', quantity='$quantity' WHERE model={$_POST['model']}"); To: $db->query("UPDATE cars SET value='$value', make='$make', model='$model', quantity='$quantity' , carpics='$carpics' WHERE model={$_POST['model']}"); And that should be it - you can now have images for your cars too.
-
Oh and remember to add this to your smenu.php <hr />[b]Cars[/b] > [url='staff_cars.php?action=addcar']Add Car[/url] > [url='staff_cars.php?action=editcar']Edit Car[/url] > [url='staff_cars.php?action=delcar']Delete Car[/url]
-
This is my first mod so please be fair with comments. I created this mod to allow me to set up a decent GTA, User Garage and Races (all of which will come soon) but you can do whatever you want with it. I know there is already a cars mod out there somewhere but to be honest it didn't suit my needs and was kinda dated I think. This mod is an amendment of the cities inbuild mod. [mysql] -- -- Table structure for table `cars` -- CREATE TABLE IF NOT EXISTS `cars` ( `id` int(11) NOT NULL AUTO_INCREMENT, `model` text NOT NULL, `make` text NOT NULL, `value` int(11) NOT NULL, `quantity` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; [/mysql] Open global_func.php and find: function shop_dropdown($connection,$ddname="shop",$selected=-1) On a new line above that add: function cars_dropdown($connection,$ddname="cars",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM cars ORDER BY make ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['id']}'"; if ($selected == $r['id'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.= ">{$r['make']}</option>"; } $ret.="\n</select>"; return $ret; } Create a new file named staff_cars.php <?php include "sglobals.php"; if($ir['user_level'] > 2) { die("403"); } //Cars Scripting switch($_GET['action']) { case "addcar": addcar(); break; case "editcar": editcar(); break; case "delcar": delcar(); break; default: echo "Error: This script requires an action."; break; } function addcar() { global $db, $ir, $c, $h, $userid; $value=abs((int) $_POST['value']); $model=$_POST['model']; $make=$_POST['make']; $quantity=$_POST['quantity']; if($value and $make and $model and $quantity) { $q=$db->query("SELECT * FROM cars WHERE model='{$model}'"); if($db->num_rows($q)) { echo "Sorry, you cannot have two cars with the same model."; $h->endpage(); exit; } $db->query("INSERT INTO cars VALUES('', '$model', '$make', '$value', '$quantity')"); echo "[b]You just added the $make $model to the game.[/b]"; stafflog_add("Created car $make $model"); } else { echo "<h3>Add Car</h3><hr /> <form action='staff_cars.php?action=addcar' method='post'> Make: <input type='text' name='make' /> Model: <input type='text' name='model' /> Value: <input type='text' name='value' /> Quantity: <input type='test' name='quantity' /> <input type='submit' value='Add Car' /></form>"; } } function editcar() { global $db, $ir, $c, $h, $userid; switch($_POST['step']) { case "2": $value=abs((int) $_POST['value']); $model=$_POST['model']; $make=$_POST['make']; $quantity=$_POST['quantity']; $q=$db->query("SELECT * FROM cars WHERE make='{$make}' AND model!={$_POST['model']}"); if($db->num_rows($q)) { echo "Sorry, you cannot have two cars with the same model."; $h->endpage(); exit; } $model=$_POST['model']; $q=$db->query("SELECT * FROM cars WHERE model={$_POST['model']}"); $old=$db->fetch_row($q); $db->query("UPDATE cars SET value='$value', make='$make', model='$model', quantity='$quantity' WHERE model={$_POST['model']}"); echo "You just changed the details for the $make $model"; stafflog_add("Edited car $make $model"); break; case "1": $q=$db->query("SELECT * FROM cars WHERE id={$_POST['car']}"); $old=$db->fetch_row($q); echo "<h3>Editing a car</h3><hr /> <form action='staff_cars.php?action=editcar' method='post'> <input type='hidden' name='step' value='2' /> <input type='hidden' name='id' value='{$_POST['car']}' /> Model: <input type='text' name='model' value='{$old['model']}' /> Make: <input type='text' name='make' value='{$old['make']}' /> Value: <input type='text' name='value' value='{$old['value']}' /> Quantity: <input type='text' name='quantity' value='{$old['quantity']}' /> <input type='submit' value='Edit Car' /></form>"; break; default: echo "<h3>Editing a Car</h3><hr /> <form action='staff_cars.php?action=editcar' method='post'> <input type='hidden' name='step' value='1' /> car: ".cars_dropdown($c, "car")." <input type='submit' value='Edit car' /></form>"; break; } } function delcar() { global $db,$ir,$c,$h,$userid; if($_POST['car']) { $q=$db->query("SELECT * FROM cars WHERE id={$_POST['car']}"); $old=$db->fetch_row($q); if($old['id']==1) { die("This car cannot be deleted."); } $db->query("DELETE FROM cars WHERE id={$old['id']}"); echo "You just deleted the {$old['make']} {$old['model']} from the game."; stafflog_add("Deleted car {$old['make']} {$old['model']}"); } else { echo "<h3>Delete car</h3><hr /> <font color='red'><blink>[b]DELETING A CAR IS PERMANENT![/b]</font></blink> Any users that have this car will have it removed from their garage, auctions, races and any other place it is used. <form action='staff_cars.php?action=delcar' method='post'> Car to be deleted: ".cars_dropdown($c, "car")." <input type='submit' value='Delete Car' /></form>"; } } $h->endpage(); ?> And there you have it, the starting point for a multitude of new mods. Please also use this post to make the mod better if you so wish :thumbsup:
-
Hi there, Wondering if anyone can help me with my registration script? I am trying to customise it to suit the login page which works great but getting it to display properly is proving mighty difficult. I am sure that the people who have changed their register.php script before to suit new designs will see this and find my problem in seconds but maybe it just needs a fresh set of eyes lol. I don't want my page shown publicly just now until I sort the problem out so would be very grateful if someone can help me via MSN ([email protected]) Thanks much guys!
-
Works perfect up till the last changes. Get error on line 34 so I kept it the the last working version and its ok
-
Now running over a year on Alpha and attracting more players daily. Like every game that is out there live we still need to know what else we can do and whats missing to make the game more popular. I would like you to share your thoughts on it and tell me on Make Web Games what you think. Have a look guys and gals and share your thoughts. http://www.gangster-game.com/?a=27
-
I think crimson offers the ability to choose files from the left hand side which is a great addition. Notepad ++ (to my knowledge) doesn't offer this.
-
I personally use Notepad ++
-
Lets hope so, it's not as in depth as mccode v2 or does it have as many free mods but it offers loads that I needed like killing (I asked so many people for that on mccode and not 1 person could do it.)
-
Hey mate, thanks for the reply, I got it last night (as you can see in my free mod script) but it helps to know you and Jamie are also around when I get stuck.
-
This is my first ever script so please be kind with comments. I would also like to point out that this is an edit of the user statistics script by Jaimee Make ipdetails.php and add the code below: <?php require("top.php"); ?> <form method="post"> <?php if (in_array($name, $admin_array) or in_array($name, $manager_array)){ ?> <fieldset style="color: #ffffff; border: 1px solid #ffffff; width: 600px; text-align: left; padding: 5px;"> <table width="550" border="0" align="center" cellpadding="0" cellspacing="2" class="table"> <tr> <td colspan="3" align="left" class="head">IP Details: </td> </tr> <tr> <td width="150" align="left" class="sub">Name:</td> <td width="150" align="left" class="sub">Signup_IP:</td> <td width="250" align="left" class="sub">Login_IP:</td> </tr> <? $result = mysql_query("SELECT name,signup_ip,login_ip FROM login WHERE sitestate='0'") or die(mysql_error()); // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table ?> <tr> <td width="150" align="left" class="cell"><?php echo "<a href=\"view_profile.php?name=". $row['name'] ."\" onFocus=\"if(this.blur)this.blur()\">".$row['name']."</a>"; ?></td> <td width="150" align="left" class="cell"><?php echo $row['signup_ip']; ?></td> <td width="250" align="left" class="cell"><?php echo $row['login_ip']; ?></td> </tr> <?php } // while ?> </table> </fieldset> </p> </form> <?php } include('information_bar.php'); ?> <?php require("bottom.php"); ?> add the below code to information_bar.php <a href=\"ipdetails.php\" onFocus=\"if(this.blur)this.blur()\">Player IP Details</a> ||
-
Change to the code that belongs to "Its not allowed to use this function on staff members." to : if (1==2) { echo "Its not allowed to use this function on staff members."; }else{ I have also fixed the IP page but wil need some help making it admin viewable only then I can release as a free mod (any takers on the helping me?)
-
First part sorted, thanks to the main man seanybob
-
I need help with two things. The first being car thefts. For some reason, no matter who commits a car theft you get the error "Its not allowed to use this function on staff members." I have looked intensively over the script and I'm sure it's pretty obvious but just can't get it. Second thing is creating a page that shows IP addresses for the users since the acp does not yet have that feature.
-
I get this Unknown column 'staff' in 'where clause'
-
Thanks to a very helpful guy named Alexander I got this sorted, now I have another problem, I need the same for my login / index page.
-
Wondering if anyone would be able to help me? I have a built page simply based on html for registration and would like to ensure that it works when people go to register but I'm really not sure which parts of register.php are important. I can supply the html page if anyone can help me sort out the registration part. My login works fine but just cant get the registration page to work no matter how hard I try. if you want to contact me via msn the id is [email protected]
-
Re: [V2] Userlist Help Needed Here is what I have in full <?php include "globals.php"; $_GET['st'] = abs((int) $_GET['st']); $st=($_GET['st']) ? $_GET['st'] : 0; $by=($_GET['by']) ? $_GET['by'] : 'userid'; $ord=($_GET['ord']) ? $_GET['ord'] : 'ASC'; print "<h3>Userlist</h3>"; $cnt=mysql_query("SELECT userid FROM users",$c); $membs=mysql_num_rows($cnt); $pages=(int) ($membs/100)+1; if($membs % 100 == 0) { $pages--; } print "Pages: "; for($i=1;$i <= $pages;$i++) { $stl=($i-1)*100; print "[url='userlist.php?st=$stl&by=$by&ord=$ord']$i[/url] "; } print " Order By: [url='userlist.php?st=$st&by=userid&ord=$ord']User ID[/url] | [url='userlist.php?st=$st&by=username&ord=$ord']Username[/url] | [url='userlist.php?st=$st&by=level&ord=$ord']Level[/url] | [url='userlist.php?st=$st&by=money&ord=$ord']Money[/url] [url='userlist.php?st=$st&by=$by&ord=asc']Ascending[/url] | [url='userlist.php?st=$st&by=$by&ord=desc']Descending[/url] "; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON u.gang=g.gangID ORDER BY $by $ord LIMIT $st,100"); $no1=$st+1; $no2=$st+100; print "Showing users $no1 to $no2 by order of $by $ord. <table width=75% cellspacing=1 class='table'><tr style='background:gray'><th>ID</th><th>Name</th><th>Money</th><th>Level</th><th>Gender</th><th>Online</th></tr>"; while($r=$db->fetch_row($q)) { $d=""; if($r['donatordays']) { $r['username'] = "<font color=red>{$r['username']}</font>";$d="[img=donator.gif]"; } print "<tr><td>{$r['userid']}</td><td>[url='viewuser.php?u={$r[']{$r['gangPREF']} {$r['username']} $d[/url]</td><td>\${$r['money']}</td><td>{$r['level']}</td><td>{$r['gender']}</td><td>"; if($r['laston'] >= time()-15*60) { print "<font color=green>[b]Online[/b]</font>"; } else { print "<font color=red>[b]Offline[/b]</font>"; } print "</td></tr>"; } print "</table>"; $h->endpage(); ?>
-
Hi Peeps, can anyone help me change it so that userlist.php shows this instead of levels. if ($user['level'] < 15) { $rank = " Wannabe [img=images/ranks/1.gif]"; } else if ($user['level'] < 30) { $rank = " Petty Thief [img=images/ranks/2.gif]"; } else if ($user['level'] < 60) { $rank = " Shoplifter [img=images/ranks/3.gif]"; } else if ($user['level'] < 90) { $rank = " Car Jacker [img=images/ranks/4.gif]"; } else if ($user['level'] < 110) { $rank = " Criminal [img=images/ranks/5.gif]"; } else if ($user['level'] < 140) { $rank = " Thief [img=images/ranks/6.gif]"; } else if ($user['level'] < 170) { $rank = " Con Artist [img=images/ranks/7.gif]"; } else if ($user['level'] < 200) { $rank = " Drug Runner [img=images/ranks/8.gif]"; } else if ($user['level'] < 230) { $rank = " Drug Dealer [img=images/ranks/9.gif]"; } else if ($user['level'] < 260) { $rank = " Fraudster [img=images/ranks/10.gif]"; } else if ($user['level'] < 290) { $rank = " Armed Robber [img=images/ranks/11.gif]"; } else if ($user['level'] < 310) { $rank = " Bank Robber [img=images/ranks/12.gif]"; } else if ($user['level'] < 340) { $rank = " Money Launderer"; } else if ($user['level'] < 370) { $rank = " Big Shot"; } else if ($user['level'] < 400) { $rank = " Assassin"; } else if ($user['level'] < 430) { $rank = " Hitman"; } else if ($user['level'] < 460) { $rank = " Gang Leader"; } else if ($user['level'] < 490) { $rank = " Criminal Mastermind"; } else if ($user['level'] < 510) { $rank = " Overlord"; } else if ($user['level'] > 600) { $rank = " Beyond the Law"; } else { $rank = " Fool"; I just dont know where to put it - it works great on the profile page.
-
Re: Registration Page Found it but the mail out dont work lol
-
Re: [mccodes]Secure demo account Not even to mention the fact that as an Admin on MCCODES you can change a user password back whenever you want.....
-
Can someone help me finish this off please? I need it to show only item type 1 which is named "Cars". Now before I get flamed let me point out that this is just a simple re-do of the inventory.php <?php include "globals.php"; if($ir['jail'] or $ir['hospital']) { die("This page cannot be accessed while in jail or hospital."); } print "<h3>{$set['game_name']} User Garage</h3> "; $inv=$db->query("SELECT iv.*,i.*,it.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.inv_userid={$userid} ORDER BY i.itmtype ASC, i.itmname ASC"); if($lt!=$i['itmtypeid'] < 2) if ($db->num_rows($inv) == 0) { print "[b]You have no cars![/b]"; } else { print "[b]Your cars are listed below.[/b] <table width=95% class=\"table\" border=\"0\" cellspacing=\"1\"> <tr> <td class=\"h\">Item</td> <td class=\"h\">Sell Value</td> <td class=\"h\">Total Sell Value</td> <td class=\"h\">Links</td> </tr>"; $lt=""; while($i=$db->fetch_row($inv)) { if($lt!=$i['itmtypename']) { $lt=$i['itmtypename']; print "\n<tr><td colspan=4>[b]{$lt}[/b]</td></tr>"; } print "<tr><td>{$i['itmname']}"; if ($i['inv_qty'] > 1) { print " x{$i['inv_qty']}"; } print "</td><td>\${$i['itmsellprice']}</td><td>"; print "$".($i['itmsellprice']*$i['inv_qty']); print "</td><td>[[url='iteminfo.php?ID={$i[']Info[/url]] [[url='itemsend.php?ID={$i[']Send[/url]] [[url='itemsell.php?ID={$i[']Sell[/url]] [[url='imadd.php?ID={$i[']Add To Market[/url]]"; print "</td></tr>"; } print "</table>"; } ?>
-
Re: [mccode v2] Email Activation It don't seem to be sending out the mail, any ideas?
-
Now I can't remember who made it and I have hunted everywhere for it again but there was a Registration page that emailed a user with a verification link after they signed up, can anyone point me in the right direction?