Immediately call spawn event

This commit is contained in:
Vortrex
2022-09-20 03:31:49 -05:00
parent 67b57399f3
commit b7de1e054a

View File

@@ -519,6 +519,7 @@ function selectCharacter(client, characterId = -1) {
if (getGame() <= AGRP_GAME_GTA_SA) { if (getGame() <= AGRP_GAME_GTA_SA) {
spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0], spawnInterior, spawnDimension); spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0], spawnInterior, spawnDimension);
onPlayerSpawn(client);
} else if (getGame() == AGRP_GAME_GTA_IV) { } else if (getGame() == AGRP_GAME_GTA_IV) {
//spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0], spawnInterior, spawnDimension); //spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0], spawnInterior, spawnDimension);
clearPlayerWeapons(client); clearPlayerWeapons(client);
@@ -536,10 +537,7 @@ function selectCharacter(client, characterId = -1) {
//spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0]); //spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0]);
//logToConsole(LOG_DEBUG, `[AGRP.SubAccount] Spawning ${getPlayerDisplayForConsole(client)} as ${getGameConfig().skins[getGame()][skin][1]} (${getGameConfig().skins[getGame()][skin][0]})`); //logToConsole(LOG_DEBUG, `[AGRP.SubAccount] Spawning ${getPlayerDisplayForConsole(client)} as ${getGameConfig().skins[getGame()][skin][1]} (${getGameConfig().skins[getGame()][skin][0]})`);
spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0]); spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0]);
setTimeout(function () { onPlayerSpawn(client);
onPlayerSpawn(client);
//stopRadioStreamForPlayer(client);
}, 250);
} }
removePlayerKeyBind(client, getKeyIdFromParams("insert")); removePlayerKeyBind(client, getKeyIdFromParams("insert"));