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:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem with logout script
Author Message
dabritmusic
Journeyman
*

Posts: 50
Likes Given: 8
Likes Received: 2 in 1 posts
Joined: Nov 2013
Reputation: 0



Post: #1
problem with logout script
im having trouble getting the player to logout and the new item bounced into their pack. anyone know exactly what im doing wrong?

Code:
[PLEVEL 1]
logout

[FUNCTION logout]
IF <SRC.TAG.LOGOUT>=1>>
src.findid.i_logout_delay.remove
SRC.TAG.LOGOUT=0
MESSAGE @079 You have changed your mind about logging out right now
RETURN 1
ELSE
SRC.TAG.LOGOUT=1
SRC.NEWITEM=i_logout_delay
SRC.ACT.EQUIP
SYSMESSAGE @0481 You Will Receive Player Reward Tickets For Logging Out Correctly. Thank You For Helping Keep <serv.name> Lag Free!
SYSMESSAGE @079 You will be logged out in 30 seconds.
SYSMESSAGE @079 If you decide you dont want to log out simply type .logout again.
RETURN 0
endif

[ITEMDEF i_logout_delay]
src.newitem i_logout_timer
src.act.equip        
src.act.timer 30

NAME=Logout Delay
ID=i_handr_1
TYPE=T_EQ_SCRIPT
WEIGHT=0
LAYER=layer_special

ON=@Create
    ATTR=attr_invis|attr_decay
    MORE1=30
    MOREP=britain

ON=@Equip
    TIMER=1

ON=@Timer
    if ( <cont> )
        if ( <more1> )
            cont.message @079 <EVAL(<more1>)> // put countdown above my head.
            more1=<more1>-1
            TIMER=1
            return 1
        DORAND 56
CONT.GOPLACE 5447,1086
CONT.GOPLACE 5447,1085
CONT.GOPLACE 5447,1084
CONT.GOPLACE 5447,1083
CONT.GOPLACE 5447,1082
CONT.GOPLACE 5447,1087
CONT.GOPLACE 5447,1088
CONT.GOPLACE 5447,1089
CONT.GOPLACE 5447,1090
CONT.GOPLACE 5448,1086
CONT.GOPLACE 5449,1086
CONT.GOPLACE 5450,1086
CONT.GOPLACE 5446,1086
CONT.GOPLACE 5445,1086
CONT.GOPLACE 5444,1086
CONT.GOPLACE 5443,1086
CONT.GOPLACE 5448,1087
CONT.GOPLACE 5448,1088
CONT.GOPLACE 5448,1089
CONT.GOPLACE 5448,1090
CONT.GOPLACE 5448,1085
CONT.GOPLACE 5448,1084
CONT.GOPLACE 5448,1083
CONT.GOPLACE 5448,1082
CONT.GOPLACE 5449,1087
CONT.GOPLACE 5449,1088
CONT.GOPLACE 5449,1089
CONT.GOPLACE 5449,1090
CONT.GOPLACE 5449,1085
CONT.GOPLACE 5449,1084
CONT.GOPLACE 5449,1083
CONT.GOPLACE 5449,1082
CONT.GOPLACE 5450,1087
CONT.GOPLACE 5450,1088
CONT.GOPLACE 5450,1089
CONT.GOPLACE 5450,1090
CONT.GOPLACE 5450,1085
CONT.GOPLACE 5450,1084
CONT.GOPLACE 5450,1083
CONT.GOPLACE 5450,1082
CONT.GOPLACE 5446,1087
CONT.GOPLACE 5446,1088
CONT.GOPLACE 5446,1089
CONT.GOPLACE 5446,1090
CONT.GOPLACE 5446,1085
CONT.GOPLACE 5446,1084
CONT.GOPLACE 5446,1083
CONT.GOPLACE 5446,1082
CONT.GOPLACE 5445,1087
CONT.GOPLACE 5445,1088
CONT.GOPLACE 5445,1089
CONT.GOPLACE 5445,1090
CONT.GOPLACE 5445,1085
CONT.GOPLACE 5445,1084
CONT.GOPLACE 5445,1083
SRC.GOPLACE 5445,1082 // Rand 56
ENDDO
cont.tag.logout=0
src.newitem=i_reward_ticket {10 50}
src.bounce
CONT.DISCONNECT
    endif
    endif
    remove
    return 1


[EOF]
(This post was last modified: 01-26-2014 08:03 AM by Mordaunt.)
01-26-2014 07:37 AM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #2
RE: problem with logout script
Why are you doing it this way?
Why change how players log out? it will just annoy and not be used.

Just add an event to all players like this:

