Change prefix of consts
This commit is contained in:
@@ -8,35 +8,35 @@
|
||||
// ===========================================================================
|
||||
|
||||
// Account Contact Types
|
||||
const VRR_CONTACT_NONE = 0;
|
||||
const VRR_CONTACT_NEUTRAL = 1; // Contact is neutral. Used for general contacts with no special additional features
|
||||
const VRR_CONTACT_FRIEND = 2; // Contact is a friend. Shows when they're online.
|
||||
const VRR_CONTACT_BLOCKED = 3; // Contact is blocked. Prevents all communication to/from them except for RP
|
||||
const AGRP_CONTACT_NONE = 0;
|
||||
const AGRP_CONTACT_NEUTRAL = 1; // Contact is neutral. Used for general contacts with no special additional features
|
||||
const AGRP_CONTACT_FRIEND = 2; // Contact is a friend. Shows when they're online.
|
||||
const AGRP_CONTACT_BLOCKED = 3; // Contact is blocked. Prevents all communication to/from them except for RP
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
// Account Authentication Methods
|
||||
const VRR_ACCT_AUTHMETHOD_NONE = 0; // None
|
||||
const VRR_ACCT_AUTHMETHOD_EMAIL = 1; // Email
|
||||
const VRR_ACCT_AUTHMETHOD_PHONENUM = 2; // Phone number
|
||||
const VRR_ACCT_AUTHMETHOD_2FA = 3; // Two factor authentication app (authy, google authenticator, etc)
|
||||
const VRR_ACCT_AUTHMETHOD_PEBBLE = 4; // Pebble watch (this one's for Vortrex but anybody with a Pebble can use)
|
||||
const VRR_ACCT_AUTHMETHOD_PHONEAPP = 5; // The Android/iOS companion app (will initially be a web based thing until I can get the apps created)
|
||||
const AGRP_ACCT_AUTHMETHOD_NONE = 0; // None
|
||||
const AGRP_ACCT_AUTHMETHOD_EMAIL = 1; // Email
|
||||
const AGRP_ACCT_AUTHMETHOD_PHONENUM = 2; // Phone number
|
||||
const AGRP_ACCT_AUTHMETHOD_2FA = 3; // Two factor authentication app (authy, google authenticator, etc)
|
||||
const AGRP_ACCT_AUTHMETHOD_PEBBLE = 4; // Pebble watch (this one's for Vortrex but anybody with a Pebble can use)
|
||||
const AGRP_ACCT_AUTHMETHOD_PHONEAPP = 5; // The Android/iOS companion app (will initially be a web based thing until I can get the apps created)
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
// Two-Factor Authentication States
|
||||
const VRR_2FA_STATE_NONE = 0; // None
|
||||
const VRR_2FA_STATE_CODEINPUT = 1; // Waiting on player to enter code to play
|
||||
const VRR_2FA_STATE_SETUP_CODETOAPP = 2; // Providing player with a code to put in their auth app
|
||||
const VRR_2FA_STATE_SETUP_CODEFROMAPP = 3; // Waiting on player to enter code from auth app to set up
|
||||
const AGRP_2FA_STATE_NONE = 0; // None
|
||||
const AGRP_2FA_STATE_CODEINPUT = 1; // Waiting on player to enter code to play
|
||||
const AGRP_2FA_STATE_SETUP_CODETOAPP = 2; // Providing player with a code to put in their auth app
|
||||
const AGRP_2FA_STATE_SETUP_CODEFROMAPP = 3; // Waiting on player to enter code from auth app to set up
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
// Reset Password States
|
||||
const VRR_RESETPASS_STATE_NONE = 0; // None
|
||||
const VRR_RESETPASS_STATE_CODEINPUT = 1; // Waiting on player to enter code sent via email
|
||||
const VRR_RESETPASS_STATE_SETPASS = 2; // Waiting on player to enter new password
|
||||
const AGRP_RESETPASS_STATE_NONE = 0; // None
|
||||
const AGRP_RESETPASS_STATE_CODEINPUT = 1; // Waiting on player to enter code sent via email
|
||||
const AGRP_RESETPASS_STATE_SETPASS = 2; // Waiting on player to enter new password
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
@@ -811,7 +811,7 @@ function loginSuccess(client) {
|
||||
if (getPlayerData(client).subAccounts.length == 0) {
|
||||
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||
showPlayerPrompt(client, getLocaleString(client, "NoCharactersGUIMessage"), getLocaleString(client, "NoCharactersGUIWindowTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
||||
getPlayerData(client).promptType = VRR_PROMPT_CREATEFIRSTCHAR;
|
||||
getPlayerData(client).promptType = AGRP_PROMPT_CREATEFIRSTCHAR;
|
||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the no characters prompt GUI`);
|
||||
} else {
|
||||
messagePlayerAlert(client, getLocaleString(client, "NoCharactersChatMessage", `{ALTCOLOUR}/newchar{MAINCOLOUR}`));
|
||||
@@ -1209,7 +1209,7 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress
|
||||
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||
showPlayerRegistrationSuccessGUI(client);
|
||||
showPlayerPrompt(client, getLocaleString(client, "NoCharactersMessage"), getLocaleString(client, "NoCharactersWindowTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
||||
getPlayerData(client).promptType = VRR_PROMPT_CREATEFIRSTCHAR;
|
||||
getPlayerData(client).promptType = AGRP_PROMPT_CREATEFIRSTCHAR;
|
||||
} else {
|
||||
messagePlayerAlert(client, getLocaleString(client, "NoCharactersChatMessage"), `{ALTCOLOUR}/newchar{MAINCOLOUR}`);
|
||||
}
|
||||
@@ -1224,7 +1224,7 @@ function checkAccountResetPasswordRequest(client, inputText) {
|
||||
}
|
||||
|
||||
switch (getPlayerData(client).passwordResetState) {
|
||||
case VRR_RESETPASS_STATE_EMAILCONFIRM: {
|
||||
case AGRP_RESETPASS_STATE_EMAILCONFIRM: {
|
||||
if (toLowerCase(getPlayerData(client).accountData.emailAddress) != toLowerCase(inputText)) {
|
||||
logToConsole(LOG_INFO | LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to reset their password (email not correct)`);
|
||||
showPlayerErrorGUI(client, getLocaleString(client, "GUIErrorResetPasswordFailedInvalidEmail"), getLocaleString(client, "GUIErrorTitle"), getLocaleString(client, "GUIOkButton"));
|
||||
@@ -1232,7 +1232,7 @@ function checkAccountResetPasswordRequest(client, inputText) {
|
||||
}
|
||||
|
||||
let passwordResetCode = toUpperCase(generateEmailVerificationCode());
|
||||
getPlayerData(client).passwordResetState = VRR_RESETPASS_STATE_CODEINPUT;
|
||||
getPlayerData(client).passwordResetState = AGRP_RESETPASS_STATE_CODEINPUT;
|
||||
getPlayerData(client).passwordResetCode = passwordResetCode;
|
||||
showPlayerResetPasswordCodeInputGUI(client);
|
||||
sendPasswordResetEmail(client, passwordResetCode);
|
||||
@@ -1240,11 +1240,11 @@ function checkAccountResetPasswordRequest(client, inputText) {
|
||||
break;
|
||||
}
|
||||
|
||||
case VRR_RESETPASS_STATE_CODEINPUT: {
|
||||
case AGRP_RESETPASS_STATE_CODEINPUT: {
|
||||
logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} submitted code for password reset (${inputText}) ...`);
|
||||
if (inputText != "") {
|
||||
if (getPlayerData(client).passwordResetCode == toUpperCase(inputText)) {
|
||||
getPlayerData(client).passwordResetState = VRR_RESETPASS_STATE_SETPASS;
|
||||
getPlayerData(client).passwordResetState = AGRP_RESETPASS_STATE_SETPASS;
|
||||
showPlayerChangePasswordGUI(client);
|
||||
logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} entered the correct reset password verification code. Awaiting new password input ...`);
|
||||
} else {
|
||||
@@ -1261,10 +1261,10 @@ function checkAccountResetPasswordRequest(client, inputText) {
|
||||
break;
|
||||
}
|
||||
|
||||
case VRR_RESETPASS_STATE_NONE: {
|
||||
case AGRP_RESETPASS_STATE_NONE: {
|
||||
logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} requested a password reset. Awaiting email input ...`);
|
||||
showPlayerResetPasswordEmailInputGUI(client);
|
||||
getPlayerData(client).passwordResetState = VRR_RESETPASS_STATE_EMAILCONFIRM;
|
||||
getPlayerData(client).passwordResetState = AGRP_RESETPASS_STATE_EMAILCONFIRM;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1276,8 +1276,8 @@ function checkAccountResetPasswordRequest(client, inputText) {
|
||||
|
||||
function checkAccountChangePassword(client, newPassword, confirmNewPassword) {
|
||||
if (!isPlayerLoggedIn(client)) {
|
||||
if (getPlayerData(client).passwordResetState != VRR_RESETPASS_STATE_SETPASS) {
|
||||
//getPlayerData(client).passwordResetState = VRR_RESETPASS_STATE_NONE;
|
||||
if (getPlayerData(client).passwordResetState != AGRP_RESETPASS_STATE_SETPASS) {
|
||||
//getPlayerData(client).passwordResetState = AGRP_RESETPASS_STATE_NONE;
|
||||
//disconnectPlayer(client);
|
||||
logToConsole(LOG_DEBUG | LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to change their password (not logged in or not using reset password)`);
|
||||
return false;
|
||||
@@ -1313,8 +1313,8 @@ function checkAccountChangePassword(client, newPassword, confirmNewPassword) {
|
||||
|
||||
saveAccountToDatabase(getPlayerData(client).accountData);
|
||||
|
||||
if (getPlayerData(client).passwordResetState == VRR_RESETPASS_STATE_SETPASS) {
|
||||
getPlayerData(client).passwordResetState = VRR_RESETPASS_STATE_NONE;
|
||||
if (getPlayerData(client).passwordResetState == AGRP_RESETPASS_STATE_SETPASS) {
|
||||
getPlayerData(client).passwordResetState = AGRP_RESETPASS_STATE_NONE;
|
||||
}
|
||||
|
||||
messagePlayerSuccess(client, getLocaleString(client, "PasswordChanged"));
|
||||
@@ -1355,7 +1355,7 @@ function savePlayerToDatabase(client) {
|
||||
//let subAccountData = getPlayerCurrentSubAccount(client);
|
||||
|
||||
if (getPlayerPed(client) != null) {
|
||||
if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType != VRR_RETURNTO_TYPE_ADMINGET) {
|
||||
if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType != AGRP_RETURNTO_TYPE_ADMINGET) {
|
||||
getPlayerCurrentSubAccount(client).spawnPosition = getPlayerData(client).returnToPosition;
|
||||
getPlayerCurrentSubAccount(client).spawnHeading = getPlayerData(client).returnToHeading.z;
|
||||
getPlayerCurrentSubAccount(client).interior = getPlayerData(client).returnToInterior;
|
||||
|
||||
@@ -34,8 +34,8 @@ function playPlayerAnimationCommand(command, params, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getAnimationData(animationSlot)[3] == VRR_ANIMTYPE_SURRENDER) {
|
||||
getPlayerData(client).pedState = VRR_PEDSTATE_HANDSUP;
|
||||
if (getAnimationData(animationSlot)[3] == AGRP_ANIMTYPE_SURRENDER) {
|
||||
getPlayerData(client).pedState = AGRP_PEDSTATE_HANDSUP;
|
||||
}
|
||||
|
||||
if (isPlayerHandCuffed(client) || isPlayerTazed(client) || isPlayerInForcedAnimation(client)) {
|
||||
@@ -98,8 +98,8 @@ function makePlayerPlayAnimation(client, animationSlot, offsetPosition = 1) {
|
||||
|
||||
makePedPlayAnimation(getPlayerPed(client), animationSlot, offsetPosition);
|
||||
setEntityData(getPlayerPed(client), "agrp.anim", animationSlot, true);
|
||||
//if(getAnimationData(animationSlot)[9] != VRR_ANIMMOVE_NONE) {
|
||||
// if(getGame() < VRR_GAME_GTA_SA) {
|
||||
//if(getAnimationData(animationSlot)[9] != AGRP_ANIMMOVE_NONE) {
|
||||
// if(getGame() < AGRP_GAME_GTA_SA) {
|
||||
// setPlayerMouseCameraState(client, true);
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
// ===========================================================================
|
||||
|
||||
// House Owner Types
|
||||
const VRR_BANK_ACCT_OWNER_NONE = 0; // Not owned
|
||||
const VRR_BANK_ACCT_OWNER_PLAYER = 1; // Owner is a player (character/subaccount)
|
||||
const VRR_BANK_ACCT_OWNER_JOB = 2; // Owned by a job
|
||||
const VRR_BANK_ACCT_OWNER_CLAN = 3; // Owned by a clan
|
||||
const VRR_BANK_ACCT_OWNER_FACTION = 4; // Owned by a faction
|
||||
const VRR_BANK_ACCT_OWNER_BIZ = 4; // Owned by a faction
|
||||
const VRR_BANK_ACCT_OWNER_PUBLIC = 5; // Is a public bank account. Technically not owned. This probably won't be used.
|
||||
const AGRP_BANK_ACCT_OWNER_NONE = 0; // Not owned
|
||||
const AGRP_BANK_ACCT_OWNER_PLAYER = 1; // Owner is a player (character/subaccount)
|
||||
const AGRP_BANK_ACCT_OWNER_JOB = 2; // Owned by a job
|
||||
const AGRP_BANK_ACCT_OWNER_CLAN = 3; // Owned by a clan
|
||||
const AGRP_BANK_ACCT_OWNER_FACTION = 4; // Owned by a faction
|
||||
const AGRP_BANK_ACCT_OWNER_BIZ = 4; // Owned by a faction
|
||||
const AGRP_BANK_ACCT_OWNER_PUBLIC = 5; // Is a public bank account. Technically not owned. This probably won't be used.
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
|
||||
@@ -8,33 +8,33 @@
|
||||
// ===========================================================================
|
||||
|
||||
// Business Types
|
||||
const VRR_BIZ_TYPE_NONE = 0; // None (invalid)
|
||||
const VRR_BIZ_TYPE_NORMAL = 1; // Normal business (sells items)
|
||||
const VRR_BIZ_TYPE_BANK = 2; // Bank
|
||||
const VRR_BIZ_TYPE_PUBLIC = 3; // Public business (Government, public service, etc)
|
||||
const VRR_BIZ_TYPE_PAINTBALL = 4; // Paintball arena. Player joins paintball/airsoft when they enter
|
||||
const AGRP_BIZ_TYPE_NONE = 0; // None (invalid)
|
||||
const AGRP_BIZ_TYPE_NORMAL = 1; // Normal business (sells items)
|
||||
const AGRP_BIZ_TYPE_BANK = 2; // Bank
|
||||
const AGRP_BIZ_TYPE_PUBLIC = 3; // Public business (Government, public service, etc)
|
||||
const AGRP_BIZ_TYPE_PAINTBALL = 4; // Paintball arena. Player joins paintball/airsoft when they enter
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
// Business Location Types
|
||||
const VRR_BIZ_LOC_NONE = 0; // None
|
||||
const VRR_BIZ_LOC_GATE = 1; // Center of any moveable gate that belongs to the biz
|
||||
const VRR_BIZ_LOC_GARAGE = 2; // Location for attached garage (pos1 = outside, pos2 = inside). Use pos to teleport or spawn veh/ped
|
||||
const VRR_BIZ_LOC_FUEL = 3; // Fuel pump
|
||||
const VRR_BIZ_LOC_DRIVETHRU = 4; // Drivethrough
|
||||
const VRR_BIZ_LOC_VENDMACHINE = 5; // Vending machine
|
||||
const VRR_BIZ_LOC_ATM = 6; // ATM
|
||||
const VRR_BIZ_LOC_PAYPHONE = 7; // Payphone
|
||||
const AGRP_BIZ_LOC_NONE = 0; // None
|
||||
const AGRP_BIZ_LOC_GATE = 1; // Center of any moveable gate that belongs to the biz
|
||||
const AGRP_BIZ_LOC_GARAGE = 2; // Location for attached garage (pos1 = outside, pos2 = inside). Use pos to teleport or spawn veh/ped
|
||||
const AGRP_BIZ_LOC_FUEL = 3; // Fuel pump
|
||||
const AGRP_BIZ_LOC_DRIVETHRU = 4; // Drivethrough
|
||||
const AGRP_BIZ_LOC_VENDMACHINE = 5; // Vending machine
|
||||
const AGRP_BIZ_LOC_ATM = 6; // ATM
|
||||
const AGRP_BIZ_LOC_PAYPHONE = 7; // Payphone
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
// Business Owner Types
|
||||
const VRR_BIZ_OWNER_NONE = 0; // Not owned
|
||||
const VRR_BIZ_OWNER_PLAYER = 1; // Owned by a player (character/subaccount)
|
||||
const VRR_BIZ_OWNER_JOB = 2; // Owned by a job
|
||||
const VRR_BIZ_OWNER_CLAN = 3; // Owned by a clan
|
||||
const VRR_BIZ_OWNER_FACTION = 4; // Owned by a faction (not used at the moment)
|
||||
const VRR_BIZ_OWNER_PUBLIC = 5; // Public Business. Used for goverment/official places like police, fire, city hall, DMV, etc
|
||||
const AGRP_BIZ_OWNER_NONE = 0; // Not owned
|
||||
const AGRP_BIZ_OWNER_PLAYER = 1; // Owned by a player (character/subaccount)
|
||||
const AGRP_BIZ_OWNER_JOB = 2; // Owned by a job
|
||||
const AGRP_BIZ_OWNER_CLAN = 3; // Owned by a clan
|
||||
const AGRP_BIZ_OWNER_FACTION = 4; // Owned by a faction (not used at the moment)
|
||||
const AGRP_BIZ_OWNER_PUBLIC = 5; // Public Business. Used for goverment/official places like police, fire, city hall, DMV, etc
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
@@ -48,7 +48,7 @@ class BusinessData {
|
||||
constructor(dbAssoc = false) {
|
||||
this.databaseId = 0;
|
||||
this.name = "";
|
||||
this.ownerType = VRR_BIZ_OWNER_NONE;
|
||||
this.ownerType = AGRP_BIZ_OWNER_NONE;
|
||||
this.ownerId = 0;
|
||||
this.buyPrice = 0;
|
||||
this.locked = false;
|
||||
@@ -56,7 +56,7 @@ class BusinessData {
|
||||
this.index = -1;
|
||||
this.needsSaved = false;
|
||||
this.interiorLights = true;
|
||||
this.type = VRR_BIZ_TYPE_NONE;
|
||||
this.type = AGRP_BIZ_TYPE_NONE;
|
||||
|
||||
this.floorItemCache = [];
|
||||
this.storageItemCache = [];
|
||||
@@ -87,7 +87,7 @@ class BusinessData {
|
||||
this.streamingRadioStation = 0;
|
||||
//this.streamingRadioStationIndex = -1;
|
||||
|
||||
this.labelHelpType = VRR_PROPLABEL_INFO_NONE;
|
||||
this.labelHelpType = AGRP_PROPLABEL_INFO_NONE;
|
||||
|
||||
if (dbAssoc) {
|
||||
this.databaseId = toInteger(dbAssoc["biz_id"]);
|
||||
@@ -495,7 +495,7 @@ function setBusinessOwnerCommand(command, params, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
getBusinessData(businessId).ownerType = VRR_BIZ_OWNER_PLAYER;
|
||||
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_PLAYER;
|
||||
getBusinessData(businessId).ownerId = getPlayerCurrentSubAccount(newBusinessOwner).databaseId;
|
||||
getBusinessData(businessId).needsSaved = true;
|
||||
|
||||
@@ -537,7 +537,7 @@ function setBusinessJobCommand(command, params, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
getBusinessData(businessId).ownerType = VRR_BIZ_OWNER_JOB;
|
||||
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_JOB;
|
||||
getBusinessData(businessId).ownerId = getJobData(jobId).databaseId;
|
||||
getBusinessData(businessId).needsSaved = true;
|
||||
|
||||
@@ -570,7 +570,7 @@ function setBusinessClanCommand(command, params, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getBusinessData(business).ownerType != VRR_VEHOWNER_PLAYER) {
|
||||
if (getBusinessData(business).ownerType != AGRP_VEHOWNER_PLAYER) {
|
||||
messagePlayerError(client, getLocaleString(client, "MustOwnBusiness"));
|
||||
return false;
|
||||
}
|
||||
@@ -581,9 +581,9 @@ function setBusinessClanCommand(command, params, client) {
|
||||
}
|
||||
|
||||
showPlayerPrompt(client, getLocaleString(client, "SetBusinessClanConfirmMessage"), getLocaleString(client, "SetBusinessClanConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
||||
getPlayerData(client).promptType = VRR_PROMPT_BIZGIVETOCLAN;
|
||||
getPlayerData(client).promptType = AGRP_PROMPT_BIZGIVETOCLAN;
|
||||
|
||||
//getBusinessData(businessId).ownerType = VRR_BIZ_OWNER_CLAN;
|
||||
//getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_CLAN;
|
||||
//getBusinessData(businessId).ownerId = getClanData(clanId).databaseId;
|
||||
//getBusinessData(businessId).needsSaved = true;
|
||||
}
|
||||
@@ -614,7 +614,7 @@ function setBusinessRankCommand(command, params, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getVehicleData(vehicle).ownerType == VRR_VEHOWNER_CLAN) {
|
||||
if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_CLAN) {
|
||||
let clanId = getClanIdFromDatabaseId(getBusinessData(businessId).ownerId);
|
||||
rankId = getClanRankFromParams(clanId, params);
|
||||
if (!getClanRankData(clanId, rankId)) {
|
||||
@@ -623,7 +623,7 @@ function setBusinessRankCommand(command, params, client) {
|
||||
}
|
||||
getBusinessData(businessId).rank = getClanRankData(clanId, rankId).databaseId;
|
||||
messagePlayerSuccess(client, `{MAINCOLOUR}You set business {businessBlue}${getBusinessData(businessId).name} {MAINCOLOUR}rank to {ALTCOLOUR}${getClanRankData(clanId, rankId).name} {MAINCOLOUR}of the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan!`);
|
||||
} else if (getBusinessData(businessId).ownerType == VRR_VEHOWNER_JOB) {
|
||||
} else if (getBusinessData(businessId).ownerType == AGRP_VEHOWNER_JOB) {
|
||||
getBusinessData(businessId).rank = rankId;
|
||||
messagePlayerSuccess(client, `{MAINCOLOUR}You set business {businessBlue}${getBusinessData(businessId).name} {MAINCOLOUR}rank to {ALTCOLOUR}${rankId} {MAINCOLOUR}of the {jobYellow}${getJobData(getJobIdFromDatabaseId(getBusinessData(businessId).ownerId)).name} {MAINCOLOUR}job!`);
|
||||
}
|
||||
@@ -720,7 +720,7 @@ function setBusinessJobCommand(command, params, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
getBusinessData(businessId).ownerType = VRR_BIZ_OWNER_JOB;
|
||||
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_JOB;
|
||||
getBusinessData(businessId).ownerId = getJobData(jobId).databaseId;
|
||||
|
||||
getBusinessData(businessId).needsSaved = true;
|
||||
@@ -750,7 +750,7 @@ function setBusinessPublicCommand(command, params, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
getBusinessData(businessId).ownerType = VRR_BIZ_OWNER_PUBLIC;
|
||||
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_PUBLIC;
|
||||
getBusinessData(businessId).ownerId = 0;
|
||||
|
||||
getBusinessData(businessId).needsSaved = true;
|
||||
@@ -780,7 +780,7 @@ function removeBusinessOwnerCommand(command, params, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
getBusinessData(businessId).ownerType = VRR_BIZ_OWNER_NONE;
|
||||
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_NONE;
|
||||
getBusinessData(businessId).ownerId = -1;
|
||||
getBusinessData(businessId).needsSaved = true;
|
||||
|
||||
@@ -872,7 +872,7 @@ function setBusinessPaintBallCommand(command, params, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
getBusinessData(businessId).entranceType = VRR_BIZ_ENTRANCE_TYPE_PAINTBALL;
|
||||
getBusinessData(businessId).entranceType = AGRP_BIZ_ENTRANCE_TYPE_PAINTBALL;
|
||||
getBusinessData(businessId).needsSaved = true;
|
||||
messagePlayerSuccess(client, getLocaleString(client, "BusinessIsNowPaintBall"));
|
||||
}
|
||||
@@ -904,24 +904,24 @@ function getBusinessInfoCommand(command, params, client) {
|
||||
|
||||
let ownerName = "Unknown";
|
||||
switch (businessData.ownerType) {
|
||||
case VRR_BIZ_OWNER_CLAN:
|
||||
case AGRP_BIZ_OWNER_CLAN:
|
||||
ownerName = getClanData(businessData.ownerId).name;
|
||||
break;
|
||||
|
||||
case VRR_BIZ_OWNER_JOB:
|
||||
case AGRP_BIZ_OWNER_JOB:
|
||||
ownerName = getJobData(businessData.ownerId).name;
|
||||
break;
|
||||
|
||||
case VRR_BIZ_OWNER_PLAYER:
|
||||
case AGRP_BIZ_OWNER_PLAYER:
|
||||
let subAccountData = loadSubAccountFromId(businessData.ownerId);
|
||||
ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`;
|
||||
break;
|
||||
|
||||
case VRR_BIZ_OWNER_PUBLIC:
|
||||
case AGRP_BIZ_OWNER_PUBLIC:
|
||||
ownerName = "Public";
|
||||
break;
|
||||
|
||||
case VRR_BIZ_OWNER_NONE:
|
||||
case AGRP_BIZ_OWNER_NONE:
|
||||
//submitBugReport(client, `[AUTOMATED REPORT] getBusinessInfoCommand() - Invalid ownerType for business ${businessId}/${getBusinessData(businessId).databaseId}`);
|
||||
ownerName = "None";
|
||||
break;
|
||||
@@ -1274,7 +1274,7 @@ function giveDefaultItemsToBusinessCommand(command, params, client) {
|
||||
let itemTypeId = getItemTypeFromParams(getGameConfig().defaultBusinessItems[getGame()][typeParam][i][0]);
|
||||
let itemTypeData = getItemTypeData(itemTypeId);
|
||||
if (itemTypeData) {
|
||||
let newItemIndex = createItem(itemTypeId, itemTypeData.orderValue, VRR_ITEM_OWNER_BIZFLOOR, getBusinessData(businessId).databaseId, getGameConfig().defaultBusinessItems[getGame()][typeParam][i][1]);
|
||||
let newItemIndex = createItem(itemTypeId, itemTypeData.orderValue, AGRP_ITEM_OWNER_BIZFLOOR, getBusinessData(businessId).databaseId, getGameConfig().defaultBusinessItems[getGame()][typeParam][i][1]);
|
||||
getItemData(newItemIndex).buyPrice = applyServerInflationMultiplier(itemTypeData.orderPrice) * getGameConfig().defaultBusinessItems[getGame()][typeParam][i][2];
|
||||
}
|
||||
}
|
||||
@@ -1303,7 +1303,7 @@ function setBusinessEntranceLabelToDealershipCommand(command, params, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
getBusinessData(businessId).labelHelpType == VRR_PROPLABEL_INFO_ENTERVEHICLE;
|
||||
getBusinessData(businessId).labelHelpType == AGRP_PROPLABEL_INFO_ENTERVEHICLE;
|
||||
updateBusinessPickupLabelData(businessId);
|
||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set the business type of {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} to dealership`);
|
||||
}
|
||||
@@ -1545,7 +1545,7 @@ function orderItemForBusinessCommand(command, params, client) {
|
||||
|
||||
let orderTotalCost = pricePerItem * amount;
|
||||
|
||||
//getPlayerData(client).promptType = VRR_PROMPT_BIZORDER;
|
||||
//getPlayerData(client).promptType = AGRP_PROMPT_BIZORDER;
|
||||
getPlayerData(client).businessOrderAmount = amount;
|
||||
getPlayerData(client).businessOrderBusiness = businessId;
|
||||
getPlayerData(client).businessOrderItem = itemType;
|
||||
@@ -1554,7 +1554,7 @@ function orderItemForBusinessCommand(command, params, client) {
|
||||
|
||||
getBusinessData(businessId).needsSaved = true;
|
||||
showPlayerPrompt(client, `Ordering ${amount} ${getPluralForm(getItemTypeData(itemType).name)} (${getItemValueDisplay(itemType, value)}) at $${makeLargeNumberReadable(pricePerItem)} each will cost a total of $${makeLargeNumberReadable(orderTotalCost)}`, "Business Order Cost");
|
||||
getPlayerData(client).promptType = VRR_PROMPT_BIZORDER;
|
||||
getPlayerData(client).promptType = AGRP_PROMPT_BIZORDER;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -1641,7 +1641,7 @@ function buyBusinessCommand(command, params, client) {
|
||||
}
|
||||
|
||||
showPlayerPrompt(client, getLocaleString(client, "BuyBusinessConfirmMessage"), getLocaleString(client, "BuyBusinessConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
||||
getPlayerData(client).promptType = VRR_PROMPT_BIZBUY;
|
||||
getPlayerData(client).promptType = AGRP_PROMPT_BIZBUY;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -2341,17 +2341,17 @@ function exitBusiness(client) {
|
||||
*/
|
||||
function getBusinessOwnerTypeText(ownerType) {
|
||||
switch (ownerType) {
|
||||
case VRR_BIZ_OWNER_CLAN:
|
||||
case AGRP_BIZ_OWNER_CLAN:
|
||||
return "clan";
|
||||
|
||||
case VRR_BIZ_OWNER_JOB:
|
||||
case AGRP_BIZ_OWNER_JOB:
|
||||
return "job";
|
||||
|
||||
case VRR_BIZ_OWNER_PLAYER:
|
||||
case AGRP_BIZ_OWNER_PLAYER:
|
||||
return "player";
|
||||
|
||||
case VRR_BIZ_OWNER_NONE:
|
||||
case VRR_BIZ_OWNER_PUBLIC:
|
||||
case AGRP_BIZ_OWNER_NONE:
|
||||
case AGRP_BIZ_OWNER_PUBLIC:
|
||||
return "not owned";
|
||||
|
||||
default:
|
||||
@@ -2537,7 +2537,7 @@ function setBusinessDataIndexes() {
|
||||
//}
|
||||
|
||||
for (let j in getServerData().businesses[i].locations) {
|
||||
if (getServerData().businesses[i].locations[j].type == VRR_BIZ_LOC_ATM) {
|
||||
if (getServerData().businesses[i].locations[j].type == AGRP_BIZ_LOC_ATM) {
|
||||
getServerData().atmLocationCache.push([i, j, getServerData().businesses[i].locations[j].position]);
|
||||
}
|
||||
}
|
||||
@@ -2553,7 +2553,7 @@ function addToBusinessInventory(businessId, itemType, amount, buyPrice) {
|
||||
tempItemData.buyPrice = buyPrice;
|
||||
tempItemData.itemType = getItemTypeData(itemType).databaseId;
|
||||
tempItemData.ownerId = getBusinessData(business).databaseId;
|
||||
tempItemData.ownerType = VRR_ITEMOWNER_BIZ;
|
||||
tempItemData.ownerType = AGRP_ITEMOWNER_BIZ;
|
||||
tempItemData.ownerIndex = businessId;
|
||||
tempItemData.itemTypeIndex = itemType;
|
||||
saveItemToDatabase(tempItemData);
|
||||
@@ -2645,7 +2645,7 @@ function buyFromBusinessCommand(command, params, client) {
|
||||
}
|
||||
|
||||
takePlayerCash(client, totalCost);
|
||||
createItem(getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).itemTypeIndex, getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).value, VRR_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId, amount);
|
||||
createItem(getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).itemTypeIndex, getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).value, AGRP_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId, amount);
|
||||
cachePlayerHotBarItems(client);
|
||||
getBusinessData(businessId).till = getBusinessData(businessId).till + totalCost;
|
||||
|
||||
@@ -2655,7 +2655,7 @@ function buyFromBusinessCommand(command, params, client) {
|
||||
}
|
||||
|
||||
let useType = getItemTypeData(getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).itemTypeIndex).useType;
|
||||
if (useType == VRR_ITEM_USE_TYPE_WEAPON || VRR_ITEM_USE_TYPE_TAZER || useType == VRR_ITEM_USE_TYPE_AMMO_CLIP) {
|
||||
if (useType == AGRP_ITEM_USE_TYPE_WEAPON || AGRP_ITEM_USE_TYPE_TAZER || useType == AGRP_ITEM_USE_TYPE_AMMO_CLIP) {
|
||||
if (isPlayerWeaponBanned(client) && !isPlayerExemptFromAntiCheat(client)) {
|
||||
messagePlayerError(client, getLocaleString(client, "WeaponBanned"));
|
||||
return false;
|
||||
@@ -2754,7 +2754,7 @@ function storeItemInBusinessStorageCommand(command, params, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).ownerType = VRR_ITEM_OWNER_BIZSTORAGE;
|
||||
getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).ownerType = AGRP_ITEM_OWNER_BIZSTORAGE;
|
||||
getBusinessData(businessId).storageItemCache[firstSlot] = getBusinessData(businessId).floorItemCache[itemSlot - 1];
|
||||
getBusinessData(businessId).storageItemCache[itemSlot - 1] = -1;
|
||||
messagePlayerSuccess(client, `You moved the ${getItemTypeData(getItemData(getBusinessData(businessId).storageItemCache[firstSlot]).itemTypeIndex).name}s in slot ${itemSlot} to the business storage in slot ${firstSlot}`);
|
||||
@@ -2798,7 +2798,7 @@ function stockItemOnBusinessFloorCommand(command, params, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
getItemData(getBusinessData(businessId).storageItemCache[itemSlot - 1]).ownerType = VRR_ITEM_OWNER_BIZFLOOR;
|
||||
getItemData(getBusinessData(businessId).storageItemCache[itemSlot - 1]).ownerType = AGRP_ITEM_OWNER_BIZFLOOR;
|
||||
getBusinessData(businessId).floorItemCache[firstSlot] = getBusinessData(businessId).storageItemCache[itemSlot - 1];
|
||||
getBusinessData(businessId).storageItemCache[itemSlot - 1] = -1;
|
||||
messagePlayerSuccess(client, `You moved the ${getItemTypeData(getItemData(getBusinessData(businessId).storageItemCache[firstSlot]).itemTypeIndex).name}s in slot ${itemSlot} of the business storage to the business floor slot ${firstSlot}`);
|
||||
@@ -2838,14 +2838,14 @@ function cacheBusinessItems(businessId) {
|
||||
|
||||
//let businessData = getBusinessData(businessId);
|
||||
//logToConsole(LOG_VERBOSE, `[VRR.Business] Caching business items for business ${businessId} (${businessData.name}) ...`);
|
||||
//getBusinessData(businessId).floorItemCache = getServerData().items.filter(item => item.ownerType == VRR_ITEM_OWNER_BIZFLOOR && item.ownerId == businessData.databaseId).map(i => i.index);
|
||||
//getBusinessData(businessId).storageItemCache = getServerData().items.filter(item => item.ownerType == VRR_ITEM_OWNER_BIZSTORAGE && item.ownerId == businessData.databaseId);
|
||||
//getBusinessData(businessId).floorItemCache = getServerData().items.filter(item => item.ownerType == AGRP_ITEM_OWNER_BIZFLOOR && item.ownerId == businessData.databaseId).map(i => i.index);
|
||||
//getBusinessData(businessId).storageItemCache = getServerData().items.filter(item => item.ownerType == AGRP_ITEM_OWNER_BIZSTORAGE && item.ownerId == businessData.databaseId);
|
||||
|
||||
logToConsole(LOG_VERBOSE, `[VRR.Business] Caching business items for business ${businessId} (${getBusinessData(businessId).name}) ...`);
|
||||
for (let i in getServerData().items) {
|
||||
if (getItemData(i).ownerType == VRR_ITEM_OWNER_BIZFLOOR && getItemData(i).ownerId == getBusinessData(businessId).databaseId) {
|
||||
if (getItemData(i).ownerType == AGRP_ITEM_OWNER_BIZFLOOR && getItemData(i).ownerId == getBusinessData(businessId).databaseId) {
|
||||
getBusinessData(businessId).floorItemCache.push(i);
|
||||
} else if (getItemData(i).ownerType == VRR_ITEM_OWNER_BIZSTORAGE && getItemData(i).ownerId == getBusinessData(businessId).databaseId) {
|
||||
} else if (getItemData(i).ownerType == AGRP_ITEM_OWNER_BIZSTORAGE && getItemData(i).ownerId == getBusinessData(businessId).databaseId) {
|
||||
getBusinessData(businessId).storageItemCache.push(i);
|
||||
}
|
||||
}
|
||||
@@ -2869,41 +2869,41 @@ function updateBusinessPickupLabelData(businessId) {
|
||||
}
|
||||
|
||||
if (getBusinessData(businessId).exitPickup != null) {
|
||||
setEntityData(getBusinessData(businessId).exitPickup, "agrp.owner.type", VRR_PICKUP_BUSINESS_EXIT, false);
|
||||
setEntityData(getBusinessData(businessId).exitPickup, "agrp.owner.type", AGRP_PICKUP_BUSINESS_EXIT, false);
|
||||
setEntityData(getBusinessData(businessId).exitPickup, "agrp.owner.id", businessId, false);
|
||||
setEntityData(getBusinessData(businessId).exitPickup, "agrp.label.type", VRR_LABEL_EXIT, true);
|
||||
setEntityData(getBusinessData(businessId).exitPickup, "agrp.label.type", AGRP_LABEL_EXIT, true);
|
||||
}
|
||||
|
||||
if (getBusinessData(businessId).entrancePickup != null) {
|
||||
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.owner.type", VRR_PICKUP_BUSINESS_ENTRANCE, false);
|
||||
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.owner.type", AGRP_PICKUP_BUSINESS_ENTRANCE, false);
|
||||
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.owner.id", businessId, false);
|
||||
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.type", VRR_LABEL_BUSINESS, true);
|
||||
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.type", AGRP_LABEL_BUSINESS, true);
|
||||
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.name", getBusinessData(businessId).name, true);
|
||||
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.locked", getBusinessData(businessId).locked, true);
|
||||
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_NONE, true);
|
||||
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_NONE, true);
|
||||
|
||||
switch (getBusinessData(businessId).labelHelpType) {
|
||||
case VRR_PROPLABEL_INFO_ENTERVEHICLE: {
|
||||
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_ENTERVEHICLE, true);
|
||||
case AGRP_PROPLABEL_INFO_ENTERVEHICLE: {
|
||||
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTERVEHICLE, true);
|
||||
break;
|
||||
}
|
||||
|
||||
case VRR_PROPLABEL_INFO_ENTER: {
|
||||
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_ENTER, true);
|
||||
case AGRP_PROPLABEL_INFO_ENTER: {
|
||||
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTER, true);
|
||||
break;
|
||||
}
|
||||
|
||||
case VRR_PROPLABEL_INFO_REPAIR: {
|
||||
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_REPAIR, true);
|
||||
case AGRP_PROPLABEL_INFO_REPAIR: {
|
||||
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_REPAIR, true);
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
if (getBusinessData(businessId).hasInterior) {
|
||||
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_ENTER, true);
|
||||
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTER, true);
|
||||
} else {
|
||||
if (doesBusinessHaveAnyItemsToBuy(businessId)) {
|
||||
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_BUY, true);
|
||||
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_BUY, true);
|
||||
} else {
|
||||
removeEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help");
|
||||
}
|
||||
@@ -2990,7 +2990,7 @@ function doesBusinessHaveAnyItemsToBuy(businessId) {
|
||||
|
||||
//function clearPlayerBusinessGameScripts(client, businessId) {
|
||||
// for(let i in getBusinessData(businessId).gameScripts) {
|
||||
// sendPlayerGameScriptState(client, VRR_GAMESCRIPT_DENY);
|
||||
// sendPlayerGameScriptState(client, AGRP_GAMESCRIPT_DENY);
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -3012,11 +3012,11 @@ function canPlayerWithdrawFromBusinessTill(client, businessId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (getBusinessData(businessId).ownerType == VRR_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
||||
if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (getBusinessData(businessId).ownerType == VRR_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
|
||||
if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
|
||||
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageBusinesses"))) {
|
||||
return true;
|
||||
}
|
||||
@@ -3032,11 +3032,11 @@ function canPlayerSetBusinessInteriorLights(client, businessId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (getBusinessData(businessId).ownerType == VRR_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
||||
if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (getBusinessData(businessId).ownerType == VRR_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
|
||||
if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
|
||||
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageBusinesses"))) {
|
||||
return true;
|
||||
}
|
||||
@@ -3052,11 +3052,11 @@ function canPlayerLockUnlockBusiness(client, businessId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (getBusinessData(businessId).ownerType == VRR_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
||||
if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (getBusinessData(businessId).ownerType == VRR_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
|
||||
if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
|
||||
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageBusinesses"))) {
|
||||
return true;
|
||||
}
|
||||
@@ -3072,13 +3072,13 @@ function canPlayerManageBusiness(client, businessId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (getBusinessData(businessId).ownerType == VRR_BIZ_OWNER_PLAYER) {
|
||||
if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_PLAYER) {
|
||||
if (getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (getBusinessData(businessId).ownerType == VRR_BIZ_OWNER_CLAN) {
|
||||
if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_CLAN) {
|
||||
if (getBusinessData(businessId).ownerId == getPlayerClan(client)) {
|
||||
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageBusinesses"))) {
|
||||
return true;
|
||||
|
||||
@@ -162,7 +162,7 @@ function onEntityProcess(event, entity) {
|
||||
function onPedEnteringVehicle(event, ped, vehicle, seat) {
|
||||
if (ped.isType(ELEMENT_PLAYER)) {
|
||||
let client = getClientFromPlayerElement(ped);
|
||||
getPlayerData(client).pedState = VRR_PEDSTATE_ENTERINGVEHICLE;
|
||||
getPlayerData(client).pedState = AGRP_PEDSTATE_ENTERINGVEHICLE;
|
||||
|
||||
if (!getVehicleData(vehicle)) {
|
||||
return false;
|
||||
@@ -197,7 +197,7 @@ function onPedExitingVehicle(event, ped, vehicle) {
|
||||
|
||||
if (ped.isType(ELEMENT_PLAYER)) {
|
||||
let client = getClientFromPlayerElement(ped);
|
||||
getPlayerData(client).pedState = VRR_PEDSTATE_EXITINGVEHICLE;
|
||||
getPlayerData(client).pedState = AGRP_PEDSTATE_EXITINGVEHICLE;
|
||||
}
|
||||
|
||||
if (!getVehicleData(vehicle).spawnLocked) {
|
||||
@@ -256,7 +256,7 @@ async function onPlayerEnteredVehicle(client, vehicle, seat) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getGame() == VRR_GAME_GTA_IV) {
|
||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||
vehicle = getVehicleFromIVNetworkId(clientVehicle);
|
||||
}
|
||||
//else {
|
||||
@@ -276,7 +276,7 @@ async function onPlayerEnteredVehicle(client, vehicle, seat) {
|
||||
getPlayerData(client).lastVehicle = vehicle;
|
||||
getVehicleData(vehicle).lastActiveTime = getCurrentUnixTimestamp();
|
||||
|
||||
if (getPlayerVehicleSeat(client) == VRR_VEHSEAT_DRIVER) {
|
||||
if (getPlayerVehicleSeat(client) == AGRP_VEHSEAT_DRIVER) {
|
||||
vehicle.engine = getVehicleData(vehicle).engine;
|
||||
|
||||
if (getVehicleData(vehicle).buyPrice > 0) {
|
||||
@@ -294,23 +294,23 @@ async function onPlayerEnteredVehicle(client, vehicle, seat) {
|
||||
let ownerType = getLocaleString(client, "NotOwned");
|
||||
ownerType = toLowerCase(getVehicleOwnerTypeText(getVehicleData(vehicle).ownerType));
|
||||
switch (getVehicleData(vehicle).ownerType) {
|
||||
case VRR_VEHOWNER_CLAN:
|
||||
case AGRP_VEHOWNER_CLAN:
|
||||
ownerName = getClanData(getClanIdFromDatabaseId(getVehicleData(vehicle).ownerId)).name;
|
||||
ownerType = getLocaleString(client, "Clan");
|
||||
break;
|
||||
|
||||
case VRR_VEHOWNER_JOB:
|
||||
case AGRP_VEHOWNER_JOB:
|
||||
ownerName = getJobData(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)).name;
|
||||
ownerType = getLocaleString(client, "Job");
|
||||
break;
|
||||
|
||||
case VRR_VEHOWNER_PLAYER:
|
||||
case AGRP_VEHOWNER_PLAYER:
|
||||
let subAccountData = loadSubAccountFromId(getVehicleData(vehicle).ownerId);
|
||||
ownerName = `${subAccountData.firstName} ${subAccountData.lastName}`;
|
||||
ownerType = getLocaleString(client, "Player");
|
||||
break;
|
||||
|
||||
case VRR_VEHOWNER_BIZ:
|
||||
case AGRP_VEHOWNER_BIZ:
|
||||
ownerName = getBusinessData(getVehicleData(vehicle).ownerId).name;
|
||||
ownerType = getLocaleString(client, "Business");
|
||||
break;
|
||||
@@ -340,7 +340,7 @@ async function onPlayerEnteredVehicle(client, vehicle, seat) {
|
||||
let currentSubAccount = getPlayerCurrentSubAccount(client);
|
||||
|
||||
if (isPlayerWorking(client)) {
|
||||
if (getVehicleData(vehicle).ownerType == VRR_VEHOWNER_JOB) {
|
||||
if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_JOB) {
|
||||
if (getVehicleData(vehicle).ownerId == getPlayerCurrentSubAccount(client).job) {
|
||||
getPlayerCurrentSubAccount(client).lastJobVehicle = vehicle;
|
||||
messagePlayerInfo(client, `Use /startroute to start working in this vehicle`);
|
||||
@@ -367,7 +367,7 @@ async function onPlayerEnteredVehicle(client, vehicle, seat) {
|
||||
// ===========================================================================
|
||||
|
||||
function onPlayerExitedVehicle(client, vehicle) {
|
||||
getPlayerData(client).pedState = VRR_PEDSTATE_READY;
|
||||
getPlayerData(client).pedState = AGRP_PEDSTATE_READY;
|
||||
|
||||
stopRadioStreamForPlayer(client);
|
||||
|
||||
@@ -392,7 +392,7 @@ function onPlayerExitedVehicle(client, vehicle) {
|
||||
|
||||
function onPlayerDeath(client, position) {
|
||||
logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} died.`);
|
||||
getPlayerData(client).pedState = VRR_PEDSTATE_DEAD;
|
||||
getPlayerData(client).pedState = AGRP_PEDSTATE_DEAD;
|
||||
updatePlayerSpawnedState(client, false);
|
||||
setPlayerControlState(client, false);
|
||||
setTimeout(function () {
|
||||
@@ -413,7 +413,7 @@ function onPlayerDeath(client, position) {
|
||||
stopWorking(client);
|
||||
}
|
||||
|
||||
if (getGame() == VRR_GAME_MAFIA_ONE) {
|
||||
if (getGame() == AGRP_GAME_MAFIA_ONE) {
|
||||
spawnPlayer(client, getGameConfig().skins[getGame()][getPlayerCurrentSubAccount(client).skin][0], closestJail.position, closestJail.heading);
|
||||
} else {
|
||||
spawnPlayer(client, closestJail.position, closestJail.heading, getGameConfig().skins[getGame()][getPlayerCurrentSubAccount(client).skin][0]);
|
||||
@@ -436,7 +436,7 @@ function onPlayerDeath(client, position) {
|
||||
stopWorking(client);
|
||||
}
|
||||
|
||||
if (getGame() == VRR_GAME_MAFIA_ONE) {
|
||||
if (getGame() == AGRP_GAME_MAFIA_ONE) {
|
||||
spawnPlayer(client, getGameConfig().skins[getGame()][getPlayerCurrentSubAccount(client).skin][0], closestHospital.position, closestHospital.heading);
|
||||
} else {
|
||||
spawnPlayer(client, closestHospital.position, closestHospital.heading, getGameConfig().skins[getGame()][getPlayerCurrentSubAccount(client).skin][0]);
|
||||
@@ -525,7 +525,7 @@ async function onPlayerSpawn(client) {
|
||||
// return false;
|
||||
//}
|
||||
|
||||
if (isCustomCameraSupported() && getGame() != VRR_GAME_GTA_IV && getGame() != VRR_GAME_GTA_IV_EFLC) {
|
||||
if (isCustomCameraSupported() && getGame() != AGRP_GAME_GTA_IV && getGame() != AGRP_GAME_GTA_IV_EFLC) {
|
||||
restorePlayerCamera(client);
|
||||
}
|
||||
|
||||
@@ -539,7 +539,7 @@ async function onPlayerSpawn(client) {
|
||||
//messagePlayerNormal(client, "This server is in early development and may restart at any time for updates.", getColourByName("orange"));
|
||||
//messagePlayerNormal(client, "Please report any bugs using /bug and suggestions using /idea", getColourByName("yellow"));
|
||||
|
||||
if (getGame() == VRR_GAME_MAFIA_ONE) {
|
||||
if (getGame() == AGRP_GAME_MAFIA_ONE) {
|
||||
setPlayerPosition(client, getPlayerCurrentSubAccount(client).spawnPosition);
|
||||
setPlayerHeading(client, getPlayerCurrentSubAccount(client).spawnHeading);
|
||||
setPlayerDimension(client, getPlayerCurrentSubAccount(client).dimension);
|
||||
@@ -572,7 +572,7 @@ async function onPlayerSpawn(client) {
|
||||
updatePlayerSnowState(client);
|
||||
}
|
||||
|
||||
if (areServerElementsSupported() && getGame() == VRR_GAME_GTA_SA) {
|
||||
if (areServerElementsSupported() && getGame() == AGRP_GAME_GTA_SA) {
|
||||
logToConsole(LOG_DEBUG, `[VRR.Event] Setting player walk and fightstyle for ${getPlayerDisplayForConsole(client)}`);
|
||||
setEntityData(getPlayerPed(client), "agrp.walkStyle", getPlayerCurrentSubAccount(client).walkStyle, true);
|
||||
|
||||
@@ -621,7 +621,7 @@ async function onPlayerSpawn(client) {
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[VRR.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped state to ready`);
|
||||
getPlayerData(client).pedState = VRR_PEDSTATE_READY;
|
||||
getPlayerData(client).pedState = AGRP_PEDSTATE_READY;
|
||||
|
||||
if (areServerElementsSupported()) {
|
||||
syncPlayerProperties(client);
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
// ===========================================================================
|
||||
|
||||
// Prompts (used for client GUI prompt responses)
|
||||
const VRR_PROMPT_NONE = 0;
|
||||
const VRR_PROMPT_CREATEFIRSTCHAR = 1;
|
||||
const VRR_PROMPT_BIZORDER = 2;
|
||||
const AGRP_PROMPT_NONE = 0;
|
||||
const AGRP_PROMPT_CREATEFIRSTCHAR = 1;
|
||||
const AGRP_PROMPT_BIZORDER = 2;
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
@@ -22,21 +22,21 @@ function initGUIScript() {
|
||||
// ===========================================================================
|
||||
|
||||
function playerPromptAnswerNo(client) {
|
||||
if (getPlayerData(client).promptType == VRR_PROMPT_NONE) {
|
||||
if (getPlayerData(client).promptType == AGRP_PROMPT_NONE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} answered NO to their prompt (${getPlayerData(client).promptType})`);
|
||||
|
||||
switch (getPlayerData(client).promptType) {
|
||||
case VRR_PROMPT_CREATEFIRSTCHAR:
|
||||
case AGRP_PROMPT_CREATEFIRSTCHAR:
|
||||
logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} chose not to create a first character. Kicking them from the server ...`);
|
||||
showPlayerErrorGUI(client, "You don't have a character to play. Goodbye!", "No Characters");
|
||||
getPlayerData(targetClient).customDisconnectReason = `Kicked - Didn't create a character`;
|
||||
setTimeout(function () { disconnectPlayer(client); }, 5000);
|
||||
break;
|
||||
|
||||
case VRR_PROMPT_BIZORDER:
|
||||
case AGRP_PROMPT_BIZORDER:
|
||||
if (getPlayerData(client).businessOrderAmount > 0) {
|
||||
if (canPlayerUseGUI(client)) {
|
||||
showPlayerErrorGUI(client, "You canceled the order.", "Business Order Canceled");
|
||||
@@ -53,25 +53,25 @@ function playerPromptAnswerNo(client) {
|
||||
break;
|
||||
}
|
||||
|
||||
getPlayerData(client).promptType = VRR_PROMPT_NONE;
|
||||
getPlayerData(client).promptType = AGRP_PROMPT_NONE;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function playerPromptAnswerYes(client) {
|
||||
if (getPlayerData(client).promptType == VRR_PROMPT_NONE) {
|
||||
if (getPlayerData(client).promptType == AGRP_PROMPT_NONE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} answered YES to their prompt (${getPlayerData(client).promptType})`);
|
||||
|
||||
switch (getPlayerData(client).promptType) {
|
||||
case VRR_PROMPT_CREATEFIRSTCHAR: {
|
||||
case AGRP_PROMPT_CREATEFIRSTCHAR: {
|
||||
showPlayerNewCharacterGUI(client);
|
||||
break;
|
||||
}
|
||||
|
||||
case VRR_PROMPT_BIZORDER: {
|
||||
case AGRP_PROMPT_BIZORDER: {
|
||||
if (getPlayerData(client).businessOrderAmount > 0) {
|
||||
if (getBusinessData(getPlayerData(client).businessOrderBusiness).till < getPlayerData(client).businessOrderCost) {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} failed to order ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} at ${getPlayerData(client).businessOrderCost / getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness).name} (Reason: Not enough money in business till)`);
|
||||
@@ -83,7 +83,7 @@ function playerPromptAnswerYes(client) {
|
||||
} else {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} successfully ordered ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} at ${getPlayerData(client).businessOrderCost / getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness).name}`);
|
||||
showPlayerInfoGUI(client, `You ordered ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} (${getItemValueDisplay(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue)}) for ${getPlayerData(client).businessOrderCost}!`, "Business Order Successful");
|
||||
createItem(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue, VRR_ITEM_OWNER_BIZFLOOR, getBusinessData(getPlayerData(client).businessOrderBusiness).databaseId, getPlayerData(client).businessOrderAmount);
|
||||
createItem(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue, AGRP_ITEM_OWNER_BIZFLOOR, getBusinessData(getPlayerData(client).businessOrderBusiness).databaseId, getPlayerData(client).businessOrderAmount);
|
||||
cacheBusinessItems(getPlayerData(client).businessOrderBusiness);
|
||||
getBusinessData(getPlayerData(client).businessOrderBusiness).till -= getPlayerData(client).businessOrderCost;
|
||||
updateBusinessPickupLabelData(getPlayerData(client).businessOrderBusiness);
|
||||
@@ -98,7 +98,7 @@ function playerPromptAnswerYes(client) {
|
||||
break;
|
||||
}
|
||||
|
||||
case VRR_PROMPT_GIVEVEHTOCLAN: {
|
||||
case AGRP_PROMPT_GIVEVEHTOCLAN: {
|
||||
if (!isPlayerInAnyVehicle(client)) {
|
||||
messagePlayerError(client, getLocaleString(client, "MustBeInVehicle"));
|
||||
return false;
|
||||
@@ -109,7 +109,7 @@ function playerPromptAnswerYes(client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getVehicleData(getPlayerVehicle(client)).ownerType != VRR_VEHOWNER_PLAYER) {
|
||||
if (getVehicleData(getPlayerVehicle(client)).ownerType != AGRP_VEHOWNER_PLAYER) {
|
||||
messagePlayerError(client, getLocaleString(client, "MustOwnVehicle"));
|
||||
return false;
|
||||
}
|
||||
@@ -119,21 +119,21 @@ function playerPromptAnswerYes(client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
getVehicleData(getPlayerVehicle(client)).ownerType = VRR_VEHOWNER_CLAN;
|
||||
getVehicleData(getPlayerVehicle(client)).ownerType = AGRP_VEHOWNER_CLAN;
|
||||
getVehicleData(getPlayerVehicle(client)).ownerId = getPlayerCurrentSubAccount(client).clan;
|
||||
messagePlayerSuccess(client, getLocaleString(client, "GaveVehicleToClan", getVehicleName(getPlayerVehicle(client))));
|
||||
//messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} {MAINCOLOUR}set their {vehiclePurple}${getVehicleName(vehicle)} {MAINCOLOUR}owner to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan`);
|
||||
break;
|
||||
}
|
||||
|
||||
case VRR_PROMPT_GIVEHOUSETOCLAN: {
|
||||
case AGRP_PROMPT_GIVEHOUSETOCLAN: {
|
||||
let houseId = getPlayerHouse(client);
|
||||
if (!houseId) {
|
||||
messagePlayerError(client, getLocaleString(client, "InvalidHouse"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getHouseData(houseId).ownerType != VRR_VEHOWNER_PLAYER) {
|
||||
if (getHouseData(houseId).ownerType != AGRP_VEHOWNER_PLAYER) {
|
||||
messagePlayerError(client, getLocaleString(client, "MustOwnHouse"));
|
||||
return false;
|
||||
}
|
||||
@@ -143,21 +143,21 @@ function playerPromptAnswerYes(client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
getHouseData(houseId).ownerType = VRR_HOUSE_OWNER_CLAN;
|
||||
getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_CLAN;
|
||||
getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(client).clan;
|
||||
messagePlayerSuccess(client, getLocaleString(client, "GaveHouseToClan"));
|
||||
//messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} {MAINCOLOUR}set their {vehiclePurple}${getVehicleName(vehicle)} {MAINCOLOUR}owner to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan`);
|
||||
break;
|
||||
}
|
||||
|
||||
case VRR_PROMPT_GIVEBIZTOCLAN: {
|
||||
case AGRP_PROMPT_GIVEBIZTOCLAN: {
|
||||
let businessId = getPlayerBusiness(client);
|
||||
if (!businessId) {
|
||||
messagePlayerError(client, getLocaleString(client, "InvalidBusiness"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getBusinessData(businessId).ownerType != VRR_VEHOWNER_PLAYER) {
|
||||
if (getBusinessData(businessId).ownerType != AGRP_VEHOWNER_PLAYER) {
|
||||
messagePlayerError(client, getLocaleString(client, "MustOwnBusiness"));
|
||||
return false;
|
||||
}
|
||||
@@ -167,14 +167,14 @@ function playerPromptAnswerYes(client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
getBusinessData(businessId).ownerType = VRR_BIZ_OWNER_CLAN;
|
||||
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_CLAN;
|
||||
getBusinessData(businessId).ownerId = getPlayerCurrentSubAccount(client).clan;
|
||||
messagePlayerSuccess(client, getLocaleString(client, "GaveBusinessToClan"));
|
||||
//messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} {MAINCOLOUR}set their {vehiclePurple}${getVehicleName(vehicle)} {MAINCOLOUR}owner to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan`);
|
||||
break;
|
||||
}
|
||||
|
||||
case VRR_PROMPT_BUYHOUSE: {
|
||||
case AGRP_PROMPT_BUYHOUSE: {
|
||||
let houseId = getPlayerHouse(client);
|
||||
if (!houseId) {
|
||||
messagePlayerError(client, getLocaleString(client, "InvalidHouse"));
|
||||
@@ -191,7 +191,7 @@ function playerPromptAnswerYes(client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
getHouseData(houseId).ownerType = VRR_HOUSE_OWNER_PLAYER;
|
||||
getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_PLAYER;
|
||||
getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(client).databaseId;
|
||||
getHouseData(houseId).buyPrice = 0;
|
||||
getHouseData(houseId).needsSaved = true;
|
||||
@@ -202,7 +202,7 @@ function playerPromptAnswerYes(client) {
|
||||
break;
|
||||
}
|
||||
|
||||
case VRR_PROMPT_BUYBIZ: {
|
||||
case AGRP_PROMPT_BUYBIZ: {
|
||||
let businessId = getPlayerBusiness(client);
|
||||
if (!businessId) {
|
||||
messagePlayerError(client, getLocaleString(client, "InvalidBusiness"));
|
||||
@@ -219,7 +219,7 @@ function playerPromptAnswerYes(client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
getBusinessData(businessId).ownerType = VRR_BIZ_OWNER_PLAYER;
|
||||
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_PLAYER;
|
||||
getBusinessData(businessId).ownerId = getPlayerCurrentSubAccount(client).databaseId;
|
||||
getBusinessData(businessId).buyPrice = 0;
|
||||
getBusinessData(businessId).needsSaved = true;
|
||||
@@ -236,7 +236,7 @@ function playerPromptAnswerYes(client) {
|
||||
}
|
||||
}
|
||||
|
||||
getPlayerData(client).promptType = VRR_PROMPT_NONE;
|
||||
getPlayerData(client).promptType = AGRP_PROMPT_NONE;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
@@ -8,19 +8,19 @@
|
||||
// ===========================================================================
|
||||
|
||||
// House Location Types
|
||||
const VRR_HOUSE_LOC_NONE = 0; // None
|
||||
const VRR_HOUSE_LOC_GATE = 1; // Center of any moveable gate that belongs to the house
|
||||
const VRR_HOUSE_LOC_GARAGE = 2; // Location for garage (pos1 = outside, pos2 = inside). Use pos to teleport or spawn veh/ped
|
||||
const AGRP_HOUSE_LOC_NONE = 0; // None
|
||||
const AGRP_HOUSE_LOC_GATE = 1; // Center of any moveable gate that belongs to the house
|
||||
const AGRP_HOUSE_LOC_GARAGE = 2; // Location for garage (pos1 = outside, pos2 = inside). Use pos to teleport or spawn veh/ped
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
// House Owner Types
|
||||
const VRR_HOUSE_OWNER_NONE = 0; // Not owned
|
||||
const VRR_HOUSE_OWNER_PLAYER = 1; // Owner is a player (character/subaccount)
|
||||
const VRR_HOUSE_OWNER_JOB = 2; // Owned by a job
|
||||
const VRR_HOUSE_OWNER_CLAN = 3; // Owned by a clan
|
||||
const VRR_HOUSE_OWNER_FACTION = 4; // Owned by a faction
|
||||
const VRR_HOUSE_OWNER_PUBLIC = 5; // Is a public house. Technically not owned. This probably won't be used.
|
||||
const AGRP_HOUSE_OWNER_NONE = 0; // Not owned
|
||||
const AGRP_HOUSE_OWNER_PLAYER = 1; // Owner is a player (character/subaccount)
|
||||
const AGRP_HOUSE_OWNER_JOB = 2; // Owned by a job
|
||||
const AGRP_HOUSE_OWNER_CLAN = 3; // Owned by a clan
|
||||
const AGRP_HOUSE_OWNER_FACTION = 4; // Owned by a faction
|
||||
const AGRP_HOUSE_OWNER_PUBLIC = 5; // Is a public house. Technically not owned. This probably won't be used.
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
@@ -31,7 +31,7 @@ class HouseData {
|
||||
constructor(dbAssoc = false) {
|
||||
this.databaseId = 0
|
||||
this.description = "";
|
||||
this.ownerType = VRR_HOUSE_OWNER_NONE;
|
||||
this.ownerType = AGRP_HOUSE_OWNER_NONE;
|
||||
this.ownerId = 0;
|
||||
this.buyPrice = 0;
|
||||
this.rentPrice = 0;
|
||||
@@ -297,7 +297,7 @@ function setHouseOwnerCommand(command, params, client) {
|
||||
}
|
||||
|
||||
if (!doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageHouses"))) {
|
||||
if (getHouseData(houseId).ownerType == VRR_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
||||
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
||||
messagePlayerError(client, getLocaleString(client, "CantModifyHouse"));
|
||||
return false;
|
||||
}
|
||||
@@ -305,7 +305,7 @@ function setHouseOwnerCommand(command, params, client) {
|
||||
|
||||
getHouseData(houseId).needsSaved = true;
|
||||
|
||||
getHouseData(houseId).ownerType = VRR_HOUSE_OWNER_PLAYER;
|
||||
getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_PLAYER;
|
||||
getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(newHouseOwner).databaseId;
|
||||
messagePlayerSuccess(`{MAINCOLOUR}You gave house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} to {ALTCOLOUR}${newHouseOwner.name}`);
|
||||
}
|
||||
@@ -328,13 +328,13 @@ function removeHouseOwnerCommand(command, params, client) {
|
||||
}
|
||||
|
||||
if (!doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageHouses"))) {
|
||||
if (getHouseData(houseId).ownerType == VRR_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
||||
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
||||
messagePlayerError(client, getLocaleString(client, "CantModifyHouse"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
getHouseData(houseId).ownerType = VRR_HOUSE_OWNER_NONE;
|
||||
getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_NONE;
|
||||
getHouseData(houseId).ownerId = -1;
|
||||
getHouseData(houseId).needsSaved = true;
|
||||
|
||||
@@ -367,7 +367,7 @@ function setHouseClanCommand(command, params, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getHouseData(houseId).ownerType != VRR_VEHOWNER_PLAYER) {
|
||||
if (getHouseData(houseId).ownerType != AGRP_VEHOWNER_PLAYER) {
|
||||
messagePlayerError(client, getLocaleString(client, "MustOwnHouse"));
|
||||
return false;
|
||||
}
|
||||
@@ -378,7 +378,7 @@ function setHouseClanCommand(command, params, client) {
|
||||
}
|
||||
|
||||
showPlayerPrompt(client, getLocaleString(client, "SetHouseClanConfirmMessage"), getLocaleString(client, "SetHouseClanConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
||||
getPlayerData(client).promptType = VRR_PROMPT_HOUSEGIVETOCLAN;
|
||||
getPlayerData(client).promptType = AGRP_PROMPT_HOUSEGIVETOCLAN;
|
||||
|
||||
//messagePlayerSuccess(`{MAINCOLOUR}You gave house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan!`);
|
||||
}
|
||||
@@ -1100,7 +1100,7 @@ function createHouseEntranceBlip(houseId) {
|
||||
setElementStreamOutDistance(entranceBlip, getGlobalConfig().houseBlipStreamOutDistance);
|
||||
}
|
||||
|
||||
setEntityData(entranceBlip, "agrp.owner.type", VRR_BLIP_HOUSE_ENTRANCE, false);
|
||||
setEntityData(entranceBlip, "agrp.owner.type", AGRP_BLIP_HOUSE_ENTRANCE, false);
|
||||
setEntityData(entranceBlip, "agrp.owner.id", houseId, false);
|
||||
|
||||
houseData.entranceBlip = entranceBlip;
|
||||
@@ -1206,7 +1206,7 @@ function createHouseExitBlip(houseId) {
|
||||
setElementStreamOutDistance(exitBlip, getGlobalConfig().houseBlipStreamOutDistance);
|
||||
}
|
||||
setElementTransient(exitBlip, false);
|
||||
setEntityData(exitBlip, "agrp.owner.type", VRR_BLIP_HOUSE_EXIT, false);
|
||||
setEntityData(exitBlip, "agrp.owner.type", AGRP_BLIP_HOUSE_EXIT, false);
|
||||
setEntityData(exitBlip, "agrp.owner.id", houseId, false);
|
||||
getHouseData(houseId).exitBlip = exitBlip;
|
||||
}
|
||||
@@ -1216,22 +1216,22 @@ function createHouseExitBlip(houseId) {
|
||||
|
||||
function getHouseOwnerTypeText(ownerType) {
|
||||
switch (ownerType) {
|
||||
case VRR_HOUSE_OWNER_CLAN:
|
||||
case AGRP_HOUSE_OWNER_CLAN:
|
||||
return "clan";
|
||||
|
||||
case VRR_HOUSE_OWNER_PLAYER:
|
||||
case AGRP_HOUSE_OWNER_PLAYER:
|
||||
return "player";
|
||||
|
||||
case VRR_HOUSE_OWNER_NONE:
|
||||
case AGRP_HOUSE_OWNER_NONE:
|
||||
return "not owned";
|
||||
|
||||
case VRR_HOUSE_OWNER_PUBLIC:
|
||||
case AGRP_HOUSE_OWNER_PUBLIC:
|
||||
return "not owned";
|
||||
|
||||
case VRR_HOUSE_OWNER_JOB:
|
||||
case AGRP_HOUSE_OWNER_JOB:
|
||||
return "job";
|
||||
|
||||
case VRR_HOUSE_OWNER_BIZ:
|
||||
case AGRP_HOUSE_OWNER_BIZ:
|
||||
return "business";
|
||||
|
||||
default:
|
||||
@@ -1266,28 +1266,28 @@ function getHouseInfoCommand(command, params, client) {
|
||||
|
||||
let ownerName = "Unknown";
|
||||
switch (getHouseData(houseId).ownerType) {
|
||||
case VRR_HOUSE_OWNER_CLAN:
|
||||
case AGRP_HOUSE_OWNER_CLAN:
|
||||
ownerName = getClanData(houseData).name;
|
||||
break;
|
||||
|
||||
case VRR_HOUSE_OWNER_PLAYER:
|
||||
case AGRP_HOUSE_OWNER_PLAYER:
|
||||
let subAccountData = loadSubAccountFromId(houseData.ownerId);
|
||||
ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`;
|
||||
break;
|
||||
|
||||
case VRR_HOUSE_OWNER_NONE:
|
||||
case AGRP_HOUSE_OWNER_NONE:
|
||||
ownerName = "None";
|
||||
break;
|
||||
|
||||
case VRR_HOUSE_OWNER_PUBLIC:
|
||||
case AGRP_HOUSE_OWNER_PUBLIC:
|
||||
ownerName = "Public";
|
||||
break;
|
||||
|
||||
case VRR_HOUSE_OWNER_BIZ:
|
||||
case AGRP_HOUSE_OWNER_BIZ:
|
||||
ownerName = getBusinessDataFromDatabaseId(houseData.ownerId).name;
|
||||
break;
|
||||
|
||||
case VRR_HOUSE_OWNER_JOB:
|
||||
case AGRP_HOUSE_OWNER_JOB:
|
||||
ownerName = getJobData(houseData.ownerId).name;
|
||||
break;
|
||||
}
|
||||
@@ -1423,7 +1423,7 @@ function buyHouseCommand(command, params, client) {
|
||||
}
|
||||
|
||||
showPlayerPrompt(client, getLocaleString(client, "BuyHouseConfirmMessage"), getLocaleString(client, "BuyHouseConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
||||
getPlayerData(client).promptType = VRR_PROMPT_HOUSEBUY;
|
||||
getPlayerData(client).promptType = AGRP_PROMPT_HOUSEBUY;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -1581,7 +1581,7 @@ function cacheHouseItems(houseId) {
|
||||
getHouseData(houseId).itemCache = [];
|
||||
|
||||
for (let i in getServerData().items) {
|
||||
if (getItemData(i).ownerType == VRR_ITEM_OWNER_HOUSE && getItemData(i).ownerId == getHouseData(houseId).databaseId) {
|
||||
if (getItemData(i).ownerType == AGRP_ITEM_OWNER_HOUSE && getItemData(i).ownerId == getHouseData(houseId).databaseId) {
|
||||
getHouseData(houseId).itemCache.push(i);
|
||||
}
|
||||
}
|
||||
@@ -1610,7 +1610,7 @@ function getHouseIdFromDatabaseId(databaseId) {
|
||||
|
||||
//function clearPlayerHouseGameScripts(client, houseId) {
|
||||
// for(let i in getHouseData(houseId).gameScripts) {
|
||||
// sendPlayerGameScriptState(client, VRR_GAMESCRIPT_DENY);
|
||||
// sendPlayerGameScriptState(client, AGRP_GAMESCRIPT_DENY);
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -1632,11 +1632,11 @@ function canPlayerSetHouseInteriorLights(client, houseId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (getHouseData(houseId).ownerType == VRR_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
||||
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (getHouseData(houseId).ownerType == VRR_HOUSE_OWNER_CLAN && getHouseData(houseId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
|
||||
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_CLAN && getHouseData(houseId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
|
||||
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageHouses"))) {
|
||||
return true;
|
||||
}
|
||||
@@ -1652,11 +1652,11 @@ function canPlayerLockUnlockHouse(client, houseId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (getHouseData(houseId).ownerType == VRR_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
||||
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (getHouseData(houseId).ownerType == VRR_HOUSE_OWNER_CLAN && getHouseData(houseId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
|
||||
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_CLAN && getHouseData(houseId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
|
||||
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageHouses"))) {
|
||||
return true;
|
||||
}
|
||||
@@ -1706,13 +1706,13 @@ function canPlayerManageHouse(client, houseId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (getHouseData(houseId).ownerType == VRR_HOUSE_OWNER_PLAYER) {
|
||||
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER) {
|
||||
if (getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (getHouseData(houseId).ownerType == VRR_HOUSE_OWNER_CLAN) {
|
||||
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_CLAN) {
|
||||
if (getHouseData(houseId).ownerId == getPlayerClan(client)) {
|
||||
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageHouses"))) {
|
||||
return true;
|
||||
@@ -1753,26 +1753,26 @@ function updateHousePickupLabelData(houseId) {
|
||||
let houseData = getHouseData(houseId);
|
||||
|
||||
if (houseData.entrancePickup != null) {
|
||||
setEntityData(houseData.entrancePickup, "agrp.owner.type", VRR_PICKUP_HOUSE_ENTRANCE, false);
|
||||
setEntityData(houseData.entrancePickup, "agrp.owner.type", AGRP_PICKUP_HOUSE_ENTRANCE, false);
|
||||
setEntityData(houseData.entrancePickup, "agrp.owner.id", houseId, false);
|
||||
setEntityData(houseData.entrancePickup, "agrp.label.type", VRR_LABEL_HOUSE, true);
|
||||
setEntityData(houseData.entrancePickup, "agrp.label.type", AGRP_LABEL_HOUSE, true);
|
||||
setEntityData(houseData.entrancePickup, "agrp.label.name", houseData.description, true);
|
||||
setEntityData(houseData.entrancePickup, "agrp.label.locked", houseData.locked, true);
|
||||
if (houseData.buyPrice > 0) {
|
||||
setEntityData(houseData.entrancePickup, "agrp.label.price", houseData.buyPrice, true);
|
||||
setEntityData(houseData.entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_BUYHOUSE, true);
|
||||
setEntityData(houseData.entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_BUYHOUSE, true);
|
||||
} else {
|
||||
if (houseData.rentPrice > 0) {
|
||||
setEntityData(houseData.entrancePickup, "agrp.label.rentprice", houseData.rentPrice, true);
|
||||
setEntityData(houseData.entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_RENTHOUSE, true);
|
||||
setEntityData(houseData.entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_RENTHOUSE, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (houseData.exitPickup != null) {
|
||||
setEntityData(houseData.exitPickup, "agrp.owner.type", VRR_PICKUP_HOUSE_EXIT, false);
|
||||
setEntityData(houseData.exitPickup, "agrp.owner.type", AGRP_PICKUP_HOUSE_EXIT, false);
|
||||
setEntityData(houseData.exitPickup, "agrp.owner.id", houseId, false);
|
||||
setEntityData(houseData.exitPickup, "agrp.label.type", VRR_LABEL_EXIT, true);
|
||||
setEntityData(houseData.exitPickup, "agrp.label.type", AGRP_LABEL_EXIT, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,26 +8,26 @@
|
||||
// ===========================================================================
|
||||
|
||||
// Job Types
|
||||
const VRR_JOB_NONE = 0;
|
||||
const VRR_JOB_POLICE = 1;
|
||||
const VRR_JOB_MEDICAL = 2;
|
||||
const VRR_JOB_FIRE = 3;
|
||||
const VRR_JOB_BUS = 4;
|
||||
const VRR_JOB_TAXI = 5;
|
||||
const VRR_JOB_GARBAGE = 6;
|
||||
const VRR_JOB_WEAPON = 7;
|
||||
const VRR_JOB_DRUG = 8;
|
||||
const VRR_JOB_PIZZA = 9;
|
||||
const VRR_JOB_GENERIC = 10;
|
||||
const AGRP_JOB_NONE = 0;
|
||||
const AGRP_JOB_POLICE = 1;
|
||||
const AGRP_JOB_MEDICAL = 2;
|
||||
const AGRP_JOB_FIRE = 3;
|
||||
const AGRP_JOB_BUS = 4;
|
||||
const AGRP_JOB_TAXI = 5;
|
||||
const AGRP_JOB_GARBAGE = 6;
|
||||
const AGRP_JOB_WEAPON = 7;
|
||||
const AGRP_JOB_DRUG = 8;
|
||||
const AGRP_JOB_PIZZA = 9;
|
||||
const AGRP_JOB_GENERIC = 10;
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
// Job Route States
|
||||
const VRR_JOBROUTESTATE_NONE = 0; // None
|
||||
const VRR_JOBROUTESTATE_INPROGRESS = 1; // Route is in progress. Player is in between stops but not at the last one.
|
||||
const VRR_JOBROUTESTATE_LASTSTOP = 2; // Player is heading to the last stop on the route
|
||||
const VRR_JOBROUTESTATE_PAUSED = 3; // Route is paused for some reason. For police, this could be player accepted callout and once finished, patrol route will resume
|
||||
const VRR_JOBROUTESTATE_ATSTOP = 4; // For bus/trash stops that freeze player, this is the state when they're at one
|
||||
const AGRP_JOBROUTESTATE_NONE = 0; // None
|
||||
const AGRP_JOBROUTESTATE_INPROGRESS = 1; // Route is in progress. Player is in between stops but not at the last one.
|
||||
const AGRP_JOBROUTESTATE_LASTSTOP = 2; // Player is heading to the last stop on the route
|
||||
const AGRP_JOBROUTESTATE_PAUSED = 3; // Route is paused for some reason. For police, this could be player accepted callout and once finished, patrol route will resume
|
||||
const AGRP_JOBROUTESTATE_ATSTOP = 4; // For bus/trash stops that freeze player, this is the state when they're at one
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
@@ -42,7 +42,7 @@ class JobData {
|
||||
constructor(dbAssoc = false) {
|
||||
this.databaseId = 0;
|
||||
this.serverId = 0;
|
||||
this.type = VRR_JOB_NONE;
|
||||
this.type = AGRP_JOB_NONE;
|
||||
this.name = "Unnamed";
|
||||
this.enabled = true;
|
||||
this.blipModel = -1
|
||||
@@ -633,9 +633,9 @@ function createAllJobPickups() {
|
||||
for (let j in getServerData().jobs[i].locations) {
|
||||
pickupCount++;
|
||||
getServerData().jobs[i].locations[j].pickup = game.createPickup(getServerData().jobs[i].pickupModel, getServerData().jobs[i].locations[j].position);
|
||||
setEntityData(getServerData().jobs[i].locations[j].pickup, "agrp.owner.type", VRR_PICKUP_JOB, false);
|
||||
setEntityData(getServerData().jobs[i].locations[j].pickup, "agrp.owner.type", AGRP_PICKUP_JOB, false);
|
||||
setEntityData(getServerData().jobs[i].locations[j].pickup, "agrp.owner.id", j, false);
|
||||
setEntityData(getServerData().jobs[i].locations[j].pickup, "agrp.label.type", VRR_LABEL_JOB, true);
|
||||
setEntityData(getServerData().jobs[i].locations[j].pickup, "agrp.label.type", AGRP_LABEL_JOB, true);
|
||||
setEntityData(getServerData().jobs[i].locations[j].pickup, "agrp.label.name", getServerData().jobs[i].name, true);
|
||||
setEntityData(getServerData().jobs[i].locations[j].pickup, "agrp.label.jobType", getServerData().jobs[i].databaseId, true);
|
||||
setElementOnAllDimensions(getServerData().jobs[i].locations[j].pickup, false);
|
||||
@@ -662,7 +662,7 @@ function showJobInformationToPlayer(client, jobType) {
|
||||
}
|
||||
|
||||
switch (jobType) {
|
||||
case VRR_JOB_POLICE:
|
||||
case AGRP_JOB_POLICE:
|
||||
if (!canPlayerUsePoliceJob(client)) {
|
||||
return false;
|
||||
}
|
||||
@@ -675,7 +675,7 @@ function showJobInformationToPlayer(client, jobType) {
|
||||
messagePlayerInfo(client, "- When finished, use /stopwork to stop working.");
|
||||
break;
|
||||
|
||||
case VRR_JOB_MEDICAL:
|
||||
case AGRP_JOB_MEDICAL:
|
||||
messagePlayerInfo(client, "== Job Help =================================");
|
||||
messagePlayerInfo(client, "- Paramedics help people by healing them.");
|
||||
messagePlayerInfo(client, "- Use /startwork at the hospital to work as a Paramedic.");
|
||||
@@ -684,7 +684,7 @@ function showJobInformationToPlayer(client, jobType) {
|
||||
messagePlayerInfo(client, "- When finished, use /stopwork to stop working.");
|
||||
break;
|
||||
|
||||
case VRR_JOB_FIRE:
|
||||
case AGRP_JOB_FIRE:
|
||||
if (!canClientUseFireJob(client)) {
|
||||
return false;
|
||||
}
|
||||
@@ -696,7 +696,7 @@ function showJobInformationToPlayer(client, jobType) {
|
||||
messagePlayerInfo(client, "- When finished, use /stopwork to stop working.");
|
||||
break;
|
||||
|
||||
case VRR_JOB_BUS:
|
||||
case AGRP_JOB_BUS:
|
||||
messagePlayerInfo(client, "== Job Help =================================");
|
||||
messagePlayerInfo(client, "- Bus Drivers transport people around the city on a route");
|
||||
messagePlayerInfo(client, "- Use /startwork at the bus depot to work as a Bus Driver.");
|
||||
@@ -705,7 +705,7 @@ function showJobInformationToPlayer(client, jobType) {
|
||||
messagePlayerInfo(client, "- When finished, use /stopwork to stop working.");
|
||||
break;
|
||||
|
||||
case VRR_JOB_TAXI:
|
||||
case AGRP_JOB_TAXI:
|
||||
messagePlayerInfo(client, "== Job Help =================================");
|
||||
messagePlayerInfo(client, "- Taxi Drivers transport people around the city");
|
||||
messagePlayerInfo(client, "- Use /startwork at the taxi depot to work as a Taxi Driver.");
|
||||
@@ -715,7 +715,7 @@ function showJobInformationToPlayer(client, jobType) {
|
||||
messagePlayerInfo(client, "- When finished, use /stopwork to stop working.");
|
||||
break;
|
||||
|
||||
case VRR_JOB_GARBAGE:
|
||||
case AGRP_JOB_GARBAGE:
|
||||
messagePlayerInfo(client, "== Job Help =================================");
|
||||
messagePlayerInfo(client, "- Garbage Collectors pick up the trash around the city.");
|
||||
messagePlayerInfo(client, "- Use /startwork at the garbage depot to work as a Garbage Collector.");
|
||||
@@ -726,10 +726,10 @@ function showJobInformationToPlayer(client, jobType) {
|
||||
messagePlayerInfo(client, "- When finished, use /stopwork to stop working.");
|
||||
break;
|
||||
|
||||
case VRR_JOB_WEAPON:
|
||||
case AGRP_JOB_WEAPON:
|
||||
break;
|
||||
|
||||
case VRR_JOB_DRUG:
|
||||
case AGRP_JOB_DRUG:
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -771,7 +771,7 @@ function takeJobCommand(command, params, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getPlayerCurrentSubAccount(client).job > VRR_JOB_NONE) {
|
||||
if (getPlayerCurrentSubAccount(client).job > AGRP_JOB_NONE) {
|
||||
messagePlayerInfo(client, getLocaleString(client, "QuitJobToTakeAnother", "{ALTCOLOUR}/quitjob{MAINCOLOUR}"));
|
||||
return false;
|
||||
}
|
||||
@@ -803,7 +803,7 @@ function startWorkingCommand(command, params, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getVehicleData(closestVehicle).ownerType != VRR_VEHOWNER_JOB) {
|
||||
if (getVehicleData(closestVehicle).ownerType != AGRP_VEHOWNER_JOB) {
|
||||
messagePlayerError(client, getLocaleString(client, "NotAJobVehicle"));
|
||||
return false;
|
||||
}
|
||||
@@ -815,7 +815,7 @@ function startWorkingCommand(command, params, client) {
|
||||
|
||||
jobData = getJobData(getJobIdFromDatabaseId(getVehicleData(closestVehicle).ownerId));
|
||||
} else {
|
||||
if (getPlayerCurrentSubAccount(client).job == VRR_JOB_NONE) {
|
||||
if (getPlayerCurrentSubAccount(client).job == AGRP_JOB_NONE) {
|
||||
messagePlayerError(client, "You don't have a job!");
|
||||
messagePlayerInfo(client, "You can get a job by going the yellow points on the map.");
|
||||
return false;
|
||||
@@ -871,41 +871,41 @@ function startWorking(client) {
|
||||
switchPlayerActiveHotBarSlot(client, -1);
|
||||
getPlayerCurrentSubAccount(client).skin = getPlayerSkin(client);
|
||||
storePlayerItemsInTempLocker(client);
|
||||
getPlayerData(client).tempLockerType = VRR_TEMP_LOCKER_TYPE_JOB;
|
||||
getPlayerData(client).tempLockerType = AGRP_TEMP_LOCKER_TYPE_JOB;
|
||||
messagePlayerInfo(client, "Your personal items have been stored in your locker while you work");
|
||||
|
||||
getPlayerCurrentSubAccount(client).isWorking = true;
|
||||
|
||||
let jobId = getPlayerCurrentSubAccount(client).job;
|
||||
switch (getJobIndexFromDatabaseId(jobId)) {
|
||||
case VRR_JOB_POLICE:
|
||||
case AGRP_JOB_POLICE:
|
||||
messagePlayerInfo(client, getLocaleString(client, "JobEquipAndUniformLabel", `{ALTCOLOUR}/uniform{MAINCOLOUR}, {ALTCOLOUR}/equip{MAINCOLOUR}`));
|
||||
break;
|
||||
|
||||
case VRR_JOB_MEDICAL:
|
||||
case AGRP_JOB_MEDICAL:
|
||||
messagePlayerInfo(client, getLocaleString(client, "JobEquipAndUniformLabel", `{ALTCOLOUR}/uniform{MAINCOLOUR}, {ALTCOLOUR}/equip{MAINCOLOUR}`));
|
||||
break;
|
||||
|
||||
case VRR_JOB_FIRE:
|
||||
case AGRP_JOB_FIRE:
|
||||
messagePlayerInfo(client, getLocaleString(client, "JobEquipAndUniformLabel", `{ALTCOLOUR}/uniform{MAINCOLOUR}, {ALTCOLOUR}/equip{MAINCOLOUR}`));
|
||||
break;
|
||||
|
||||
case VRR_JOB_BUS:
|
||||
case AGRP_JOB_BUS:
|
||||
messagePlayerInfo(client, getLocaleString(client, "GetStartedJobVehicle", getGroupedLocaleString(client, "VehicleTypes", "Bus")));
|
||||
break;
|
||||
|
||||
case VRR_JOB_TAXI:
|
||||
case AGRP_JOB_TAXI:
|
||||
messagePlayerInfo(client, getLocaleString(client, "GetStartedJobVehicle", getGroupedLocaleString(client, "VehicleTypes", "Taxi")));
|
||||
break;
|
||||
|
||||
case VRR_JOB_GARBAGE:
|
||||
case AGRP_JOB_GARBAGE:
|
||||
messagePlayerInfo(client, getLocaleString(client, "GetStartedJobVehicle", getGroupedLocaleString(client, "VehicleTypes", "GarbageTruck")));
|
||||
break;
|
||||
|
||||
case VRR_JOB_WEAPON:
|
||||
case AGRP_JOB_WEAPON:
|
||||
break;
|
||||
|
||||
case VRR_JOB_DRUG:
|
||||
case AGRP_JOB_DRUG:
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -944,10 +944,10 @@ function givePlayerJobEquipment(client, equipmentId) {
|
||||
|
||||
for (let i in getJobData(jobId).equipment[equipmentId].items) {
|
||||
let value = getJobData(jobId).equipment[equipmentId].items[i].value
|
||||
if (getItemTypeData(getItemTypeIndexFromDatabaseId(getJobData(jobId).equipment[equipmentId].items[i].itemType)).useType == VRR_ITEM_USE_TYPE_WALKIETALKIE) {
|
||||
if (getItemTypeData(getItemTypeIndexFromDatabaseId(getJobData(jobId).equipment[equipmentId].items[i].itemType)).useType == AGRP_ITEM_USE_TYPE_WALKIETALKIE) {
|
||||
value = getJobData(jobId).walkieTalkieFrequency;
|
||||
}
|
||||
let itemId = createItem(getItemTypeIndexFromDatabaseId(getJobData(jobId).equipment[equipmentId].items[i].itemType), value, VRR_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId);
|
||||
let itemId = createItem(getItemTypeIndexFromDatabaseId(getJobData(jobId).equipment[equipmentId].items[i].itemType), value, AGRP_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId);
|
||||
getItemData(itemId).needsSaved = false;
|
||||
getItemData(itemId).databaseId = -1; // Make sure it doesnt save
|
||||
let freeSlot = getPlayerFirstEmptyHotBarSlot(client);
|
||||
@@ -996,37 +996,37 @@ function stopWorking(client) {
|
||||
messageDiscordEventChannel(`💼 ${getCharacterFullName(client)} has stopped working as a ${getJobData(jobId).name}`);
|
||||
|
||||
switch (getJobType(jobId)) {
|
||||
case VRR_JOB_POLICE:
|
||||
case AGRP_JOB_POLICE:
|
||||
messagePlayerInfo(client, "Your uniform, equipment, and vehicle have been returned to the police station");
|
||||
break;
|
||||
|
||||
case VRR_JOB_MEDICAL:
|
||||
case AGRP_JOB_MEDICAL:
|
||||
messagePlayerInfo(client, "Your uniform, equipment, and vehicle have been returned to the hospital");
|
||||
break;
|
||||
|
||||
case VRR_JOB_FIRE:
|
||||
case AGRP_JOB_FIRE:
|
||||
messagePlayerInfo(client, "Your uniform, equipment, and vehicle have been returned to the fire station");
|
||||
break;
|
||||
|
||||
case VRR_JOB_BUS:
|
||||
case AGRP_JOB_BUS:
|
||||
messagePlayerInfo(client, "Your vehicle has been returned to the bus depot");
|
||||
break;
|
||||
|
||||
case VRR_JOB_TAXI:
|
||||
case AGRP_JOB_TAXI:
|
||||
messagePlayerInfo(client, "Your vehicle has been returned to the taxi depot");
|
||||
break;
|
||||
|
||||
case VRR_JOB_GARBAGE:
|
||||
case AGRP_JOB_GARBAGE:
|
||||
messagePlayerInfo(client, "Your vehicle has been returned to the city trash dump");
|
||||
break;
|
||||
|
||||
case VRR_JOB_WEAPON:
|
||||
case AGRP_JOB_WEAPON:
|
||||
break;
|
||||
|
||||
case VRR_JOB_DRUG:
|
||||
case AGRP_JOB_DRUG:
|
||||
break;
|
||||
|
||||
case VRR_JOB_GENERIC:
|
||||
case AGRP_JOB_GENERIC:
|
||||
messagePlayerInfo(client, "Your vehicle has been respawned at your job location");
|
||||
break;
|
||||
|
||||
@@ -1062,7 +1062,7 @@ function jobUniformCommand(command, params, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getVehicleData(closestVehicle).ownerType != VRR_VEHOWNER_JOB) {
|
||||
if (getVehicleData(closestVehicle).ownerType != AGRP_VEHOWNER_JOB) {
|
||||
messagePlayerError(client, getLocaleString(client, "NotAJobVehicle"));
|
||||
return false;
|
||||
}
|
||||
@@ -1074,7 +1074,7 @@ function jobUniformCommand(command, params, client) {
|
||||
|
||||
jobData = getJobData(getJobIdFromDatabaseId(getVehicleData(closestVehicle).ownerId));
|
||||
} else {
|
||||
if (getPlayerCurrentSubAccount(client).job == VRR_JOB_NONE) {
|
||||
if (getPlayerCurrentSubAccount(client).job == AGRP_JOB_NONE) {
|
||||
messagePlayerError(client, getLocaleString(client, "NotYourJob"));
|
||||
messagePlayerInfo(client, getLocaleString(client, "JobPoints"));
|
||||
return false;
|
||||
@@ -1147,7 +1147,7 @@ function jobEquipmentCommand(command, params, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getVehicleData(closestVehicle).ownerType != VRR_VEHOWNER_JOB) {
|
||||
if (getVehicleData(closestVehicle).ownerType != AGRP_VEHOWNER_JOB) {
|
||||
messagePlayerError(client, getLocaleString(client, "NotAJobVehicle"));
|
||||
return false;
|
||||
}
|
||||
@@ -1159,7 +1159,7 @@ function jobEquipmentCommand(command, params, client) {
|
||||
|
||||
jobData = getJobData(getJobIdFromDatabaseId(getVehicleData(closestVehicle).ownerId));
|
||||
} else {
|
||||
if (getPlayerCurrentSubAccount(client).job == VRR_JOB_NONE) {
|
||||
if (getPlayerCurrentSubAccount(client).job == AGRP_JOB_NONE) {
|
||||
messagePlayerError(client, getLocaleString(client, "NotYourJob"));
|
||||
messagePlayerInfo(client, getLocaleString(client, "JobPoints"));
|
||||
return false;
|
||||
@@ -2047,7 +2047,7 @@ function jobStopRouteCommand(command, params, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//if(!doesPlayerHaveJobType(client, VRR_JOB_BUS) && !doesPlayerHaveJobType(client, VRR_JOB_GARBAGE)) {
|
||||
//if(!doesPlayerHaveJobType(client, AGRP_JOB_BUS) && !doesPlayerHaveJobType(client, AGRP_JOB_GARBAGE)) {
|
||||
// messagePlayerError(client, "Your job doesn't use a route!");
|
||||
// return false;
|
||||
//}
|
||||
@@ -2752,9 +2752,9 @@ function createJobLocationPickup(jobId, locationId) {
|
||||
tempJobData.locations[locationId].pickup = pickup;
|
||||
setElementDimension(pickup, tempJobData.locations[locationId].dimension);
|
||||
setElementOnAllDimensions(pickup, false);
|
||||
setEntityData(pickup, "agrp.owner.type", VRR_PICKUP_JOB, false);
|
||||
setEntityData(pickup, "agrp.owner.type", AGRP_PICKUP_JOB, false);
|
||||
setEntityData(pickup, "agrp.owner.id", locationId, false);
|
||||
setEntityData(pickup, "agrp.label.type", VRR_LABEL_JOB, true);
|
||||
setEntityData(pickup, "agrp.label.type", AGRP_LABEL_JOB, true);
|
||||
setEntityData(pickup, "agrp.label.name", tempJobData.name, true);
|
||||
setEntityData(pickup, "agrp.label.jobType", tempJobData.databaseId, true);
|
||||
addToWorld(pickup);
|
||||
|
||||
@@ -8,43 +8,43 @@
|
||||
// ===========================================================================
|
||||
|
||||
// Pickup Types
|
||||
const VRR_PICKUP_NONE = 0;
|
||||
const VRR_PICKUP_JOB = 1;
|
||||
const VRR_PICKUP_BUSINESS_ENTRANCE = 2;
|
||||
const VRR_PICKUP_BUSINESS_EXIT = 3;
|
||||
const VRR_PICKUP_HOUSE_ENTRANCE = 4;
|
||||
const VRR_PICKUP_HOUSE_EXIT = 5;
|
||||
const VRR_PICKUP_EXIT = 6;
|
||||
const AGRP_PICKUP_NONE = 0;
|
||||
const AGRP_PICKUP_JOB = 1;
|
||||
const AGRP_PICKUP_BUSINESS_ENTRANCE = 2;
|
||||
const AGRP_PICKUP_BUSINESS_EXIT = 3;
|
||||
const AGRP_PICKUP_HOUSE_ENTRANCE = 4;
|
||||
const AGRP_PICKUP_HOUSE_EXIT = 5;
|
||||
const AGRP_PICKUP_EXIT = 6;
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
// Blip Owner Types
|
||||
const VRR_BLIP_NONE = 0;
|
||||
const VRR_BLIP_JOB = 1;
|
||||
const VRR_BLIP_BUSINESS_ENTRANCE = 2;
|
||||
const VRR_BLIP_BUSINESS_EXIT = 3;
|
||||
const VRR_BLIP_HOUSE_ENTRANCE = 4;
|
||||
const VRR_BLIP_HOUSE_EXIT = 5;
|
||||
const VRR_BLIP_EXIT = 6;
|
||||
const AGRP_BLIP_NONE = 0;
|
||||
const AGRP_BLIP_JOB = 1;
|
||||
const AGRP_BLIP_BUSINESS_ENTRANCE = 2;
|
||||
const AGRP_BLIP_BUSINESS_EXIT = 3;
|
||||
const AGRP_BLIP_HOUSE_ENTRANCE = 4;
|
||||
const AGRP_BLIP_HOUSE_EXIT = 5;
|
||||
const AGRP_BLIP_EXIT = 6;
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
// Ped States
|
||||
const VRR_PEDSTATE_NONE = 2; // None
|
||||
const VRR_PEDSTATE_READY = 1; // Ready
|
||||
const VRR_PEDSTATE_DRIVER = 2; // Driving a vehicle
|
||||
const VRR_PEDSTATE_PASSENGER = 3; // In a vehicle as passenger
|
||||
const VRR_PEDSTATE_DEAD = 4; // Dead
|
||||
const VRR_PEDSTATE_ENTERINGPROPERTY = 5; // Entering a property
|
||||
const VRR_PEDSTATE_EXITINGPROPERTY = 6; // Exiting a property
|
||||
const VRR_PEDSTATE_ENTERINGVEHICLE = 7; // Entering a vehicle
|
||||
const VRR_PEDSTATE_EXITINGVEHICLE = 8; // Exiting a vehicle
|
||||
const VRR_PEDSTATE_BINDED = 9; // Binded by rope or handcuffs
|
||||
const VRR_PEDSTATE_TAZED = 10; // Under incapacitating effect of tazer
|
||||
const VRR_PEDSTATE_INTRUNK = 11; // In vehicle trunk
|
||||
const VRR_PEDSTATE_INITEM = 12; // In item (crate, box, etc)
|
||||
const VRR_PEDSTATE_HANDSUP = 13; // Has hands up (surrendering)
|
||||
const VRR_PEDSTATE_SPAWNING = 14; // Spawning
|
||||
const AGRP_PEDSTATE_NONE = 2; // None
|
||||
const AGRP_PEDSTATE_READY = 1; // Ready
|
||||
const AGRP_PEDSTATE_DRIVER = 2; // Driving a vehicle
|
||||
const AGRP_PEDSTATE_PASSENGER = 3; // In a vehicle as passenger
|
||||
const AGRP_PEDSTATE_DEAD = 4; // Dead
|
||||
const AGRP_PEDSTATE_ENTERINGPROPERTY = 5; // Entering a property
|
||||
const AGRP_PEDSTATE_EXITINGPROPERTY = 6; // Exiting a property
|
||||
const AGRP_PEDSTATE_ENTERINGVEHICLE = 7; // Entering a vehicle
|
||||
const AGRP_PEDSTATE_EXITINGVEHICLE = 8; // Exiting a vehicle
|
||||
const AGRP_PEDSTATE_BINDED = 9; // Binded by rope or handcuffs
|
||||
const AGRP_PEDSTATE_TAZED = 10; // Under incapacitating effect of tazer
|
||||
const AGRP_PEDSTATE_INTRUNK = 11; // In vehicle trunk
|
||||
const AGRP_PEDSTATE_INITEM = 12; // In item (crate, box, etc)
|
||||
const AGRP_PEDSTATE_HANDSUP = 13; // Has hands up (surrendering)
|
||||
const AGRP_PEDSTATE_SPAWNING = 14; // Spawning
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
@@ -74,7 +74,7 @@ function toggleMouseCursorCommand(command, params, client) {
|
||||
// ===========================================================================
|
||||
|
||||
function toggleMouseCameraCommand(command, params, client) {
|
||||
if (getGame() != VRR_GAME_GTA_VC) {
|
||||
if (getGame() != AGRP_GAME_GTA_VC) {
|
||||
sendPlayerMouseCameraToggle(client);
|
||||
}
|
||||
return true;
|
||||
@@ -172,25 +172,25 @@ function enterExitPropertyCommand(command, params, client) {
|
||||
let ownerId = getEntityData(getPlayerData(client).currentPickup, "agrp.owner.id");
|
||||
|
||||
switch (ownerType) {
|
||||
case VRR_PICKUP_BUSINESS_ENTRANCE:
|
||||
case AGRP_PICKUP_BUSINESS_ENTRANCE:
|
||||
isBusiness = true;
|
||||
isEntrance = true;
|
||||
closestProperty = getServerData().businesses[ownerId];
|
||||
break;
|
||||
|
||||
case VRR_PICKUP_BUSINESS_EXIT:
|
||||
case AGRP_PICKUP_BUSINESS_EXIT:
|
||||
isBusiness = true;
|
||||
isEntrance = false;
|
||||
closestProperty = getServerData().businesses[ownerId];
|
||||
break;
|
||||
|
||||
case VRR_PICKUP_HOUSE_ENTRANCE:
|
||||
case AGRP_PICKUP_HOUSE_ENTRANCE:
|
||||
isBusiness = false;
|
||||
isEntrance = true;
|
||||
closestProperty = getServerData().houses[ownerId];
|
||||
break;
|
||||
|
||||
case VRR_PICKUP_HOUSE_EXIT:
|
||||
case AGRP_PICKUP_HOUSE_EXIT:
|
||||
isBusiness = false;
|
||||
isEntrance = false;
|
||||
closestProperty = getServerData().houses[ownerId];
|
||||
@@ -248,7 +248,7 @@ function enterExitPropertyCommand(command, params, client) {
|
||||
}
|
||||
|
||||
clearPlayerStateToEnterExitProperty(client);
|
||||
getPlayerData(client).pedState = VRR_PEDSTATE_ENTERINGPROPERTY;
|
||||
getPlayerData(client).pedState = AGRP_PEDSTATE_ENTERINGPROPERTY;
|
||||
meActionToNearbyPlayers(client, getLocaleString(client, "EntersProperty", (isBusiness) ? getLocaleString(client, "Business") : getLocaleString(client, "House")));
|
||||
|
||||
if (isFadeCameraSupported()) {
|
||||
@@ -272,7 +272,7 @@ function enterExitPropertyCommand(command, params, client) {
|
||||
}, 1100);
|
||||
|
||||
if (isBusiness) {
|
||||
if (closestProperty.entranceType == VRR_PROPERTY_ENTRANCE_TYPE_PAINTBALL) {
|
||||
if (closestProperty.entranceType == AGRP_PROPERTY_ENTRANCE_TYPE_PAINTBALL) {
|
||||
messagePlayerAlert(client, getLocaleString(client, "JoinedPaintBall"));
|
||||
startPaintBall(client);
|
||||
}
|
||||
@@ -292,7 +292,7 @@ function enterExitPropertyCommand(command, params, client) {
|
||||
meActionToNearbyPlayers(client, getLocaleString(client, "EnterExitPropertyDoorLocked", (isBusiness) ? getLocaleString(client, "Business") : getLocaleString(client, "House")));
|
||||
return false;
|
||||
}
|
||||
getPlayerData(client).pedState = VRR_PEDSTATE_EXITINGPROPERTY;
|
||||
getPlayerData(client).pedState = AGRP_PEDSTATE_EXITINGPROPERTY;
|
||||
clearPlayerStateToEnterExitProperty(client)
|
||||
meActionToNearbyPlayers(client, getLocaleString(client, "ExitsProperty", (isBusiness) ? getLocaleString(client, "Business") : getLocaleString(client, "House")));
|
||||
|
||||
@@ -317,7 +317,7 @@ function enterExitPropertyCommand(command, params, client) {
|
||||
}, 1100);
|
||||
|
||||
if (isBusiness) {
|
||||
if (closestProperty.entranceType == VRR_PROPERTY_ENTRANCE_TYPE_PAINTBALL) {
|
||||
if (closestProperty.entranceType == AGRP_PROPERTY_ENTRANCE_TYPE_PAINTBALL) {
|
||||
messagePlayerAlert(client, getLocaleString(client, "LeftPaintBall"));
|
||||
stopPaintBall(client);
|
||||
}
|
||||
@@ -515,7 +515,7 @@ function stuckPlayerCommand(command, params, client) {
|
||||
messagePlayerAlert(client, getLocaleString(client, "FixingStuck"));
|
||||
|
||||
if (getGameConfig().skinChangePosition[getGame()].length > 0) {
|
||||
if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == VRR_RETURNTO_TYPE_SKINSELECT) {
|
||||
if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == AGRP_RETURNTO_TYPE_SKINSELECT) {
|
||||
messagePlayerAlert(client, "You canceled the skin change.");
|
||||
restorePlayerCamera(client);
|
||||
|
||||
@@ -529,11 +529,11 @@ function stuckPlayerCommand(command, params, client) {
|
||||
getPlayerData(client).returnToInterior = null;
|
||||
getPlayerData(client).returnToDimension = null;
|
||||
|
||||
getPlayerData(client).returnToType = VRR_RETURNTO_TYPE_NONE;
|
||||
getPlayerData(client).returnToType = AGRP_RETURNTO_TYPE_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
//if(getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == VRR_RETURNTO_TYPE_ADMINGET) {
|
||||
//if(getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == AGRP_RETURNTO_TYPE_ADMINGET) {
|
||||
// messagePlayerError(client, `You were teleported by an admin and can't use the stuck command`);
|
||||
// return false;
|
||||
//}
|
||||
|
||||
@@ -180,7 +180,7 @@ function getVehicleHeading(vehicle) {
|
||||
// ===========================================================================
|
||||
|
||||
function setVehicleHeading(vehicle, heading) {
|
||||
if (getGame() == VRR_GAME_GTA_IV) {
|
||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||
return sendNetworkEventToPlayer("agrp.vehPosition", null, getVehicleForNetworkEvent(vehicle), heading);
|
||||
}
|
||||
return vehicle.heading = heading;
|
||||
@@ -214,7 +214,7 @@ function getVehicleSyncer(vehicle) {
|
||||
// ===========================================================================
|
||||
|
||||
function getVehicleForNetworkEvent(vehicle) {
|
||||
if (getGame() == VRR_GAME_GTA_IV) {
|
||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||
if (getVehicleData(vehicle).ivNetworkId != -1) {
|
||||
return getVehicleData(vehicle).ivNetworkId;
|
||||
}
|
||||
@@ -254,7 +254,7 @@ function removePlayerFromVehicle(client) {
|
||||
|
||||
function setPlayerSkin(client, skinIndex) {
|
||||
logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s skin to ${getGameConfig().skins[getGame()][skinIndex][0]} (Index: ${skinIndex}, Name: ${getGameConfig().skins[getGame()][skinIndex][1]})`);
|
||||
if (getGame() == VRR_GAME_GTA_IV) {
|
||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||
triggerNetworkEvent("agrp.localPlayerSkin", client, getGameConfig().skins[getGame()][skinIndex][0]);
|
||||
} else {
|
||||
getPlayerPed(client).modelIndex = getGameConfig().skins[getGame()][skinIndex][0];
|
||||
@@ -635,15 +635,15 @@ function createGamePed(modelIndex, position, heading, toClient = null) {
|
||||
// ===========================================================================
|
||||
|
||||
function getIsland(position) {
|
||||
if (getGame() == VRR_GAME_GTA_III) {
|
||||
if (getGame() == AGRP_GAME_GTA_III) {
|
||||
if (position.x > 616) {
|
||||
return VRR_ISLAND_PORTLAND;
|
||||
return AGRP_ISLAND_PORTLAND;
|
||||
} else if (position.x < -283) {
|
||||
return VRR_ISLAND_SHORESIDEVALE;
|
||||
return AGRP_ISLAND_SHORESIDEVALE;
|
||||
}
|
||||
return VRR_ISLAND_STAUNTON;
|
||||
return AGRP_ISLAND_STAUNTON;
|
||||
} else {
|
||||
return VRR_ISLAND_NONE;
|
||||
return AGRP_ISLAND_NONE;
|
||||
}
|
||||
|
||||
//return game.getIslandFromPosition(position);
|
||||
@@ -955,7 +955,7 @@ function setConstantsAsGlobalVariablesInDatabase() {
|
||||
let entries = Object.entries(global);
|
||||
for (let i in entries) {
|
||||
logToConsole(LOG_DEBUG, `[VRR.Database] Checking entry ${i} (${entries[i]})`);
|
||||
if (toString(i).slice(0, 3).indexOf("VRR_") != -1) {
|
||||
if (toString(i).slice(0, 3).indexOf("AGRP_") != -1) {
|
||||
logToConsole(LOG_DEBUG, `[VRR.Database] Adding ${i} (${entries[i]}) to database global variables`);
|
||||
}
|
||||
}
|
||||
@@ -1078,7 +1078,7 @@ function getClosestCivilian(position) {
|
||||
// ===========================================================================
|
||||
|
||||
function getVehiclesInRange(position, range) {
|
||||
if (getGame() == VRR_GAME_GTA_IV) {
|
||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||
return getServerData().vehicles.reduce((i, j) => (getDistance(position, i.syncPosition) <= getDistance(position, j.syncPosition)) ? i : j);
|
||||
}
|
||||
return getElementsByTypeInRange(ELEMENT_VEHICLE, position, range);
|
||||
@@ -1111,7 +1111,7 @@ function getVehicleFirstEmptySeat(vehicle) {
|
||||
// ===========================================================================
|
||||
|
||||
function isVehicleTrain(vehicle) {
|
||||
if (getGame() == VRR_GAME_GTA_III) {
|
||||
if (getGame() == AGRP_GAME_GTA_III) {
|
||||
if (vehicle.modelIndex == 124) {
|
||||
return true;
|
||||
}
|
||||
@@ -1179,7 +1179,7 @@ function setElementStreamOutDistance(element, distance) {
|
||||
// ===========================================================================
|
||||
|
||||
function getPlayerPed(client) {
|
||||
if (getGame() == VRR_GAME_GTA_IV) {
|
||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||
return getPlayerData(client).ped;
|
||||
} else {
|
||||
return client.player;
|
||||
|
||||
@@ -180,7 +180,7 @@ function getVehicleHeading(vehicle) {
|
||||
// ===========================================================================
|
||||
|
||||
function setVehicleHeading(vehicle, heading) {
|
||||
if (getGame() == VRR_GAME_GTA_IV) {
|
||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||
return sendNetworkEventToPlayer("agrp.vehPosition", null, getVehicleForNetworkEvent(vehicle), heading);
|
||||
}
|
||||
return vehicle.heading = heading;
|
||||
@@ -214,7 +214,7 @@ function getVehicleSyncer(vehicle) {
|
||||
// ===========================================================================
|
||||
|
||||
function getVehicleForNetworkEvent(vehicle) {
|
||||
if (getGame() == VRR_GAME_GTA_IV) {
|
||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||
if (getVehicleData(vehicle).ivNetworkId != -1) {
|
||||
return getVehicleData(vehicle).ivNetworkId;
|
||||
}
|
||||
@@ -254,7 +254,7 @@ function removePlayerFromVehicle(client) {
|
||||
|
||||
function setPlayerSkin(client, skinIndex) {
|
||||
logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s skin to ${getGameConfig().skins[getGame()][skinIndex][0]} (Index: ${skinIndex}, Name: ${getGameConfig().skins[getGame()][skinIndex][1]})`);
|
||||
if (getGame() == VRR_GAME_GTA_IV) {
|
||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||
triggerNetworkEvent("agrp.localPlayerSkin", client, getGameConfig().skins[getGame()][skinIndex][0]);
|
||||
} else {
|
||||
getPlayerPed(client).modelIndex = getGameConfig().skins[getGame()][skinIndex][0];
|
||||
@@ -955,7 +955,7 @@ function getClosestCivilian(position) {
|
||||
// ===========================================================================
|
||||
|
||||
function getVehiclesInRange(position, range) {
|
||||
if (getGame() == VRR_GAME_GTA_IV) {
|
||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||
return getServerData().vehicles.reduce((i, j) => (getDistance(position, i.syncPosition) <= getDistance(position, j.syncPosition)) ? i : j);
|
||||
}
|
||||
return getElementsByTypeInRange(ELEMENT_VEHICLE, position, range);
|
||||
@@ -1124,7 +1124,7 @@ function despawnPlayer(client) {
|
||||
// ===========================================================================
|
||||
|
||||
function getGame() {
|
||||
return VRR_GAME_GTA_V;
|
||||
return AGRP_GAME_GTA_V;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
@@ -666,7 +666,7 @@ function playerDamagedByPlayer(client, damagerEntityName, weaponId, pedPiece, he
|
||||
logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager is ${getPlayerDisplayForConsole(damagerEntity)}`);
|
||||
|
||||
switch (getPlayerData(damagerEntity).weaponDamageEvent) {
|
||||
case VRR_WEAPON_DAMAGE_EVENT_TAZER:
|
||||
case AGRP_WEAPON_DAMAGE_EVENT_TAZER:
|
||||
logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} is using a tazer`);
|
||||
if (!isPlayerTazed(client) && !isPlayerHandCuffed(client) && !isPlayerInAnyVehicle(client)) {
|
||||
logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)} was not previously tazed, binded, or in a vehicle. Taze successful`);
|
||||
@@ -675,13 +675,13 @@ function playerDamagedByPlayer(client, damagerEntityName, weaponId, pedPiece, he
|
||||
}
|
||||
break;
|
||||
|
||||
case VRR_WEAPON_DAMAGE_EVENT_EXTINGUISH:
|
||||
case AGRP_WEAPON_DAMAGE_EVENT_EXTINGUISH:
|
||||
break;
|
||||
|
||||
case VRR_WEAPON_DAMAGE_EVENT_MACE:
|
||||
case AGRP_WEAPON_DAMAGE_EVENT_MACE:
|
||||
break;
|
||||
|
||||
case VRR_WEAPON_DAMAGE_EVENT_NORMAL:
|
||||
case AGRP_WEAPON_DAMAGE_EVENT_NORMAL:
|
||||
logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} caused ${healthLoss} damage (damage reduction makes it ${(healthLoss * getPlayerData(client).incomingDamageMultiplier)})`);
|
||||
setPlayerHealth(client, getPlayerHealth(client) - (healthLoss * getPlayerData(client).incomingDamageMultiplier));
|
||||
break;
|
||||
@@ -737,7 +737,7 @@ function forcePlayerIntoSkinSelect(client) {
|
||||
getPlayerData(client).returnToHeading = getPlayerHeading(client);
|
||||
getPlayerData(client).returnToInterior = getPlayerInterior(client);
|
||||
getPlayerData(client).returnToDimension = getPlayerDimension(client);
|
||||
getPlayerData(client).returnToType = VRR_RETURNTO_TYPE_SKINSELECT;
|
||||
getPlayerData(client).returnToType = AGRP_RETURNTO_TYPE_SKINSELECT;
|
||||
|
||||
setPlayerPosition(client, getGameConfig().skinChangePosition[getGame()][0]);
|
||||
setPlayerHeading(client, getGameConfig().skinChangePosition[getGame()][1]);
|
||||
@@ -888,7 +888,7 @@ function playerFinishedSkinSelection(client, allowedSkinIndex) {
|
||||
messagePlayerAlert(client, "You canceled the skin change.");
|
||||
restorePlayerCamera(client);
|
||||
|
||||
if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == VRR_RETURNTO_TYPE_SKINSELECT) {
|
||||
if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == AGRP_RETURNTO_TYPE_SKINSELECT) {
|
||||
setPlayerPosition(client, getPlayerData(client).returnToPosition);
|
||||
setPlayerHeading(client, getPlayerData(client).returnToHeading);
|
||||
setPlayerInterior(client, getPlayerData(client).returnToInterior);
|
||||
@@ -909,7 +909,7 @@ function playerFinishedSkinSelection(client, allowedSkinIndex) {
|
||||
setPlayerSkin(client, getPlayerCurrentSubAccount(client).skin);
|
||||
}
|
||||
|
||||
if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == VRR_RETURNTO_TYPE_SKINSELECT) {
|
||||
if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == AGRP_RETURNTO_TYPE_SKINSELECT) {
|
||||
setPlayerPosition(client, getPlayerData(client).returnToPosition);
|
||||
setPlayerHeading(client, getPlayerData(client).returnToHeading);
|
||||
setPlayerInterior(client, getPlayerData(client).returnToInterior);
|
||||
|
||||
@@ -8,27 +8,27 @@
|
||||
// ===========================================================================
|
||||
|
||||
// NPC Trigger Condition Match Types
|
||||
const VRR_NPC_COND_MATCH_NONE = 0; // None (invalid)
|
||||
const VRR_NPC_COND_MATCH_EQ = 1; // Must be equal to
|
||||
const VRR_NPC_COND_MATCH_GT = 2; // Must be greater than
|
||||
const VRR_NPC_COND_MATCH_LT = 3; // Must be less than
|
||||
const VRR_NPC_COND_MATCH_GTEQ = 4; // Must be greater than or equal to
|
||||
const VRR_NPC_COND_MATCH_LTEQ = 5; // Must be less than or equal to
|
||||
const VRR_NPC_COND_MATCH_CONTAINS = 6; // Must contain string (case insensitive)
|
||||
const VRR_NPC_COND_MATCH_CONTAINS_CASE = 7; // Must contain string (case sensitive)
|
||||
const VRR_NPC_COND_MATCH_EXACT = 8; // Must match string exactly (case insensitive)
|
||||
const VRR_NPC_COND_MATCH_EXACT_CASE = 9; // Must match string exactly (case insensitive)
|
||||
const AGRP_NPC_COND_MATCH_NONE = 0; // None (invalid)
|
||||
const AGRP_NPC_COND_MATCH_EQ = 1; // Must be equal to
|
||||
const AGRP_NPC_COND_MATCH_GT = 2; // Must be greater than
|
||||
const AGRP_NPC_COND_MATCH_LT = 3; // Must be less than
|
||||
const AGRP_NPC_COND_MATCH_GTEQ = 4; // Must be greater than or equal to
|
||||
const AGRP_NPC_COND_MATCH_LTEQ = 5; // Must be less than or equal to
|
||||
const AGRP_NPC_COND_MATCH_CONTAINS = 6; // Must contain string (case insensitive)
|
||||
const AGRP_NPC_COND_MATCH_CONTAINS_CASE = 7; // Must contain string (case sensitive)
|
||||
const AGRP_NPC_COND_MATCH_EXACT = 8; // Must match string exactly (case insensitive)
|
||||
const AGRP_NPC_COND_MATCH_EXACT_CASE = 9; // Must match string exactly (case insensitive)
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
// NPC Owner Types
|
||||
const VRR_NPC_OWNER_NONE = 0; // Not owned
|
||||
const VRR_NPC_OWNER_PLAYER = 1; // Owned by a player (character/subaccount)
|
||||
const VRR_NPC_OWNER_JOB = 2; // Owned by a job
|
||||
const VRR_NPC_OWNER_CLAN = 3; // Owned by a clan
|
||||
const VRR_NPC_OWNER_FACTION = 4; // Owned by a faction (not used at the moment)
|
||||
const VRR_NPC_OWNER_PUBLIC = 5; // Public NPC. Anybody can do stuff with it.
|
||||
const VRR_NPC_OWNER_BIZ = 6; // Owned by a business
|
||||
const AGRP_NPC_OWNER_NONE = 0; // Not owned
|
||||
const AGRP_NPC_OWNER_PLAYER = 1; // Owned by a player (character/subaccount)
|
||||
const AGRP_NPC_OWNER_JOB = 2; // Owned by a job
|
||||
const AGRP_NPC_OWNER_CLAN = 3; // Owned by a clan
|
||||
const AGRP_NPC_OWNER_FACTION = 4; // Owned by a faction (not used at the moment)
|
||||
const AGRP_NPC_OWNER_PUBLIC = 5; // Public NPC. Anybody can do stuff with it.
|
||||
const AGRP_NPC_OWNER_BIZ = 6; // Owned by a business
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
@@ -55,14 +55,14 @@ class NPCData {
|
||||
this.fightStyle = 0;
|
||||
this.health = 100;
|
||||
this.armour = 100;
|
||||
this.currentAction = VRR_NPC_ACTION_NONE;
|
||||
this.currentAction = AGRP_NPC_ACTION_NONE;
|
||||
this.triggers = [];
|
||||
this.typeFlags = 0;
|
||||
this.heedThreats = false;
|
||||
this.threats = 0;
|
||||
this.invincible = false;
|
||||
this.animationName = "";
|
||||
this.ownerType = VRR_NPC_OWNER_NONE;
|
||||
this.ownerType = AGRP_NPC_OWNER_NONE;
|
||||
this.ownerId = 0;
|
||||
|
||||
this.bodyParts = {
|
||||
@@ -617,28 +617,28 @@ function getNPCInfoCommand(command, params, client) {
|
||||
let ownerName = "Nobody";
|
||||
let ownerType = "None";
|
||||
switch (npcData.ownerType) {
|
||||
case VRR_NPC_OWNER_CLAN:
|
||||
case AGRP_NPC_OWNER_CLAN:
|
||||
ownerName = getClanData(getClanIdFromDatabaseId(npcData.ownerId)).name;
|
||||
ownerType = "clan";
|
||||
break;
|
||||
|
||||
case VRR_NPC_OWNER_JOB:
|
||||
case AGRP_NPC_OWNER_JOB:
|
||||
ownerName = getJobData(getJobIdFromDatabaseId(npcData.ownerId)).name;
|
||||
ownerType = "job";
|
||||
break;
|
||||
|
||||
case VRR_NPC_OWNER_PLAYER:
|
||||
case AGRP_NPC_OWNER_PLAYER:
|
||||
let subAccountData = loadSubAccountFromId(npcData.ownerId);
|
||||
ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`;
|
||||
ownerType = "player";
|
||||
break;
|
||||
|
||||
case VRR_NPC_OWNER_BIZ:
|
||||
case AGRP_NPC_OWNER_BIZ:
|
||||
ownerName = getBusinessData(getBusinessIdFromDatabaseId(npcData.ownerId)).name;
|
||||
ownerType = "business";
|
||||
break;
|
||||
|
||||
case VRR_NPC_OWNER_PUBLIC:
|
||||
case AGRP_NPC_OWNER_PUBLIC:
|
||||
ownerName = "Nobody";
|
||||
ownerType = "public";
|
||||
break;
|
||||
|
||||
@@ -8,21 +8,21 @@
|
||||
// ===========================================================================
|
||||
|
||||
// Vehicle Owner Types
|
||||
const VRR_VEHOWNER_NONE = 0; // Not owned
|
||||
const VRR_VEHOWNER_PLAYER = 1; // Owned by a player (character/subaccount)
|
||||
const VRR_VEHOWNER_JOB = 2; // Owned by a job
|
||||
const VRR_VEHOWNER_CLAN = 3; // Owned by a clan
|
||||
const VRR_VEHOWNER_FACTION = 4; // Owned by a faction (not used at the moment)
|
||||
const VRR_VEHOWNER_PUBLIC = 5; // Public vehicle. Anybody can drive it.
|
||||
const VRR_VEHOWNER_BIZ = 6; // Owned by a business (also includes dealerships since they're businesses)
|
||||
const AGRP_VEHOWNER_NONE = 0; // Not owned
|
||||
const AGRP_VEHOWNER_PLAYER = 1; // Owned by a player (character/subaccount)
|
||||
const AGRP_VEHOWNER_JOB = 2; // Owned by a job
|
||||
const AGRP_VEHOWNER_CLAN = 3; // Owned by a clan
|
||||
const AGRP_VEHOWNER_FACTION = 4; // Owned by a faction (not used at the moment)
|
||||
const AGRP_VEHOWNER_PUBLIC = 5; // Public vehicle. Anybody can drive it.
|
||||
const AGRP_VEHOWNER_BIZ = 6; // Owned by a business (also includes dealerships since they're businesses)
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
// Vehicle Seats
|
||||
const VRR_VEHSEAT_DRIVER = 0;
|
||||
const VRR_VEHSEAT_FRONTPASSENGER = 1;
|
||||
const VRR_VEHSEAT_REARLEFTPASSENGER = 2;
|
||||
const VRR_VEHSEAT_REARRIGHTPASSENGER = 3;
|
||||
const AGRP_VEHSEAT_DRIVER = 0;
|
||||
const AGRP_VEHSEAT_FRONTPASSENGER = 1;
|
||||
const AGRP_VEHSEAT_REARLEFTPASSENGER = 2;
|
||||
const AGRP_VEHSEAT_REARRIGHTPASSENGER = 3;
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
@@ -47,7 +47,7 @@ class VehicleData {
|
||||
this.syncHeading = 0.0;
|
||||
|
||||
// Ownership
|
||||
this.ownerType = VRR_VEHOWNER_NONE;
|
||||
this.ownerType = AGRP_VEHOWNER_NONE;
|
||||
this.ownerId = 0;
|
||||
this.buyPrice = 0;
|
||||
this.rentPrice = 0;
|
||||
@@ -336,7 +336,7 @@ function spawnAllVehicles() {
|
||||
* @return {VehicleData} The vehicles's data (class instance)
|
||||
*/
|
||||
function getVehicleData(vehicle) {
|
||||
if (getGame() != VRR_GAME_GTA_IV) {
|
||||
if (getGame() != AGRP_GAME_GTA_IV) {
|
||||
if (isVehicleObject(vehicle)) {
|
||||
let dataIndex = getEntityData(vehicle, "agrp.dataSlot");
|
||||
if (typeof getServerData().vehicles[dataIndex] != "undefined") {
|
||||
@@ -366,7 +366,7 @@ function createVehicleCommand(command, params, client) {
|
||||
}
|
||||
|
||||
let heading = getPlayerHeading(client);
|
||||
if (getGame() == VRR_GAME_MAFIA_ONE) {
|
||||
if (getGame() == AGRP_GAME_MAFIA_ONE) {
|
||||
heading = degToRad(getPlayerHeading(client));
|
||||
}
|
||||
|
||||
@@ -705,7 +705,7 @@ function buyVehicleCommand(command, params, client) {
|
||||
setEntityData(vehicle, "agrp.engine", getVehicleData(vehicle).engine, true);
|
||||
|
||||
getVehicleData(vehicle).needsSaved = true;
|
||||
setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_TESTDRIVE, vehicle.id, getVehiclePosition(vehicle));
|
||||
setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_TESTDRIVE, vehicle.id, getVehiclePosition(vehicle));
|
||||
meActionToNearbyPlayers(client, `receives a set of keys to test drive the ${getVehicleName(vehicle)} and starts the engine`);
|
||||
messagePlayerInfo(client, getLocaleString(client, "DealershipPurchaseTestDrive"));
|
||||
getServerData().purchasingVehicleCache.push(client);
|
||||
@@ -800,17 +800,17 @@ function doesPlayerHaveVehicleKeys(client, vehicle) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (vehicleData.ownerType == VRR_VEHOWNER_PUBLIC) {
|
||||
if (vehicleData.ownerType == AGRP_VEHOWNER_PUBLIC) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (vehicleData.ownerType == VRR_VEHOWNER_PLAYER) {
|
||||
if (vehicleData.ownerType == AGRP_VEHOWNER_PLAYER) {
|
||||
if (vehicleData.ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (vehicleData.ownerType == VRR_VEHOWNER_CLAN) {
|
||||
if (vehicleData.ownerType == AGRP_VEHOWNER_CLAN) {
|
||||
if (vehicleData.ownerId == getPlayerCurrentSubAccount(client).clan) {
|
||||
if (vehicleData.clanRank <= getPlayerCurrentSubAccount(client).clanRank) {
|
||||
return true;
|
||||
@@ -818,7 +818,7 @@ function doesPlayerHaveVehicleKeys(client, vehicle) {
|
||||
}
|
||||
}
|
||||
|
||||
if (vehicleData.ownerType == VRR_VEHOWNER_FACTION) {
|
||||
if (vehicleData.ownerType == AGRP_VEHOWNER_FACTION) {
|
||||
if (vehicleData.ownerId == getPlayerCurrentSubAccount(client).faction) {
|
||||
if (vehicleData.factionRank <= getPlayerCurrentSubAccount(client).factionRank) {
|
||||
return true;
|
||||
@@ -826,7 +826,7 @@ function doesPlayerHaveVehicleKeys(client, vehicle) {
|
||||
}
|
||||
}
|
||||
|
||||
if (vehicleData.ownerType == VRR_VEHOWNER_JOB) {
|
||||
if (vehicleData.ownerType == AGRP_VEHOWNER_JOB) {
|
||||
if (vehicleData.ownerId == getPlayerCurrentSubAccount(client).job) {
|
||||
return true;
|
||||
}
|
||||
@@ -848,13 +848,13 @@ function doesClientOwnVehicle(client, vehicle) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (vehicleData.ownerType == VRR_VEHOWNER_PLAYER) {
|
||||
if (vehicleData.ownerType == AGRP_VEHOWNER_PLAYER) {
|
||||
if (vehicleData.ownerId == getPlayerData(client).accountData.databaseId) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (vehicleData.ownerType == VRR_VEHOWNER_CLAN) {
|
||||
if (vehicleData.ownerType == AGRP_VEHOWNER_CLAN) {
|
||||
if (vehicleData.ownerId == getPlayerCurrentSubAccount(client).clan) {
|
||||
if (doesPlayerHaveClanPermission(client, "ManageVehicles") || doesPlayerHaveClanPermission(client, "owner")) {
|
||||
return true;
|
||||
@@ -893,7 +893,7 @@ function setVehicleJobCommand(command, params, client) {
|
||||
// return false;
|
||||
//}
|
||||
|
||||
getVehicleData(vehicle).ownerType = VRR_VEHOWNER_JOB;
|
||||
getVehicleData(vehicle).ownerType = AGRP_VEHOWNER_JOB;
|
||||
getVehicleData(vehicle).ownerId = getJobData(jobId).databaseId;
|
||||
|
||||
getVehicleData(vehicle).needsSaved = true;
|
||||
@@ -922,7 +922,7 @@ function setVehicleRankCommand(command, params, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getVehicleData(vehicle).ownerType == VRR_VEHOWNER_CLAN) {
|
||||
if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_CLAN) {
|
||||
rankId = getClanRankFromParams(getVehicleData(vehicle).ownerId, params);
|
||||
if (!getClanRankData(getVehicleData(vehicle).ownerId, rankId)) {
|
||||
messagePlayerError(client, getLocaleString(client, "ClanRankInvalid"));
|
||||
@@ -930,7 +930,7 @@ function setVehicleRankCommand(command, params, client) {
|
||||
}
|
||||
getVehicleData(vehicle).rank = getClanRankData(getVehicleData(vehicle).ownerId, rankId).databaseId;
|
||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} rank to {ALTCOLOUR}${getClanRankData(getVehicleData(vehicle).ownerId, rankId).name}{MAINCOLOUR} of the {clanOrange}${getClanData(getVehicleData(vehicle).ownerId).name}{MAINCOLOUR} clan!`);
|
||||
} else if (getVehicleData(vehicle).ownerType == VRR_VEHOWNER_JOB) {
|
||||
} else if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_JOB) {
|
||||
getVehicleData(vehicle).rank = rankId;
|
||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} rank to {ALTCOLOUR}${rankId}{MAINCOLOUR} of the {jobYellow}${getJobData(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)).name}{MAINCOLOUR} job!`);
|
||||
}
|
||||
@@ -959,7 +959,7 @@ function setVehicleClanCommand(command, params, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getVehicleData(vehicle).ownerType != VRR_VEHOWNER_PLAYER) {
|
||||
if (getVehicleData(vehicle).ownerType != AGRP_VEHOWNER_PLAYER) {
|
||||
messagePlayerError(client, getLocaleString(client, "MustOwnVehicle"));
|
||||
return false;
|
||||
}
|
||||
@@ -970,7 +970,7 @@ function setVehicleClanCommand(command, params, client) {
|
||||
}
|
||||
|
||||
showPlayerPrompt(client, getLocaleString(client, "SetVehicleClanConfirmMessage"), getLocaleString(client, "SetVehicleClanConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
||||
getPlayerData(client).promptType = VRR_PROMPT_GIVEVEHTOCLAN;
|
||||
getPlayerData(client).promptType = AGRP_PROMPT_GIVEVEHTOCLAN;
|
||||
|
||||
getVehicleData(vehicle).needsSaved = true;
|
||||
}
|
||||
@@ -996,7 +996,7 @@ function setVehicleToBusinessCommand(command, params, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
getVehicleData(vehicle).ownerType = VRR_VEHOWNER_BIZ;
|
||||
getVehicleData(vehicle).ownerType = AGRP_VEHOWNER_BIZ;
|
||||
getVehicleData(vehicle).ownerId = getBusinessData(businessId).databaseId;
|
||||
|
||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} owner to the {businessBlue}${getBusinessData(businessId).name} {MAINCOLOUR}business`);
|
||||
@@ -1025,7 +1025,7 @@ function setVehicleOwnerCommand(command, params, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
getVehicleData(vehicle).ownerType = VRR_VEHOWNER_PLAYER;
|
||||
getVehicleData(vehicle).ownerType = AGRP_VEHOWNER_PLAYER;
|
||||
getVehicleData(vehicle).ownerId = getPlayerCurrentSubAccount(targetClient).databaseId;
|
||||
|
||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} owner to {ALTCOLOUR}${getClientSubAccountName(targetClient)}`);
|
||||
@@ -1048,7 +1048,7 @@ function setVehiclePublicCommand(command, params, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
getVehicleData(vehicle).ownerType = VRR_VEHOWNER_PUBLIC;
|
||||
getVehicleData(vehicle).ownerType = AGRP_VEHOWNER_PUBLIC;
|
||||
getVehicleData(vehicle).ownerId = 0;
|
||||
|
||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} to a public vehicle!`);
|
||||
@@ -1135,7 +1135,7 @@ function removeVehicleOwnerCommand(command, params, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
getVehicleData(vehicle).ownerType = VRR_VEHOWNER_NONE;
|
||||
getVehicleData(vehicle).ownerType = AGRP_VEHOWNER_NONE;
|
||||
getVehicleData(vehicle).ownerId = 0;
|
||||
|
||||
getVehicleData(vehicle).needsSaved = true;
|
||||
@@ -1164,28 +1164,28 @@ function getVehicleInfoCommand(command, params, client) {
|
||||
let ownerName = "Nobody";
|
||||
let ownerType = "None";
|
||||
switch (vehicleData.ownerType) {
|
||||
case VRR_VEHOWNER_CLAN:
|
||||
case AGRP_VEHOWNER_CLAN:
|
||||
ownerName = getClanData(getClanIdFromDatabaseId(vehicleData.ownerId)).name;
|
||||
ownerType = "clan";
|
||||
break;
|
||||
|
||||
case VRR_VEHOWNER_JOB:
|
||||
case AGRP_VEHOWNER_JOB:
|
||||
ownerName = getJobData(getJobIdFromDatabaseId(vehicleData.ownerId)).name;
|
||||
ownerType = "job";
|
||||
break;
|
||||
|
||||
case VRR_VEHOWNER_PLAYER:
|
||||
case AGRP_VEHOWNER_PLAYER:
|
||||
let subAccountData = loadSubAccountFromId(vehicleData.ownerId);
|
||||
ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`;
|
||||
ownerType = "player";
|
||||
break;
|
||||
|
||||
case VRR_VEHOWNER_BIZ:
|
||||
case AGRP_VEHOWNER_BIZ:
|
||||
ownerName = getBusinessData(getBusinessIdFromDatabaseId(vehicleData.ownerId)).name;
|
||||
ownerType = "business";
|
||||
break;
|
||||
|
||||
case VRR_VEHOWNER_PUBLIC:
|
||||
case AGRP_VEHOWNER_PUBLIC:
|
||||
ownerName = "Nobody";
|
||||
ownerType = "public";
|
||||
break;
|
||||
@@ -1241,28 +1241,28 @@ function getLastVehicleInfoCommand(command, params, client) {
|
||||
let ownerName = "Nobody";
|
||||
let ownerType = "None";
|
||||
switch (vehicleData.ownerType) {
|
||||
case VRR_VEHOWNER_CLAN:
|
||||
case AGRP_VEHOWNER_CLAN:
|
||||
ownerName = getClanData(vehicleData.ownerId).name;
|
||||
ownerType = "clan";
|
||||
break;
|
||||
|
||||
case VRR_VEHOWNER_JOB:
|
||||
case AGRP_VEHOWNER_JOB:
|
||||
ownerName = getJobData(vehicleData.ownerId).name;
|
||||
ownerType = "job";
|
||||
break;
|
||||
|
||||
case VRR_VEHOWNER_PLAYER:
|
||||
case AGRP_VEHOWNER_PLAYER:
|
||||
let subAccountData = loadSubAccountFromId(vehicleData.ownerId);
|
||||
ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`;
|
||||
ownerType = "player";
|
||||
break;
|
||||
|
||||
case VRR_VEHOWNER_BIZ:
|
||||
case AGRP_VEHOWNER_BIZ:
|
||||
ownerName = getBusinessData(vehicleData.ownerId).name;
|
||||
ownerType = "business";
|
||||
break;
|
||||
|
||||
case VRR_VEHOWNER_PUBLIC:
|
||||
case AGRP_VEHOWNER_PUBLIC:
|
||||
ownerName = "None";
|
||||
ownerType = "public";
|
||||
break;
|
||||
@@ -1369,7 +1369,7 @@ function respawnEmptyVehiclesCommand(command, params, client) {
|
||||
|
||||
function respawnJobVehiclesCommand(command, params, client) {
|
||||
for (let i in getServerData().vehicles) {
|
||||
if (getServerData().vehicles[i].ownerType == VRR_VEHOWNER_JOB) {
|
||||
if (getServerData().vehicles[i].ownerType == AGRP_VEHOWNER_JOB) {
|
||||
respawnVehicle(getServerData().vehicles[i].vehicle);
|
||||
}
|
||||
}
|
||||
@@ -1381,7 +1381,7 @@ function respawnJobVehiclesCommand(command, params, client) {
|
||||
|
||||
function respawnClanVehiclesCommand(command, params, client) {
|
||||
for (let i in getServerData().vehicles) {
|
||||
if (getServerData().vehicles[i].ownerType == VRR_VEHOWNER_CLAN) {
|
||||
if (getServerData().vehicles[i].ownerType == AGRP_VEHOWNER_CLAN) {
|
||||
respawnVehicle(getServerData().vehicles[i].vehicle);
|
||||
}
|
||||
}
|
||||
@@ -1393,7 +1393,7 @@ function respawnClanVehiclesCommand(command, params, client) {
|
||||
|
||||
function respawnPlayerVehiclesCommand(command, params, client) {
|
||||
for (let i in getServerData().vehicles) {
|
||||
if (getServerData().vehicles[i].ownerType == VRR_VEHOWNER_PLAYER) {
|
||||
if (getServerData().vehicles[i].ownerType == AGRP_VEHOWNER_PLAYER) {
|
||||
respawnVehicle(getServerData().vehicles[i].vehicle);
|
||||
}
|
||||
}
|
||||
@@ -1405,7 +1405,7 @@ function respawnPlayerVehiclesCommand(command, params, client) {
|
||||
|
||||
function respawnPublicVehiclesCommand(command, params, client) {
|
||||
for (let i in getServerData().vehicles) {
|
||||
if (getServerData().vehicles[i].ownerType == VRR_VEHOWNER_PUBLIC) {
|
||||
if (getServerData().vehicles[i].ownerType == AGRP_VEHOWNER_PUBLIC) {
|
||||
respawnVehicle(getServerData().vehicles[i].vehicle);
|
||||
}
|
||||
}
|
||||
@@ -1417,7 +1417,7 @@ function respawnPublicVehiclesCommand(command, params, client) {
|
||||
|
||||
function respawnBusinessVehiclesCommand(command, params, client) {
|
||||
for (let i in getServerData().vehicles) {
|
||||
if (getServerData().vehicles[i].ownerType == VRR_VEHOWNER_BIZ) {
|
||||
if (getServerData().vehicles[i].ownerType == AGRP_VEHOWNER_BIZ) {
|
||||
respawnVehicle(getServerData().vehicles[i].vehicle);
|
||||
}
|
||||
}
|
||||
@@ -1445,7 +1445,7 @@ function respawnVehicle(vehicle) {
|
||||
vehicles[i].engine = false;
|
||||
}
|
||||
|
||||
if (vehicles[i].ownerType == VRR_VEHOWNER_JOB) {
|
||||
if (vehicles[i].ownerType == AGRP_VEHOWNER_JOB) {
|
||||
vehicles[i].locked = true;
|
||||
}
|
||||
|
||||
@@ -1531,19 +1531,19 @@ function isVehicleAtPayAndSpray(vehicle) {
|
||||
|
||||
function getVehicleOwnerTypeText(ownerType) {
|
||||
switch (ownerType) {
|
||||
case VRR_VEHOWNER_CLAN:
|
||||
case AGRP_VEHOWNER_CLAN:
|
||||
return "clan";
|
||||
|
||||
case VRR_VEHOWNER_JOB:
|
||||
case AGRP_VEHOWNER_JOB:
|
||||
return "job";
|
||||
|
||||
case VRR_VEHOWNER_PLAYER:
|
||||
case AGRP_VEHOWNER_PLAYER:
|
||||
return "player";
|
||||
|
||||
case VRR_VEHOWNER_BIZ:
|
||||
case AGRP_VEHOWNER_BIZ:
|
||||
return "business";
|
||||
|
||||
case VRR_VEHOWNER_PUBLIC:
|
||||
case AGRP_VEHOWNER_PUBLIC:
|
||||
return "public";
|
||||
|
||||
default:
|
||||
@@ -1554,7 +1554,7 @@ function getVehicleOwnerTypeText(ownerType) {
|
||||
// ===========================================================================
|
||||
|
||||
function isVehicleOwnedByJob(vehicle, jobId) {
|
||||
if (getVehicleData(vehicle).ownerType == VRR_VEHOWNER_JOB) {
|
||||
if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_JOB) {
|
||||
return (getVehicleData(vehicle).ownerId == jobId);
|
||||
}
|
||||
return false;
|
||||
@@ -1588,7 +1588,7 @@ function createNewDealershipVehicle(modelIndex, spawnPosition, spawnRotation, pr
|
||||
tempVehicleData.spawnLocked = true;
|
||||
tempVehicleData.spawnPosition = spawnPosition;
|
||||
tempVehicleData.spawnRotation = spawnRotation;
|
||||
tempVehicleData.ownerType = VRR_VEHOWNER_BIZ;
|
||||
tempVehicleData.ownerType = AGRP_VEHOWNER_BIZ;
|
||||
tempVehicleData.ownerId = dealershipId;
|
||||
tempVehicleData.needsSaved = true;
|
||||
tempVehicleData.interior = interior;
|
||||
@@ -1674,22 +1674,22 @@ function processVehiclePurchasing() {
|
||||
|
||||
function checkVehiclePurchasing(client) {
|
||||
if (!isPlayerLoggedIn(client)) {
|
||||
setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null);
|
||||
setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_NONE, null, null);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isPlayerSpawned(client)) {
|
||||
setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null);
|
||||
setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_NONE, null, null);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!getPlayerData(client)) {
|
||||
setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null);
|
||||
setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_NONE, null, null);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!getPlayerData(client).buyingVehicle) {
|
||||
setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null);
|
||||
setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_NONE, null, null);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1699,7 +1699,7 @@ function checkVehiclePurchasing(client) {
|
||||
messagePlayerError(client, getLocaleString(client, "DealershipPurchaseExitedVehicle"));
|
||||
respawnVehicle(getPlayerData(client).buyingVehicle);
|
||||
getPlayerData(client).buyingVehicle = false;
|
||||
setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null);
|
||||
setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_NONE, null, null);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -1710,7 +1710,7 @@ function checkVehiclePurchasing(client) {
|
||||
messagePlayerError(client, getLocaleString(client, "VehiclePurchaseNotEnoughMoney"));
|
||||
respawnVehicle(getPlayerData(client).buyingVehicle);
|
||||
getPlayerData(client).buyingVehicle = false;
|
||||
setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null);
|
||||
setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_NONE, null, null);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1719,13 +1719,13 @@ function checkVehiclePurchasing(client) {
|
||||
takePlayerCash(client, getVehicleData(getPlayerData(client).buyingVehicle).buyPrice);
|
||||
updatePlayerCash(client);
|
||||
getVehicleData(getPlayerData(client).buyingVehicle).ownerId = getPlayerCurrentSubAccount(client).databaseId;
|
||||
getVehicleData(getPlayerData(client).buyingVehicle).ownerType = VRR_VEHOWNER_PLAYER;
|
||||
getVehicleData(getPlayerData(client).buyingVehicle).ownerType = AGRP_VEHOWNER_PLAYER;
|
||||
getVehicleData(getPlayerData(client).buyingVehicle).buyPrice = 0;
|
||||
getVehicleData(getPlayerData(client).buyingVehicle).rentPrice = 0;
|
||||
getVehicleData(getPlayerData(client).buyingVehicle).spawnLocked = false;
|
||||
getPlayerData(client).buyingVehicle = false;
|
||||
messagePlayerSuccess(client, getLocaleString(client, "VehiclePurchaseComplete"));
|
||||
setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null);
|
||||
setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_NONE, null, null);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1752,9 +1752,9 @@ function processVehicleBurning() {
|
||||
function cacheAllVehicleItems() {
|
||||
for (let i in getServerData().vehicles) {
|
||||
for (let j in getServerData().items) {
|
||||
if (getItemData(j).ownerType == VRR_ITEM_OWNER_VEHTRUNK && getItemData(j).ownerId == getServerData().vehicles[i].databaseId) {
|
||||
if (getItemData(j).ownerType == AGRP_ITEM_OWNER_VEHTRUNK && getItemData(j).ownerId == getServerData().vehicles[i].databaseId) {
|
||||
getServerData().vehicles[i].trunkItemCache.push(j);
|
||||
} else if (getItemData(j).ownerType == VRR_ITEM_OWNER_VEHDASH && getItemData(j).ownerId == getServerData().vehicles[i].databaseId) {
|
||||
} else if (getItemData(j).ownerType == AGRP_ITEM_OWNER_VEHDASH && getItemData(j).ownerId == getServerData().vehicles[i].databaseId) {
|
||||
getServerData().vehicles[i].dashItemCache.push(j);
|
||||
}
|
||||
}
|
||||
@@ -1781,16 +1781,16 @@ function setAllVehicleIndexes() {
|
||||
// ===========================================================================
|
||||
|
||||
function doesVehicleHaveMegaphone(vehicle) {
|
||||
if (getVehicleData(vehicle).ownerType == VRR_VEHOWNER_JOB) {
|
||||
if (getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == VRR_JOB_POLICE) {
|
||||
if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_JOB) {
|
||||
if (getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == AGRP_JOB_POLICE) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == VRR_JOB_FIRE) {
|
||||
if (getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == AGRP_JOB_FIRE) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == VRR_JOB_MEDICAL) {
|
||||
if (getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == AGRP_JOB_MEDICAL) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user