Jump to content
MakeWebGames

create gang


castle

Recommended Posts

suddenly players can not create their own gangs. i did not change anything as far as i know

<?php

session_start();

require "global_func.php";

if($_SESSION['loggedin']==0) { header("Location: login.php");exit; }

$userid=$_SESSION['userid'];

require "header.php";

$h = new headers;

$h->startheaders();

include "mysql.php";

global $c;

$is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error());

$ir=mysql_fetch_array($is);

check_level();

$fm=money_formatter($ir['money']);

$cm=money_formatter($ir['points'],'');

$lv=date('F j, Y, g:i a',$ir['laston']);

$h->userdata($ir,$lv,$fm,$cm);

$h->menuarea();

if($ir['money'] < 500000)

{

die("You don't have enough money. You need \$500,000.");

}

if($ir['gang'])

{

die ("You're already in a gang!");

}

if($_POST['submit'])

{

$name=htmlspecialchars($_POST['name']);

$desc=htmlspecialchars($_POST['desc']);

mysql_query("INSERT INTO gangs VALUES('','$name','$desc','','',0,0,100,$userid,$userid,5,0,0,'')",$c);

$i=mysql_insert_id($c);

mysql_query("UPDATE users SET gang=$i,money=money-500000 where userid=$userid",$c);

print "Gang created!";

}

else

{

print "<h3> Create A Gang </h3><form action='creategang.php' method='post'><input type='hidden' name='submit' value='1' />Name:<input type='text' name='name' />

Description:

<textarea name='desc' cols='40' rows='7'></textarea>

<input type='submit' value='Create Gang for \$500,000' /></form>";

}

$h->endpage();

?>

Link to comment
Share on other sites

Re: create gang

have you added gang pictures or summet of the sort?

if you are

Find:

mysql_query("INSERT INTO gangs VALUES('','$name','$desc','','',0,0,100,$userid,$userid,5,0,0,'')",$c);

 

Replace:

mysql_query("INSERT INTO gangs VALUES('','$name','$desc','','',0,0,100,$userid,$userid,5,0,0,'','')",$c);
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...