newttster
Members-
Posts
514 -
Joined
-
Last visited
-
Days Won
14
Content Type
Profiles
Forums
Events
Everything posted by newttster
-
I am not sure how to test this. Which would be faster? This one. $t=$db->query("SELECT agility FROM userstats WHERE userid={['$ir['userid']}"); $r=$db->fetch_row($t); Or this one. $t=($db->fetch_row($db->query("SELECT agility FROM userstats WHERE userid={$ir['userid']}"))); It seems to me that the second one would be faster but I'm not sure. Or is it just a case of keeping the code shorter?
-
Simple banking System with Loans & Investmenst!
newttster replied to Razor42's topic in Free Modifications
Very nice job, Razor. Some of the things that I have added to my loan system for my future game is penalties for having defaulted on the loan. If they default on the loan repayment ... I get a message saying so ... then they are added to the "not allowed to borrow again" list. The money is then recouped from thier existing bank accounts. If there is no money to be had there ... then their balance is taken from whatever inventory they have ... this does not include donar items for obvious reasons. If there is none to be had from the inventory sale .. then whatever they earn via game routes .. it is confiscated automatically until the money is regained. While they are in default ... interest is added. -
Regardless of whether or not they are helpful comments or not ... they have valid points. Though creating the items, city names etc takes some time and creative thinking ... this is what makes whatever game you are planning on making unique. Copying someone elses tables is as you said ... very lazy ... and pointless.
-
http://nicolashoening.de/?twocents&nr=8
-
Like this? <td><a href='smslavehire.php?action=hired&&ID={$_GET}'> Hire </a></td></tr>"; OR <td><a href='smslavehire.php?action=hired&&ID=slaveid'> Hire </a></td></tr>";
-
Okay ... I am making a mod that is fairly involved that will be using a number of tables. So far all is going well ... except for the latest part that I am working on. For the life of me ... I can't get the $_GET to work in one portion of my code. I am actually having two problems with this. But for now .. I need the $_GET to work first ... then maybe the second problem will be taken care of that way. Before anyone asks .. I have the query echoing to the page so I know for a fact that the $_GET is not picking anything up. Okay ... so my table has these fields and they are input on a previoius step and works fine. slaveid int (11) which is key and incremental userid int (11) which is the standard pull from the users table slavename varchar (50) input on previous step jobstodo varchar (255) input on previous step tofill int(11) adds one on input from previous step slavepword varchar(50) input on previous step Here is the code ... maybe someone can find what I am missing.If you need me to clarify something, let me know. <?PHP include "globals.php"; switch($_GET['action']) { case "hired": hired();break; default: hiring(); break; } function hiring()// lists all the slaves { global $db, $ir, $c, $h, $userid; $q=$db->query("SELECT * FROM slavemarket ORDER BY jobstodo"); echo'<h1><u>Hire a Slave</u></h1> Click on the hire link beside the slave you wish to hire.<br /><br />'; echo "<br /><table width=75% cellspacing=1 class='table'> <table cellspacing=1 class='table' table border=\"1\"bordercolor=\"red\"> <tr style='background:gray;'> <th>Slave ID</th> <th>Slave Name</th> <th>Position</th> <th>Hire</th> </tr>"; while($r=$db->fetch_row($q)) { echo "<tr> <td align=left>{$r['slaveid']}</td> <td align=left> {$r['slavename']} </td> <td> {$r['jobstodo']} </td> <td><a href='smslavehire.php?action=hired'> Hire </a></td></tr>"; } echo "</table><br /><br />"; echo'Changed your mind?<br /><br /> <a href="slavemarket.php">Slave Market</a><br /> <a href="explore.php">Back to town</a>'; } function hired() // when clicking the link "hire" it adds the new info into 2nd table with the added info of the one hiring { global $db, $ir, $c, $h, $userid; $_GET['ID'] = (isset($_GET['ID']) && !empty($_GET['ID']) && is_numeric($_GET['ID'])); $inq=$db->query("SELECT * FROM slavemarket WHERE slaveid= '{$_GET['ID']}'"); $m=$db->fetch_row($inq); $mslaveid=$m['slaveid']; $muserid=$m['userid']; $mslavename=$m['slavename']; $mjobstodo=$m['jobstodo']; $mslavepword=$m['slavepword']; echo"Your listing is {$mslaveid},{$muserid},{$mslavename},{$mjobstodo},{$mslavepword}<br />"; if ($ir['userid']==$m['userid']) { echo'You can\'t hire yourself.<br /><br /> <a href="slavemarket.php">Slave Market</a><br /> <a href="explore.php">Back to town</a>'; $h->endpage(); exit; } else { $db->query("INSERT INTO slavemarket2 VALUES (NULL, '{$ir['userid']}','{$ir['username']}','{$mslaveid}','{$muserid}','{$mslavename}', '{$mjobstodo}','{$mslavepword}')"); event_add($m['userid'], "You have been hired by ".$ir['username'].". Your password to access the Tool Shed is {$mslavepword}",$c); echo"You have hired {$mslavename}.<br /> You now have to go to the tool shed to deposit the tools<br /> necessary for your slave to their job.<br /> You only have to do this for the first time.<br /> After that, the tools are put into the shed at reset.<br /><br /> <a href='smtoolshed.php'>Tool Shed</a><br /> <a href='slavemarket.php'>Slave Market</a><br /> <a href='explore.php'>Back to town</a>"; $db->query("DELETE FROM slavemarket WHERE slaveid=$mslaveid"); } } $h->endpage(); ?>
-
Thanks, Peter. Dominion ... it really makes you wonder of the history of them doing this, just how many companies have been forced into this position. It would be even more interesting to find out how many of those same businesses have filed for bankruptcy or shut down their businesses because of it. Sure makes you wonder how the various governmental bodies of the associated cities justifies this to their voters. Granted the Olympics potentially brings in a huge income during that time. But ... the same city also lays out a huge amount to host them as well. It seems to me that having a local entrepeneur in business for x number of years should garner some loyalty from the local politicians rather than giving them a kick in the ass and saying "oh well ... them's the breaks".
-
What part about them being in business for 30 years prior to the Olympics coming to Vancouver did you not get? For over 30 years they operated under that name. The Olympics comes to town and you think it is okay for them to dictate to legitimate business owners what they have to do ... not too mention that these business owners have to accomodate this out of their own pockets. You think that this is in any way fair or just?
-
I like the graphics that you have used. The muted tones make it easier on the eyes if someone were to be on for an extended period of time. If this is your first attempt ... I think it is rather a good one. I have seen better and I have also seen much worse as well. Kudos.
-
I have to say that I admire the athletes that have achieved thier status ... their hard work finally paying off for them and all that. That having been said though ... I don't care for the Olympics at all anymore. When they held them in Vancouver ... a couple I have known for over 30 years owned a pizza parlour with the name of Olympic Pizza. The governing board for the Olympics made it very clear to City Hall in Vancouver that any businesses carrying the name Olympic were to have their name changed as it was an infringement on the Olymic copywrite laws. If they did not they would be sued for being in violation of this. They were told that once the Olympics were done they could go back to carrying the name. It cost them close to 50k to meet these "new rules" and as a result are now struggling to just keep the business going. They did inquire what their options were legally and they were told that this has happened before and that the petitioners always lose, ending up paying a hell of a lot more in the end. So no ... I don't care for the Olympics anymore.
-
Spudinski, you were asking for a test array to show how this would work. How about a function(s) that first shows the most popular day of the week players are on your game, then break it down further that would show the most popular time frame of that day. It should potentially return say something like Sunday between 3pm and 6pm. Is that something that arrays could do? I realize that this is probably going back to using the timestamp again but it could be a very useful function for a game owner to have for creating activities that could take place during that time or to have activities during the deadest time to promote activity.
-
I wouldn't even know how to do a benchmark test. And did I understand correctly how they work?
-
This one always gets me ... I'm trying to understand how this works. In your example ... only numbers and letters would match or it would return false. If it is true then it is placed into the variable $X. So if I typed in daviD3, it's true then $X=daviD3. But if I typed in daviD_3, it's false because an underscore was not part of the matching criteria therefore you would get an error message because of this and $X would not contain anything. Am I understanding how this works ... or is that wrong?
-
If I read the documentation on this correctly ... X is a decimal in a table field and it's value is 5.00 Y is an int in a table field and it's value is 5 X==y returns true X===y returns false but if both X and Y where decimal and you used === it would then return true. Is that how these two work? And which would be faster to use?
-
:D Great. Another thing added to the "add to game " list. Thanks, guys! Great Job, Sniko and all others who have created something like this. Unique idea that I'm sure players will love.
-
Ain't it just? ;)
-
Okay ... I feel like a real idiot now. :( See this; $theirhitratio=max(10,min(20*(($them['speed']/$me['agility'])),95)); then this; if(rand(1,100)<=$themhitratio) <- Wrong!!! Should be this; if(rand(1,100)<=$theirhitratio) My apologies to everyone for the waste of time.
-
Good luck.
-
Then send an email to them asking them to send you your login information at your new email account.
-
Log onto Mccodes.com and check to make sure that the URL you have matches the one that they have on file.
-
Are you still using the same URL? If the URL you are using today is different than what they have on file it will say that it is invalid.
-
Maybe try changing ID to staffaps ID. Perhaps there is a conflict with the field name ID??? Have you set an increment for the ID? Or a key?
-
It's something that was in the original McCodes attack file. I can hear you screaming from here. *laughs* It does make sense though, even the best will occasionally miss. If the players were closely matched ... you would need the random in there in order for them to fair odds. In that case, I think it would depend on who started the fight to determine the winner though. As for the $wait it doesn't echo out anything. If I understand correctly though ... it is needed in just that way in order for it to step through the fight correctly.
-
The rand for the hitration? If that's the one you mean ... it shouldn't matter what the rand is because for them they have 5 chances of missing where as I have 90 chances of missing. As for the $wait. I'll run a test by removing it to see if it make a change. Thanks for the suggestion. I'll let you know what happens with the $wait removed.
-
Yuppers definately a separate column for each stat. If you look at the first screen shot you will see that their hitratio for them is 95 and mine is 10.