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
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 786 - File: showthread.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/showthread.php 786 errorHandler->error






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Open Doors Function
Author Message
dicataldisky
Apprentice
*

Posts: 9
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Nov 2019
Reputation: 0



Post: #1
Open Doors Function
I am using the code below to open and close the doors, but I am having difficulty closing the doors when the char is inside the building ..

To be able to close the door it is necessary to be on top of the same tile, but the behavior must be that if it is 3 2 tiles from the door it must be closed!

when i have active .gm the port works the way i need ...

can anybody help me?

I recorded a video demonstrating my problem.





Code:
[FUNCTION open_door]
LOCAL.CURRENT_DOOR 0

FORITEMS 0
    IF (<TYPE> == t_door_locked) || (<TYPE> == t_door)
        IF (<EVAL ABS(<Z> - <SRC.P.Z>)> < 8)
            LOCAL.CURRENT_DOOR <UID>
            IF (<SRC.CTAG0.LAST_DOOR> != <UID>)
                DCLICK
                SRC.CTAG.LAST_DOOR <UID>
                RETURN
            ENDIF
        ENDIF
    ENDIF
ENDFOR

FORITEMS 1
    IF (<TYPE> == t_door_locked) || (<TYPE> == t_door)
        IF (<EVAL ABS(<Z> - <SRC.P.Z>)> < 8)
            LOCAL.CURRENT_DOOR <UID>
            IF (<SRC.CTAG0.LAST_DOOR> != <UID>)
                DCLICK
                SRC.CTAG.LAST_DOOR <UID>
                RETURN
            ENDIF
        ENDIF
    ENDIF
ENDFOR

FORITEMS 2
    IF (<TYPE> == t_door_locked) || (<TYPE> == t_door)
        IF (<EVAL ABS(<Z> - <SRC.P.Z>)> < 8)
            LOCAL.CURRENT_DOOR <UID>
            IF (<SRC.CTAG0.LAST_DOOR> != <UID>)
                DCLICK
                SRC.CTAG.LAST_DOOR <UID>
                RETURN
            ENDIF
        ENDIF
    ENDIF
ENDFOR

IF (<LOCAL.CURRENT_DOOR>)
    REF1 <LOCAL.CURRENT_DOOR>

    IF (<EVAL ABS(<REF1.Z> - <SRC.P.Z>)> < 8)
        REF1.DCLICK
    ENDIF
ENDIF
11-30-2019 06:03 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Open Doors Function - dicataldisky - 11-30-2019 06:03 PM
RE: Open Doors Function - Coruja - 12-01-2019, 09:34 AM
RE: Open Doors Function - dicataldisky - 12-01-2019, 01:36 PM

Forum Jump:


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