Jump to content
MakeWebGames

Zero-Affect

Members
  • Posts

    3,713
  • Joined

  • Last visited

    Never

Everything posted by Zero-Affect

  1. <?php /*----------------------------------------------------- -- File: itembuy.php -- Edited by: CrimGame/ZeroAffect -- Released for: MakeWebGames.com -----------------------------------------------------*/ include_once (DIRNAME(__FILE__) . '/globals.php'); $_GET['ID'] = ( isset($_GET['ID']) && ctype_digit($_GET['ID']) ) ? $_GET['ID'] : '' ; $_POST['qty'] = ( isset($_POST['qty']) && ctype_digit($_POST['qty']) ) ? $_POST['qty'] : '' ; if( !$_GET['ID'] || !$_POST['qty'] ) { echo 'Invalid use of file'; } else if( $_POST['qty'] <= 0 ) { echo 'You have been added to the delete list for trying to cheat the game.'; } else { $q = $db->query("SELECT * FROM items WHERE itmid={$_GET['ID']}"); if ( $db->num_rows($q) == 0 ) { echo 'Invalid item ID'; } else { $itemd = $db->fetch_row($q); if ( $ir['money'] < ($itemd['itmbuyprice'] * $_POST['qty']) ) { echo 'You don\'t have enough money to buy '.$_POST['qty'].' '.$itemd['itmname'].'!'; die($h->endpage()); } if ( $itemd['itmbuyable'] == 0 ) { echo 'This item can\'t be bought!'; die($h->endpage()); } $grab_shop = $db->query('SELECT `shopID` FROM `shops` WHERE `shopLOCATION` = '.$ir['location']); while ($list_shop = $db->fetch_row($grab_shop)) { $shots .= $list_shop['shopID'].','; } $shots .= 0; $result_sID = explode(",", $shots); $grab_sITEM = $db->fetch_row($db->query('SELECT COUNT(`sitemID`) AS `sITEM_CNT` FROM `shopitems` WHERE `sitemSHOP` IN('.$shots.') AND `sitemITEMID` = '.$_GET['ID'])); if ( $grab_sITEM['sITEM_CNT'] == 0 ) { echo 'You can\'t buy items from other cities.'; die($h->endpage()); } $price = ($itemd['itmbuyprice'] * $_POST['qty']); item_add($userid, $_GET['ID'], $_POST['qty']); $db->query("UPDATE `users` SET `money` = `money` - $price WHERE `userid` = $userid"); $db->query("INSERT INTO `itembuylogs` VALUES ('', $userid, {$_GET['ID']}, $price, {$_POST['qty']}, unix_timestamp(), '{$ir['username']} bought {$_POST['qty']} {$itemd['itmname']}(s) for {$price}')"); echo 'You bought '.$_POST['qty'].' '.$itemd['itmname'].' '.(($_POST['qty'] > 1) ? 's' : '').' for '.money_formatter($price); } } $h->endpage(); ?>
  2. im 20 lol bit young i guess but 21 this year :D
  3. echo $set['game_marquee']; You could also use it like echo 'start[b]'.$set['game_marquee'].'[/b]end';
  4. Dave last time we spoke you told me you wasn't going to make anymore mods and you still haven't fixed that donation mod, Also you may wanna know that your website "iamwicked" doesn't allow users to login. I know this because i grew inpatient in waiting for you to fix the donation mod i went to go buy it and fix it myself. Seriously just fix the damn thing and hand it over instead of making other mods before hand because that shows bad support for your mods. All the best CrimGame...
  5. My original idea of a hospital and jail time related to MC ideology but im considering going with TimeStamp in another table later in time.
  6. Yeah sorry about that my bad, converting it is a bugger sometimes.
  7. Note lines 29, 30, 39 & 40 $h->endpage(); die; It does kill the rest of the code so yes it will not show the files you select, The placement of the header code depends on your layout really. It is quicker and really to be honest im surprised anyone on here can see past MC generic and include something like this. I use this on CrimGame but i use a different method of including it so like i said untested on MC so if someone could i'd appreciate it.
  8. Nein
  9. I think i can do that old fashioned horror movie tune on a piano :D lol i rock!
  10. My edited version for you lot to take a look at header.php - Replace: if($ir['hospital']) { print "[b]NB:[/b] You are currently in hospital for {$ir['hospital']} minutes. "; } if($ir['jail']) { print "[b]NB:[/b] You are currently in jail for {$ir['jail']} minutes. "; } With: #Notification Function (Start) $file_name = basename($_SERVER['SCRIPT_FILENAME']); $grab_caution_files = $db->query("SELECT `page` FROM `notification_alert` WHERE `page` = '$file_name'"); /* # You could use a array and dismiss the MySQL idea as following $grab_cation_files = array( 'index.php', 'explore.php' ); # I added another comment below please read it */ if ( $ir['jail'] AND $ir['hospital'] ) { $caution_type = 'jailANDhospital'; } elseif ( $ir['jail'] OR $ir['hospital'] ) { $caution_type = 'jailORhospital'; } if ( !empty($caution_type) AND $db->num_rows($grab_caution_files) != 0 ) { # change above "$db->num_rows($grab_caution_files) != 0" to "count($grab_caution_files)" if ( $caution_type == 'jailORhospital' ) { $check_caution_var = ( $ir['jail'] ) ? $ir['jail'] : $ir['hospital'] ; $caution_var_mins = ( $check_caution_var > 1 ) ? 's' : '' ; $caution_type_check = ( $ir['jail'] ) ? 'prison' : 'the medical centre' ; echo ' You are in '.$caution_type_check.' for '.$check_caution_var.' minute'.$caution_var_mins.'. > Go [url="index.php"]home[/url]. '; $h->endpage(); die; } elseif ( $caution_type == 'jailANDhospital' ) { $jail_mins = ( $ir['jail'] > 1 ) ? 's' : '' ; $hospital_mins = ( $ir['hospital'] > 1 ) ? 's' : '' ; echo ' You are in prison for '.$ir['jail'].' minute'.$jail_mins.' and the medical centre for '.$ir['hospital'].' minute'.$hospital_mins.'. > Go [url="index.php"]home[/url]. '; $h->endpage(); die; } } # Notification Function (End) The follow MySQL code would not be needed if you choose to use the array option. [mysql] CREATE TABLE IF NOT EXISTS `notification_alert` ( `page` varchar(100) NOT NULL, PRIMARY KEY (`page`) ); [/mysql] If you can't install this then you don't deserve to use it. Note to users: This has NOT been tested on MCv2 it's a conversion of a CimGame addon so i cannot guarantee it will work 100% and im sure the code could do with a little editing and maybe could be smaller.
  11. http://www.crimgame.com http://crimgame.com/signin.php crimgame.com/signin.php http:// www. crimgame com signin.php
  12. FFS get your own ideas lol and it only really works for me since im like the top poster...
  13. Oh god they talking about my site im sure i heard crimgame in that convo!
  14. Unique story and features makes the game a whole lot more interesting, i personally like Text based games so i must disagree with you there Alain.
  15. Wow sounds good mate will have to look over the demo again later when your fully done.
  16. Well mate we can still have chats about ideas on MSN and yeah i know what you mean by noticing your fragile i went to hospital afew months back i thought i was having a heart attack and im only 20 so... Lol it was nothing to do with my heart so ... weird they said it was caffeine so now i don't drink coffee or copious amounts of redbull. So now i actually sleep normal hours and feel good. Amazing how old i am and i thought i was having a heart attack lol
  17. why are you spelling it like iTEAM? it's item...
  18. For me when i play a game (seldom event) i want it to be secure because i personally have a curious nature and finding bugs is my job so if the game ain't secure there's no point me playing it. [mp]118[/mp]:P
  19. Bit knackered atm but thought this may help $_GET['amt'] = ( isset($_GET['amt']) AND in_array($_GET['amt'], array(10,15,25,50,100)) ) ? $_GET['amt'] : 10 ; echo ' [url="usersonline.php?amt=10"][/url] | [url="usersonline.php?amt=15"][/url] | [url="usersonline.php?amt=25"][/url] | [url="usersonline.php?amt=50"][/url] | [url="usersonline.php?amt=100"][/url] <font size="4" face="Arial, Helvetica, sans-serif">Users Online</font> <hr color="black" width="75%"> '; $query = mysql_query("SELECT `userid`,`username`,`laston`,`gender` FROM `users` WHERE `laston` > unix_timestamp()-30*60 ORDER BY `laston` DESC LIMIT {$_GET['amt']}");
  20. Hey illegalife i know this may sound a little anti social but have you ever considered conventional colours? black+red white+black and so forth. The colours you use really put me off i don't know if the customers choose them but i seem to think they look... idk weird.
  21. Care to elaborate on the issues, if your having security issues you may want to look over the following market place post. [mp]118[/mp]
  22. using in clause with list would considerably shorten the amount of queries right?
  23. In 25 years time re-Evolution will have taken place and every human will be rather hooked into a computer or on one :) The word Borg springs to mind (no im not a Trek fan but my father is and come on seven of nine was well fit).
  24. Really now when someone says to me "short cliff" i think height because who in their right mind would call a cliff short... it's a cliff so it can't be length wise im sure there is a issue there because your would be talking about a ledge not a cliff :-s something like that. So when you say short cliff im sure 98% of people will think your speaking about height. So in final put the ruler away... and get back on Topic (go spam your forum).
×
×
  • Create New...