Manually call spawn event for IV and Mafia 1

This commit is contained in:
Vortrex
2022-09-04 15:52:27 -05:00
parent ca30e94451
commit e9bf890772

View File

@@ -528,22 +528,24 @@ function selectCharacter(client, characterId = -1) {
//setPlayerDimension(client, spawnDimension);
restorePlayerCamera(client);
setPlayerSkin(client, skin);
setTimeout(function () {
onPlayerSpawn(client);
//stopRadioStreamForPlayer(client);
}, 500);
} else if (getGame() == AGRP_GAME_MAFIA_ONE) {
//spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0]);
//logToConsole(LOG_DEBUG, `[VRR.SubAccount] Spawning ${getPlayerDisplayForConsole(client)} as ${getGameConfig().skins[getGame()][skin][1]} (${getGameConfig().skins[getGame()][skin][0]})`);
spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0]);
setTimeout(function () {
onPlayerSpawn(client);
//stopRadioStreamForPlayer(client);
}, 250);
}
removePlayerKeyBind(client, getKeyIdFromParams("insert"));
logToConsole(LOG_DEBUG, `[VRR.SubAccount] Spawned ${getPlayerDisplayForConsole(client)} as character ID ${getPlayerData(client).currentSubAccount} with skin ${skin} (${spawnPosition.x}, ${spawnPosition.y}, ${spawnPosition.z})`);
setTimeout(function () {
onPlayerSpawn(client);
}, 500);
stopRadioStreamForPlayer(client);
getPlayerCurrentSubAccount(client).lastLogin = getCurrentUnixTimestamp();
}