Home Community Mys-Script Creative Off-Topic |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Problem with Adding Dimorphism?
Okay, I got it to work with alternates only showing with a specified gender, but for some reason it's making the type "NULL" in the mysql database, causing the adopt not to show up in the person's myadopts. So yeah... this is the edited part:
Code:
$petgender = $genders[$rand]; switch($petgender){ case "m": $alts = "yes"; break; default: $alts = "no"; } $mysidia->user->changecash(-$row->cost); $mysidia->page->settitle("{$name} adopted successfully"); $mysidia->db->insert("owned_adoptables", array("aid" => NULL, "type" => $row->type, "name" => $name, "owner" => $mysidia->user->username, "currentlevel" => 0, "totalclicks" => 0, "code" => $code, "imageurl" => NULL, "usealternates" => $alts, "tradestatus" => 'fortrade', "isfrozen" => 'no', "gender" => $genders[$rand], "lastbred" => 0)); |
#2
|
||||
|
||||
the property $row->type does not exist, which will be holding a default Null value if you attempt to use it. You need to define what the adoptables type is, and replace $row->type by the appropriate variable name.
__________________
Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site. |
#3
|
|||
|
|||
Oh. Derp. That fixed it, thanks xD Should of realized that :p
Also is it possible to remove showing gender from a level until you level it up? Last edited by Infernette; 02-09-2013 at 06:22 PM. |
#4
|
||||
|
||||
Yeah, its possible, the issue is how complicated you want it to be. If all you need is to show the gender after a global level set for all adoptables, it can be done in a few secs. If you want this to be species-specific, it can take much longer as you need to create a new field in table prefix_adoptables to store this level for each adoptable.
__________________
Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site. |
#5
|
|||
|
|||
It would be global, so it's good to know it can be easily done :)
But um... Where do I place the code; sorry once again. Last edited by Infernette; 02-11-2013 at 06:33 AM. |
#6
|
||||
|
||||
Anywhere where you show the gender. Something like
if level == '#'{ echo a blank or something }else{ show the gender } |
#7
|
|||
|
|||
Okay, I edited the script you posted Silver to work with my current version and it works just fine. Thanks :)
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding a Theme | PokeFerno | Questions and Supports | 3 | 05-13-2014 03:47 PM |
Adding Databases | Kesstryl | Questions and Supports | 4 | 06-08-2012 06:47 AM |
Adding new adoptables? | Slix | Questions and Supports | 0 | 07-05-2011 11:12 AM |
adding images | Nemesis | Questions and Supports | 11 | 04-10-2011 11:00 AM |
Adding adoptable >.< | blondbananamix | Questions and Supports | 12 | 03-20-2011 05:29 PM |
What's New? |
What's Hot? |
What's Popular? |