Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not triggering time expiry
Author Message
mlyon83
Apprentice
*

Posts: 44
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2013
Reputation: 0



Post: #1
Not triggering time expiry
The script below won't take action to release a player from jail. LINK.ACCOUNT.TAG.JAIL_TIME value is 30 seconds. Any idea?


Code:
IF (<LINK.ACCOUNT.TAG.JAIL_STATUS> == 1)
    LINK.TAG.JAIL_TEMP_CALC=<EVAL <SERV.TIME> / 10>
    LINK.TAG.JAIL_TEMP_CALC2=<EVAL <SERV.TIME>+<LINK.ACCOUNT.TAG.JAIL_TIME>>
    IF (<LINK.TAG.JAIL_TEMP_CALC> >= <LINK.TAG.JAIL_TEMP_CALC2>)
        LINK.ACCOUNT.TAG.JAIL_STATUS=0
        LINK.TAG.JAIL_LOGIN=0
        LINK.TAG.JAIL_LOGIN2=0
        LINK.EVENTS=-e_player_jailed
        LINK.GO=<LINK.TAG.JAIL_RELEASE_POSITION>
        LINK.MESSAGE @00 You feel free.
    ELSE
        IF (<LINK.REGION.NAME> != Jail)
            VAR.NEXT_JAIL_CELL=<VAR.NEXT_JAIL_CELL>+1
            IF (<VAR.NEXT_JAIL_CELL> >= 5)
                LINK.GO=3905,1255,-10
                VAR.NEXT_JAIL_CELL=0
            ELSEIF (<VAR.NEXT_JAIL_CELL> >= 4)
                LINK.GO=3904,1265,-10
            ELSEIF (<VAR.NEXT_JAIL_CELL> >= 3)
                LINK.GO=3914,1265,-10
            ELSEIF (<VAR.NEXT_JAIL_CELL> >= 2)
                LINK.GO=3914,1255,-10
            ELSEIF (<VAR.NEXT_JAIL_CELL> >= 1)
                LINK.GO=3905,1255,-10
            ENDIF
            LINK.MESSAGE @00 You cannot leave jail until you're forgiven.
        ELSE
            LINK.MESSAGE @00 Nothing shows, test.
        ENDIF
    ENDIF
ENDIF
05-18-2013 04:39 AM
Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #2
RE: Not triggering time expiry
Not enough information... is that code on a item? Is the item a memory on the player? Does it have a timer? Is the timer being set properly? Is this code sample from the timer trigger? Does the player have all the right tags? Are there syntax errors?
05-18-2013 06:12 AM
Find all posts by this user Like Post Quote this message in a reply
mlyon83
Apprentice
*

Posts: 44
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2013
Reputation: 0



Post: #3
RE: Not triggering time expiry
(05-18-2013 06:12 AM)RanXerox Wrote:  Not enough information... is that code on a item? Is the item a memory on the player? Does it have a timer? Is the timer being set properly? Is this code sample from the timer trigger? Does the player have all the right tags? Are there syntax errors?

Everything on it works fine up until the IF (TIME >= TIME) statement. I've even done test messages to see if it works. The problem is it's not processing that IF statement to evaluate the time properly, so the player sits in jail without automatically being released.
05-18-2013 10:54 AM
Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #4
RE: Not triggering time expiry
It seems to me that (<SERV.TIME> / 10) is always less than (<SERV.TIME>+<LINK.ACCOUNT.TAG.JAIL_TIME>) unless this jail_time tag is a number less than zero...

Or in other words, (a tenth of "something") is always less than ("something" plus "something else") unless that "something else" is a very small number. You said that "something else" is 30, which is definitely not a small number...
05-18-2013 04:52 PM
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)