Use player utils

This commit is contained in:
Vortrex
2022-04-09 23:59:58 -05:00
parent 6774b8f175
commit 2ed4f0ab7b
8 changed files with 95 additions and 42 deletions

View File

@@ -1089,7 +1089,7 @@ function isValidEmailAddress(emailAddress) {
// ===========================================================================
function saveAllClientsToDatabase() {
function savePlayersToDatabase() {
logToConsole(LOG_DEBUG, "[VRR.Account]: Saving all clients to database ...");
getClients().forEach(function(client) {
savePlayerToDatabase(client);
@@ -1114,7 +1114,7 @@ function savePlayerToDatabase(client) {
if(getPlayerData(client).currentSubAccount != -1) {
//let subAccountData = getPlayerCurrentSubAccount(client);
if(client.player != null) {
if(getPlayerPed(client) != null) {
if(getPlayerData(client).returnToPosition != null) {
getPlayerCurrentSubAccount(client).spawnPosition = getPlayerData(client).returnToPosition;
getPlayerCurrentSubAccount(client).spawnHeading = getPlayerData(client).returnToHeading.z;