Quit reason

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
Feb 4, 2017
71
4
1
Is there any way of telling the reason why a player left? Im trying to make a combatlog skript and would need something like

On quit:
If quit-reason is not "kicked", "timed out" etc....
Kill the player

I tried all of mundosks packets already but couldnt find a working one.
[doublepost=1490443340,1488463142][/doublepost]Could still need help with that ^^
 
Create a custom kick command.
code_language.skript:
command /kick <player>
  permission: sk.kick
  trigger:
    kick arg 1

Create a variable when the player is kicked and set it to true. For example, {was.%player%.kicked}.
code_language.skript:
command /kick <player>
  permission: sk.kick
  trigger:
    kick arg 1
    set {was.%player%.kicked} to true

Make sure the kick command runs before the combat logger!

Now, add this to your combat log:
code_language.skript:
if {was.%player%.kicked} true:
  stop

and create this to clear the kick state from the player when he logs again:
code_language.skript:
on join:
  if {was.%player%.kicked} true:
    clear {was.%player%.kicked}

(Maybe someone knows how to check the kick reason, but I don't, so this is another way for doing it. At least it will work).
 
That wont work in my case because i need i to cover Timed out, anticheat kicks, broken pipe errors etc too
 
That wont work in my case because i need i to cover Timed out, anticheat kicks, broken pipe errors etc too
So you want to kill the player if he leaves while fighting. But only of he left the game and was not kicked or anything else...

The recognize if the player times out is, as far as I know, impossible.

But you can ping the player and log the ping and read it out by a skript to see if the ping has increased drastically in the last seconds before leaving. If it's the case, the player tuned out.
[doublepost=1490561800,1490561595][/doublepost]
So you want to kill the player if he leaves while fighting. But only of he left the game and was not kicked or anything else...

The recognize if the player times out is, as far as I know, impossible.

But you can ping the player and log the ping and read it out by a skript to see if the ping has increased drastically in the last seconds before leaving. If it's the case, the player tuned out.
Something came in my mind right now... There is a possibility the disable pressing escape... (I'll look it up tomorrow)
And if the player left the server he was kicked or something else. And because he can't press escape and quit its not possible for him to quit without alt f4
 
So you want to kill the player if he leaves while fighting. But only of he left the game and was not kicked or anything else...

The recognize if the player times out is, as far as I know, impossible.

But you can ping the player and log the ping and read it out by a skript to see if the ping has increased drastically in the last seconds before leaving. If it's the case, the player tuned out.
[doublepost=1490561800,1490561595][/doublepost]
Something came in my mind right now... There is a possibility the disable pressing escape... (I'll look it up tomorrow)
And if the player left the server he was kicked or something else. And because he can't press escape and quit its not possible for him to quit without alt f4
if your saying you can use any type of server side code to disable the press of the escape button, you can't do that.
 
if your saying you can use any type of server side code to disable the press of the escape button, you can't do that.
if your saying you can use any type of server side code to disable the press of the escape button, you can't do that.
Not directly disabling the quit button but closing the players inventory. The escape screen is a inventory too (in 1.8 tested without addons)

Directly from the docs:

code_language.skript:
close [the] inventory [view] (to|of|for) %players%
"Closing will close any inventory the player has currently open."
 
Ill try that inventory idea but i was hoping for a way to get the cause out of the quit message the console gets when a player leaves or gets kicked or whatever. Those are always different, depending on the cause
 
Status
Not open for further replies.