Custom disconnect reason

This commit is contained in:
Vortrex
2022-03-15 04:17:58 -05:00
parent 47764b0a76
commit 297ab6f8f8
2 changed files with 10 additions and 4 deletions

View File

@@ -569,6 +569,7 @@ function loginSuccess(client) {
if(doesServerHaveTesterOnlyEnabled()) {
if(!hasBitFlag(getPlayerData(client).accountData.flags.moderation, getModerationFlagValue("IsTester"))) {
setTimeout(function() {
getPlayerData(client).customDisconnectReason = "Kicked - Not a tester";
client.disconnect();
}, 3500);

View File

@@ -60,7 +60,8 @@ function onPlayerJoin(event, client) {
fadeCamera(client, true, 1.0);
}
messageDiscordEventChannel(`👋 ${getPlayerDisplayForConsole(client)} has joined the server.`);
messageAdmins(`${client.name} is joining the server ...`);
//messageDiscordEventChannel(`👋 ${getPlayerDisplayForConsole(client)} has joined the server.`);
}
// ===========================================================================
@@ -97,7 +98,11 @@ function onPlayerQuit(event, client, quitReasonId) {
updateConnectionLogOnQuit(client, quitReasonId);
if(isPlayerLoggedIn(client)) {
messagePlayerNormal(null, `👋 ${getPlayerName(client)} has left the server (${disconnectReasons[quitReasonId]})`, getColourByName("softYellow"));
let reasonText = disconnectReasons[quitReasonId];
if(getPlayerData(client).customDisconnectReason != "") {
reasonText = getPlayerData(client).customDisconnectReason;
}
messagePlayerNormal(null, `👋 ${getPlayerName(client)} has left the server (${reasonText})`, getColourByName("softYellow"));
savePlayerToDatabase(client);
resetClientStuff(client);
getServerData().clients[client.index] = null;
@@ -587,8 +592,8 @@ function onPlayerSpawn(client) {
if(!areServerElementsSupported()) {
sendAllBusinessesToPlayer(client);
//sendAllHousesToPlayer(client);
//sendAllJobLocationsToPlayer(client);
sendAllHousesToPlayer(client);
sendAllJobsToPlayer(client);
//sendAllVehiclesToPlayer(client);
requestPlayerPedNetworkId(client);