Add new utils
This commit is contained in:
@@ -1717,4 +1717,33 @@ function arrayBufferToString(arrayBuffer) {
|
|||||||
|
|
||||||
function getClientDisplayForConsole(client) {
|
function getClientDisplayForConsole(client) {
|
||||||
return `${client.name}[${client.index}]`;
|
return `${client.name}[${client.index}]`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function getBoolRedGreenInlineColour(boolVal) {
|
||||||
|
return (!boolVal) ? getColourByName("softRed") : getColourByName("softGreen");
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function updatePlayerNameTag(client) {
|
||||||
|
triggerNetworkEvent("ag.nametag", null, client.name, getPlayerNameForNameTag(client), getPlayerColour(client), false, client.ping);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function getPlayerNameForNameTag(client) {
|
||||||
|
if(isPlayerSpawned(client)) {
|
||||||
|
return `${getClientCurrentSubAccount(client).firstName} ${getClientCurrentSubAccount(client).lastName}`;
|
||||||
|
}
|
||||||
|
return client.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function isPlayerSpawned(client) {
|
||||||
|
return (localPlayer != null);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
Reference in New Issue
Block a user