The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Clothing Bless Deed & ContextMenus
Author Message
Reflex
Journeyman
*

Posts: 130
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Apr 2012
Reputation: 1



Post: #1
Clothing Bless Deed & ContextMenus
Now, for some reason.. After I bless an Item with the CBD the blessed item always calls the contextmenu instead of only when i want it to call it ? Even if I get the else message it still displays the context menu? wth.. why?

Code:
//override for t_clothing
[TYPEDEF t_clothing]
ON=@Click
IF (<TAG0.isblessed> = 1)
    src.sysmessage This has tag.isblessed 1 and needs to call a contextmenu
    TRIGGER ContextMenuRequest
    message <name>
    return 1 // thought maybe the returns were causing this.. dunno
ELSE
src.sysmessage Else
message <name>
RETURN 1
ENDIF

ON=@ContextMenuRequest
SRC.AddContextEntry 1000,3006278,0
SRC.AddContextEntry 2000,3006208,0

ON=@ContextMenuSelect
IF (<ARGN>==1000)
    SRC.SAY CUT ARTICLE OF BLESSED CLOTHING
ENDIF
IF (<ARGN>==2000)
    SRC.SAY GET CBD BACK
ENDIF
[eof]

[itemdef i_cbd]
id=i_deed
name=Clothing Bless Deed

    on=@create
    attr=04
    CATEGORY=Custom
    SUBSECTION=Special
    DESCRIPTION=Clothing Bless Deed

ON=@DCLICK
IF (<CONT> == <SRC.FINDLAYER(21).uid>)
    //src.sysmessageloc 1 1045156 //these dont seem to want to work?
    src.sysmessageua 955 0 0 1 Select the article of clothing you wish to bless.
    TARGETF f_BlessAnItem
    RETURN 1
ELSE
    SRC.SYSMESSAGELOC 1 1045156 // must be in backpack
    RETURN 1  
ENDIF

[FUNCTION f_BlessAnItem]

IF <ARGO.ISITEM>
    IF (STRMATCH(*t_clothing*,<ARGO.TYPE>)) && (<ARGO.CONT> == <SRC.FINDLAYER(21).uid>)
        IF !(<ARGO.ATTR> & attr_newbie)
        SRC.SYSMESSAGELOC 1 1010025 1 // this cliloc wont display
               //src.sysmessageua 955 0 0 1 The <ARGO.name> is now Blessed.
        ARGO.ATTR=04
        ARGO.NAME=<ARGO.NAME> [Blessed]
        ARGO.HITPOINTS=0fffffff
        ARGO.tag.isblessed=1
        consume 1 i_cbd // is this ok or is there a more secure way?
        ELSE
           sysmessageua 955 0 0 1 This article of clothing is already Newbied or Blessed.
           RETURN 1
        ENDIF
    ELSE
    SRC.SYSMESSAGE This is not an article of clothing?
       SRC.SYSMESSAGELOC 1 1005019
       RETURN 1
    ENDIF
ELSE
   sysmessageua 955 0 0 1 This item is not able to be blessed.
    RETURN 1
ENDIF

ON=@Targon_Char
    src.sysmessageua 955 0 0 1 I dont think you can make someone else a newbie this way :/
    return 1

//end of cbd
(This post was last modified: 04-21-2012 05:10 PM by Reflex.)
04-21-2012 05:04 PM
Find all posts by this user Like Post Quote this message in a reply
Shaklaban
Master
**

Posts: 378
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 8

DOT

Post: #2
RE: Clothing Bless Deed & ContextMenus
why you calling TRIGGER ContextMenuRequest under @click? there is @contextmenurequest trigger, you must define your statements under this trigger, not on click:

Code:
on=@contextmenurequest
if bla bla

endif
(This post was last modified: 04-21-2012 06:01 PM by Shaklaban.)
04-21-2012 05:59 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)