Code:
on=@logout
DORAND 56
src.go 5447,1086
src.go 5447,1085
src.go 5447,1084
src.go 5447,1083
src.go 5447,1082
src.go 5447,1087
src.go 5447,1088
src.go 5447,1089
src.go 5447,1090
src.go 5448,1086
src.go 5449,1086
src.go 5450,1086
src.go 5446,1086
src.go 5445,1086
src.go 5444,1086
src.go 5443,1086
src.go 5448,1087
src.go 5448,1088
src.go 5448,1089
src.go 5448,1090
src.go 5448,1085
src.go 5448,1084
src.go 5448,1083
src.go 5448,1082
src.go 5449,1087
src.go 5449,1088
src.go 5449,1089
src.go 5449,1090
src.go 5449,1085
src.go 5449,1084
src.go 5449,1083
src.go 5449,1082
src.go 5450,1087
src.go 5450,1088
src.go 5450,1089
src.go 5450,1090
src.go 5450,1085
src.go 5450,1084
src.go 5450,1083
src.go 5450,1082
src.go 5446,1087
src.go 5446,1088
src.go 5446,1089
src.go 5446,1090
src.go 5446,1085
src.go 5446,1084
src.go 5446,1083
src.go 5446,1082
src.go 5445,1087
src.go 5445,1088
src.go 5445,1089
src.go 5445,1090
src.go 5445,1085
src.go 5445,1084
src.go 5445,1083
SRC.GO 5445,1082 // Rand 56
ENDDO

It could be way smaller than this also honestly given how you are seemingly tiling your offline players, which honestly won't help anything either.

[Image: 2nis46r.jpg]
(This post was last modified: 01-26-2014 08:08 AM by Mordaunt.)
01-26-2014 08:06 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #3
RE: problem with logout script
IF <SRC.TAG.LOGOUT>=1>> this line won't work, what are the '>>' at the end for? Also, if you are comparing you must use ==, = is for setting


src.findid.i_logout_delay.remove //using src on a function without knowledge of what SRC is may give you problems, src is related to the one that made this function run, so if you do ingame .x logout to any player, you will be src as you are the one making the function to run


SERV.NEWITEM=i_logout_delay //this is the correct code for it
EQUIP=<NEW>

[ITEMDEF i_logout_delay]
src.newitem i_logout_timer <---- what is this? this is an itemdef block, not a function one, you can't execute code this way, remove line.
src.act.equip // and this one.
src.act.timer 30 //and this one too.

NAME=Logout Delay
ID=i_handr_1
TYPE=T_EQ_SCRIPT
WEIGHT=0
LAYER=layer_special

ON=@Create
ATTR=attr_invis|attr_decay
MORE1=30
MOREP=britain //you dont need this line since you are not using it anywhere

ON=@Equip
TIMER=1

ON=@Timer
if ( <cont> )
if ( <more1> )
cont.message @079 <EVAL(<more1>)> // put countdown above my head.
more1=<more1>-1
TIMER=1
return 1
//I think you should place an ELSE here to run when the item does not have more1
//cont.go <r5445,5450>,<r1080,1090> // this line will remove all the dorand section, wich is useless.
DORAND 56
CONT.GOPLACE 5447,1086
CONT.GOPLACE 5447,1085
CONT.GOPLACE 5447,1084
CONT.GOPLACE 5447,1083
CONT.GOPLACE 5447,1082
CONT.GOPLACE 5447,1087
CONT.GOPLACE 5447,1088
CONT.GOPLACE 5447,1089
CONT.GOPLACE 5447,1090
CONT.GOPLACE 5448,1086
CONT.GOPLACE 5449,1086
CONT.GOPLACE 5450,1086
CONT.GOPLACE 5446,1086
CONT.GOPLACE 5445,1086
CONT.GOPLACE 5444,1086
CONT.GOPLACE 5443,1086
CONT.GOPLACE 5448,1087
CONT.GOPLACE 5448,1088
CONT.GOPLACE 5448,1089
CONT.GOPLACE 5448,1090
CONT.GOPLACE 5448,1085
CONT.GOPLACE 5448,1084
CONT.GOPLACE 5448,1083
CONT.GOPLACE 5448,1082
CONT.GOPLACE 5449,1087
CONT.GOPLACE 5449,1088
CONT.GOPLACE 5449,1089
CONT.GOPLACE 5449,1090
CONT.GOPLACE 5449,1085
CONT.GOPLACE 5449,1084
CONT.GOPLACE 5449,1083
CONT.GOPLACE 5449,1082
CONT.GOPLACE 5450,1087
CONT.GOPLACE 5450,1088
CONT.GOPLACE 5450,1089
CONT.GOPLACE 5450,1090
CONT.GOPLACE 5450,1085
CONT.GOPLACE 5450,1084
CONT.GOPLACE 5450,1083
CONT.GOPLACE 5450,1082
CONT.GOPLACE 5446,1087
CONT.GOPLACE 5446,1088
CONT.GOPLACE 5446,1089
CONT.GOPLACE 5446,1090
CONT.GOPLACE 5446,1085
CONT.GOPLACE 5446,1084
CONT.GOPLACE 5446,1083
CONT.GOPLACE 5446,1082
CONT.GOPLACE 5445,1087
CONT.GOPLACE 5445,1088
CONT.GOPLACE 5445,1089
CONT.GOPLACE 5445,1090
CONT.GOPLACE 5445,1085
CONT.GOPLACE 5445,1084
CONT.GOPLACE 5445,1083
SRC.GOPLACE 5445,1082 // Rand 56
ENDDO
cont.tag.logout=0
src.newitem=i_reward_ticket {10 50}
src.bounce //src.bounce what? you are bouncing src( so you are trying to put yourself in the backpack? Tongue) as i told you above: serv.newitem=xxx, bounce=<new>
01-26-2014 08:25 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: problem with logout script
Instead of DORAND 56 and GOPLACE... you could use MOVENEAR <someobject>,10 and it will put the character within 10 squares of that object.
01-29-2014 05:03 AM
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)