-
Posts
3,137 -
Joined
-
Last visited
-
Days Won
35
Content Type
Profiles
Forums
Events
Everything posted by Djkanna
-
Try this: <?php /** * MCCodes Version 2.0.5b * Copyright (C) 2005-2012 Dabomstew * All rights reserved. * * Redistribution of this code in any form is prohibited, except in * the specific cases set out in the MCCodes Customer License. * * This code license may be used to run one (1) game. * A game is defined as the set of users and other game database data, * so you are permitted to create alternative clients for your game. * * If you did not obtain this code from MCCodes.com, you are in all likelihood * using it illegally. Please contact MCCodes to discuss licensing options * in this case. * * File: inventory.php * Signature: 923658342519b486f3b2ebde8fa3d86f * Date: Fri, 20 Apr 12 08:50:30 +0000 */ require_once('globals.php'); //Add more here if required. $itemActions = array ( 6 => 'Eat', //Alter to suit. 7 => 'Drink', //Alter to suit. ); $q = $db->query( "SELECT `itmid`, `itmname` FROM `items` WHERE `itmid` IN({$ir['equip_primary']}, {$ir['equip_secondary']}, {$ir['equip_armor']})"); echo "<h3>Equipped Items</h3><hr />"; $equip = array(); while ($r = $db->fetch_row($q)) { $equip[$r['itmid']] = $r; } $db->free_result($q); echo "<table width='75%' cellspacing='1' class='table'> <tr> <th>Primary Weapon</th> <td>"; if (isset($equip[$ir['equip_primary']])) { print $equip[$ir['equip_primary']]['itmname'] . "</td><td><a href='unequip.php?type=equip_primary'>Unequip Item</a></td>"; } else { echo "None equipped.</td><td> </td>"; } echo "</tr> <tr> <th>Secondary Weapon</th> <td>"; if (isset($equip[$ir['equip_secondary']])) { print $equip[$ir['equip_secondary']]['itmname'] . "</td><td><a href='unequip.php?type=equip_secondary'>Unequip Item</a></td>"; } else { echo "None equipped.</td><td> </td>"; } echo "</tr> <tr> <th>Armor</th> <td>"; if (isset($equip[$ir['equip_armor']])) { print $equip[$ir['equip_armor']]['itmname'] . "</td><td><a href='unequip.php?type=equip_armor'>Unequip Item</a></td>"; } else { echo "None equipped.</td><td> </td>"; } echo "</tr> </table><hr /> <h3>Inventory</h3><hr />"; $inv = $db->query( "SELECT `inv_qty`, `itmsellprice`, `itmid`, `inv_id`, `effect1_on`, `effect2_on`, `effect3_on`, `itmname`, `weapon`, `armor`, `itmtypename`, itmtypeid FROM `inventory` AS `iv` INNER JOIN `items` AS `i` ON `iv`.`inv_itemid` = `i`.`itmid` INNER JOIN `itemtypes` AS `it` ON `i`.`itmtype` = `it`.`itmtypeid` WHERE `iv`.`inv_userid` = {$userid} ORDER BY `i`.`itmtype` ASC, `i`.`itmname` ASC"); if ($db->num_rows($inv) == 0) { echo "<b>You have no items!</b>"; } else { echo "<b>Your items are listed below.</b><br /> <table width=100% class=\"table\" border=\"0\" cellspacing=\"1\"> <tr> <td class=\"h\">Item</td> <td class=\"h\">Sell Value</td> <td class=\"h\">Total Sell Value</td> <td class=\"h\">Links</td> </tr>"; $lt = ""; while ($i = $db->fetch_row($inv)) { if ($lt != $i['itmtypename']) { $lt = $i['itmtypename']; echo "\n<tr> <td colspan='4'> <b>{$lt}</b> </td> </tr>"; } if ($i['weapon']) { $i['itmname'] = "<span style='color: red;'>*</span>" . $i['itmname']; } if ($i['armor']) { $i['itmname'] = "<span style='color: green;'>*</span>" . $i['itmname']; } echo "<tr> <td>{$i['itmname']}"; if ($i['inv_qty'] > 1) { echo " x{$i['inv_qty']}"; } echo "</td> <td>" . money_formatter($i['itmsellprice']) . "</td> <td>"; echo money_formatter($i['itmsellprice'] * $i['inv_qty']); echo "</td> <td> [<a href='iteminfo.php?ID={$i['itmid']}'>Info</a>] [<a href='itemsend.php?ID={$i['inv_id']}'>Send</a>] [<a href='itemsell.php?ID={$i['inv_id']}'>Sell</a>] [<a href='imadd.php?ID={$i['inv_id']}'>Add To Market</a>]"; if ($i['effect1_on'] || $i['effect2_on'] || $i['effect3_on']) { if ( array_key_exists ( $i['itmtypeid'], $itemActions ) ) { echo ' [<a href="itemuse.php?ID='.$i['inv_id'].'">'.$itemActions[$i['itmtypeid']].'</a>]'; } else { echo " [<a href='itemuse.php?ID={$i['inv_id']}'>Use</a>]"; } } if ($i['weapon'] > 0) { echo " [<a href='equip_weapon.php?ID={$i['inv_id']}'>Equip as Weapon</a>]"; } if ($i['armor'] > 0) { echo " [<a href='equip_armor.php?ID={$i['inv_id']}'>Equip as Armor</a>]"; } echo "</td> </tr>"; } echo "</table>"; $db->free_result($inv); echo "<small><b>NB:</b> Items with a small red </small><span style='color: red;'>*</span><small> next to their name can be used as weapons in combat.<br /> Items with a small green </small><span style='color: green;'>*</span><small> next to their name can be used as armor in combat.</small>"; } $h->endpage(); *Untested.
-
User Mentions and other new features.
Djkanna replied to Djkanna's topic in Feedback and Site Support
Should be used as suggested, yes I agree and thanks for that thread by the way. Will be used as suggested? doubt it. I could tag everyone in this post, I believe only time and patience are the things preventing me from doing it? Unless there is some limitations that I don't know about? This is the main concern I have for it, is there any precautions set against folks just tagging for no apparent reason, besides your guidelines. Also would removing a tagged post ( IE: soft delete, or self-deleted posts ) remove the notification of tag to a tagged user? -
This is very good point, the solution for us at the moment is to remove those specific posts as per request by the author. However the thing we have issue with is not really knowing who the author is. This is not an issue for the ones that are fairly recent, we usually can tell who it was that posted it. The older ones predating 2011 for example, I cannot remember that far back, I don't think many of us can. Guilty, especially of the first... no wait of both, guilty your honour. But I understand your point, at times I do find myself asking someone to stop being off-topic for example then go to the next post and do just what I asked someone not to do. This differs from person to person that moderates in some form, I do imagine we're all guilty of it though at least once or twice anyway, not to be cliche but we're only human. You've got nothing to worry about, you make valid points I doubt anyone will delete you ( if they do for this reason only then I vote get rid of them ). See ya pal. :(
-
As the original thread has been closed, despite it being a thread to voice our opinions on the feature. *Yes @ColdBlooded I am looking at you * Please voice your concerns and opinions on these new features, both good and bad. Just keep it friendly. ( hint: @The Coder ) - Spaces may be an issue? The tagging is interesting, but only time will tell if it provides valuable use to the forum as a whole. My only concern is spam tagging ^see my The Coder above^ The thanks,likes,dislikes I somewhat like it follows suit of many other community-style sites. New reputation features, I do like that now we have a way of seeing it without going through the mod/admin panels. Thanks CB for this.
-
Oh darn, now who am I going to get to change my user-title the next time I edit my profile. :(
-
I didn't specifically say MCCodes, there's always NWE, Panther, GL so on and so forth. But I do get your point, I hope you understand mine though. The last thing we need is another engine to do the exact same as every other engine, what would really be beneficial would be the existing ones to become solid all-round-good engines.
-
I'm going to say no. Unless you're releasing this engine to address a serious problem(s) with the other engines available. If not, then why instead of creating yet another engine focus your energy on improving the existing ones. That's my thoughts, I do wish you the best of luck however. :)
-
[php], [sql] tags are being removed when editing thread
Djkanna replied to john.'s topic in Feedback and Site Support
Are you sure they are being removed and it's not just because there is no reload when quick editing to update the JS syntax highlighter? -
For those way to lazy like me Looking good.:)
-
Dependent on the tasks the cron is required to do. Things like stat updating and such, sure. [get last run info] -> [calculate how many times it should have run between now and then] -> [alter values dependent on the value of the calculation] -> updates -> set new last run info. Things that explicitly need to run a set time, no. *Haven't tested "cron-less crons" *facepalm* in a live environment, so unable to comment in that respect.
-
It grabs what ever is in <p class="description"> and the p tag as per the regex. If you want the p tag as html, remove the htmlentities [be careful].
-
$url = 'http://www.reed.co.uk/jobs/'.$where.'?keywords='.$what; $curl = curl_init ( $url ); curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE); $page = curl_exec($curl); curl_close($curl); $regex = '/<p class="description">(.*?)<\/p>/s'; if ( preg_match_all ( $regex, $page, $matches ) ) { $matches = $matches[0]; // Want the <p> ? no? use $matches[1]; then. foreach ( $matches as $key => $val ) { echo 'Match('.$key.'): '.htmlentities ( $val, ENT_QUOTES, 'UTF-8' ).' <br />'; } }
-
It's okay if the information is useful. Whilst I don't agree one should sanitize globally let alone do before validating. If you really had to there's built in functionality that makes it easier to do the examples HazardBoy gave: array_walk array_map. The only issue, not every input has to be sanitized nor does every input have to be sanitized the same way. Seems just a waste to sanitize a stage marker or a similar input ( anyone seen: _GET['ajax] before? or _POST['submit'] or users.php?addUser ) ?
-
Depends on the person. Anyone on here then PM here or IRC. Skype, Facebook, Twitter, email, phone all have their uses too, dependent on the person wishing to contact me.
-
I'll just say best of luck with your game. :)
-
Where do you host your web game and how do you keep it fast?
Djkanna replied to john.'s topic in Game Projects
Extremely easy at this end too.:D -
Anything that shows your skills in the subjects you've specified in your first post, would be a good place to start. ;)
-
Thirded (???) Used it, broken it, fixed it, broken it some more. Useful for lazy folks like me. :P
-
Structure is fine; ( edit: Alignment is off, but the basic structure is a common, but pretty good one ) Colour scheme is rather bad, sorry but it is. Also with templates, you really do need to design for content you have no content which makes it a lot harder to judge. There is plenty of resources out there to teach you things about web design, colour theory and such. You could even grab a template off of Dribbble or something and deconstruct it, see how they've done what they've done. I find that to be a good way to learn about things you do not know. Either way best of luck, you'll only get better with time and as you said practice..
-
Indeed, finding a decent balance in games is a tricky thing. But at least you can always tweak your values after the game is live, so it's not like the ones you start with are set in stone... That's at least something. Best of luck. :)
-
Depends on the game really, sure if it's a mafia, war, so on and so forth then sure go for realistic items with realistic properties. If it's a fantasy game, then things get a little more interesting and you can play with unrealistic weapons with unrealistic properties and such. Not to say you cannot have unrealistic items in the other genres, but those tend to lean towards realism over fantasy. As for attack properties, you probably have to compromise a little, especially if there isn't some implementation of misfires and such like Angel mentioned. You've got to think ( using the ideas here ), which does more damage a chainsaw or a shotgun. Whilst a shotgun is easier to handle, a chainsaw could do more damage than a single shot of a shotgun. But a chainsaw requires the one that's handling it to be up close, a shotgun has a little more distance to it. However distance doesn't really apply, unless you want to factor that into the equation. Many factors apply to real-life situations, that don't really apply in the game ( unless it's implemented ). Categorising the weapons seems to help a little. Say having chainsaw and baseball bat in one category, then it's easy to see which would deal the most damage, whilst both can be lethal but a chainsaw would kill you with a little more ease. Categorising the weapons would in most cases allow you to only apply attack properties based on that of the weapons that are also in that category. So guns, would only need to factor in other guns. Melee would only need to factor in other melee items. The rest would depend on your implementation of attacking.
-
Depends on the project at hand, so MCC, NWE and Custom. Beyond downloading Panther, viewing a demo of GL and silently screaming at GRPG, I've not really used the other 3 options.
-
WebDesign @ Tuts+