Jump to content

Is there a way to Force a player to disconnect or quit?


Lord Henry

Recommended Posts

  • Other Languages Moderators

Hello everyone.

I was testing some commands on Console, and I can use normally this to make the player User#ff00ffname logout from the server.

aexec User#ff00ffname logout

BUT

If I try this below, it doesn't work.

aexec User#ff00ffname disconnect

or

aexec User#ff00ffname quit

Can someone explain a way to make it? Or it is not possible anyway?

Link to comment
  • Other Languages Moderators
14 minutes ago, Tails said:

Why not just kick them?

Because I do not want the player to know who kicked him for safety. I am thinking of cases where the server was hacked and the hackers changed the ACLs. So I must do it without being in the server and without any player realizes what I'm doing.

Link to comment

good finally you can create a script using.

addCommandHandler("Command",functionNameHere) --....
kickPlayer() --Please note that this can only be used in serving sid

You will need to give permission to your script in order to use the function kickPlayer.

You can do this by simply adding in your admin group (resource.resourcename) or ..

add it in the goal of your script

meta.XML

<aclrequest>
	<right name="function.function.kickPlayer" access="true" />
</aclrequest>

use this command in cmd or manually do to give permission to your script.


command.

Quote

aclrequest allow resourceName all

this will help to do what you want it will only tell something in the chat if you use outputChatBox .. or have any script that uses OnClientPlayerQuit justifying reason to kick.

fontes:

https://wiki.multitheftauto.com/wiki/KickPlayer

https://wiki.multitheftauto.com/wiki/AddCommandHandler

Link to comment

The reason why you can't use disconnect or quit with aexec is that those are client commands. Not meaning that they are client-sided but that they are in the client itself and can be used even without being connected to any server. Same applies for connect, reconnect, screenshot and so on.

The only way to make player disconnect is to kick them, kickPlayer has a responsiblePlayer argument that can be a string, so you can put in anything you want to make the kick 'anonymous'. Can't think of any other way, sure you could try to crash the player's game but MTA is too good for that, at least I'm not familiar with any way of crashing the client's game.

@01010011 i don't think that's gonna make the client 'explode', infinite loops get detected and terminated automatically.

Edited by MIKI785
  • Like 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...