Jump to content

Porl123

Members
  • Posts

    239
  • Joined

  • Last visited

Everything posted by Porl123

  1. I've created a topic before about making this game in php and mysql, which would be on a -250x250 grid but would only display 11x11, displaying your character in the center/middle of the table and being able to click the surrounding squares to change coordinates. I thought I'd realized how to make one of these map explore games but I've really got no ideas for some bits, so if anyone has any general hints or any tutorials for learning how to make something like this it would be greatly appreciated. Thanks in advance people
  2. Nobody have any ideas?
  3. I've tried making a random decimal number with $rand = rand(0.1,0.5); but it just returns the 0. Is there something I'm missing or is it a different function I need? Much thanks in advance
  4. Ah thanks man, that's work
  5. I have a variable that contains a random number $rand = rand(0.1,0.3); and I try to update my record in my database UPDATE table SET field = field + $rand the data type in for this row is decimal, but for some reason when it goes through, the number rounds itself. I've never really used decimals much before so it's might be obvious where I'm going wrong, but I don't want it to round off. Can anyone tell me what's wrong? Much thanks
  6. Ah that's got it working fine now thanks guys for your help
  7. Woops, sorry forgot that function whole_int($var) { $var = (int)$var; if($var >= 1 && is_numeric($var)) { $tmp = explode('.', $var); $var = (is_array($tmp)) ? $tmp[0] : $var; } else { $var = 0; } return $var; }
  8. I've been making this function which checks if the value isn't a decimal, which works. Then I've put is_numeric in there and checked that the value is >= 1 because all I want the user to enter is a whole, numeric, positive number. But for some reason it still allows the user to enter values with a minus on the end e.g. 010000000000000- I'm not really sure at all why it allows them to do that. If someone could help me out with what I'm missing it would be greatly appreciated. Thanks
  9. I'm trying to make a mini-game using php and mysql, which would be an 11 by 11 grid having the player bang in the center. One where you can click on the other surrounding squares to move your character's coordinates. I've seen this done on other websites but can't think for the life of me how I'd go about creating it. ??? I don't expect to be told personally how it's done because I know that's way too much work, but any of you guys know where I can read up on it? Links would be much appreciated thanks
  10. Thanks man! works completely
  11. Are there any functions that can verify an image link to make sure it's the right format? Thanks in advance
  12. I have a member's table with username, password, age, pet and DOB in and I'm trying to find the most popular pet. So I was wondering how I'd go about doing that. Any thoughts? Thanks for your help
  13. That's working but for some reason anything below 256 sets off the error message too :[
  14. I've been making this roulette page in php for the last day or so and everything's fine except this one error message that isn't showing up. I have the outcome to the wheel, betting on red/black, odd/even all put into the arrays $bet[] and $won[] and I've used array_sum to get them afterwards. I've tried to make sure they're using whole numbers by putting in if(!round(array_sum($bet))) { echo "Invalid bet"; } I was hoping that would just work on its own, but you can still place bets containing decimal places if there's at least one box filled with a whole number. Anyone have any ideas? I'd be really grateful :] thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.