
aburdet
Members-
Posts
15 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by aburdet
-
Ok, the main problem I'm having so far is a compatibility issue with FF. FireFox tends to show a fade out and fade in transition upon reloading the data, while Internet Explorer does not. This isn't such an issue if you set the interval to 60000 or so, but that seems too slow to me for my intentions. The odd thing is, it only does that SOMETIMES. [align=center]Energy: 75% (9/12) [/align] If I set the entire above example as the portion to be updated, the entire thing flickers/fades/whatever you want to call it every 5 seconds (or whatever your interval is set to). But if I only set the numbers (9/12, or the percent value), then it doesn't show any fade during transition. This code works fine: function energy() { global $db, $ir, $userid; $enperc = (int) ($ir['energy']/$ir['maxenergy']*100); echo "<span>$enperc% ({$ir['energy']}/{$ir['maxenergy']})</span>"; } This makes the entire thing flicker: function energy() { global $db, $ir, $userid; $enperc = (int) ($ir['energy']/$ir['maxenergy']*100); $enopp = (int) 100-$enperc; echo "<span>$enperc% ({$ir['energy']}/{$ir['maxenergy']}) <img src={$ir['barperc']} width=$enperc height=10>"; if($enperc<100) { echo "<img src={$ir['baropp']} width=$enopp height=10></span>"; }
-
I actually have a variable for the image source since users can customize the bars, so mine is somewhat of a different scenario. I'll play around with it a bit and see if I can come up with a solution that may work for everyone. I can almost guarantee you it won't be the prettiest looking code if I do get around to it though.
-
Very well done, indeed =) I used this on my site and all works great, but I went one step further and tried using it for the status bars (Energy, Brave, Will, etc.) and I can't seem to figure out how to update the variable for the bars width, I can only get it to update the echoed text. If it says "Energy: 12/12 (100%)", I can get those numbers to change just fine, but I obviously can't put <span id='energy'>$energy_variable</span> as the width attribute for the image... Sorry for the rambling, I'm trying to type while keeping my two year old from putting in his two cents and slamming on the keyboard lol.
-
congrats. I'm sure you got that all the way down. lets add up the points. there are 4 questions. the first question gets a 1 for good question. the second question gets a .5 for half and half the third question gets a -1 for worst question. the last question of course gets a 1 for I don't know what. so that is basically 1.5/4 so out of all that, you get a rating of 37.5% no offense though since I know your curious. but don't ask the question. it makes it so personal like asking a person for all their personal information. Wow, Gambino... Really?? I can see wasting 30 seconds of your time to rant about what you think is a terribly stupid post (as I am doing right now)... but that must've taken you several minutes! Have you got no life?? ...pathetic.... I'd give you -10 points, but I just feel too sorry for you....
-
There's a VERY good chance I'm wrong here since I'm just STARTING to learn.... BUT.... Shouldn't $itmpic = "[img=itmpics/".$r[]};
-
I am far too tired to fully describe this as I've been up for nearly two days trying to get my tiny n00b brain to figure this out lol but I'll try anyway... I want to do away with the "Staff Room " link in yourgang.php and instead have all the Staff Room sub-links combined on yourgang.php. It would be three columns (the left being the standard links that everyone can see, and the center and right columns being grayed out for any members who do not have the appropriate permissions. Also, I want an "Assign Permissions" link that only the President can see. Each member of the gang would be able to view whichever pages the President decides. To my knowledge (being a noob), I can only imagine doing this via several new tables in my databse (one for each permission). If anyone feels they can do this, either PM me or get me on yahoo messenger at [email protected] Thanks
-
I didn't even notice that....and it worked fine on my V2 without changing it. Is that normal?? lol
-
Worked like a charm, thanks! It only required one tiny little fix that I only point out in case other n00bs have the same issue.... It needs ; after $qty2=mysql_fetch_array($qty) Here's the correct version, to save from others posting repeat questions: $qty=$db->query("SELECT * FROM inventory WHERE inv_userid=$userid and inv_id={$_GET['ID']}"); $qty2=mysql_fetch_array($qty); if($_GET['qty']>$qty2['inv_qty']) { die ("You are trying to add more items to the market than you have."); }
-
I'm trying to make it so users cannot exploit the system and add more items to the market than they actually have. I put this at the top of the page but it only works on some items. $qty=$db->query("SELECT inv_qty FROM inventory WHERE inv_userid=$userid and inv_id={$_GET['ID']}"); if($_GET['qty']>$qty) { die ("You are trying to add more items to the market than you have."); } Other times, it will work when it shouldn't (when you actually DO have that many items). Can anyone please tell this n00b what I'm doing wrong? ?(
-
Haven't been on to check MWG in a while, but I gave up on it. Like previously said, the train button already populates your max energy for you, so there's no real point.
-
I'm trying to add a "Train to Exhaustion" button in addition to the already existing "Train" button. I'm sure the name speaks for itself, but just to clarify, it would be a button that would use all of a players available energy to train whatever stat is selected. My question is: Do I run both submit buttons ("Train" and "Train to Exhaustion") in the same form since they both run off the same drop-down menu used to select a stat? Or am I going about this entirely wrong? Here is the code so far. Sorry, it's a bit messy, but that's mccodes for you. <?php include "globals.php"; check_level(); $fm=money_formatter($ir['money']); $ts=$ir['strength']+$ir['agility']+$ir['guard']+$ir['labour']+$ir['IQ']+$ir['combat']+$ir['marksmanship']; $ir['strank']=get_rank($ir['strength'],'strength'); $ir['agirank']=get_rank($ir['agility'],'agility'); $ir['guarank']=get_rank($ir['guard'],'guard'); $ir['labrank']=get_rank($ir['labour'],'labour'); $ir['IQrank']=get_rank($ir['IQ'],'IQ'); $ir['comrank']=get_rank($ir['combat'],'combat'); $ir['marrank']=get_rank($ir['marksmanship'],'marksmanship'); $tsrank=get_rank($ts,'strength+agility+guard+labour+IQ+combat+marksmanship'); $ir['strength']=number_format($ir['strength']); $ir['agility']=number_format($ir['agility']); $ir['guard']=number_format($ir['guard']); $ir['labour']=number_format($ir['labour']); $ir['IQ']=number_format($ir['IQ']); $ir['combat']=number_format($ir['combat']); $ir['marksmanship']=number_format($ir['marksmanship']); $ts=number_format($ts); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $out=""; $_GET['times']= abs((int) $_GET['times']); if(isset($_GET['train'])) { if($_GET['train'] != "strength" && $_GET['train'] != "agility" && $_GET['train'] != "guard" && $_GET['train'] != "labour" && $_GET['train'] != "combat" && $_GET['train'] != "marksmanship") { die("Abusers aren't allowed."); } $tgain=0; for($i=1;$i<=$_GET['times'] && $ir['energy'] > 0;$i++) { if ($ir['energy'] > 0) { $gain=rand(1,3)/rand(800,1000)*rand(800,1000)*(($ir['will']+20)/150); $tgain+=$gain; if ($_GET['train']=="IQ") { $gain/=100; } $ir[$_GET['train']]+=$gain; $egain = $gain/20; $ts=$ir[$_GET['train']]; $st=$_GET['train']; $db->query("UPDATE userstats SET $st=$st+".$gain." WHERE userid=$userid",$c) or die("UPDATE userstats SET $st=$st+$gain,energy=energy-1,exp=exp+$egain WHERE userid=$userid ".mysql_error()); $wu=(int) (rand(1,3)); if ($ir['will'] >= $wu) { $ir['will']-=$wu; $db->query("UPDATE users SET energy=energy-1,exp=exp+$egain,will=will-$wu WHERE userid=$userid",$c); } else { $ir['will']=0; $db->query("UPDATE users SET energy=energy-1,exp=exp+$egain,will=0 WHERE userid=$userid",$c); } $ir['energy']-=1; $ir['exp']+=$egain; } else { $out="You do not have enough energy to train."; } } $stat=$ir[$st]; $i--; $out="<h1>Gym</h1><hr width=50%><div> You begin training your $st. <font color=green>You have gained [b]$tgain $st[/b] by training it $i times.</font> You now have [b]$stat $st[/b] and [b]{$ir['energy']}[/b] energy left. "; } else { $out="<h3>Gym</h3><hr width=50%><div> "; } print $out; print "Enter the times you wish to train the stat you select You can train {$ir['energy']} times with the energy you have. <form method='get' action=gym.php> <table border=0><tr> <td align=center>Times</td> <td align=center>Stat</td> </tr><tr> <td align=left><input type='text' size='5' name='times' value='{$ir['energy']}' maxlength='2'></td> <td align=left><select type='dropdown' name='train'> <option value='strength'>Strength</option> <option value='agility'>Agility</option> <option value='labour'>Labour</option> <option value='guard'>Guard</option> <option value='combat'>Combat</option> <option value='marksmanship'>Marksmanship</option> </select></td> </tr><tr> <td align=center><input type=submit value='Train'></form></td> </tr></table><hr width=50%><h3>Your Current Stats:</h3><hr width=50%> <table width=50%> <tr align=left> <td>[b]Strength:[/b] {$ir['strength']} [Ranked: {$ir['strank']}]</td> <td>[b]Agility:[/b] {$ir['agility']} [Ranked: {$ir['agirank']}]</td> </tr> <tr align=left> <td>[b]Combat:[/b] {$ir['combat']} [Ranked: {$ir['comrank']}]</td> <td>[b]Marksmanship:[/b] {$ir['marksmanship']} [Ranked: {$ir['marrank']}]</td> </tr> <tr align=left> <td>[b]Guard:[/b] {$ir['guard']} [Ranked: {$ir['guarank']}]</td> <td>[b]Labour:[/b] {$ir['labour']} [Ranked: {$ir['labrank']}]</td> </tr> <tr align=left> <td>[b]IQ: [/b] {$ir['IQ']} [Ranked: {$ir['IQrank']}]</td> <td>[b]Total stats:[/b] {$ts} [Ranked: $tsrank]</td> </tr> </table>"; $h->endpage(); ?>
-
It started out as a game mod request though...
-
I'm making my very first game and I don't know much PHP just yet. I'm sure the things I'm looking to have done are fairly simple, but I would rather pay someone who knows what their doing so I can get the game up and running ASAP. If you are interested, please email me [email protected] or IM me on Yahoo (sn: whisperedechoes9). I would much prefer Yahoo, but email will work if you are responsive (I can't keep waiting several days to hear back from someone on each mail sent). Thanks :)