Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 11-12-2015, 12:58 PM
Sibyl's Avatar
Sibyl Sibyl is offline
Certified Chinchilla
 
Join Date: Nov 2015
Posts: 12
Gender: Female
Credits: 2,469
Sibyl is on a distinguished road
Red face Receiving an Item on a Specific Page?

How can I make it so that my users can receive a specific item for going onto a certain page? And, better yet, make it so they can only receive said item once? ;~;

I'd love to do an exploration type system, but I'm uncertain of how to make it rewarding without the user having to be redirected to a shop so they can buy the item themselves, or make it so that there is a promo code. The problem with promo codes is that the user must leave the page to go enter the code, and they could share the codes with the other users. ;~~~;

If anyone knows even a makeshift way, that'd be wonderful ;v; thank you all very much.
Reply With Quote
  #2  
Old 11-13-2015, 05:44 AM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 87,031
Kyttias is on a distinguished road
Default

I did a write up on some stuff that might be helpful here. Which, if you can follow it, should be more than enough to help you give a user an item -- and if you combine it with the item check later down the page, you should have what you need.

This would be especially good for super important quest items - does the user have a Fancy Lamp? If so, do nothing. If not, give them one.

PHP Code:
$item "Fancy Lamp";
$hasitem $mysidia->db->select("inventory", array("quantity"), "itemname ='{$item}' and owner='{$mysidia->user->username}'")->fetchColumn();
if(
$hasitem){
    
$document->add(new Comment("You have already obtained this {$item}!"));
} else {
    
$document->add(new Comment("It looks like you could use this {$item}!"));
    
$qty 1;
    
$newitem = new StockItem($item);
    
$newitem->append($qty$mysidia->user->username);  

__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mys v1.3.4 Item Shop Mod(s): NPC + Item Display + Tooltips Kyttias Mys v1.3.x Mods 55 06-19-2020 11:21 AM
Buy X of Item A to receive X of Item B AndromedaKerova Suggestions and Feature Requests 0 11-09-2014 08:17 PM
Help Making Stats Page = Click Page & Lineages? squiggler Questions and Supports 2 02-22-2014 04:42 AM
can edit specific adoptables in the AdminPanel ? kratosvr Questions and Supports 1 08-13-2011 02:59 AM


All times are GMT -5. The time now is 03:59 AM.

Currently Active Users: 684 (0 members and 684 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636