Renkia Posted May 15, 2010 Share Posted May 15, 2010 Morning MWG/MCC Forum: Now, since I have found out 'Pokemon' is programmed in C, I am just waiting for a friend on a forum to reply & help me for some starters. (http://www.cplusplus.com/forum/) In the mean time while I am waiting. I Would just like to know some information on a modification& what it does/whatdoesthisemans/whyisthatfaster? Etc. Code by SHAD / Click >> Here << for the link print' Throw a grenade '; $query=mysql_query("SELECT `inv_itemid` FROM `inventory` where `inv_itemid` = $gid && `inv_userid` = $userid");$i=mysql_fetch_array($query); // How is this including the performance? if(!$i['inv_itemid'] == $gid) // What does (!$i) mean?{print "Invalid Item";exit;} if(!isset($_POST['ID'])) {print "User id: "; } else { $_POST['ID'] = abs(floatval($_POST['ID'])); // Does (abs) mean absent? :P $maxMembs = $db->fetch_row($db->query("SELECT COUNT(`userid`) AS `u` FROM `users`")); if($_POST['ID'] > $maxMembs['u']) // What's the (['u']) for?{echo "Invalid user!";$h->endpage();}$ht = mt_rand($mintime,$maxtime);mysql_query("UPDATE `users` SET `hp` = 1, `will` = 0, `hospital` = {$hosptime}, `hospreason` = 'Bombed by {$ir['username']}' WHERE `userid` = {$_POST['ID']}"); event_add($_POST['ID'],"{$ir['username']} [{$ir['userid']}] threw a grenade at you, causing some severe effects. ",$c); // What's ($c) mean? Config? item_remove($userid, $gid, 1);print" You have successfully threw your grenade .";}$h->endpage();?> Sorry about the code. I Sorted it out 4 times, but It won't code up neatly. :S Quote Link to comment Share on other sites More sharing options...
Djkanna Posted May 15, 2010 Share Posted May 15, 2010 $i = mysql_fetch_array($query) returns as an array, http://www.php.net/array abs() = absolute http://www.php.net/abs $c = the connection identifier http://php.net/manual/en/function.mysql-connect.php If I missed anything sorry I don't function well at 2:30am :O Quote Link to comment Share on other sites More sharing options...
Renkia Posted May 15, 2010 Author Share Posted May 15, 2010 Cheers, Djkanna. You missed something out, but not everyone is a coffee chonga. :D And I'm surprised you didn't give me links to Wikipedia. Lol Quote Link to comment Share on other sites More sharing options...
Djkanna Posted May 15, 2010 Share Posted May 15, 2010 :D sorry I just gave the code a quick scan :O Um.. Wikipedia is usefull but PHP's manual is more usefull when it comes to PHP :O Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.