Check null client and data for nametag
This commit is contained in:
@@ -80,6 +80,14 @@ function addAllNetworkEventHandlers() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function updatePlayerNameTag(client) {
|
function updatePlayerNameTag(client) {
|
||||||
|
if (client == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getPlayerData(client) == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending ${getPlayerDisplayForConsole(client)}'s updated nametag to all players`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending ${getPlayerDisplayForConsole(client)}'s updated nametag to all players`);
|
||||||
sendNetworkEventToPlayer("agrp.nametag", null, getPlayerName(client), getPlayerNameForNameTag(client), getPlayerColour(client), getPlayerData(client).afk, getPlayerPing(client));
|
sendNetworkEventToPlayer("agrp.nametag", null, getPlayerName(client), getPlayerNameForNameTag(client), getPlayerColour(client), getPlayerData(client).afk, getPlayerPing(client));
|
||||||
}
|
}
|
||||||
@@ -1324,3 +1332,9 @@ function sendClientVariablesToClient(client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
|
function requestPlayerToken(client) {
|
||||||
|
sendNetworkEventToPlayer("agrp.token", client);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==========================================================================
|
||||||
Reference in New Issue
Block a user