![]() |
IF ON bag ON pack question - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Help (/Forum-Script-Help) +--- Thread: IF ON bag ON pack question (/Thread-IF-ON-bag-ON-pack-question) Pages: 1 2 |
IF ON bag ON pack question - Lazarus - 12-04-2012 05:20 PM Hi! I have a simple question here ![]() I want to take a simple IF. IF it is in your pack and if it is in a bag in your pack ![]() it's just to use some items in packs in your bags too ^_^ because if I use something like: Code: IF <CONT.UID>!=<SRC.FINDLAYER(21).UID> or Code: IF <SRC.TARG.CONT.UID>==<SRC.findlayer(layer_pack).UID> The item needs to be in your pack only and not in others bags or something else in your pack ^_^ Thanks! Lazarus. RE: IF ON bag ON pack question - darksun84 - 12-04-2012 07:36 PM What about FORCONTID ? [FUNCTION rem_spellbooks2] FORCONTID i_spellbook 10 // number of subcontainer inside backpack blabla ENDFOR RE: IF ON bag ON pack question - Lazarus - 12-05-2012 03:50 AM (12-04-2012 07:36 PM)darksun84 Wrote: What about FORCONTID ? I want in a DCLICK script, like if you are using that item, you must have the item in the pack or in a pack on the pack ![]() RE: IF ON bag ON pack question - ChaveS - 12-05-2012 03:53 AM you already know the item uid you wanna check? RE: IF ON bag ON pack question - Mordaunt - 12-05-2012 04:09 AM The wiki is your friend Quote:TOPOBJ If an object is buried in several containers within containers, this is always the top-level container before you get to the world. If an item is buried in a player's backpack, TOPOBJ is the player. RE: IF ON bag ON pack question - ChaveS - 12-05-2012 08:02 AM @Mordaunt If i understood what he wants topobj wont gonna help, cuz topobj would be always the char... RE: IF ON bag ON pack question - Mordaunt - 12-05-2012 08:05 AM and you can't find layer_backpack on a character?..... RE: IF ON bag ON pack question - Lazarus - 12-05-2012 08:58 AM (12-05-2012 08:05 AM)Mordaunt Wrote: and you can't find layer_backpack on a character?..... Like Code: IF (<SRC.TARG.TOPOBJ.UID>==<SRC.UID>) thanks, I will search in some scripts if I find more topobj and try to use it ^_^ Oh I have it! IF (<TOPOBJ.UID>!=<SRC>) ![]() Thanks for all Mordaunt, chaves and darksun ♥ RE: IF ON bag ON pack question - ChaveS - 12-05-2012 01:13 PM @Lazarus This isn't supposed to work If you already know the item is in somewhere his backpack, you can simply use if (<cont.layer> != 21) src.message <name> is in some container inside my bag endif RE: IF ON bag ON pack question - Lazarus - 12-07-2012 01:55 AM (12-05-2012 01:13 PM)ChaveS Wrote: @Lazarus This was work: [function OUTPACK] IF (<TOPOBJ.UID>!=<SRC>) || (<CONT.UID>==<SRC.FINDLAYER.LAYER_BANKBOX.UID>) SRC.SYSMESSAGE The item must be in your pack! RETURN 1 ELSE RETURN 0 ENDIF when i call it in a function i use: ON=@DCLICK IF !<OUTPACK> SRC.MESSAGE TARGET XXXX ELSE RETURN 1 ENDIF ^_^ |