Jump to content
MakeWebGames

Becon

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Becon's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Ok. I used a mod off here for a gang armoury and cant find the original right now but my problem is when I have a lent item from the armoury....or armory...however you like to spell it...and I use an auto item quantifyer it screws everything up. It throws the lent items in with the non lent items. Then to make matters worse if when you lend out an item to ID number whatever and start refreshing it keeps sending the items and dupes them. Now with quantify making everything mixed up Im able to sell all the duped items and make hella bank. If I take quantify off and do it I can still dupe the items into the inventory but when I recall the item lent it takes back only the one it was supposed to and Im left with the rest that I can NOT sell as inventory still thinks that it was lent from the gang so they just get a messed up inventory. Any way of quantifying items and keeping the lent ones seperate from the actual owned ones? Im using MDK666's Inventory mod http://criminalexistence.com/ceforums/index.php?topic=26757.0 And this is my lenditem.php <?php include "globals.php"; $gq=mysql_query("SELECT g.*,oc.* FROM gangs g LEFT JOIN orgcrimes oc ON g.gangCRIME=oc.ocID WHERE g.gangID={$ir['gang']}",$c); $gangdata=mysql_fetch_array($gq); $q=mysql_query("SELECT * FROM items WHERE itmid={$_GET['ID']}",$c); $item=mysql_fetch_array($q); $q=mysql_query("SELECT * FROM gangarmory WHERE armoryITEMID={$_GET['ID']} AND armoryGANGID={$ir['gang']} AND armoryID={$_GET['ITEMID']}",$c); $pres=$gangdata['gangPRESIDENT']; $vicepres=$gangdata['gangVICEPRES']; $theitem=$item['itmname']; $username=$ir['username']; if($_GET['ID'] && $_GET['USER'] && $_GET['ITEMID']) { $f=mysql_query("SELECT * FROM users WHERE userid={$_GET['USER']}",$c); $er=mysql_fetch_array($f); $otheruser=$er['userid']; if($userid != $pres && $userid != $vicepres) { die("You are not President or Vice President of your gang therefore cannot give out armory items."); } if($er['gang'] != $ir['gang']) { die("That user is not in your gang."); } if(mysql_num_rows($q)==0) { die("Your gang does not own this item."); } mysql_query("UPDATE gangarmory SET armoryLENT={$_GET['USER']} WHERE armoryID={$_GET['ITEMID']} LIMIT 1;",$c); mysql_query("INSERT INTO inventory VALUES ('','{$_GET['ID']}','{$er['userid']}','1','{$ir['gang']}');",$c); mysql_query("INSERT INTO gangevents VALUES ('',{$gangdata['gangID']},unix_timestamp(),\"{$er['username']} was lent a/an $theitem from the gang armory.\");",$c); event_add($otheruser,"You have been lent a/an $theitem from your gang's armory.",$c,'general'); die("You took the $theitem from the gang armory and lent it to {$er['username']}."); } else if($_GET['ID'] && $_GET['ITEMID']) { print "[b]Enter the ID of the member of your gang that you wish to lend the $theitem to.[/b]</br> <form action='lenditem.php' method='get'> <input type='hidden' name='ID' value='{$_GET['ID']}' />User ID: <input type='text' name='USER' value='' /><input type='hidden' name='ITEMID' value='{$_GET['ITEMID']}' /> </br> <input type='submit' value='Lend To Member' /></form>"; } $h->endpage(); ?>   Anything else you need? Thanx in advance. Still a noob!! =o)~
  2. Re: [mccode v2] Advanced(isher) Level Upgrade Mod. First of its spelled Jedi...lol yeah. Im a dork. Just messin....Second... Seems that they have to HACK first BEFORE they can use the variable...in which case its too late. Once you gain access to 94% of peoples stuff there is only 6% of the game safe anyways. What you posted the first time makes me thing that they can gain access to that 94% with the variable...the last post says they can use the variable only AFTER they hacked the sight. Everyone kinda knows that dont they? Or am I misunderstanding?!
  3. Ok. After seeing Matty's [mccode v1] Advanced(ish) Level Upgrade Mod. http://criminalexistence.com/ceforums/index.php?topic=6683.0 I thought I would poke around and try and mod his mod a bit and make it work for v2. Also it should still work like McCodes does for the way it tallies the exp. Such as if you need 25% exp to lvl and you gain 50% more, when you level you will be 25% into the next level already. Unfortunatly if you need 25% and gain 125% you have to click the upgrade button twice to go through the levels. And as Cruisey says on Mattys post that can suck as people can save up their levels and get there faster. What I want to do is make it so you cant gain any more exp untill you click the Upgrade button but Im still learning so once again, Im just starting out so please be nice! OK. Here we go!!! Start by making a file called upgrade.php <?php include "globals.php"; $exp_needed=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*2.2); if($ir[exp] < $exp_needed) { die("You need more experience before you can upgrade!"); } else { $expu=$ir['exp']-$ir['exp_needed']; $ir['level']+=1; $ir['exp']=$expu; $ir['energy']+=2; $ir['brave']+=2; $ir['maxenergy']+=2; $ir['maxbrave']+=2; $ir['hp']+=50; $ir['maxhp']+=50; $ir['exp_needed']=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*2.2); $db->query("UPDATE users SET level=level+1,exp=$expu,energy=energy+2,brave=brave+2,maxenergy=maxenergy+2,maxbrave=maxbrave+2, hp=hp+50,maxhp=maxhp+50 where userid=$userid"); print"You Upgraded to Level [b]{$ir['level']}[/b]!"; } $h->endpage; ?>   Open up global_func.php and find:   function check_level() { global $ir,$c,$userid; $ir['exp_needed']=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*3.5); if($ir['exp'] >= $ir['exp_needed']) { $expu=$ir['exp']-$ir['exp_needed']; $ir['level']+=1; $ir['exp']=$expu; $ir['energy']+=2; $ir['brave']+=2; $ir['maxenergy']+=2; $ir['maxbrave']+=2; $ir['hp']+=50; $ir['maxhp']+=50; $ir['exp_needed']=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*2.2); mysql_query("UPDATE users SET level=level+1,exp=$expu,energy=energy+2,brave=brave+2,maxenergy=maxenergy+2,maxbrave=maxbrave+2, hp=hp+50,maxhp=maxhp+50 where userid=$userid",$c); } } }   And Replace with:   function check_level() { global $db; global $ir,$c,$userid; $ir['exp_needed']=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*2.2); if($ir['exp'] >= $ir['exp_needed']) { $exp_needed=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*2.2); if($ir['exp'] >= $exp_needed) { global $upgrade; $upgrade = "Y"; } } }   Last but not least put this where you want the [upgrade] button to go:   if($upgrade == "Y") { print"<a href=upgrade.php>[upgrade]</a>"; }   Pretty much copied and moved some tidbits from global_func.php and put them into the upgrade.php file instead and added Matty's "switch" to activate it. And that was all I did! Tested and works on my sight, hope it works for all of you! GL and thanx! Hit me a + if you like it. Later
  4. Re: [mccode] quantify items automatically Yeah illegalife...Im getting that same error.
  5. Whats up all? This is an addition for Richard's New House Mod found here: http://criminalexistence.com/ceforums/index.php?topic=28097.0 Just to get a few things out of the way cuz after reading the boards for months I feel I need to!!! FIRST: This is my first mod..I'm no coder....yet! I just look at examples from other codes and do some shit and poof. SECOND: Even though I searched for "House Upgrade" in the search section and didn't find anythnig that doesnt mean its not there...just means someone put it under something stupid. THIRD: Even though I'm the one that actually wrote this I'm sure that {$r['username']} WHERE {$r['username']}={$r['dumbass-know-it-all']} will say it was someone else's. FORTH: I don't care!!! ENJOY First open smenu.php! Find: [url='staff_houses.php?action=delhouse']Delete House[/url] Under it add: [url='staff_houses.php?action=addupgrade']Add Upgrade[/url] [url='staff_houses.php?action=editupgrade']Edit Upgrade[/url] [url='staff_houses.php?action=delupgrade']Delete Upgrade[/url]   Then open global_func.php Find: $ret.=">{$r['itmtypename']}</option>"; } $ret.="\n</select>"; return $ret; } Under it add: function upgrade_dropdown($connection,$ddname="upgrade",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM house_upgrades ORDER BY upgradeName ASC"); if($selected < 1) { } else { $ret.="<option value='0'>-- None --</option>"; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['upgradeId']}'"; if ($selected == $r['upgradeId']) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['upgradeName']}</option>"; } $ret.="\n</select>"; return $ret; }   Then open staff_houses.php Find: case "delhouse": delhouse(); break; Under it add: case "addupgrade": addupgrade(); break; case "editupgrade": editupgrade(); break; case "delupgrade": delupgrade(); break; case "delupgradesub": delupgradesub(); break; function addupgrade() { global $db, $ir, $c, $h, $userid; $uprice=abs((int) $_POST['price']); $uwill=abs((int) $_POST['will']); $uname=$_POST['name']; if($uprice and $uwill and $uname) { $q=$db->query("SELECT * FROM house_upgrades WHERE upgradeName='{$_POST['name']}'"); if($db->num_rows($q) != 0) { print "<h3>Sorry, you cannot have two upgrades with the same name.</h3> "; $h->endpage(); exit; } $db->query("INSERT INTO house_upgrades VALUES(NULL, '$uname', '$uprice', '$uwill')"); print "<h3>House upgrade {$uname} added to the game.</h3> "; stafflog_add("Created House Upgrade $uname"); } else { print "<h3>Add House Upgrade</h3> <form action='staff_houses.php?action=addupgrade' method='post'> Name: <input type='text' name='name' /> Price: <input type='text' name='price' /> Max Will: <input type='text' name='will' /> <input type='submit' value='Add Upgrade' /></form>"; } } function editupgrade() { global $db, $ir, $c, $h, $userid; switch($_POST['step']) { case "2": $uprice=abs((int) $_POST['price']); $uwill=abs((int) $_POST['will']); $q=$db->query("SELECT * FROM house_upgrades WHERE upgradeMood={$uwill} AND upgradeId!={$_POST['upgrade']}"); if($db->num_rows($q)) { print "<h3>Sorry, you cannot have two upgrades with the same maximum will.</h3> "; $h->endpage(); exit; } $uname=$_POST['name']; $q=$db->query("SELECT * FROM house_upgrades WHERE upgradeId={$_POST['upgrade']}"); $old=$db->fetch_row($q); if($old['upgradeMood'] == 100 && $old['upgradeMood'] != $uwill) { die("Sorry, this house's upgrade cannot be edited."); } $db->query("UPDATE house_upgrades SET upgradeMood=$uwill, upgradeCost=$uprice, upgradeName='$uname' WHERE upgradeId={$_POST['upgrade']}"); //$db->query("UPDATE users SET maxwill=$will WHERE maxwill={$old['hWILL']}"); //$db->query("UPDATE users SET will=maxwill WHERE will > maxwill"); print "<h3>House upgrade \"$uname\" was edited successfully.</h3> "; stafflog_add("Edited house upgrade $uname"); break; case "1": $q=$db->query("SELECT * FROM house_upgrades WHERE upgradeId={$_POST['upgrade']}"); $old=$db->fetch_row($q); print "<h3>Editing house Upgrade</h3> <form action='staff_houses.php?action=editupgrade' method='post'> <input type='hidden' name='step' value='2' /> <input type='hidden' name='upgrade' value='{$_POST['upgrade']}' /> Name: <input type='text' name='name' value='{$old['upgradeName']}' /> Price: <input type='text' name='price' value='{$old['upgradeCost']}' /> Max Will: <input type='text' name='will' value='{$old['upgradeMood']}' /> <input type='submit' value='Edit House' /></form>"; break; default: print "<h3>Editing an Upgrade</h3> <form action='staff_houses.php?action=editupgrade' method='post'> <input type='hidden' name='step' value='1' /> House: ".upgrade_dropdown($c, "upgrade")." <input type='submit' value='Edit Upgrade' /></form>"; break; } } function delupgrade() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } print "<h3>House House Upgrade</h3> The upgrade will be permanently removed from the game. <form action='staff_houses.php?action=delupgradesub' method='post'> Item: ".upgrade_dropdown($c,'upgrade')." <input type='submit' value='Delete Upgrade' /></form>"; } function delupgradesub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM house_upgrades WHERE upgradeId={$_POST['upgrade']}"); $old=$db->fetch_row($d); $db->query("DELETE FROM house_upgrades WHERE upgradeId={$_POST['upgrade']}"); print "<h3>The \"{$old['upgradeName']}\" Upgrade was removed from the game.</h3>[url='staff_houses.php?action=delupgrade']>Back[/url]"; stafflog_add("Deleted house upgrade {$old['upgradeName']}"); }   Hopefully it all works out for you. I actually don't have true McCodes...but its close enough to be able to use the same stuff. Works with mine. This should be for Version 2 I believe. Let me know what you all think!! Enjoy BECON
  6. Re: [mccode v2] Factions ORG-CRIME Armoury Something I noticed with this script is that if you donate say 2 or more items to the Faction Armory and then you only give them back out 1 at a time, the quantity in the vault doesnt go down so you start dupeing items. Unless you give the full quantity all at once that is...then it removes "item" from the vault. And what i think Toufail means is there is no Case that defines what the function is for crimes. I could be wrong. =o)~   +1 though cuz its a lot of work and I like it. heheh
  7. Re: Hacker I dont know if it helps or not but when I made my game...there are admins....and I made myself an OWNER account which was kinda like admin used to be but I limited everyone else. But since Im the only OWNER account...all the admins cant do squat to me. Then again Im sure some hacker can still get me some how. Thats what they do.
  8. Re: Query Error - Email Validation If Im reading it right its just as unique as using a random string for the validation comparison. Everything works though.
  9. Re: [mccode v2] Email Activation Just in case anyone was paying attention to my problem I fixed it...posted it here: http://criminalexistence.com/ceforums/index.php?topic=26823.15
  10. Re: Query Error - Email Validation GOT IT!!! =o) Ok...heres what I did...Like I said my system actually sent the email with the link...worked with both the md5(unix_timestamp()))"); and the random_string('alnum', 32) way btw so pick one. You click the link and it DID change the 0 to a 1 in the database but I couldnt log anyone in. I opened up HEADER.PHP and after $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.userid={$userid}"); $r=$db->fetch_row($q); I inserted a if ($ir['activated'] ==0) { die("Your account is not active, check your email address including junk boxes. [url='login.php']back[/url]"); }   That seamed to do it. I tested it and nobody can log in without that stupid "1" in the database and anyone who DOES have it WILL log in. I also tested fliping through a couple pages to see if i could access them manually and i couldnt....untill I checked the e-mail and clicked that link and relogged in.   YEAY! lol Thanx everyone for the help. Its been teaching me some things. Now my way might not be the best way or most efficiant way or even the most secure way....but it is a working way right now. Il learn the better ways later. =oD Thanx again!
  11. Re: Query Error - Email Validation thanx. =o)
  12. Re: Query Error - Email Validation Nope. once again It is the same as before...I click the link...it adds the "1" to my database and says thanx for valadating...now go here to log in...I try and log in and it tells me go validate. Does that with ALL the accounts. I still think its in the authenticate.php where I put the if ($mem['activated'] == 0) { die("Your account is not active, check your email address including junk boxes. [url='login.php']back[/url]"); }   But once again I cant figure out exactly where that goes.
  13. Re: Query Error - Email Validation Well...I noticed Random_key was missing and I added that earlier....I dont know what new_mail is for though. I dont have that in my DB or know what its for. Also Im kinda unclear on your instructions....Add md5(unix_timestamp()))"); after '{$_POST['email']}', -1, '$IP', '$IP', '1', md5(unix_timestamp()))"); ??? Isnt that kinda doubling up on the md5(unix_timestamp()))"); ? And is the random_string('alnum', 32) not needed anymore? Sorry for the ignorance...Im still kinda new at this.
  14. Re: Query Error - Email Validation Huh...Im having the same problem where I cant log into the game. It DOES insert into the database but I cant seem to find where to put the if ($mem['activated'] ==0) { die("Your account is not active, check your email address including junk boxes. [url='login.php']back[/url]"); } . I dont even know if thats right. I manyally added a 1 into the data base and cant log in ANY account. Does say the accounts ARE already activated though. Any thoughts? How did you get that fixed Saint? lol
  15. Re: [mccode v2] Email Activation Ok. I got most everything up and running...sends out the email to authenticate....you click the link and it updates the database and changes a 0 to a 1 in the 'activated' table just fine....but for the love of God i can NOT figure out where to put the damn if ($mem['activated'] ==0) { die("Your account is not active, check your email address including junk boxes. [url='login.php']back[/url]"); } string. I put it everyware below the $mem=$db->fetch_row($uq); string and I get the: You havent clicked the link page EVERYTIME I try to log in ANY account. I manually added the activated "1" to the database on some accounts just to test it and I cant log in. I tried other accounts and cant log in. Hell...I tried changing the ($mem['activated'] ==0) to a ($mem['activated'] <1) and nothing. The only time I CAN log in is if I take out that string or change it to ($mem['activated'] ==1) in which case it acts as if it isnt there...I CAN log in with ANY account verrified or not if I change it to a 1. Whats up? Can someone help please? Its driving me nuts. lol Thanx again if anyone still reads the old posts. =o)
×
×
  • Create New...