SphereCommunity
statlock problem - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: statlock problem (/Thread-statlock-problem)



statlock problem - ograso - 03-23-2015 12:04 AM

Hey all,

I receive an errors on console as follow. Statchange using in player event.

Code:
ERROR:(e_player.scp,131)Can't resolve <STATLOCK[3]>
ERROR:(e_player.scp,131)Undefined symbol ''
ERROR:(e_player.scp,134)Can't resolve <STATLOCK[3]>
ERROR:(e_player.scp,134)Undefined symbol ''

Any idea?


Code:
ON=@StatChange
IF (<TAG0.OVERRIDE.STATSUM>)
LOCAL.STATSUM=<TAG0.OVERRIDE.STATSUM>
ELSE
LOCAL.STATSUM=<SERV.SKILLCLASS.0.STATSUM>
ENDIF
LOCAL.STATS=<EVAL <OSTR>+<ODEX>+<OINT>>
IF (<LOCAL.STATS> == <LOCAL.STATSUM>)
    IF (<STATLOCK[<ARGN1>]> == lock_locked)         // Line 131
    RETURN 1
    ENDIF
    IF (<STATLOCK[<ARGN1>]> == lock_up)              // Line 134
        FOR 0 2
            IF (<LOCAL._FOR> != <ARGN1>)
                IF (<STATLOCK[<dLOCAL._FOR>]> == lock_down)
                    IF (<LOCAL._FOR> == 0)
                        IF (<EVAL <OSTR>-1> > 0)
                        OSTR --
                        MAXHITS --
                            IF (<ARGN1> == 0)
                            MAXHITS += <EVAL <ARGN2>-<OSTR>>
                            ELIF (<ARGN1> == 1)
                            MAXMANA += <EVAL <ARGN2>-<OINT>>
                            ELIF (<ARGN1> == 2)
                            MAXSTAM += <EVAL <ARGN2>-<ODEX>>
                            ENDIF
                        RETURN 0
                        ENDIF
                    ELIF (<LOCAL._FOR> == 1)
                        IF (<EVAL <OINT>-1> > 0)
                        OINT --
                        MAXMANA --
                            IF (<ARGN1> == 0)
                            MAXHITS += <EVAL <ARGN2>-<OSTR>>
                            ELIF (<ARGN1> == 1)
                            MAXMANA += <EVAL <ARGN2>-<OINT>>
                            ELIF (<ARGN1> == 2)
                            MAXSTAM += <EVAL <ARGN2>-<ODEX>>
                            ENDIF
                        RETURN 0
                        ENDIF
                    ELIF (<LOCAL._FOR> == 2)
                        IF (<EVAL <ODEX>-1> > 0)
                        ODEX --
                        MAXSTAM --
                            IF (<ARGN1> == 0)
                            MAXHITS += <EVAL <ARGN2>-<OSTR>>
                            ELIF (<ARGN1> == 1)
                            MAXMANA += <EVAL <ARGN2>-<OINT>>
                            ELIF (<ARGN1> == 2)
                            MAXSTAM += <EVAL <ARGN2>-<ODEX>>
                            ENDIF
                        RETURN 0
                        ENDIF
                    ENDIF
                RETURN 1
                ENDIF
            ENDIF
        ENDFOR    
    RETURN 1
    ENDIF
ELIF (<LOCAL.STATS> < <LOCAL.STATSUM>)
    IF (<ARGN1> == 0)
    MAXHITS += <EVAL <ARGN2>-<OSTR>>
    ELIF (<ARGN1> == 1)
    MAXMANA += <EVAL <ARGN2>-<OINT>>
    ELIF (<ARGN1> == 2)
    MAXSTAM += <EVAL <ARGN2>-<ODEX>>
    ENDIF
ENDIF



RE: statlock problem - Shamino - 03-23-2015 12:48 AM

Try...

<STATLOCK.<ARGN1>>
or
<STATLOCK(<ARGN1>)>
or
<STATLOCK.(<ARGN1>)>

STATLOCK.stat_id RW Gets or sets the lock state of the player's STR (0), DEX (2) or INT (1). [0 = up, 1 = down, 2 = locked]


RE: statlock problem - ograso - 03-23-2015 02:47 AM

Nope, unfortunately. I tried all of them but none of above isnt correct


RE: statlock problem - Shamino - 03-23-2015 03:16 AM

Ok, i found, try this.

<STATLOCK[STR]>
<STATLOCK[DEX]>
<STATLOCK[INT]>


RE: statlock problem - ograso - 03-23-2015 04:08 AM

Yeah its done Shamino. Thank you


RE: statlock problem - XuN - 03-23-2015 06:39 PM

ERROR:(e_player.scp,131)Can't resolve <STATLOCK[3]>

+

STATLOCK.stat_id RW Gets or sets the lock state of the player's STR (0), DEX (2) or INT (1). [0 = up, 1 = down, 2 = locked]

=

if (<argn>> 2)//no value higher than 2 can be passed to <statlock[]>
return
endif