Use player utils

This commit is contained in:
Vortrex
2022-04-09 23:59:58 -05:00
parent 6774b8f175
commit 2ed4f0ab7b
8 changed files with 95 additions and 42 deletions

View File

@@ -51,8 +51,8 @@ function updatePlayerNameTag(clientName, characterName, colour, paused, ping) {
if(game.game == VRR_GAME_GTA_IV) {
let client = getPlayerFromParams(clientName);
if(client != false) {
if(client.player != null) {
client.player.setNametag(characterName, colour);
if(getPlayerPed(client) != null) {
getPlayerPed(client).setNametag(characterName, colour);
}
}
}
@@ -205,7 +205,7 @@ function updateNametags(element) {
function getClientFromPlayer(player) {
getClients().forEach(function(client) {
if(client.player == player) {
if(getPlayerPed(client) == player) {
return client;
}
});