PDA

View Full Version : Extra click


SleepWalker
12-06-2009, 05:43 AM
I'm planning a new mod:the extra click system!The meaning:when somebody clikc on your adoptable,due to type the clicks are multiplying.
Step 1:Create a new adoptable type under the name extra.Be sure to make the adoptable with restrictions such as donator-only and artist-only or promo code,etc.
Step 2:modify the levelup.php(put this code under the Adoptable is NOT frozen...comment)

mysql_query("SELECT * FROM ".$prefix." adopts_owned_adoptables WHERE type = '$type'");
if ($type = "extra"){
$newclicks = $currentclicks + 2;}
else{
$newclicks =$currentclicks + 1;}

This is my first mod.I'm going to make a level-dependent and a giving system.If you found some errors in my script,please write to this thread.

Arianna
12-06-2009, 08:44 AM
I don't know how you are planning to update it... Isn't the code usually somewhat different? It lists the table and stuff like that in the update query.

SleepWalker
12-06-2009, 08:52 AM
UPDATE in the code means changing the number of the clicks to the most recent.Plus,this code means to make special adoptables with faster growing.

Arianna
12-06-2009, 09:12 AM
Yes, but doesn't it usually have a whole query? Otherwise, you'd be changing a variable, like $update, and then changing the query. Lemme get this code and I'll show you. ;)[hr]
Here we go...
$query = "UPDATE ".$prefix."owned_adoptables SET totalclicks='".$newclicks."' WHERE aid='".$id."'";
mysql_query($query);
You see? :/ You have to have stuff like that in there. :)

SleepWalker
12-06-2009, 10:42 AM
Good tip from you.I will test it.

Arianna
12-06-2009, 10:43 AM
Haha, yeah. You gotta have the tables in the queries, or they're useless!

SleepWalker
12-06-2009, 10:53 AM
Thanks again!