Making a Trinket System
Hello everyone! I'm working on a trinket sytem that I'm going to be sharing with everyone later on, but I was wondering whether or not this code would work for the item function(I'm pretty sure it's done wrong):
PHP Code:
|
What about that reward/toy mod that was recently posted? Isn't that the same thing? *I know nothing*
|
^It is, this is my edit on it. I wanted to make it so that you can choose what slot to put it in.
|
Ah. What would the slots be for? Just organization?
|
Umm, with the current system, you can have several slots, but each specific type of item can only be put in one slot. For example, when you use an item, you don't have the choice of which slot to put it in. :3
|
Don't really know what you want to do, but that return message will stop your function from doing anything after it. Rest looks functional I think xD Great mods btw :3
|
^Thanks! Is there an alternative to the "return"... function? :3
|
What did you want to do with return? xD A function returns when it ends, consider it the final result of a math problem. And it's other functions that pick up the return from other functions and work with the values
|
Having a return at the end like that basically means that calling items_trinket() will result in the value of $note, and will never run again because it is no longer a function holding formula to run/posing a question, it is a function holding an answer? I think. I'm sleepy.
|
A function runs as many times as you call it. Even if you return from it, if you call it again it will return again. The problem is the
return $message; In the middle. At that moment, the function will quit and the rest of code inside that function won't run at all. This part is like it doesn't exist: PHP Code:
|
^I want the code to display some radio buttons that will allow a user to actually choose to spot to put a trinket in instead of having the trinket go to the only slot the trinket type was set to go to.(Hope that made sense) The user would then click a radio button to select the slot, and then the rest of the code would put the trinket there and show this message: The trinket has been added. :3 Would adding a "comment" instead work?
|
Hmmm... would this code work?:
PHP Code:
|
Ok, I tested out this code:
PHP Code:
Parse error: syntax error, unexpected end of file in /home/wallie12/public_html/functions/functions_items.php on line 391 I'm pretty certain the code above is the issue, but I don't know what's wrong. :L |
You need a closing bracket, I think. You closed the else, but not the function itself.
|
Thanks! The page is no longer broken, but now this message pops up:
The item function is invalid. I already modified the privateitem.php file... |
All times are GMT -5. The time now is 07:07 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.