![]() |
|
#1
|
||||
|
||||
![]()
Uh oh, I'm a bummer - can someone show me an example or the location of the source codes? :(
|
#2
|
||||
|
||||
![]()
Hall Of Famer means the function you made, the whole code from the file
Btw you have the if still liek this? if($gender = 'f') It should be if($gender == 'f') = means you are giving the variable a value. == means you are comparing it (it's a function that says if it is false or true) Btw if you already have the switch-case you can take the if off. Like PHP Code:
Last edited by IntoRain; 08-20-2013 at 11:41 PM. |
#3
|
||||
|
||||
![]()
Oh, it has to be 2 equal signs - I'll try that! Thanks for the tip. :3
Edit: Thanks, you fixed half of my problem! The item says "action completed" and gets deleted, but my male adoptable is still male, and the "gender change successful messge" does not pop up. :L Also, here's the code: PHP Code:
Last edited by Hwona; 08-21-2013 at 08:06 AM. |
#4
|
||||
|
||||
![]()
I guess my post was a bit misleading, I was merely referring to the source code of the very item function you created, not the source code of the entire functions_items.php file. For this case it is not a problem, but at some circumstances it may be time consuming to read through an entire script file. Id say just post the code that aint working is sufficient when bringing up a problem.
__________________
![]() Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site. |
#5
|
||||
|
||||
![]()
Ah. I see! xP
Well, in that case, here's the code! :D PHP Code:
Here's the finished code :D: PHP Code:
Last edited by Hwona; 08-21-2013 at 04:48 PM. |
#6
|
||||
|
||||
![]()
I already explained why it wasn't working, see the post above Hall Of Famer's. Your switch case is wrong
case "f": .... ^ The switch-case only does the code (update thingy) you have after it if your adopt's gender is female. So it will only change the gender from female to female. You need to change it to case "m". Last edited by IntoRain; 08-21-2013 at 05:12 PM. |
#7
|
||||
|
||||
![]()
Yeah, I edited my last post. Anyways, thank you so much! I probably would have kept changing the code and fixing nothing if you didn't point that out. >^.^<
|
#8
|
||||
|
||||
![]()
Yay that's great! :D
|
#9
|
|||
|
|||
![]()
Sorry to bump up this thread, but I was seeing if I could try out this mod (and then do one similar for color/marking changing) and have been running into the same item function invalid error. I'm using 1.3.4, so I'm not sure if maybe that's the issue or not or if I've run into an error with my itemfunctions table in general (I assume that the intent is for adoptable, but I may have done it wrong) . ^v^;
|
#10
|
||||
|
||||
![]() Quote:
In the item_functions table, the function parameter is the name of your item function (in this example, it would be genderf) and in this case the intent is for Adoptable yes. After that, you will have to go to the classes folder and edit the file class_privateitem.php. In the apply() function, inside the big switch-case, you have to put another 'case' to add the new item type
__________________
![]() ![]() ![]() asp.net stole my soul. |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help with a item function | kristhasirah | Questions and Supports | 35 | 04-03-2017 10:17 AM |
Mys v1.3.4 Item Function: Gender Change Potion | Kyttias | Mys v1.3.x Mods | 21 | 10-12-2016 07:52 PM |
Calling a function in a function from the same class page | Hwona | Questions and Supports | 2 | 04-25-2015 08:41 AM |
Item Function Suggestions | NobodysHero | Suggestions and Feature Requests | 5 | 06-23-2014 03:45 AM |
What's New? |
What's Hot? |
What's Popular? |