
TheMafia!
Members-
Posts
70 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by TheMafia!
-
hi all in hall of fame all of the stats colums there are doubles of each player can any body help? its on the site http://gangsta-life.com
-
Re: [v1] local school help you dont understand, do i replace the whole cron file with mysql_query("UPDATE users SET CourseDays=CourseDays-1 WHERE Course>0 AND CourseDays > 0"); or do i change the file and ad mysql_query("UPDATE users SET CourseDays=CourseDays-1 WHERE Course>0 AND CourseDays > 0");
-
Re: [v1] local school help so can you help me , so do i put that cron in the day crons or the cron file that i used
-
Re: [v1] local school help heres my course cron can you help? <?php require "global_func.php"; include "mysql.php"; global $c; mysql_query("UPDATE users SET CourseDays=CourseDays-1 WHERE Course>0"); $userquery = "SELECT * FROM users WHERE Course>0"; $userresult = mysql_query("$userquery") or die (mysql_error()); $user = mysql_fetch_array($userresult); if ($user['CourseDays'] == 0) { $coursequery = "SELECT * FROM Courses WHERE cID='{$user['Course']}'"; $courseresult = mysql_query("$coursequery") or die (mysql_error()); $course = mysql_fetch_array($courseresult); $updatequery = "UPDATE userstats SET intelligance=intelligance+'{$course['cINTEL']}', endurance=endurance+'{$course['cENDU']}', labor=labor+'{$course['MANL']}'"; $updateresult = mysql_query("$updatequery") or die (mysql_error()); $cdonequery = "INSERT INTO CoursesDone VALUES ('', '{$course['cID']}', '{$user['userid']}')"; $cdone = mysql_query("$cdonequery") or die (mysql_error()); event_add($user['userid'],"You completed the [b]{$course['cNAME']}[/b] course and gained. [b]{$course['cINTEL']}[/b] Intelligence [b]{$course['cENDU']}[/b] Endurence [b]{$course['cMANL']}[/b] Manual Labor. Also you may have unlocked some unqiue things within the game, look around the game see if there is anything new, the description of the course you just completed will give you a idea of what you just unlocked.",$c); mysql_query("UPDATE users SET Course=0 WHERE CourseDays=0 OR CourseDays<0"); } print "Cron complete!"; ?>
-
Re: [v1] local school help please help me
-
hi I'm having problems with my local school when someone starts a course and the time is over it starts going into minus here is my local school <?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['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); switch ($_GET['view']) { case 'info': info(); break; case 'currentusers': current_users(); break; case 'do': course_do(); break; default: course_index(); break; } function course_index() { global $ir,$c,$userid; if ($ir['Course'] > 0) { $coursequery = "SELECT * FROM Courses WHERE cID = {$ir['Course']}"; $courseresult = mysql_query("$coursequery"); $course = mysql_fetch_array($courseresult); print "<center>Sorry you cannot start another course until the currrent course you are doing is complete! Here if you course information: <table width='50%' border='1' class='coll' bgcolor='#303030'> <tr> <th colspan='2'>Course Information</th> </tr> <tr> <td width='30%'>Course Name:</td> <td>{$course['cNAME']}</td> </tr> <tr> <td>Course Time Left (Days):</td> <td>{$ir['CourseDays']}</td> </tr> <tr> <td>Course Description:</td> <td>{$course['cDESCRIPTION']}</td> </tr> <tr> <td>Course Type:</td> <td>{$course['cTYPE']}</td> </tr> </table>"; } else { print " <center> <h4>Local School</h4> <hr color='black' width='50%'> <table width='50%' border='1' class='coll' bgcolor='#303030'> <tr> <th width='50%'>Course Name</th> <th width='50%'>Course Information</th> </tr>"; $coursequery="SELECT * FROM Courses ORDER BY cTYPE ASC"; $courseresult=mysql_query("$coursequery"); while ($course=mysql_fetch_array($courseresult)) { echo " <tr> <td>{$course['cNAME']}</td> <td>- [url='localschool.php?view=info&ID={$course[']Course Information[/url]</td> </tr>"; } } print "</table>"; } function info() { global $ir,$c,$userid; $cinfoquery="SELECT * FROM Courses WHERE cID='{$_GET['ID']}'"; $cinforesult=mysql_query("$cinfoquery"); $cinfo=mysql_fetch_array($cinforesult); $userquery="SELECT * FROM users WHERE Course='{$cinfo['cID']}'"; $user=mysql_query("$userquery"); if (mysql_num_rows($user) == $cinfo['cMAXUSERS']) { $c = "<font color=red>".mysql_num_rows($user)."/{$cinfo['cMAXUSERS']}</font>"; } else { $c = "".mysql_num_rows($user)."/{$cinfo['cMAXUSERS']}"; } print "<center><h4>Course Information</h4> <hr color='black' width='50%'> <table width='50%' border='1' class='coll' bgcolor='#303030'> <tr colspan='4'> <th colspan='4'>Information About Course: {$cinfo['cNAME']}</th> </tr> <tr> <td>Name:</td> <td>{$cinfo['cNAME']}</td> </tr> <tr> <td>Type of course:</td> <td>{$cinfo['cTYPE']}</td> </tr> <tr> <td>Max Users:</td> <td>$c</td> </tr> <tr> <td>Cost:</td> <td>{$cinfo['cCOST']}</td> </tr> <tr> <td>Power Required:</td> <td>{$cinfo['cPOWERR']}</td> </tr> <tr> <td>Level Required:</td> <td>{$cinfo['cLEVELR']}</td> </tr> <tr> <td>Time Length (Days)</td> <td>{$cinfo['cLENGTH']}</td> </tr> <tr colspan='2'> <th colspan='2'>Course Description</th> </tr> <tr colspan='2'> <td colspan='2'>[size="1"]{$cinfo['cDESCRIPTION']}[/size]</td> </tr> <tr> <td>- <a href='localschool.php?view=currentusers&ID={$cinfo['cID']}' style='color:steelblue;'>View users doing this course!</td> <td>- <a href='localschool.php?view=do&ID={$cinfo['cID']}' style='color:steelblue;'>Do</td> </tr> </table>"; } function current_users() { global $c,$ir,$userid; $coursequery="SELECT * FROM Courses WHERE cID='{$_GET['ID']}'"; $courseresult=mysql_query("$coursequery"); $course=mysql_fetch_array($courseresult); print " <center> <h4>Viewing users doing the course named: {$course['cNAME']}!"; $userquery="SELECT * FROM users WHERE Course='{$_GET['ID']} ORDER BY userid ASC'"; $userresult=mysql_query("$userquery"); print " <table width='25%' border='1' bgcolor='#303030' class='coll'> <tr> <th>UserName</th> </tr>"; if (mysql_num_rows($userresult) == 0) { echo " <tr> <td>No users found doing this course!</td> </tr>"; } else { while ($user=mysql_fetch_array($userresult)) { echo " <tr> <td>- <a href='profile.php?u={$user['userid']}'> {$user['username']}</a></td> </tr>"; } } print "</table>"; } function course_do() { global $c,$ir,$userid; if ($_GET['ID'] == "") { die ("Invalid course!"); } if (!$_GET['ID']) { die ("Invalid course!"); } $coursequery="SELECT * FROM Courses WHERE cID='{$_GET['ID']}'"; $courseresult=mysql_query("$coursequery"); $course=mysql_fetch_array($courseresult); $cdonequery = "SELECT * FROM CoursesDone WHERE cdUSERID = $userid AND cdCOURSEID = '{$_GET['ID']}'"; $cdoneresult = mysql_query("$cdonequery"); if (mysql_num_rows($cdoneresult) > 0) { die ("You have already done this course!"); } $userquery="SELECT * FROM users WHERE Course='{$_GET['ID']}'"; $user=mysql_query("$userquery"); print "<center> <h4>Do Course</h4> <hr color='black' width='50%'>"; if (mysql_num_rows($user) == $course['cMAXUSERS']) { die ("This course has reached it's maximum user capacity, please try another course!"); } if ($ir['level'] < $course['cLEVELR']) { die ("You are not able to do this course as your level is too low!"); } if ($ir['money'] < $course['cCOST']) { die ("You do not have enough money to start this course!"); } elseif ($ir['energy'] < $course['cPOWERR']) { die ("You don't have enough power to do this course!"); } elseif (mysql_num_rows($courseresult) == 0) { die ("Invalid course!"); } else { $query="UPDATE users SET Course={$_GET['ID']}, CourseDays={$course['cLENGTH']}, energy=energy-{$course['cPOWERR']}, money=money-{$course['cCOST']} WHERE userid = '$userid'"; $result=mysql_query("$query"); print "Congratulations, you have started the [b]{$course['cNAME']}[/b] course, you will complete it is [b]{$course['cLENGTH']}[/b] days!"; } } $h->endpage(); ?> can any body help me
-
Re: My first Login its a bit plain
-
Re: My first Login there ya go
-
Re: Mccodes V1 Edit User House you mean like change the users house?
-
Re: EID MUBARAK EID MUBARAK ALL :-D (btw it 2times a year)
-
Gangsta-Life Hi , Gangsta-Life.com The game running for a while now tell me what you think any improvements would help :-)
-
ok, i have a validation script but i need help , every thing works on the script but when i register an account and go to my hotmail to confirm it, it says you have activated you account but when i login with the password that i used it dont let me login , here is the validate scrpit <?php session_start(); require "mysql.php"; global $c; if ( $_GET['act'] == 'val') { $q=mysql_query("SELECT * FROM validating WHERE vdID='{$_GET['token']}'", $c); if (!mysql_num_rows($q)) { die("Invalid account"); } $r=mysql_fetch_array($q); $password = strip_tags($_POST['vdPASSW']); $password=md5($password); $username=($r['vdUSERN']); $email=($r['vdEMAIL']); $money=($r['vdMONEY']); mysql_query("INSERT INTO users (userid, username, login_name, userpass, level, money, goldbars, donatordays, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, gender, signedup, email, bankmoney, Steps) VALUES('', '{$username}', '{$username}', md5('{$_POST['password']}'), 1, 100, 0, 0, 1, 12, 12, 100, 100, 5, 5, 100, 100, 1, 'Male', unix_timestamp(), '{$email}', -1, 10)", $c); $i=mysql_insert_id($c); mysql_query("INSERT INTO userstats VALUES($i,10,10,10,10,10,10)",$c); mysql_query("DELETE FROM validating WHERE vdID='{$_GET['token']}'", $c); print "Account validated! [url='login.php']> Login[/url]"; } else { mysql_query("DELETE FROM validating WHERE vdID='{$_GET['token']}'", $c); print "Registration Cancelled."; } ?> does any one know how to fix this so i can login with the password that i used
-
Re: 3 Word Game And then she...
-
Re: Count Backwards :D 4877 8-)
-
Re: My forgot password. [v2] & [v1] it didn't work for me so i changed it abit this is for v1 if yours didnt work use this 1 for v1 <?php session_start(); print "<html> <head> <title>Lost Pass</title> </head> <body><center> "; $ip = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; if(file_exists('ipbans/'.$ip)) { die("[b]<font color=red size=+1>Your IP has been banned, there is no way around this.</font>[/b]</body></html>"); } require "mysql.php"; global $c; if($_POST['email']) { $_POST['email'] = htmlentities($_POST['email']); $_POST['username'] = htmlentities($_POST['username']); if($_GET['username']) { $search_users = mysql_query("SELECT * FROM users WHERE login_name='".$_POST['username']."'") or die(mysql_error()); if(mysql_num_rows($search_users) == 0) { echo 'There is no user\'s with that login name.'; exit; } } $search_email = mysql_query("SELECT * FROM users WHERE email='".$_POST['email']."'") or die(mysql_error()); if(mysql_num_rows($search_email) == 0) { echo 'No user\'s with this email.'; exit; } $password = rand(10000,20000); $fetch_data = mysql_fetch_assoc($search_email); $username = $fetch_data['username']; $body = "Welcome to your website Passwords.\n\nYour password is: ".$password."\nYour login name is: ".$fetch_data['login_name']."\n\nPlease login at [url]http://www.your-website.com[/url]. Enjoy\n\nYour's sincerly your website Staff."; $subject = "Your Forgotten Password"; $email = $fetch_data['email']; $from = "From: your website Passwords <[email protected]>"; mail($email, $subject, $body, $from); mysql_query("UPDATE users SET userpass='".md5($password)."' WHERE login_name='".$_POST['username']."' AND email='".$_POST['email']."'") or die(mysql_error()); echo 'Mail has been sent. Please check your spam box also.'; exit; } echo '<form action="?act=FPass" method="post"> Email: <input type="text" name="email"> Login Name: <input type="text" name="username"> <input type="submit" value="Submit"> </form>'; ?>
-
Re: [FREE] [V2] Simple but better looking game header! This is a very nice theme :mrgreen: , looks good , so all of you v2 users try it
-
Re: Register problems | Need Help!!!!!!! its ok i have fixed the problem :evil:, can you delete this topic
-
Re: Need Help!!!!!!! please help me , this problem is affecting my game and i need YOUR help
-
Re: Need Help!!!!!!! any one :? :-o
-
Re: Need Help!!!!!!! can any one help plz
-
im not sure were to put this when someone registers on my game http://gangsta-life.com/SignUp.php , then when they login there user ID has gone and says "Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/gangstal/public_html/profile.php on line 145" due to no user Id being there, i have tried to fix this but i carnt can any one help quickley please
-
Re: Help Icon! Thanks for both of your help , it worked whoooo :mrgreen:, Thanks
-
i dont know were else to put this, can any one help , how would i do this so i can put it into my game . has any one got any ideas
-
Re: Email Activation now it makes more sense , its just the way it was said that was confusing
-
Re: Email Activation i too am stuck here : :?