Add some IV support
This commit is contained in:
@@ -311,7 +311,9 @@ addNetworkHandler("ag.removeFromVehicle", function() {
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function processEvent(event, deltaTime) {
|
||||
gta.clearMessages();
|
||||
if(gta.game != GAME_GTA_IV) {
|
||||
gta.clearMessages();
|
||||
}
|
||||
|
||||
if(localPlayer != null) {
|
||||
if(isSpawned) {
|
||||
@@ -436,7 +438,7 @@ addEventHandler("OnDrawnHUD", function (event) {
|
||||
}
|
||||
}
|
||||
|
||||
if(renderLabels) {
|
||||
if(renderLabels && gta.game != GAME_GTA_IV) {
|
||||
processLabelRendering();
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,15 @@ addNetworkHandler("ag.nametag", function(clientName, characterName, colour, paus
|
||||
playerColours[clientName] = colour;
|
||||
playerPaused[clientName] = paused;
|
||||
playerPing[clientName] = ping;
|
||||
|
||||
if(gta.game == GAME_GTA_IV) {
|
||||
let client = getPlayerFromParams(clientName);
|
||||
if(client != false) {
|
||||
if(client.player != null) {
|
||||
client.player.setNametag(characterName, colour);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
@@ -67,7 +67,7 @@ function addAllNetworkHandlers() {
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function updatePlayerNameTag(client) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Client] Sending ${getPlayerDisplayForConsole(client)}'s updated nametag to all players`);
|
||||
//logToConsole(LOG_DEBUG, `[Asshat.Client] Sending ${getPlayerDisplayForConsole(client)}'s updated nametag to all players`);
|
||||
triggerNetworkEvent("ag.nametag", null, client.name, getPlayerNameForNameTag(client), getPlayerColour(client), false, client.ping);
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ function updateAllPlayerNameTags() {
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function updatePlayerPing(client) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Client] Sending ${getPlayerDisplayForConsole(client)}'s ping to all players`);
|
||||
//logToConsole(LOG_DEBUG, `[Asshat.Client] Sending ${getPlayerDisplayForConsole(client)}'s ping to all players`);
|
||||
triggerNetworkEvent("ag.ping", null, client.name, client.ping);
|
||||
}
|
||||
|
||||
@@ -187,8 +187,10 @@ function syncPlayerProperties(client) {
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function updatePlayerSnowState(client) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Client] Setting ${getPlayerDisplayForConsole(client)}'s snow state (Falling: ${toUpperCase(getOnOffFromBool(getServerConfig().fallingSnow))}, Ground: ${toUpperCase(getOnOffFromBool(getServerConfig().groundSnow))})`);
|
||||
triggerNetworkEvent("ag.snow", client, getServerConfig().fallingSnow, getServerConfig().groundSnow);
|
||||
if(doesGameHaveSnow(getServerGame())) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Client] Setting ${getPlayerDisplayForConsole(client)}'s snow state (Falling: ${toUpperCase(getOnOffFromBool(getServerConfig().fallingSnow))}, Ground: ${toUpperCase(getOnOffFromBool(getServerConfig().groundSnow))})`);
|
||||
triggerNetworkEvent("ag.snow", client, getServerConfig().fallingSnow, getServerConfig().groundSnow);
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -444,14 +446,14 @@ function sendPlayerSetHeading(client, heading) {
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function sendPlayerSetInterior(client, interior) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Client] Sending set heading signal to ${getPlayerDisplayForConsole(client)} (Interior: ${interior})`);
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Client] Sending set interior signal to ${getPlayerDisplayForConsole(client)} (Interior: ${interior})`);
|
||||
triggerNetworkEvent("ag.interior", client, interior);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function sendPlayerFrozenState(client, state) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Client] Sending set heading signal to ${getPlayerDisplayForConsole(client)} (State: ${toUpperCase(getYesNoFromBool(state))})`);
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Client] Sending set frozen signal to ${getPlayerDisplayForConsole(client)} (State: ${toUpperCase(getYesNoFromBool(state))})`);
|
||||
triggerNetworkEvent("ag.frozen", client, state);
|
||||
}
|
||||
|
||||
|
||||
@@ -245,7 +245,11 @@ function selectCharacter(client, characterId = -1) {
|
||||
|
||||
logToConsole(LOG_DEBUG, `[Asshat.SubAccount] Spawning ${getPlayerDisplayForConsole(client)} as character ID ${getPlayerData(client).currentSubAccount} with skin ${skin} (${spawnPosition.x}, ${spawnPosition.y}, ${spawnPosition.z})`);
|
||||
//setPlayerCameraLookAt(client, getPosBehindPos(spawnPosition, spawnHeading, 5), spawnPosition);
|
||||
spawnPlayer(client, spawnPosition, spawnHeading, skin, spawnInterior, spawnDimension);
|
||||
if(getServerGame() == GAME_GTA_IV) {
|
||||
spawnPlayer(client, spawnPosition, spawnHeading, skin);
|
||||
} else {
|
||||
spawnPlayer(client, spawnPosition, spawnHeading, skin, spawnInterior, spawnDimension);
|
||||
}
|
||||
//spawnPlayer(p(0), getServerConfig().newCharacter.spawnPosition, 0.0, 26);
|
||||
logToConsole(LOG_DEBUG, `[Asshat.SubAccount] Spawned ${getPlayerDisplayForConsole(client)} as character ID ${getPlayerData(client).currentSubAccount} with skin ${skin} (${spawnPosition.x}, ${spawnPosition.y}, ${spawnPosition.z})`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user