![]() |
help with an explore page please..
Okay so...I've been trying to figure out what I did wrong, and being that I dont know coding...of course I screwed it up... lol... I've been looking at it and trying to fix it for hours now..
I was trying to modify - This coding To work a bit differently... But anytime I try to fix it? I make more problems... I know its probably a really stupid mistake... but if anyone can help me out with fixing it thatd be awesome. I was also wondering how to add in that the user has an amount of an item. like.. You currently have 5 Sherlock holmes books PHP Code:
|
I'd like to help, but what problems are you having? Are you getting any error messages or anything? As for adding how much of an item a user has, you can use:
PHP Code:
You have [itemamount] [itemname]! |
It gives me a lot of errors... the main one- seems to be this-
Parse error: syntax error, unexpected '>' in /home/atrocity/public_html/view/exploreeyresgameview.php on line 15 But im sure theres other ones... I even tried using a PHP checker to pinpoint the problem better... and it didnt help.. x.x |
There does't seem to be anything wrong with line 15 itself (meaning the coding isn't typed incorrectly or anything), did you try moving it to:
PHP Code:
|
Haha...Yea I dont actually know coding at all...so yea.... also it still gives me the same error... x.x
|
It took me a while of staring to figure out the problem xD
You're missing quotation marks in some places/ have them in the wrong spots. See this? PHP Code:
PHP Code:
PHP Code:
PHP Code:
Basically have only/make sure you have 2 quotation marks. So the "formula" should be: $document->add(new Comment("CodeGoesHere")); No extra quotation marks should go anywhere inside that line. An easy way to spot these mistakes is looking at your code and seeing if too many of the lines are blue. If your "elseif" statement is blue instead of green, then you probably need to fix the quotation marks. The same goes for "if" statements. "$document" should also always be gold/yellow. |
Did all those things... and it still gives me the same error... is there possibly the problem is that the
PHP Code:
Doesnt have brackets around it? Its not inside of any opening or closing brackets...but im not sure how to remedy that.. |
I plugged the code in on a test page to see if I could smooth out any errors and I found:
Parse error: syntax error, unexpected 'http' (T_STRING) in /home/adopttes/public_html/view/explorearea2view.php on line 45 The answer to that would be to change this: PHP Code:
PHP Code:
|
I'm still getting this error though...
Parse error: syntax error, unexpected '>' in /home/atrocity/public_html/view/exploreeyresgameview.php on line 15 What code did you use? |
I used the one in the original post after fixing all the quotation marks. Maybe try replacing it with the one I edited?:
PHP Code:
|
Yea...your edited code works ... thank you!
|
No problem!
|
Sorry to bug you- but I ran into another issue- (no errors though) I cant seem to get the "game over" Message to show when they run out of the Item they need to play... instead it lets them keep playing.. I did get the message to show up at one point... but they could still play the game... x.x
Help please... PHP Code:
|
Sorry for replying so late! It's not a bother, it was just really late last night. I was able to get the game to end by changing this line (line 11):
PHP Code:
PHP Code:
|
Thanks for the help but for some reason its not working for me... I did edit the Coding a little... and it was working. but its not giving me the game over still... (my edited code is in the post before this reply)
|
Maybe changing the items around in the script might help somehow? This is the version with the fixes I mentioned in my previous posts:
PHP Code:
1. Change the name of every item to the test item (asda) so I don't get any errors and it properly adds and removes the items from your inventory 2. I removed all but one of the lines that gave me an item so I would lose more often since I just kept winning over and over. This way, I can be sure the quantity is running out. You don't have to do that, I just did it because I was winning too much to see if a game over was possible. 3. I refreshed over and over until I had 0 "asda" and I got the game over message. If I happen to win another "asda", then it lets me play again. Obviously it wouldn't happen this way with yours since you wouldn't win back the item needed to play the game. From my understanding, the game only runs if you have a "Sherlock Holmes book", did you change your inventory so you only have one of that item and test the game again? You should get a game over if you have 0 Sherlock Holmes books. |
I do not have any books in my inventory...And honestly all the items on the game currently are placeholders... so they dont matter at the moment. But Its still not working for me... It just keeps letting me play the game...
I am so confused... x.x |
I honestly have no idea why it's not working either since I'm using the exact same script I posted in my last reply and it runs and ends fine. Maybe try replacing the entire script with:
PHP Code:
|
That worked! thank you! I honestly have no idea why it wasnt working before...thank you very much!
|
Yay! ^^ You're welcome.
|
All times are GMT -5. The time now is 02:53 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.