[Suggestion] CPlayer::Reconnect()

Started by EK.IceFlake, Dec 30, 2016, 08:12 PM

Previous topic - Next topic

EK.IceFlake


DizzasTeR

function CPlayer::Reconnect() {
    ::onPlayerPart( this, 1 );
    this.Health = 0;
    ::onPlayerJoin( this );
}

EK.IceFlake

Quote from: Doom_Kill3R on Dec 31, 2016, 06:23 PMfunction CPlayer::Reconnect() {
    ::onPlayerPart( this, 1 );
    this.Health = 0;
    ::onPlayerJoin( this );
}
...
That's not a reconnect. I want to have a reconnect for restarting the server.

vito

Quote from: EK.IceFlake on Dec 31, 2016, 06:50 PMThat's not a reconnect. I want to have a reconnect for restarting the server.
If player will lost the connection he will be reconnected automatically.

.

Well I suppose you could use the `.Redirect()` method to redirect him back to your server and then kick the player. The only problem is that the player must type something like `/allowredirect` in console or something. In fact, you probably don't even have to kick him. Just force him to type that by creating a huge canvas as big as his screen with a huge lable saying "Type /whatever in your console to activate!". Not sure you could automate that with client scripts.

I'm assuming you probably want to do this after you create a user account or something like that?
.

DizzasTeR

I tried to execute the /allowredirect manually by calling onPlayerCommand( player, "allowredirect", "" ); but that didn't work. I suppose there shouldn't be a confirmation command since the server owner wants to redirect the player

jWeb

Quote from: Doom_Kill3R on Dec 31, 2016, 07:29 PMI tried to execute the /allowredirect manually by calling onPlayerCommand( player, "allowredirect", "" );

That's a client-side command. Obviously it wouldn't work with that code.