WebCraft icon indicating copy to clipboard operation
WebCraft copied to clipboard

/kick not working for multiplayer

Open Alotario opened this issue 3 years ago • 2 comments
trafficstars

I have no idea why this is not working, but here is the code for the command:

else if ( msg.substr( 0, 5 ) == "/kick" && client.handshake.address.address == ADMIN_IP ) { var target = msg.substr( 6 ); target = server.findPlayerByName( target );

	if ( target != null ) {
			server.kick( target.socket, "Kicked by literal god" );
			return true;
	} else {
		server.sendMessage( "Couldn't find that player!", client );
		return false;
	}

If someone could help me with this ASAP that would be great.

Alotario avatar Jan 26 '22 17:01 Alotario

I know it has been two years since you have posted, but I have found the answer. first replace client.handshake.address.address with server.getIp(client) then find where ADMIN_IP is located and in the empty string write ::ffff:YOUR_IP_HERE sorry i'm a little late but good luck to you and future people who find this post :)

HotdoGuy90 avatar Jan 20 '24 01:01 HotdoGuy90

I know it has been two years since you have posted, but I have found the answer. first replace client.handshake.address.address with server.getIp(client) then find where ADMIN_IP is located and in the empty string write ::ffff:YOUR_IP_HERE sorry i'm a little late but good luck to you and future people who find this post :)

there should be a badge for this lol :P

develperbayman avatar Jan 20 '24 09:01 develperbayman