Jump to content
MakeWebGames

p_T_s

Members
  • Posts

    148
  • Joined

  • Last visited

Everything posted by p_T_s

  1. Re: Crystal market with limit and day function I want this to work on Donatorday market but i am having trouble getting it to reset. I have done the following and was hoping someone can correct my mistake (lol) sql file ALTER TABLE `donatormarket` ADD `cmDAYS` INT( 11 ) NOT NULL DEFAULT '1';   crons hour file ///start of donator market days count down to go back on hand if(date('G')== 12) { $db->query("UPDATE donatormarket SET cmDAYS = cmDAYS - 1 WHERE cmDAYS > 0"); if($r['cmDAYS'] == 0) { $q=$db->query("SELECT cm.*, u.* FROM donatormarket cm LEFT JOIN users u ON u.userid=cm.cmADDER ORDER BY cmPRICE/cmQTY ASC"); while($r=$db->fetch_row($q)) { $q=$db->query("SELECT * FROM donatormarket WHERE cmID={$r['cmID']} AND cmADDER={$r['userid']}"); $r=$db->fetch_row($q); $db->query("UPDATE users SET donatordays=donatordays+{$r['cmQTY']} WHERE userid={$r['cmADDER']}"); $db->query("DELETE FROM donatormarket WHERE cmID={$r['cmID']}"); } } ///end of donator market   added to dday.php <?php include "globals.php"; if($ir['safehouse'] > 0) { print "You are in the safehouse"; $h->endpage(); exit; } if($ir['jail'] or $ir['hospital']) { print "This Page Cannot be Accessed while in Jail or Hospital."; $h->endpage(); exit; } print "[img=headings/ddmarket.jpg] "; switch($_GET['action']) { case "buy": dday_buy(); break; case "remove": dday_remove(); break; case "add": dday_add(); break; default: dday_index(); break; } function dday_index() { global $db,$ir,$c,$userid,$h; print "[url='dday.php?action=add']> Add A Listing[/url] Viewing all listings... <table width=75% cellspacing=1 class='table'> <tr style='background:gray'> <th class='h'><font color=black>ADDER</th> <th class='h'><font color=black>QTY</th> <th class='h'><font color=black>PRICE EACH</th> <th class='h'><font color=black>DAYS LEFT</th> <th class='h'><font color=black>PRICE TOTAL</th> <th class='h'><font color=black>LINKS</th> </tr>"; $q=$db->query("SELECT cm.*, u.* FROM donatormarket cm LEFT JOIN users u ON u.userid=cm.cmADDER ORDER BY cmPRICE/cmQTY ASC"); while($r=$db->fetch_row($q)) { if($r['cmADDER'] == $userid) { $link = "[url='dday.php?action=remove&ID={$r[']Remove[/url]"; } else { $link = "[url='dday.php?action=buy&ID={$r[']Buy[/url]"; } $each= (int) $r['cmPRICE'] / $r['cmQTY']; print "\n<tr> <td><center>[url='viewuser.php?u={$r[']{$r['username']}[/url] [{$r['userid']}]</td> <td><center>{$r['cmQTY']}</td> <td><center> \$" . number_format($each)."</td> <td align=center>{$r['cmDAYS']} Days.</td> <td><center>\$".number_format($r['cmPRICE'])."</td> <td><center>[$link]</td> </tr>"; } print "</table>"; } function dday_remove() { global $db,$ir,$c,$userid,$h; $q=$db->query("SELECT * FROM donatormarket WHERE cmID={$_GET['ID']} AND cmADDER=$userid"); if(!$db->num_rows($q)) { print "Error, either these days do not exist, or you are not the owner. [url='dday.php']> Back[/url]"; $h->endpage(); exit; } $r=$db->fetch_row($q); $db->query("UPDATE users SET donatordays=donatordays+{$r['cmQTY']} where userid=$userid"); $db->query("DELETE FROM donatormarket WHERE cmID={$_GET['ID']}"); print "days removed from market! [url='dday.php']> Back[/url]"; } function dday_buy() { global $db,$ir,$c,$userid,$h; $q=$db->query("SELECT * FROM donatormarket cm WHERE cmID={$_GET['ID']}"); if(!$db->num_rows($q)) { print "Error, either these days do not exist, or they have already been bought. [url='dday.php']> Back[/url]"; $h->endpage(); exit; } $r=$db->fetch_row($q); if($r['cmPRICE'] > $ir['money']) { print "Error, you do not have the funds to buy these days. [url='dday.php']> Back[/url]"; $h->endpage(); exit; } $db->query("UPDATE users SET donatordays=donatordays+{$r['cmQTY']} where userid=$userid"); $db->query("DELETE FROM donatormarket WHERE cmID={$_GET['ID']}"); $db->query("UPDATE users SET money=money-{$r['cmPRICE']} where userid=$userid"); $db->query("UPDATE users SET money=money+{$r['cmPRICE']} where userid={$r['cmADDER']}"); event_add($r['cmADDER'],"[url='viewuser.php?u=$userid']{$ir['username']}[/url] bought your {$r['cmQTY']} days from the market for \$".number_format($r['cmPRICE']).".",$c); print "You bought the {$r['cmQTY']} days from the market for \$".number_format($r['cmPRICE'])."."; } function dday_add() { global $db,$ir,$c,$userid,$h; $_POST['amnt'] = abs((int) $_POST['amnt']); $_POST['price'] = abs((int) $_POST['price']); $_POST['days'] = abs(intval($_POST['days'])); if($_POST['amnt']) { if($_POST['amnt'] > $ir['donatordays']) { die ("You are trying to add more days to the market than you have.[url='dday.php?action=add']> Back[/url]"); } if($_POST['amnt'] > 30) { die ("You can't add this many days because you would exceed the maximum amount allowed. You can only add 30 days or less at a time. [url='dday.php?action=add']> Back[/url]"); } if(!in_array($_POST['days'], array(1,5,10))) { echo 'Amount of days is invalid!'; $h->endpage(); exit; } $b=$db->query("SELECT * FROM donatormarket WHERE cmADDER=$userid"); if ($db->num_rows($b) > 2) { die("<center>You Are Only Allowed 3 Donator Day Sales At A Time [url='dday.php?action=add'] Back[/url]"); } $tp=$_POST['amnt']*$_POST['price']; $db->query("INSERT INTO donatormarket VALUES('',{$_POST['amnt']},$userid,$tp,{$_POST['days']})"); $db->query("UPDATE users SET donatordays=donatordays-{$_POST['amnt']} WHERE userid=$userid"); print "days added to market! [url='dday.php']> Back[/url]"; } else { print "[b]Adding a listing...[/b] You have [b]{$ir['donatordays']}[/b] day(s) that you can add to the market.<form action='dday.php?action=add' method='post'><table width=50% border=2><tr> <td>Days:</td> <td><input type='text' name='amnt' value='{$ir['donatordays']}' /></td></tr><tr> <td>Price Each:</td> <td><input type='text' name='price' value='200' /></td></tr><tr> <td>Days:</td> <td><select type='dropdown' name='days' value='{$ir['cmDAYS']}' />> <option value='1'>1 <option value='5'>5 <option value='10'>10</select> </tr> <td colspan=2 align=center><input type='submit' value='Add To Market' /></tr></table></form>"; } } $h->endpage(); ?>   I have also added 30 days as a maximum limit allowed at any one time... Any help will be appreciated...
  2. Re: admins cant be feded [v2] what staff file do i put it in? if($r['user_level'] == 2) { die ("Admins cant be fedded."); $h->endpage(); exit; }   I tried it in staff_punit.php but its not working
  3. Re: Vote Mod? Is there anyway to make the users vote at each voting site before they get the rewards from my game site? My users seem to be receiving the rewards from my site but most of them don't even bother to vote. If i can't get it to only pay them after they have actually voted, i'm going to take it down...
  4. Re: [mccode v2] Display Cabinet My users want to be able to move more than 1 item at a time back to their inventory. I tried this but it doesn't work (lol) any one want to fix it for me?   <?php include "globals.php"; if ($_GET['ID'] == $ir['userid']) { switch($_GET['action']) { case "remit": remit(); break; default: die("Error!"); break; } } print " <table width='75%' cellspacing=1 class='table'> <tr> <td width='50%'>[b]Move Item[/b] <form action='displayrem.php?ID=$userid&action=remit&itm={$_GET['itm']}' method='post'> Item: {$mydisplay['itmname']} Amount: <input type='text' name='add' value='{$itemcnt['inv_qty']}' /> <input type='submit' value='Store' /></form> </td> </tr> </table>"; } function remit() { global $db,$ir,$c,$userid,$h; $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} AND iv.inv_itemid={$_GET['itm']} ORDER BY i.itmtype ASC, i.itmname ASC"); $itemcnt=$db->fetch_row($inv); $display=$db->query("SELECT * FROM display WHERE disp_userid=$userid AND disp_itemid={$_GET['itm']}"); $mydisplay=mysql_num_rows($display); $checkdisp=$db->fetch_row($display); if($mydisplay < 1) { die("You don't have that amount of items.."); } else { if ($checkdisp['disp_qty'] <= 1) { $db->query("DELETE FROM display WHERE disp_id = {$checkdisp['disp_id']}"); } else { $db->query("UPDATE display SET disp_qty=disp_qty+{$_POST['add']} WHERE disp_userid=$userid AND disp_itemid={$_GET['itm']}"); item_remove($userid, $_GET['itm'], $_POST['add']); } else { $db->query("INSERT INTO inventory VALUES ('',{$_GET['itm']},$userid,{$_POST['add']})"); item_remove($userid, $_GET['itm'], $_POST['add']); } print "[b]You have sent your {$i['itmname']} to your Inventory[/b] [url='inventory.php?ID=$userid']> Go to Inventory[/url]"; } } $h->endpage(); ?>
  5. Re: [mccodes v2]New and improved inventory code sources for free! So it sends an event to the user you are giving an item to... Find function give_item_submit in staff_items.php find $db->query("INSERT INTO inventory VALUES('',{$_POST['item']},{$_POST['user']},{$_POST['qty']},0)",$c) or die(mysql_error());   add under event_add($_POST['user'],"You were given an item {$_POST['item']}, from the administration. Check your inventory.",$c); print "User given a Item.";
  6. Re: 3 Revamps [V2] How would i get a users equipped items to show up in their profiles (viewuser.php) I have tried added along the lines of the Inventory.php above, but it just shows my equipped items in everyones profiles. thx in advance to anyone who can help.
  7. Re: [v1/v2] Auction Cron fully Fixed and tested so this will stop it from going in to negative days?
  8. Re: [mccode v2] Club Mod (my version)  
  9. Re: Need Help - Extra turns for donators Thx AlabamaHit it was as simple as that! lol
  10. I want to give all my donators extra turns in the streets. so for donators they get 100 turns at new day, non-donators get 70 turns at new day.... I have tried the following but dosn't work..   if($ir['donatordays']) { $db->query("UPDATE users SET turns=turns+100"); } else { $db->query("UPDATE users SET turns=turns+70");   and   $db->query("UPDATE users SET turns=70 where donatordays <=0); $db->query("UPDATE users SET turns=100 where donatordays > 0);   and also   if($ir['donatordays'] <= 0) { $db->query("UPDATE users SET turns=70"); } else if($ir['donatordays'] > 0) { $db->query("UPDATE users SET turns=70");   Can soem one tell me what i've done wrong?
  11. Re: [mccode v2] Gang Recruit Excellent mod buyt make sure to use Killah's event add code or it won't send an event...good pick up Killah... How do i give a +1 to Sniko and everyone else who contributed?
  12. Re: Adding an event_add gurpreet Check this topic out it might help you... http://criminalexistence.com/ceforums/index.php?topic=27525.0 AlabamaHit, I'm glad you find it easy but for some of us noobs it can be quite frustrating at times... I tried my hardest by looking at other files and they never worked, if it wasn't for Killah, i wouldn't of got it to work...Thanks again Killah!!!
  13. Re: Random Item in shop So to use array, do i have to create a seperate shops.php or just add it into the current one? If someone wants to make this mod for me with all sqls, crons and php files.... I will gladly pay for it!
  14. Re: 2 questions event add & insert item thx killah works great now :-D
  15. Re: 2 questions event add & insert item thx guys but they dont work... $sel = mysql_query("SELECT userid,username,user_level FROM users WHERE user_level=5"); while($soc = mysql_fetch_assoc($sel)) { mysql_query("UPDATE users SET money=money+1000 WHERE userid=".$soc['userid']); event_add($soc['userid'],"Hello ".$soc['user_name'].", You have been given $1, 000 for being staff. Thank you."); item_add($soc['userid'],19,1); } this one pays the $1000 but no event and not item 19   $db->query("UPDATE users set money=money+20000 WHERE user_level=5"); event_add($_POST['user'],"You were given $1000 from the administration.",$c); and this one dosn't do either (no money or event)
  16. I have this setup in my weeklycron.php $db->query("UPDATE users set money=money+1000 WHERE user_level=5"); I need it to send an event to these staff members stating they have received their payment I also want to be able to insert into inventory for these staff members will potions ie (itemid 19) can someone help me as i have tried all night with no luck..
  17. Re: Referal in HOF Ok maybe if i post what i have so far, someone can help fill in the gaps?   <td>[url='halloffame.php?action=referals&filter={$filter}']REFERALS[/url]</td>   case "referals": hof_referals(); break;   function hof_referals() { global $db,$ir,$c,$userid; print "Showing the top 20 Referers <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Referals</th> </tr>"; $q=$db->query("SELECT * FROM referals ORDER BY refREFER DESC,refREFED ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $ir['userid']) { $t="[b]";$et="[/b]"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['refREFER']} {$r['username']} [{$r['userid']}]$et</td> <td>$t".money_formatter($r['referals'],'')."$et</td> </tr>"; } print "</table>"; }   It looks like this in the Hall Of Fame Pos User Referals 1 4 [] 0 2 1 [] 0 So i have the users id's but no username showing and not showing how many referals???
  18. Re: Referal in HOF Has anyone got a working "referals" in the HOF? I have been trying to add this and it just dont work.... A huge thx inadvance if someone can help me out?
  19. Re: Have any mod ideas post here! HOW ABOUT THIS MOD IDEA... I want to add books to a book shop, Each book will give a different amount of IQ when bought and used but i want to be able to add all the books to the shop but then have only 5 show at a time, lets say book A, B, C, D, and E... But then every hour change around to say, Book F, H, A, Z, Y etc etc.... ????
  20. Re: Random Item in shop B U M P :-D
  21. Re: [v2] Will pay for a fix... i have the same prob with opera9, it looks good in IE and is messed up in opera9
  22. Re: [mccode v2] Itempedia Avguste use Lowball's codes as they work, i just deleted the gang section and works great on my game :-)
  23. I have seen this on another game and was wondering if anyone can help me get it to work? I want to add books to a book shop, Each book will give a different amount of IQ when bought and used but i want to be able to add all the books to the shop but then have only 5 show at a time, lets say book A, B, C, D, and E... But then every hour change around to say, Book F, H, A, Z, Y etc etc.... Any one?
  24. Re: [mccode v2] Slots How hard would it be to add a variable wager to the slots? What excatly would i need to change? What i mean is, my players want to be able to make there own choice on max bet just like the slotsmachine...
  25. Re: [V2] Robbery ok it is working now but when you commit a crime without any crew members, it says "Commiting The Robbery Error! You dont have any crew members, This isnt a one man job! Back Home Fail! The robbery doesnt go to plan all your crew members were shot down by S.W.A.T, only you managed to flee away!" I have looked at the code and can't see why it is coming up with the failed part?
×
×
  • Create New...