Add some IV support

This commit is contained in:
Vortrex
2021-02-20 20:09:07 -06:00
parent a48cdd3e72
commit d501e00092
6 changed files with 39 additions and 20 deletions

View File

@@ -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);
}

View File

@@ -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})`);