You will need to obtain the character ID that you want to disconnect. You can use the following query to get the character ID from the database.
SELECT CharID FROM _OnlinePlayers WHERE CharName16 = 'character_name'
Stored Procedure: _Char_Disconnect
Parameters:
@CharID INT- Target character ID@Message VARCHAR(255)- Reason for disconnection
Let us first test whether the command works by using the following code, which will disconnect the specified character.
USE [vPlus] GO DECLARE @CharID INT = (SELECT CharID FROM _OnlinePlayers WHERE CharName16 = 'character_name') EXEC _Char_Disconnect @CharID, 'You have been disconnected by the server';
For real usage, use @CharID directly from your calling procedure.
EXEC _Char_Disconnect @CharID, 'You have been disconnected by the server';