Jump to content

R1der

Members
  • Posts

    104
  • Joined

  • Last visited

    Never

Everything posted by R1der

  1. Thakns for the replys. huggie i get this error when trying your code Parse error: syntax error, unexpected ';' in /blah/blah/blah/petshop.php on line 34
  2. for some reason my code dont seem to be inserting into the database. [code]mysql_query("INSERT INTO pets_owned VALUES('', $userid, $pet, 1, 1, 1)", $c);[/code] Can you spot a problem with this? Thanks
  3. that worked great thanks for all your help
  4. thx for that. ok i have found out this is what is causing the error $r['username'] can you understand why?
  5. Hmm How can i fix that then? Not that it really matters i am still stuck with this error lol
  6. yes  1 - 10 is the fail message 11 - 20 is the succsed message and i dont see no point in changing the "if" statemts till i fix this error
  7. This is more of the code [code=php:0] <?PHP $rand = rand(1,10);   if($rand==1 || $rand==2 || $rand==3 || $rand==4 || $rand==5 || $rand==6 || $rand==7 || $rand==8 || $rand==9 || $rand==10){   echo "You cross the wires in the bomb as you are putting it together it explodes and sprays anthrax in your face and landing you in hospital for 400 minutes and taking 300 exp from you.";     mysql_query("update users set exp=exp-300 , hospital=hospital+400 , hospreason=\"Sprayed with anthrax while doing a mailbomb\" where userid=$userid",$c); } $rand = rand(11,20);   if($rand==11 || $rand==12 || $rand==13 || $rand==14 || $rand==15 || $rand==16 || $rand==17 || $rand==18 || $rand==19 || $rand==20){   echo "You Go and buy a bomb and some anthrax You send it to $r['username'] through the maill thay open the package and the bomb explodes spraying anthrax in there face and landing them in hospital for 400 minutes and earning you 650 exp.";     mysql_query("update users set exp=exp+650 , money=money-15000 where userid=$userid",$c);   mysql_query("UPDATE users SET hospreason=\"Sprayed with anthrax from $ir['username'] WHERE userid={$in}", $c);   event_add($in, "<a href='viewuser.php?u=$userid'>{$ir['username']}</a> Sent you a mailbomb in the mail spraying anthrax in your face you are in hospital!", $c); } ?>[/code]
  8. ok i tried my best to fix this my self and then found my self here asked for help lol i get this error Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/lostcity/public_html/mailbomb.php on line 41 [code]<?PHP $rand = rand(11,20);    if($rand==11 || $rand==12 || $rand==13 || $rand==14 || $rand==15 || $rand==16 || $rand==17 || $rand==18 || $rand==19 || $rand==20){    echo "You Go and buy a bomb and some anthrax You send it to $r['username'] through the maill thay open the package and the bomb explodes spraying anthrax in there face and landing them in hospital for 400 minutes and earning you 650 exp."; // this is line 41        mysql_query("update users set exp=exp+650 , money=money-15000 where userid=$userid",$c);    mysql_query("UPDATE users SET hospreason=\"Sprayed with anthrax from $ir['username'] WHERE userid={$in}", $c);    event_add($in, "<a href='viewuser.php?u=$userid'>{$ir['username']}</a> Sent you a mailbomb in the mail spraying anthrax in your face you are in hospital!", $c); } ?>[/code] [code]echo "You Go and buy a bomb and some anthrax You send it to $r['username'] through the maill thay open the package and the bomb explodes spraying anthrax in there face and landing them in hospital for 400 minutes and earning you 650 exp."; // this is line 41[/code] can anyone spot the problem? thanks for your time
  9. [quote]In this case you need 3 functions. The first being the combat system The second for the money. (How much does the winner get?) The third being exp. [/quote] i have a row for money/exp the amount of money/exp will be determined by what level there enemy was [quote author=Perad link=topic=113340.msg460524#msg460524 date=1162305088] In this case you need 3 functions. The first being the combat system The second for the money. (How much does the winner get?) The third being exp. As for your problem, do they fight to the death or attack a set amount of times? [/quote] Thay fight till one of em has "0" hp left i know this attack system is not going to be a easy task. i just hope i can manage it :s
  10. this is the main part i dont understand in the attack system [quote]Once you have these values you then need to make a formula. How do these stats relate to the battle? Create a formula, it might be something like (($strength+$hp)*$speed)) work out what it is exactly the make it.[/quote] as you can guess strength makes the user attack for more damage - where as speed makes the user atatck more times in a row. i.e 1. You attack $user with your $weapon doing $damage (hp left) 2. You attack $user with your $weapon doing $damage (hp left) 3. You attack $user with your $weapon doing $damage (hp left) 4. $user attacks you with there $weapon doing $damage (hp left) 5. You attack $user with your $weapon doing $damage (hp left) then a message "You won you gained $gold and $exp" or "You lost the battle"
  11. How ya mean stat system? i have the stats in the database Strength , speed and hp I have never made anything like this b4 so i dont know what i am doing to this point Even if you can point me in the right direction of a site that explains it.
  12. Ok i am making a PHP rpg i am kinda stuck on the attack system tho i want the attack system to run from the users stats Speed , strength and HP Does anyone have any ideas for how i can do this? Edit: To be honest i dont have a clue where to start with it :S
  13. ah i changed it to float and its workin now Thanks
  14. uStrength  int(11) Is this what u mean?
  15. ok i removed the /1000 and it updates the database fine :S so it has something to do with that :( Hmm Dont mysql store like 1.010 in the database?
  16. ok i aint tried the time one yet. But the random number one works how i want it to now but for some reason it isnt updating the database with the $rand_strength Any ideas?
  17. Ok thanks for the replys guys. Ill try them out and let ya know ;)
  18. Question 1. How can i make it so one of my pages cant be accessed dueing certon times? i.e the page will open at 8am and will close at 8pm once it is closed it will echo something like "We are closed we open at 8am and close at 8pm" can this be done? Question 2. How can i make a random number like 0.003? the fact for this is i am making a gym for my game so i want a random number from 0.001 to 0.020. i tried this way but didn't work how i wanted it to. [code]<?PHP $rand_strength = rand(0,0) . rand(0,0) . rand(1,20); echo "You have gained $rand_strength strength"; $db->query("UPDATE users SET uStrength=uStrength+'$rand_strength' WHERE uID='" . $user['uID'] . "'"); ?>[/code] This is the results i got "You have gained 0018 strength" Thanks for your time
  19. Well i removed the "-q" from the script now and all is working fine. Thanks guys
  20. erm yea thats it :D lol Thx that worked :P
  21. Ok so i setup a cron to run every 24hrs but this update statement dont seem to be working. is there a problem i have failed to spot in it? [code]$db->query("UPDATE users SET uClicksToday = uClicksToday '0' WHERE uType=1");[/code] Thanks in advance  ;D
  22. Well i just did what akitchin said. [quote]if you're trying to run the file directly in a CRON, you need to add this line to the top: Code: #!/usr/bin/php -q <?php // php here ?> this tells the command line to parse the following PHP code with the php engine (as far as i know), in quiet mode which suppresses the headers.  the /usr/bin/php might need to change depending on your hosting setup.  check phpinfo() for the proper path if this doesn't work. [/quote] But it worked fine for a few days then i started getting another error in my mailbox This is the error Error in argument 1, char 3: option not found Usage: php [-q] [-h] [-s] [-v] [-i] [-f <file>]        php <file> [args...]  -a              Run interactively  -C              Do not chdir to the script's directory  -c <path>|<file> Look for php.ini file in this directory  -n              No php.ini file will be used  -d foo[=bar]    Define INI entry foo with value 'bar'  -e              Generate extended information for debugger/profiler  -f <file>        Parse <file>.  Implies `-q'  -h              This help  -i              PHP information  -l              Syntax check only (lint)  -m              Show compiled in modules  -q              Quiet-mode.  Suppress HTTP Header output.  -s              Display colour syntax highlighted source.  -v              Version number  -w              Display source with stripped comments and whitespace.  -z <file>        Load Zend extension <file>. Anyone understand this? If so any ideas to fix it? Thanks for your time
  23. ok sorted the cron prob
  24. i am connecting to the database via a include file there is a or die in the include file I dont get anything come in my email at all now - errors or sucseed
  25. ok i added that to cron24r.php And now i dont get the error im my inbox but the database dont update :( altho if i run cron24r.php on my browser it works fine and updates the database Any ideas?
×
×
  • 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.