Jump to content
MakeWebGames

WarMad

Members
  • Posts

    218
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by WarMad

  1. im looking for a more advances coder to help me make a new attack system for my game which might have to include the items page anyone willing to help me pm me for more info i dont want a new coder i want someone who really knows what there doing to make sure that it is secure
  2. now that i look stupid can an admin delete this post lol
  3. nvm fixed it it was my stupid fault when i saved it i saved it before adding $db->query("UPDATE users SET cdays=cdays-1 WHERE course > 0"); so after i added it i was thinking i saved it but didnt lol durp pi dur
  4. cant run it manually either
  5. my cron is not counting down the cdays for my education and i cant find out why :/ what a surprise i have been trying different things all morning and havent got lucky yet   <?php include "config.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; $db->query("UPDATE fedjail set fed_days=fed_days-1"); $q=$db->query("SELECT * FROM fedjail WHERE fed_days=0"); $ids=array(); while($r=$db->fetch_row($q)) { $ids[]=$r['fed_userid']; } if(count($ids) > 0) { $db->query("UPDATE users SET fedjail=0 WHERE userid IN(".implode(",", $ids).")"); } $db->query("DELETE FROM fedjail WHERE fed_days=0"); $db->query("UPDATE users SET daysingang=daysingang+1 WHERE gang > 0"); $db->query("UPDATE users SET daysold=daysold+1, boxes_opened=0"); $db->query("UPDATE users SET mailban=mailban-1 WHERE mailban > 0"); $db->query("UPDATE users SET donatordays=donatordays-1 WHERE donatordays > 0"); $db->query("UPDATE users SET cdays=cdays-1 WHERE course > 0"); $db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney/50) where bankmoney>0"); $db->query("UPDATE users SET cybermoney=cybermoney+(cybermoney/100*7) where cybermoney>0"); $q=$db->query("SELECT * FROM users WHERE cdays=0 AND course > 0"); while($r=$db->fetch_row($q)) { $cd=$db->query("SELECT * FROM courses WHERE crID={$r['course']}"); $coud=$db->fetch_row($cd); $userid=$r['userid']; $db->query("INSERT INTO coursesdone VALUES({$r['userid']},{$r['course']})"); $upd=""; $ev=""; if($coud['crSTR'] > 0) { $upd.=",us.strength=us.strength+{$coud['crSTR']}"; $ev.=", {$coud['crSTR']} strength"; } if($coud['crGUARD'] > 0) { $upd.=",us.guard=us.guard+{$coud['crGUARD']}"; $ev.=", {$coud['crGUARD']} guard"; } if($coud['crLABOUR'] > 0) { $upd.=",us.labour=us.labour+{$coud['crLABOUR']}"; $ev.=", {$coud['crLABOUR']} labour"; } if($coud['crAGIL'] > 0) { $upd.=",us.agility=us.agility+{$coud['crAGIL']}"; $ev.=", {$coud['crAGIL']} agility"; } if($coud['crIQ'] > 0) { $upd.=",us.IQ=us.IQ+{$coud['crIQ']}"; $ev.=", {$coud['crIQ']} IQ"; } $ev=substr($ev,1); if ($upd) { $db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET us.userid=us.userid $upd WHERE u.userid=$userid"); } $db->query("INSERT INTO events VALUES('',$userid,unix_timestamp(),0,'Congratulations, you completed the {$coud['crNAME']} and gained $ev!')"); } ?>
  6. in still new to coding and i was starting a forum rating mod and its not working properly it will let a user rate the topic as much as they want can anyone tell me what i did wrong   <?php $i=('globals.php'); include "$i"; $_GET['LID'] = abs((int) $_GET['LID']); $_GET['DID'] = abs((int) $_GET['DID']); if($_GET['LID']) { global $ir, $userid, $h, $db; $p = $db->query("SELECT ft_id, ft_name FROM forum_topics WHERE ft_id = ".$_GET['LID']); $r = $db->fetch_row($p); echo "You have liked the topic"; $db->query("UPDATE forum_topics SET ft_like=ft_like+1 WHERE ft_id={$r['ft_id']}"); $db->query("INSERT INTO forum_rating VALUES('{$ir['userid']}','{$r['ft_id']}',' 1',' 0')"); } else if($_GET['DID'] == $tr['fr_topicid']) { echo "you already rated this post"; } else { return functionName(); } function functionName() { global $ir, $userid, $h, $db; $fr = $db->query("SELECT fr_userid, fr_topicid, fr_dislike FROM forum_rating WHERE fr_userid ={$ir['userid']}"); $tr = $db->fetch_row($fr); if($ir['userid'] == $_GET['fr_userid'] || $tr['fr_dislike']==1) {echo "you already rated this post";} else { $p = $db->query("SELECT ft_id, ft_name FROM forum_topics WHERE ft_id = ".$_GET['DID']); $r = $db->fetch_row($p); echo "You have disliked the topic"; $db->query("UPDATE forum_topics SET ft_dislike=ft_dislike+1 WHERE ft_id={$r['ft_id']}"); $db->query("INSERT INTO forum_rating VALUES('{$ir['userid']}','{$r['ft_id']}',' 0',' 1')"); } } ?>
  7. might be the wrong place but does anyone know what kind of program i could get for something kinda llike this [ATTACH=CONFIG]1215[/ATTACH] bsically just a list of stuff done and crap but i cant find what program is like that it would make my job a lot easier lol
  8. nvm got it
  9. im looking for it aswell
  10. how would i do another database for it i have tried a couple things i cant get it to work properly
  11. ya thats exactly what it was - - - Updated - - - ya thats exactly what it was
  12. thanks guys i fixed it
  13. doing that now thanks lol i havent coded in a while im trying to get back into it still refreshing my mind
  14. im not sure whats wrong it says gang created but all it does is take the money and does not inter in into the database not the info under users or under gangs   global $ir, $userid; $c= 1000000; if($ir['money'] < $c) { die("You don't have enough money. You need \${$c}."); } 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,'')"); $i=mysql_insert_id(); mysql_query("UPDATE users SET gang=$i,money=money-$c where userid=$userid"); echo "gang created!"; } else { echo "<h3> Create A gang</h3><form action='creategang.php' method='post'> <input type='hidden' name='submit' value='1' />Name:<input type='text' name='name' /><br /> Description:<br /> <textarea name='desc' cols='40' rows='7'></textarea> <br /><input type='submit' value='Create gang for \${$c}' /></form>"; }
  15. did did anyone get this to work if so can they post the code i cant even get the first file to work the factions.php i have been working on it for about an hour and keep getting more and more errors
×
×
  • Create New...