Mysidia Adoptables Support Forum  

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

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #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: 133,395
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
 

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 04:34 PM.

Currently Active Users: 3724 (0 members and 3724 guests)
Threads: 4,081, Posts: 32,032, 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 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636