user logout script ?

Amenovis

Golden Oldie
Golden Oldie
Loyal Member
Jan 9, 2006
1,105
0
143
Germany
mhh there is userlogin script and newuser script. but the question is is there any possibility to get a user logout script? so that i can give a user if he logs out a flag as example ?
 

Amenovis

Golden Oldie
Golden Oldie
Loyal Member
Jan 9, 2006
1,105
0
143
Germany
*BUMP*

so noone have any clue ? ill thought that the server noticed if someone logout. in the situation one logout he save all informations from that char in the db. the prob is i searched for a way to get exp lost on death working. and i found a way that works but only till someone logout. if the one logout and login again he loose no exp. thatswhy i thought if i can give him a flag if he log dead out that i can steal him the exp if he login again with that flag. another way would be possible if i can noticed in any way if the spell ressurrection got used to bring that char back to life. so rly any ideas?
 
Upvote 0

Somebody Else

Dedicated Member
Dedicated Member
Jun 24, 2005
114
0
63
Possible using MapQuest, I think. Get UserDie to run a script setting the flag to 1, and userlogin to reset the flag and take exp? Maybe would be a great idea, since you could choose which maps you would lose exp in :) (Therefore, no exp loss in PvP!)
 
Upvote 0

Amenovis

Golden Oldie
Golden Oldie
Loyal Member
Jan 9, 2006
1,105
0
143
Germany
the prob in that case are the taos. what is if userdie script set flag and a tao ressurect him than the flag still exist. if he logout and login again the flag would take the exp unimportend if he was alive or not
 
Upvote 0

Somebody Else

Dedicated Member
Dedicated Member
Jun 24, 2005
114
0
63
Doh >< I don't know. Is it possible to start a script when a player is resurrected? Then you could set the flag back again.
 
Upvote 0

CheekyVimto

It's my Precious!
Veteran
Mar 8, 2005
400
172
130
Amenovis, give me a break down of exactly what you are trying to make happen, because I cant quite put my finger on it. And I'll see if I can come up with anything.
 
Upvote 0

Amenovis

Golden Oldie
Golden Oldie
Loyal Member
Jan 9, 2006
1,105
0
143
Germany
the problem is that the normal exp lost if u die ingame not work u have it over holley window. but it do nothing. so i was searching for a way to make it other way. i know olymp had it working and i liked it cause that make the taos relevant for the game. if u make a userdie script with hlscript undeadtown or undead u dont need realy longer taos.

my thinking was now that i can make a user die script over mapquest that check every die on all maps and all call the same script (quit simple) in that script i can take exp or set a flag that if the user logout he loose the exp after login with that flag. the prob is that the taos can ressurect him. so how i can say attention a dead char is logout and login !?! can i make a hlscriptcom checkundead at userlogin ? so does he check than if a user was dead or not ? befor server autoressurect him ?? i need nly the logic behind not the scripts self.

means does the server make first undead check or first autoressurect at login?
if it make auto ressurect can i find out or see however if a char got ressureted before by a tao? means user die no tao come user still dead (act set flag 1) or tao come ( act set flag 0) to reset the flag as secure for logout login.
the last flag check is in that case in user login and say only user loged out dead no tao come so flag is 1 so i take ur exp nw and set flag to 0
 
Upvote 0

CheekyVimto

It's my Precious!
Veteran
Mar 8, 2005
400
172
130
Ok so three major points to cover:
1) User Dies, and looses exp
2) if res'd exp not lost.
3) if logout exp lost on login.

Firstly I'm not sure if you can take exp, as I havent tried it. But I'm assuming you have already figured that part out. Guessing its either :
Code:
giveexp %user -100
Code:
takeexp %user 100

Anyways I think I have the rest figured out. The best way I can think of doing this is adding a time limit for the taos to resurrect the fallen player, lets say 3 mins for this example.

UserDeath Script:
Code:
Mapquest Trigger - UserDie
[I][COLOR="RoyalBlue"];; Flag 001 set incase player logs out[/COLOR][/I]
[@Main]
#IF
#ACT
SET [001] 1 [I][COLOR="RoyalBlue"]; Set flag incase player logs out to avoid exp loss[/COLOR][/I]
delaygoto [local] 180 @ProcessExpLoss
break

[I][COLOR="royalblue"];; If player is still dead after given time frame, the below script will run
;; will not run if player is resurrected in given timeframe[/COLOR][/I]
[@ProcessExpLoss]
#IF
HLSCRIPTCMD CHECKUNDEADINHOME
HLSCRIPTCMD CHECKUNDEAD
#ACT
TAKEEXP %USERNAME 100

#IF
#ACT
SET [001] 0    [I][COLOR="royalblue"]; Reset login flag, so user doesn't lose exp on login[/COLOR][/I]
break

Login Script Snippet:
Code:
#IF
CHECK [001] 1
#ACT
TAKEEXP %USERNAME 100
SET [001] 0

So thats the best I could come up with on short notice, I hope it helps, if it doesn't, or if it's not what you are looking for, sorry :)

/Cheeky
 
Upvote 0