Check null client and data for nametag
This commit is contained in:
@@ -80,6 +80,14 @@ function addAllNetworkEventHandlers() {
|
||||
// ===========================================================================
|
||||
|
||||
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`);
|
||||
sendNetworkEventToPlayer("agrp.nametag", null, getPlayerName(client), getPlayerNameForNameTag(client), getPlayerColour(client), getPlayerData(client).afk, getPlayerPing(client));
|
||||
}
|
||||
@@ -1323,4 +1331,10 @@ function sendClientVariablesToClient(client) {
|
||||
sendNetworkEventToPlayer("agrp.cvar", client, JSON.stringify(clientVariables));
|
||||
}
|
||||
|
||||
// ==========================================================================
|
||||
|
||||
function requestPlayerToken(client) {
|
||||
sendNetworkEventToPlayer("agrp.token", client);
|
||||
}
|
||||
|
||||
// ==========================================================================
|
||||
Reference in New Issue
Block a user