Lots of fixes + clans

* Added clans
* Fixed interior exit labels
* Disabled nametags on games without 3D label support
* Fixed mouse cursor toggle command
* Fixed SA fight-style not being applied
* Added manageRanks clan permission bitflag
* Added interior lights toggle
* Fixed clan chat
* Added real-time support with optional timezone offset
* Added lots of JSDoc stuff
* Added command for managers to set server GUI colour
* Added GeoIP command for admins
* Added command for admins to force an immediate payday
* Added admins gotospawn command
* Added return player command for teleported players
* Added pizza delivery job const
* Fixed biz/house set pickup & interior type
* Fixed inventory showing ammo count for melee weapons
* Fixed SA using wrong pickup types
* Fixed char select screen breaking when in a clan
* Added +/- symbol util for number display
* Added get current timestamp for timezone offset util
* Fixed vehicle owner ID being set wrong for job veh
This commit is contained in:
Vortrex
2021-09-09 01:37:04 -05:00
parent 7b0fa01d03
commit 9c87ff950c
28 changed files with 835 additions and 165 deletions

View File

@@ -63,9 +63,26 @@ function loadSubAccountsFromAccount(accountId) {
if(dbQuery) {
while(dbAssoc = fetchQueryAssoc(dbQuery)) {
let tempSubAccount = new serverClasses.subAccountData(dbAssoc);
// Make sure skin is valid
if(tempSubAccount.skin == -1) {
tempSubAccount.skin = getServerConfig().newCharacter.skin;
}
// Check if clan and rank are still valid
if(tempSubAccount.clan != 0) {
if(!getClanData(getClanIdFromDatabaseId(tempSubAccount.clan))) {
tempSubAccount.clan = 0;
tempSubAccount.clanRank = 0;
tempSubAccount.clanTitle = "";
tempSubAccount.clanFlags = 0;
} else {
if(!getClanRankData(getClanIdFromDatabaseId(tempSubAccount.clan), tempSubAccount.clanRank)) {
tempSubAccount.clanRank = 0;
}
}
}
tempSubAccounts.push(tempSubAccount);
}
freeDatabaseQuery(dbQuery);
@@ -217,7 +234,7 @@ function showCharacterSelectToClient(client) {
getPlayerData(client).currentSubAccount = 0;
logToConsole(LOG_DEBUG, `[VRR.SubAccount] Setting ${getPlayerDisplayForConsole(client)}'s character to ID ${getPlayerData(client).currentSubAccount}`);
let tempSubAccount = getPlayerData(client).subAccounts[0];
let clanName = (tempSubAccount.clan != 0) ? getClanData(tempSubAccount.clan).name : "None";
let clanName = (tempSubAccount.clan != 0) ? getClanData(getClanIdFromDatabaseId(tempSubAccount.clan)).name : "None";
let lastPlayedText = (tempSubAccount.lastLogin != 0) ? `${msToTime(getCurrentUnixTimestamp()-tempSubAccount.lastLogin)} ago` : "Never";
showPlayerCharacterSelectGUI(client, tempSubAccount.firstName, tempSubAccount.lastName, tempSubAccount.cash, clanName, lastPlayedText, tempSubAccount.skin);
@@ -354,11 +371,16 @@ function selectCharacter(client, characterId = -1) {
logToConsole(LOG_DEBUG, `[VRR.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);
getPlayerData(client).pedState = VRR_PEDSTATE_SPAWNING;
if(getServerGame() == GAME_GTA_IV) {
spawnPlayer(client, spawnPosition, spawnHeading, skin);
} else {
if(!isGTAIV()) {
spawnPlayer(client, spawnPosition, spawnHeading, skin, spawnInterior, spawnDimension);
} else {
setPlayerPosition(client, spawnPosition);
setPlayerHeading(client, spawnHeading);
setPlayerSkin(client, skin);
restorePlayerCamera(client);
}
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() {