Change copyright, consts, and net events prefix

This commit is contained in:
Vortrex
2022-12-19 10:11:10 -06:00
parent df0bf2fdd7
commit bd29a9f7d5
127 changed files with 2745 additions and 2871 deletions

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: accent.js
// DESC: Provides accent functions and usage

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: account.js
// DESC: Provides account functions and usage
@@ -9,35 +8,35 @@
// ===========================================================================
// Account Contact Types
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
const V_CONTACT_NONE = 0;
const V_CONTACT_NEUTRAL = 1; // Contact is neutral. Used for general contacts with no special additional features
const V_CONTACT_FRIEND = 2; // Contact is a friend. Shows when they're online.
const V_CONTACT_BLOCKED = 3; // Contact is blocked. Prevents all communication to/from them except for RP
// ===========================================================================
// Account Authentication Methods
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)
const V_ACCT_AUTHMETHOD_NONE = 0; // None
const V_ACCT_AUTHMETHOD_EMAIL = 1; // Email
const V_ACCT_AUTHMETHOD_PHONENUM = 2; // Phone number
const V_ACCT_AUTHMETHOD_2FA = 3; // Two factor authentication app (authy, google authenticator, etc)
const V_ACCT_AUTHMETHOD_PEBBLE = 4; // Pebble watch (this one's for Vortrex but anybody with a Pebble can use)
const V_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 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
const V_2FA_STATE_NONE = 0; // None
const V_2FA_STATE_CODEINPUT = 1; // Waiting on player to enter code to play
const V_2FA_STATE_SETUP_CODETOAPP = 2; // Providing player with a code to put in their auth app
const V_2FA_STATE_SETUP_CODEFROMAPP = 3; // Waiting on player to enter code from auth app to set up
// ===========================================================================
// Reset Password States
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
const V_RESETPASS_STATE_NONE = 0; // None
const V_RESETPASS_STATE_CODEINPUT = 1; // Waiting on player to enter code sent via email
const V_RESETPASS_STATE_SETPASS = 2; // Waiting on player to enter new password
// ===========================================================================
@@ -866,7 +865,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 = AGRP_PROMPT_CREATEFIRSTCHAR;
getPlayerData(client).promptType = V_PROMPT_CREATEFIRSTCHAR;
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the no characters prompt GUI`);
} else {
messagePlayerAlert(client, getLocaleString(client, "NoCharactersChatMessage", `{ALTCOLOUR}/newchar{MAINCOLOUR}`));
@@ -1283,7 +1282,7 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
showPlayerRegistrationSuccessGUI(client);
showPlayerPrompt(client, getLocaleString(client, "NoCharactersGUIMessage"), getLocaleString(client, "NoCharactersGUIWindowTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
getPlayerData(client).promptType = AGRP_PROMPT_CREATEFIRSTCHAR;
getPlayerData(client).promptType = V_PROMPT_CREATEFIRSTCHAR;
} else {
messagePlayerAlert(client, getLocaleString(client, "NoCharactersChatMessage", `{ALTCOLOUR}/newchar{MAINCOLOUR}`));
}
@@ -1298,7 +1297,7 @@ function checkAccountResetPasswordRequest(client, inputText) {
}
switch (getPlayerData(client).passwordResetState) {
case AGRP_RESETPASS_STATE_EMAILCONFIRM: {
case V_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"));
@@ -1306,7 +1305,7 @@ function checkAccountResetPasswordRequest(client, inputText) {
}
let passwordResetCode = toUpperCase(generateEmailVerificationCode());
getPlayerData(client).passwordResetState = AGRP_RESETPASS_STATE_CODEINPUT;
getPlayerData(client).passwordResetState = V_RESETPASS_STATE_CODEINPUT;
getPlayerData(client).passwordResetCode = passwordResetCode;
showPlayerResetPasswordCodeInputGUI(client);
sendPasswordResetEmail(client, passwordResetCode);
@@ -1314,11 +1313,11 @@ function checkAccountResetPasswordRequest(client, inputText) {
break;
}
case AGRP_RESETPASS_STATE_CODEINPUT: {
case V_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 = AGRP_RESETPASS_STATE_SETPASS;
getPlayerData(client).passwordResetState = V_RESETPASS_STATE_SETPASS;
showPlayerChangePasswordGUI(client);
logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} entered the correct reset password verification code. Awaiting new password input ...`);
} else {
@@ -1335,10 +1334,10 @@ function checkAccountResetPasswordRequest(client, inputText) {
break;
}
case AGRP_RESETPASS_STATE_NONE: {
case V_RESETPASS_STATE_NONE: {
logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} requested a password reset. Awaiting email input ...`);
showPlayerResetPasswordEmailInputGUI(client);
getPlayerData(client).passwordResetState = AGRP_RESETPASS_STATE_EMAILCONFIRM;
getPlayerData(client).passwordResetState = V_RESETPASS_STATE_EMAILCONFIRM;
break;
}
}
@@ -1350,8 +1349,8 @@ function checkAccountResetPasswordRequest(client, inputText) {
function checkAccountChangePassword(client, newPassword, confirmNewPassword) {
if (!isPlayerLoggedIn(client)) {
if (getPlayerData(client).passwordResetState != AGRP_RESETPASS_STATE_SETPASS) {
//getPlayerData(client).passwordResetState = AGRP_RESETPASS_STATE_NONE;
if (getPlayerData(client).passwordResetState != V_RESETPASS_STATE_SETPASS) {
//getPlayerData(client).passwordResetState = V_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;
@@ -1387,8 +1386,8 @@ function checkAccountChangePassword(client, newPassword, confirmNewPassword) {
saveAccountToDatabase(getPlayerData(client).accountData);
if (getPlayerData(client).passwordResetState == AGRP_RESETPASS_STATE_SETPASS) {
getPlayerData(client).passwordResetState = AGRP_RESETPASS_STATE_NONE;
if (getPlayerData(client).passwordResetState == V_RESETPASS_STATE_SETPASS) {
getPlayerData(client).passwordResetState = V_RESETPASS_STATE_NONE;
}
messagePlayerSuccess(client, getLocaleString(client, "PasswordChanged"));
@@ -1429,7 +1428,7 @@ function savePlayerToDatabase(client) {
//let subAccountData = getPlayerCurrentSubAccount(client);
if (getPlayerPed(client) != null) {
if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType != AGRP_RETURNTO_TYPE_ADMINGET) {
if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType != V_RETURNTO_TYPE_ADMINGET) {
getPlayerCurrentSubAccount(client).spawnPosition = getPlayerData(client).returnToPosition;
getPlayerCurrentSubAccount(client).spawnHeading = getPlayerData(client).returnToHeading.z;
getPlayerCurrentSubAccount(client).interior = getPlayerData(client).returnToInterior;

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: animation.js
// DESC: Provides animation functions and usage
@@ -35,8 +34,8 @@ function playPlayerAnimationCommand(command, params, client) {
return false;
}
if (getAnimationData(animationSlot)[3] == AGRP_ANIMTYPE_SURRENDER) {
getPlayerData(client).pedState = AGRP_PEDSTATE_HANDSUP;
if (getAnimationData(animationSlot)[3] == V_ANIMTYPE_SURRENDER) {
getPlayerData(client).pedState = V_PEDSTATE_HANDSUP;
}
if (isPlayerHandCuffed(client) || isPlayerTazed(client) || isPlayerInForcedAnimation(client)) {
@@ -106,9 +105,9 @@ function makePlayerPlayAnimation(client, animationSlot, offsetPosition = 1) {
}
makePedPlayAnimation(getPlayerPed(client), animationSlot, offsetPosition);
//setEntityData(getPlayerPed(client), "agrp.anim", animationSlot, true);
//if(getAnimationData(animationSlot)[9] != AGRP_ANIMMOVE_NONE) {
// if(getGame() < AGRP_GAME_GTA_SA) {
//setEntityData(getPlayerPed(client), "v.rp.anim", animationSlot, true);
//if(getAnimationData(animationSlot)[9] != V_ANIMMOVE_NONE) {
// if(getGame() < V_GAME_GTA_SA) {
// setPlayerMouseCameraState(client, true);
// }
//}

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: anticheat.js
// DESC: Provides anticheat functions and usage
@@ -16,10 +15,10 @@ function initAntiCheatScript() {
// ===========================================================================
function clearPlayerStateToEnterExitProperty(client) {
if (getPlayerData(client).pedState != AGRP_PEDSTATE_READY) {
if (getPlayerData(client).pedState == AGRP_PEDSTATE_ENTERINGVEHICLE) {
if (getPlayerData(client).pedState != V_PEDSTATE_READY) {
if (getPlayerData(client).pedState == V_PEDSTATE_ENTERINGVEHICLE) {
sendPlayerClearPedState(client);
getPlayerData(client).pedState = AGRP_PEDSTATE_READY;
getPlayerData(client).pedState = V_PEDSTATE_READY;
} else {
return false;
}

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: bans.js
// DESC: Provides ban functions and usage
@@ -9,18 +8,18 @@
// ===========================================================================
// Ban Types
const AGRP_BANTYPE_NONE = 0;
const AGRP_BANTYPE_ACCOUNT = 1;
const AGRP_BANTYPE_SUBACCOUNT = 2;
const AGRP_BANTYPE_IPADDRESS = 3;
const AGRP_BANTYPE_SUBNET = 4;
const V_BANTYPE_NONE = 0;
const V_BANTYPE_ACCOUNT = 1;
const V_BANTYPE_SUBACCOUNT = 2;
const V_BANTYPE_IPADDRESS = 3;
const V_BANTYPE_SUBNET = 4;
// ===========================================================================
class BanData {
constructor(dbAssoc = false) {
this.databaseId = 0;
this.type = AGRP_BANTYPE_NONE;
this.type = V_BANTYPE_NONE;
this.detail = "";
this.ipAddress = "";
this.name = "";
@@ -175,7 +174,7 @@ function banAccount(accountId, adminAccountId, reason) {
let dbConnection = connectToDatabase();
if (dbConnection) {
let safeReason = dbConnection.escapetoString(reason);
let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${AGRP_BANTYPE_ACCOUNT}, ${accountId}, ${adminAccountId}, '${safeReason}');`);
let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${V_BANTYPE_ACCOUNT}, ${accountId}, ${adminAccountId}, '${safeReason}');`);
freeDatabaseQuery(dbQuery);
dbConnection.close();
return true;
@@ -190,7 +189,7 @@ function banSubAccount(subAccountId, adminAccountId, reason) {
let dbConnection = connectToDatabase();
if (dbConnection) {
let safeReason = dbConnection.escapetoString(reason);
let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${AGRP_BANTYPE_SUBACCOUNT}, ${subAccountId}, ${adminAccountId}, '${safeReason}');`);
let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${V_BANTYPE_SUBACCOUNT}, ${subAccountId}, ${adminAccountId}, '${safeReason}');`);
freeDatabaseQuery(dbQuery);
dbConnection.close();
return true;
@@ -205,7 +204,7 @@ function banIPAddress(ipAddress, adminAccountId, reason) {
let dbConnection = connectToDatabase();
if (dbConnection) {
let safeReason = dbConnection.escapetoString(reason);
let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${AGRP_BANTYPE_IPADDRESS}, INET_ATON(${ipAddress}), ${adminAccountId}, '${safeReason}');`);
let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${V_BANTYPE_IPADDRESS}, INET_ATON(${ipAddress}), ${adminAccountId}, '${safeReason}');`);
freeDatabaseQuery(dbQuery);
dbConnection.close();
return true;
@@ -220,7 +219,7 @@ function banSubNet(ipAddressStart, ipAddressEnd, adminAccountId, reason) {
let dbConnection = connectToDatabase();
if (dbConnection) {
let safeReason = dbConnection.escapetoString(reason);
let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_ip_start, ban_ip_end, ban_who_banned, ban_reason) VALUES (${AGRP_BANTYPE_SUBNET}, INET_ATON(${ipAddressStart}), INET_ATON(${ipAddressEnd}), ${adminAccountId}, '${safeReason}');`);
let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_ip_start, ban_ip_end, ban_who_banned, ban_reason) VALUES (${V_BANTYPE_SUBNET}, INET_ATON(${ipAddressStart}), INET_ATON(${ipAddressEnd}), ${adminAccountId}, '${safeReason}');`);
freeDatabaseQuery(dbQuery);
dbConnection.close();
return true;
@@ -234,7 +233,7 @@ function banSubNet(ipAddressStart, ipAddressEnd, adminAccountId, reason) {
function unbanAccount(accountId, adminAccountId) {
let dbConnection = connectToDatabase();
if (dbConnection) {
let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${AGRP_BANTYPE_ACCOUNT} AND ban_detail=${accountId}`);
let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${V_BANTYPE_ACCOUNT} AND ban_detail=${accountId}`);
freeDatabaseQuery(dbQuery);
dbConnection.close();
return true;
@@ -248,7 +247,7 @@ function unbanAccount(accountId, adminAccountId) {
function unbanSubAccount(subAccountId, adminAccountId) {
let dbConnection = connectToDatabase();
if (dbConnection) {
let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${AGRP_BANTYPE_SUBACCOUNT} AND ban_detail=${subAccountId}`);
let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${V_BANTYPE_SUBACCOUNT} AND ban_detail=${subAccountId}`);
freeDatabaseQuery(dbQuery);
dbConnection.close();
return true;
@@ -262,7 +261,7 @@ function unbanSubAccount(subAccountId, adminAccountId) {
function unbanIPAddress(ipAddress, adminAccountId) {
let dbConnection = connectToDatabase();
if (dbConnection) {
let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${AGRP_BANTYPE_IPADDRESS} AND ban_detail=INET_ATON(${ipAddress})`);
let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${V_BANTYPE_IPADDRESS} AND ban_detail=INET_ATON(${ipAddress})`);
freeDatabaseQuery(dbQuery);
dbConnection.close();
return true;
@@ -276,7 +275,7 @@ function unbanIPAddress(ipAddress, adminAccountId) {
function unbanSubNet(ipAddressStart, ipAddressEnd, adminAccountId) {
let dbConnection = connectToDatabase();
if (dbConnection) {
let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${AGRP_BANTYPE_SUBNET} AND ban_ip_start=INET_ATON(${ipAddressStart}) AND ban_ip_end=INET_ATON(${ipAddressEnd})`);
let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${V_BANTYPE_SUBNET} AND ban_ip_start=INET_ATON(${ipAddressStart}) AND ban_ip_end=INET_ATON(${ipAddressEnd})`);
freeDatabaseQuery(dbQuery);
dbConnection.close();
return true;
@@ -288,7 +287,7 @@ function unbanSubNet(ipAddressStart, ipAddressEnd, adminAccountId) {
// ===========================================================================
function isAccountBanned(accountId) {
let bans = getServerData().bans.filter(ban => ban.type === AGRP_BANTYPE_ACCOUNT && ban.detail === accountId);
let bans = getServerData().bans.filter(ban => ban.type === V_BANTYPE_ACCOUNT && ban.detail === accountId);
if (bans.length > 0) {
return true;
}
@@ -299,7 +298,7 @@ function isAccountBanned(accountId) {
// ===========================================================================
function isSubAccountBanned(subAccountId) {
let bans = getServerData().bans.filter(ban => ban.type === AGRP_BANTYPE_SUBACCOUNT && ban.detail === subAccountId);
let bans = getServerData().bans.filter(ban => ban.type === V_BANTYPE_SUBACCOUNT && ban.detail === subAccountId);
if (bans.length > 0) {
return true;
}
@@ -310,7 +309,7 @@ function isSubAccountBanned(subAccountId) {
// ===========================================================================
function isIpAddressBanned(ipAddress) {
let bans = getServerData().bans.filter(ban => ban.type === AGRP_BANTYPE_IPADDRESS && ban.detail === ipAddress);
let bans = getServerData().bans.filter(ban => ban.type === V_BANTYPE_IPADDRESS && ban.detail === ipAddress);
if (bans.length > 0) {
return true;
}

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: bank.js
// DESC: Provides banking functions and usage
@@ -9,13 +8,13 @@
// ===========================================================================
// House Owner Types
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.
const V_BANK_ACCT_OWNER_NONE = 0; // Not owned
const V_BANK_ACCT_OWNER_PLAYER = 1; // Owner is a player (character/subaccount)
const V_BANK_ACCT_OWNER_JOB = 2; // Owned by a job
const V_BANK_ACCT_OWNER_CLAN = 3; // Owned by a clan
const V_BANK_ACCT_OWNER_FACTION = 4; // Owned by a faction
const V_BANK_ACCT_OWNER_BIZ = 4; // Owned by a faction
const V_BANK_ACCT_OWNER_PUBLIC = 5; // Is a public bank account. Technically not owned. This probably won't be used.
// ===========================================================================
@@ -26,7 +25,7 @@ function isPlayerAtBank(client) {
let businessId = getPlayerBusiness(client);
if (getBusinessData(client) != false) {
if (getBusinessData(businessId).type == AGRP_BIZ_TYPE_BANK) {
if (getBusinessData(businessId).type == V_BIZ_TYPE_BANK) {
return true;
}
}

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: bitflags.js
// DESC: Provides bitwise operations, functions and usage

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: business.js
// DESC: Provides business functions and usage
@@ -9,34 +8,34 @@
// ===========================================================================
// Business Types
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
const AGRP_BIZ_TYPE_DEALERSHIP = 5; // Vehicle Dealership (also for airplane, boat, etc)
const V_BIZ_TYPE_NONE = 0; // None (invalid)
const V_BIZ_TYPE_NORMAL = 1; // Normal business (sells items)
const V_BIZ_TYPE_BANK = 2; // Bank
const V_BIZ_TYPE_PUBLIC = 3; // Public business (Government, public service, etc)
const V_BIZ_TYPE_PAINTBALL = 4; // Paintball arena. Player joins paintball/airsoft when they enter
const V_BIZ_TYPE_DEALERSHIP = 5; // Vehicle Dealership (also for airplane, boat, etc)
// ===========================================================================
// Business Location Types
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
const V_BIZ_LOC_NONE = 0; // None
const V_BIZ_LOC_GATE = 1; // Center of any moveable gate that belongs to the biz
const V_BIZ_LOC_GARAGE = 2; // Location for attached garage (pos1 = outside, pos2 = inside). Use pos to teleport or spawn veh/ped
const V_BIZ_LOC_FUEL = 3; // Fuel pump
const V_BIZ_LOC_DRIVETHRU = 4; // Drivethrough
const V_BIZ_LOC_VENDMACHINE = 5; // Vending machine
const V_BIZ_LOC_ATM = 6; // ATM
const V_BIZ_LOC_PAYPHONE = 7; // Payphone
// ===========================================================================
// Business Owner Types
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
const V_BIZ_OWNER_NONE = 0; // Not owned
const V_BIZ_OWNER_PLAYER = 1; // Owned by a player (character/subaccount)
const V_BIZ_OWNER_JOB = 2; // Owned by a job
const V_BIZ_OWNER_CLAN = 3; // Owned by a clan
const V_BIZ_OWNER_FACTION = 4; // Owned by a faction (not used at the moment)
const V_BIZ_OWNER_PUBLIC = 5; // Public Business. Used for goverment/official places like police, fire, city hall, DMV, etc
// ===========================================================================
@@ -50,7 +49,7 @@ class BusinessData {
constructor(dbAssoc = false) {
this.databaseId = 0;
this.name = "";
this.ownerType = AGRP_BIZ_OWNER_NONE;
this.ownerType = V_BIZ_OWNER_NONE;
this.ownerId = 0;
this.buyPrice = 0;
this.locked = false;
@@ -58,8 +57,8 @@ class BusinessData {
this.index = -1;
this.needsSaved = false;
this.interiorLights = true;
this.type = AGRP_BIZ_TYPE_NONE;
this.propertyType = AGRP_PROPERTY_TYPE_BUSINESS;
this.type = V_BIZ_TYPE_NONE;
this.propertyType = V_PROPERTY_TYPE_BUSINESS;
this.floorItemCache = [];
this.storageItemCache = [];
@@ -94,7 +93,7 @@ class BusinessData {
this.paintBallPlayers = [];
this.labelHelpType = AGRP_PROPLABEL_INFO_NONE;
this.labelHelpType = V_PROPLABEL_INFO_NONE;
if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["biz_id"]);
@@ -461,7 +460,7 @@ function setBusinessNameCommand(command, params, client) {
let oldBusinessName = getBusinessData(businessId).name;
getBusinessData(businessId).name = newBusinessName;
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.name", getBusinessData(businessId).name, true);
setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.name", getBusinessData(businessId).name, true);
getBusinessData(businessId).needsSaved = true;
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} renamed business {businessBlue}${oldBusinessName}{MAINCOLOUR} to {businessBlue}${newBusinessName}`, true);
}
@@ -501,7 +500,7 @@ function setBusinessOwnerCommand(command, params, client) {
return false;
}
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_PLAYER;
getBusinessData(businessId).ownerType = V_BIZ_OWNER_PLAYER;
getBusinessData(businessId).ownerId = getPlayerCurrentSubAccount(newBusinessOwner).databaseId;
getBusinessData(businessId).needsSaved = true;
@@ -543,7 +542,7 @@ function setBusinessJobCommand(command, params, client) {
return false;
}
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_JOB;
getBusinessData(businessId).ownerType = V_BIZ_OWNER_JOB;
getBusinessData(businessId).ownerId = getJobData(jobId).databaseId;
getBusinessData(businessId).needsSaved = true;
@@ -576,7 +575,7 @@ function setBusinessClanCommand(command, params, client) {
return false;
}
if (getBusinessData(business).ownerType != AGRP_VEHOWNER_PLAYER) {
if (getBusinessData(business).ownerType != V_VEHOWNER_PLAYER) {
messagePlayerError(client, getLocaleString(client, "MustOwnBusiness"));
return false;
}
@@ -588,9 +587,9 @@ function setBusinessClanCommand(command, params, client) {
// Use confirm prompt
showPlayerPrompt(client, getLocaleString(client, "SetBusinessClanConfirmMessage"), getLocaleString(client, "SetBusinessClanConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
getPlayerData(client).promptType = AGRP_PROMPT_GIVEBIZTOCLAN;
getPlayerData(client).promptType = V_PROMPT_GIVEBIZTOCLAN;
//getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_CLAN;
//getBusinessData(businessId).ownerType = V_BIZ_OWNER_CLAN;
//getBusinessData(businessId).ownerId = getClanData(clanId).databaseId;
//getBusinessData(businessId).needsSaved = true;
}
@@ -621,7 +620,7 @@ function setBusinessRankCommand(command, params, client) {
return false;
}
if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_CLAN) {
if (getVehicleData(vehicle).ownerType == V_VEHOWNER_CLAN) {
let clanId = getClanIndexFromDatabaseId(getBusinessData(businessId).ownerId);
rankId = getClanRankFromParams(clanId, params);
if (!getClanRankData(clanId, rankId)) {
@@ -630,7 +629,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 == AGRP_VEHOWNER_JOB) {
} else if (getBusinessData(businessId).ownerType == V_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!`);
}
@@ -727,7 +726,7 @@ function setBusinessJobCommand(command, params, client) {
return false;
}
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_JOB;
getBusinessData(businessId).ownerType = V_BIZ_OWNER_JOB;
getBusinessData(businessId).ownerId = getJobData(jobId).databaseId;
getBusinessData(businessId).needsSaved = true;
@@ -757,7 +756,7 @@ function setBusinessPublicCommand(command, params, client) {
return false;
}
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_PUBLIC;
getBusinessData(businessId).ownerType = V_BIZ_OWNER_PUBLIC;
getBusinessData(businessId).ownerId = 0;
getBusinessData(businessId).needsSaved = true;
@@ -787,7 +786,7 @@ function removeBusinessOwnerCommand(command, params, client) {
return false;
}
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_NONE;
getBusinessData(businessId).ownerType = V_BIZ_OWNER_NONE;
getBusinessData(businessId).ownerId = -1;
getBusinessData(businessId).needsSaved = true;
@@ -880,7 +879,7 @@ function setBusinessPaintBallCommand(command, params, client) {
return false;
}
getBusinessData(businessId).type = AGRP_BIZ_TYPE_PAINTBALL;
getBusinessData(businessId).type = V_BIZ_TYPE_PAINTBALL;
getBusinessData(businessId).needsSaved = true;
messagePlayerSuccess(client, getLocaleString(client, "BusinessIsNowPaintBall"));
}
@@ -912,24 +911,24 @@ function getBusinessInfoCommand(command, params, client) {
let ownerName = "Unknown";
switch (businessData.ownerType) {
case AGRP_BIZ_OWNER_CLAN:
case V_BIZ_OWNER_CLAN:
ownerName = getClanData(businessData.ownerId).name;
break;
case AGRP_BIZ_OWNER_JOB:
case V_BIZ_OWNER_JOB:
ownerName = getJobData(businessData.ownerId).name;
break;
case AGRP_BIZ_OWNER_PLAYER:
case V_BIZ_OWNER_PLAYER:
let subAccountData = loadSubAccountFromId(businessData.ownerId);
ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`;
break;
case AGRP_BIZ_OWNER_PUBLIC:
case V_BIZ_OWNER_PUBLIC:
ownerName = "Public";
break;
case AGRP_BIZ_OWNER_NONE:
case V_BIZ_OWNER_NONE:
//submitBugReport(client, `[AUTOMATED REPORT] getBusinessInfoCommand() - Invalid ownerType for business ${businessId}/${getBusinessData(businessId).databaseId}`);
ownerName = "None";
break;
@@ -1295,7 +1294,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, AGRP_ITEM_OWNER_BIZFLOOR, getBusinessData(businessId).databaseId, getGameConfig().defaultBusinessItems[getGame()][typeParam][i][1]);
let newItemIndex = createItem(itemTypeId, itemTypeData.orderValue, V_ITEM_OWNER_BIZFLOOR, getBusinessData(businessId).databaseId, getGameConfig().defaultBusinessItems[getGame()][typeParam][i][1]);
getItemData(newItemIndex).buyPrice = applyServerInflationMultiplier(itemTypeData.orderPrice) * getGameConfig().defaultBusinessItems[getGame()][typeParam][i][2];
}
}
@@ -1324,8 +1323,8 @@ function setBusinessDealershipCommand(command, params, client) {
return false;
}
getBusinessData(businessId).labelHelpType == AGRP_PROPLABEL_INFO_ENTERVEHICLE;
getBusinessData(businessId).type = AGRP_BIZ_TYPE_DEALERSHIP;
getBusinessData(businessId).labelHelpType == V_PROPLABEL_INFO_ENTERVEHICLE;
getBusinessData(businessId).type = V_BIZ_TYPE_DEALERSHIP;
updateBusinessPickupLabelData(businessId);
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set the type of business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} to dealership`, true);
}
@@ -1469,7 +1468,7 @@ function setBusinessBuyPriceCommand(command, params, client) {
}
getBusinessData(businessId).buyPrice = amount;
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.price", getBusinessData(businessId).buyPrice, true);
setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.price", getBusinessData(businessId).buyPrice, true);
getBusinessData(businessId).needsSaved = true;
messagePlayerSuccess(client, `{MAINCOLOUR}You set business {businessBlue}${getBusinessData(businessId).name}'s{MAINCOLOUR} for-sale price to {ALTCOLOUR}${getCurrencyString(amount)}`);
@@ -1569,7 +1568,7 @@ function orderItemForBusinessCommand(command, params, client) {
let orderTotalCost = pricePerItem * amount;
//getPlayerData(client).promptType = AGRP_PROMPT_BIZORDER;
//getPlayerData(client).promptType = V_PROMPT_BIZORDER;
getPlayerData(client).businessOrderAmount = amount;
getPlayerData(client).businessOrderBusiness = businessId;
getPlayerData(client).businessOrderItem = itemType;
@@ -1577,7 +1576,7 @@ function orderItemForBusinessCommand(command, params, client) {
getBusinessData(businessId).needsSaved = true;
showPlayerPrompt(client, `Ordering ${amount} ${getPluralForm(getItemTypeData(itemType).name)} will cost a total of ${getCurrencyString(orderTotalCost)}`, "Business Order Cost");
getPlayerData(client).promptType = AGRP_PROMPT_BIZORDER;
getPlayerData(client).promptType = V_PROMPT_BIZORDER;
}
// ===========================================================================
@@ -1664,7 +1663,7 @@ function buyBusinessCommand(command, params, client) {
}
showPlayerPrompt(client, getLocaleString(client, "BuyBusinessConfirmMessage"), getLocaleString(client, "BuyBusinessConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
getPlayerData(client).promptType = AGRP_PROMPT_BUYBIZ;
getPlayerData(client).promptType = V_PROMPT_BUYBIZ;
}
// ===========================================================================
@@ -2022,7 +2021,7 @@ function createBusinessEntrancePickup(businessId) {
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating entrance pickup for business ${businessData.name}`);
if (areServerElementsSupported() && getGame() != AGRP_GAME_MAFIA_ONE && getGame() != AGRP_GAME_GTA_IV) {
if (areServerElementsSupported() && getGame() != V_GAME_MAFIA_ONE && getGame() != V_GAME_GTA_IV) {
let entrancePickup = null;
if (isGameFeatureSupported("pickup")) {
let pickupModelId = getGameConfig().pickupModels[getGame()].Business;
@@ -2099,7 +2098,7 @@ function createBusinessEntranceBlip(businessId) {
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating entrance blip for business ${businessData.name} (model ${blipModelId})`);
if (areServerElementsSupported() && getGame() != AGRP_GAME_MAFIA_ONE && getGame() != AGRP_GAME_GTA_IV) {
if (areServerElementsSupported() && getGame() != V_GAME_MAFIA_ONE && getGame() != V_GAME_GTA_IV) {
let entranceBlip = createGameBlip(businessData.entrancePosition, blipModelId, 1, getColourByType("businessBlue"));
if (entranceBlip != null) {
if (businessData.entranceDimension != -1) {
@@ -2350,17 +2349,17 @@ function exitBusiness(client) {
*/
function getBusinessOwnerTypeText(ownerType) {
switch (ownerType) {
case AGRP_BIZ_OWNER_CLAN:
case V_BIZ_OWNER_CLAN:
return "clan";
case AGRP_BIZ_OWNER_JOB:
case V_BIZ_OWNER_JOB:
return "job";
case AGRP_BIZ_OWNER_PLAYER:
case V_BIZ_OWNER_PLAYER:
return "player";
case AGRP_BIZ_OWNER_NONE:
case AGRP_BIZ_OWNER_PUBLIC:
case V_BIZ_OWNER_NONE:
case V_BIZ_OWNER_PUBLIC:
return "not owned";
default:
@@ -2538,7 +2537,7 @@ function setBusinessDataIndexes() {
//}
for (let j in getServerData().businesses[i].locations) {
if (getServerData().businesses[i].locations[j].type == AGRP_BIZ_LOC_ATM) {
if (getServerData().businesses[i].locations[j].type == V_BIZ_LOC_ATM) {
getServerData().atmLocationCache.push([i, j, getServerData().businesses[i].locations[j].position]);
}
}
@@ -2554,7 +2553,7 @@ function addToBusinessInventory(businessId, itemType, amount, buyPrice) {
tempItemData.buyPrice = buyPrice;
tempItemData.itemType = getItemTypeData(itemType).databaseId;
tempItemData.ownerId = getBusinessData(business).databaseId;
tempItemData.ownerType = AGRP_ITEMOWNER_BIZ;
tempItemData.ownerType = V_ITEMOWNER_BIZ;
tempItemData.ownerIndex = businessId;
tempItemData.itemTypeIndex = itemType;
saveItemToDatabase(tempItemData);
@@ -2646,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, AGRP_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId, amount);
createItem(getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).itemTypeIndex, getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).value, V_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId, amount);
cachePlayerHotBarItems(client);
getBusinessData(businessId).till = getBusinessData(businessId).till + totalCost;
@@ -2656,7 +2655,7 @@ function buyFromBusinessCommand(command, params, client) {
}
let useType = getItemTypeData(getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).itemTypeIndex).useType;
if (useType == AGRP_ITEM_USE_TYPE_WEAPON || AGRP_ITEM_USE_TYPE_TAZER || useType == AGRP_ITEM_USE_TYPE_AMMO_CLIP) {
if (useType == V_ITEM_USE_TYPE_WEAPON || V_ITEM_USE_TYPE_TAZER || useType == V_ITEM_USE_TYPE_AMMO_CLIP) {
if (isPlayerWeaponBanned(client) && !isPlayerExemptFromAntiCheat(client)) {
messagePlayerError(client, getLocaleString(client, "WeaponBanned"));
return false;
@@ -2759,7 +2758,7 @@ function storeItemInBusinessStorageCommand(command, params, client) {
return false;
}
getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).ownerType = AGRP_ITEM_OWNER_BIZSTORAGE;
getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).ownerType = V_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}`);
@@ -2803,7 +2802,7 @@ function stockItemOnBusinessFloorCommand(command, params, client) {
return false;
}
getItemData(getBusinessData(businessId).storageItemCache[itemSlot - 1]).ownerType = AGRP_ITEM_OWNER_BIZFLOOR;
getItemData(getBusinessData(businessId).storageItemCache[itemSlot - 1]).ownerType = V_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}`);
@@ -2843,14 +2842,14 @@ function cacheBusinessItems(businessId) {
//let businessData = getBusinessData(businessId);
//logToConsole(LOG_VERBOSE, `[AGRP.Business] Caching business items for business ${businessId} (${businessData.name}) ...`);
//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);
//getBusinessData(businessId).floorItemCache = getServerData().items.filter(item => item.ownerType == V_ITEM_OWNER_BIZFLOOR && item.ownerId == businessData.databaseId).map(i => i.index);
//getBusinessData(businessId).storageItemCache = getServerData().items.filter(item => item.ownerType == V_ITEM_OWNER_BIZSTORAGE && item.ownerId == businessData.databaseId);
logToConsole(LOG_VERBOSE, `[AGRP.Business] Caching business items for business ${businessId} (${getBusinessData(businessId).name}) ...`);
for (let i in getServerData().items) {
if (getItemData(i).ownerType == AGRP_ITEM_OWNER_BIZFLOOR && getItemData(i).ownerId == getBusinessData(businessId).databaseId) {
if (getItemData(i).ownerType == V_ITEM_OWNER_BIZFLOOR && getItemData(i).ownerId == getBusinessData(businessId).databaseId) {
getBusinessData(businessId).floorItemCache.push(i);
} else if (getItemData(i).ownerType == AGRP_ITEM_OWNER_BIZSTORAGE && getItemData(i).ownerId == getBusinessData(businessId).databaseId) {
} else if (getItemData(i).ownerType == V_ITEM_OWNER_BIZSTORAGE && getItemData(i).ownerId == getBusinessData(businessId).databaseId) {
getBusinessData(businessId).storageItemCache.push(i);
}
}
@@ -2869,57 +2868,57 @@ function getBusinessIdFromDatabaseId(databaseId) {
// Updates all pickup data for a business by businessId
function updateBusinessPickupLabelData(businessId) {
if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE || getGame() == AGRP_GAME_GTA_IV) {
if (!areServerElementsSupported() || getGame() == V_GAME_MAFIA_ONE || getGame() == V_GAME_GTA_IV) {
sendBusinessToPlayer(null, businessId, getBusinessData(businessId).name, getBusinessData(businessId).entrancePosition, getBusinessEntranceBlipModelForNetworkEvent(businessId), getBusinessEntrancePickupModelForNetworkEvent(businessId), getBusinessData(businessId).buyPrice, getBusinessData(businessId).rentPrice, getBusinessData(businessId).hasInterior, getBusinessData(businessId).locked, doesBusinessHaveAnyItemsToBuy(businessId));
return false;
}
if (getBusinessData(businessId).exitPickup != null) {
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", AGRP_LABEL_EXIT, true);
setEntityData(getBusinessData(businessId).exitPickup, "v.rp.owner.type", V_PICKUP_BUSINESS_EXIT, false);
setEntityData(getBusinessData(businessId).exitPickup, "v.rp.owner.id", businessId, false);
setEntityData(getBusinessData(businessId).exitPickup, "v.rp.label.type", V_LABEL_EXIT, true);
}
if (getBusinessData(businessId).entrancePickup != null) {
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", 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", AGRP_PROPLABEL_INFO_NONE, true);
setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.owner.type", V_PICKUP_BUSINESS_ENTRANCE, false);
setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.owner.id", businessId, false);
setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.type", V_LABEL_BUSINESS, true);
setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.name", getBusinessData(businessId).name, true);
setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.locked", getBusinessData(businessId).locked, true);
setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_NONE, true);
switch (getBusinessData(businessId).labelHelpType) {
case AGRP_PROPLABEL_INFO_ENTERVEHICLE: {
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTERVEHICLE, true);
case V_PROPLABEL_INFO_ENTERVEHICLE: {
setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_ENTERVEHICLE, true);
break;
}
case AGRP_PROPLABEL_INFO_ENTER: {
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTER, true);
case V_PROPLABEL_INFO_ENTER: {
setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_ENTER, true);
break;
}
case AGRP_PROPLABEL_INFO_REPAIR: {
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_REPAIR, true);
case V_PROPLABEL_INFO_REPAIR: {
setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_REPAIR, true);
break;
}
default: {
if (getBusinessData(businessId).hasInterior) {
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTER, true);
setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_ENTER, true);
} else {
if (doesBusinessHaveAnyItemsToBuy(businessId)) {
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_BUY, true);
setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_BUY, true);
} else {
removeEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help");
removeEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.help");
}
}
break;
}
}
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.price", getBusinessData(businessId).buyPrice, true);
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.fee", getBusinessData(businessId).entranceFee, true);
setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.price", getBusinessData(businessId).buyPrice, true);
setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.fee", getBusinessData(businessId).entranceFee, true);
}
}
@@ -2997,7 +2996,7 @@ function doesBusinessHaveAnyItemsToBuy(businessId) {
//function clearPlayerBusinessGameScripts(client, businessId) {
// for(let i in getBusinessData(businessId).gameScripts) {
// sendPlayerGameScriptState(client, AGRP_GAMESCRIPT_DENY);
// sendPlayerGameScriptState(client, V_GAMESCRIPT_DENY);
// }
//}
@@ -3019,11 +3018,11 @@ function canPlayerWithdrawFromBusinessTill(client, businessId) {
return true;
}
if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
if (getBusinessData(businessId).ownerType == V_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
return true;
}
if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
if (getBusinessData(businessId).ownerType == V_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageBusinesses"))) {
return true;
}
@@ -3039,11 +3038,11 @@ function canPlayerSetBusinessInteriorLights(client, businessId) {
return true;
}
if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
if (getBusinessData(businessId).ownerType == V_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
return true;
}
if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
if (getBusinessData(businessId).ownerType == V_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageBusinesses"))) {
return true;
}
@@ -3059,11 +3058,11 @@ function canPlayerLockUnlockBusiness(client, businessId) {
return true;
}
if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
if (getBusinessData(businessId).ownerType == V_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
return true;
}
if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
if (getBusinessData(businessId).ownerType == V_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageBusinesses"))) {
return true;
}
@@ -3081,13 +3080,13 @@ function canPlayerManageBusiness(client, businessId, exemptAdminFlag = false) {
}
}
if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_PLAYER) {
if (getBusinessData(businessId).ownerType == V_BIZ_OWNER_PLAYER) {
if (getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
return true;
}
}
if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_CLAN) {
if (getBusinessData(businessId).ownerType == V_BIZ_OWNER_CLAN) {
if (getBusinessData(businessId).ownerId == getPlayerClan(client)) {
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageBusinesses"))) {
return true;

View File

@@ -1,28 +1,27 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: casino.js
// DESC: Provides casino games functions and commands
// TYPE: Server (JavaScript)
// ===========================================================================
const AGRP_CASINO_GAME_NONE = 0;
const AGRP_CASINO_GAME_BLACKJACK = 1;
const AGRP_CASINO_GAME_POKER = 2;
const AGRP_CASINO_GAME_BACCARAT = 3;
const AGRP_CASINO_GAME_ROULETTE = 4;
const AGRP_CASINO_GAME_CRAPS = 5;
const AGRP_CASINO_GAME_HOLDEM = 6;
const V_CASINO_GAME_NONE = 0;
const V_CASINO_GAME_BLACKJACK = 1;
const V_CASINO_GAME_POKER = 2;
const V_CASINO_GAME_BACCARAT = 3;
const V_CASINO_GAME_ROULETTE = 4;
const V_CASINO_GAME_CRAPS = 5;
const V_CASINO_GAME_HOLDEM = 6;
// ===========================================================================
const AGRP_CASINO_DECK_SUIT_NONE = 1;
const AGRP_CASINO_DECK_SUIT_CLUBS = 1;
const AGRP_CASINO_DECK_SUIT_DIAMONDS = 2;
const AGRP_CASINO_DECK_SUIT_HEARTS = 3;
const AGRP_CASINO_DECK_SUIT_SPADES = 4;
const V_CASINO_DECK_SUIT_NONE = 1;
const V_CASINO_DECK_SUIT_CLUBS = 1;
const V_CASINO_DECK_SUIT_DIAMONDS = 2;
const V_CASINO_DECK_SUIT_HEARTS = 3;
const V_CASINO_DECK_SUIT_SPADES = 4;
// ===========================================================================
@@ -37,45 +36,45 @@ class DeckCard {
// ===========================================================================
let cardDeck = [
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 1, "deckCardClubAce"),
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 2, "deckCardClubTwo"),
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 3, "deckCardClubThree"),
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 4, "deckCardClubFour"),
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 5, "deckCardClubFive"),
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 6, "deckCardClubSix"),
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 7, "deckCardClubSeven"),
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 8, "deckCardClubEight"),
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 9, "deckCardClubNine"),
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 10, "deckCardClubTen"),
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 11, "deckCardClubJack"),
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 12, "deckCardClubQueen"),
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 13, "deckCardClubKing"),
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 1, "deckCardDiamondAce"),
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 2, "deckCardDiamondTwo"),
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 3, "deckCardDiamondThree"),
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 4, "deckCardDiamondFour"),
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 5, "deckCardDiamondFive"),
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 6, "deckCardDiamondSix"),
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 7, "deckCardDiamondSeven"),
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 8, "deckCardDiamondEight"),
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 9, "deckCardDiamondNine"),
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 10, "deckCardDiamondTen"),
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 11, "deckCardDiamondJack"),
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 12, "deckCardDiamondQueen"),
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 13, "deckCardDiamondKing"),
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 1, "deckCardHeartAce"),
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 2, "deckCardHeartTwo"),
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 3, "deckCardHeartThree"),
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 4, "deckCardHeartFour"),
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 5, "deckCardHeartFive"),
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 6, "deckCardHeartSix"),
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 7, "deckCardHeartSeven"),
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 8, "deckCardHeartEight"),
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 9, "deckCardHeartNine"),
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 10, "deckCardHeartTen"),
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 11, "deckCardHeartJack"),
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 12, "deckCardHeartQueen"),
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 13, "deckCardHeartKing"),
new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 1, "deckCardClubAce"),
new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 2, "deckCardClubTwo"),
new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 3, "deckCardClubThree"),
new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 4, "deckCardClubFour"),
new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 5, "deckCardClubFive"),
new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 6, "deckCardClubSix"),
new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 7, "deckCardClubSeven"),
new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 8, "deckCardClubEight"),
new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 9, "deckCardClubNine"),
new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 10, "deckCardClubTen"),
new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 11, "deckCardClubJack"),
new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 12, "deckCardClubQueen"),
new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 13, "deckCardClubKing"),
new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 1, "deckCardDiamondAce"),
new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 2, "deckCardDiamondTwo"),
new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 3, "deckCardDiamondThree"),
new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 4, "deckCardDiamondFour"),
new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 5, "deckCardDiamondFive"),
new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 6, "deckCardDiamondSix"),
new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 7, "deckCardDiamondSeven"),
new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 8, "deckCardDiamondEight"),
new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 9, "deckCardDiamondNine"),
new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 10, "deckCardDiamondTen"),
new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 11, "deckCardDiamondJack"),
new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 12, "deckCardDiamondQueen"),
new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 13, "deckCardDiamondKing"),
new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 1, "deckCardHeartAce"),
new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 2, "deckCardHeartTwo"),
new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 3, "deckCardHeartThree"),
new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 4, "deckCardHeartFour"),
new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 5, "deckCardHeartFive"),
new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 6, "deckCardHeartSix"),
new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 7, "deckCardHeartSeven"),
new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 8, "deckCardHeartEight"),
new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 9, "deckCardHeartNine"),
new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 10, "deckCardHeartTen"),
new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 11, "deckCardHeartJack"),
new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 12, "deckCardHeartQueen"),
new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 13, "deckCardHeartKing"),
];
// ===========================================================================

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: chat.js
// DESC: Provides chat functions and usage
@@ -402,7 +401,7 @@ function clanChat(client, messageText) {
// ===========================================================================
function canPlayerUseMegaphone(client) {
if (getPlayerFirstItemSlotByUseType(client, AGRP_ITEM_USE_TYPE_MEGAPHONE) != -1) {
if (getPlayerFirstItemSlotByUseType(client, V_ITEM_USE_TYPE_MEGAPHONE) != -1) {
if (isPlayerActiveItemEnabled(client)) {
return true;
}

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: clan.js
// DESC: Provides clan functions and usage

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: client.js
// DESC: Provides client communication and cross-endpoint operations
@@ -9,9 +8,9 @@
// ===========================================================================
// Return-To types (for when a player is teleported)
const AGRP_RETURNTO_TYPE_NONE = 0; // "Return to" data is invalid
const AGRP_RETURNTO_TYPE_ADMINGET = 1; // "Return to" data is from admin teleporting
const AGRP_RETURNTO_TYPE_SKINSELECT = 2; // "Return to" data is from skin select
const V_RETURNTO_TYPE_NONE = 0; // "Return to" data is invalid
const V_RETURNTO_TYPE_ADMINGET = 1; // "Return to" data is from admin teleporting
const V_RETURNTO_TYPE_SKINSELECT = 2; // "Return to" data is from skin select
// ===========================================================================
@@ -37,9 +36,9 @@ class ClientData {
this.sessionId = 0;
// Security
this.passwordResetState = AGRP_RESETPASS_STATE_NONE;
this.passwordResetState = V_RESETPASS_STATE_NONE;
this.passwordResetCode = "";
this.twoFactorAuthenticationState = AGRP_2FA_STATE_NONE;
this.twoFactorAuthenticationState = V_2FA_STATE_NONE;
this.twoFactorAuthenticationCode = 0;
this.loginTimeout = null;
this.loginAttemptsRemaining = 3;
@@ -65,11 +64,11 @@ class ClientData {
// Items
this.tempLockerCache = new Array(9).fill(-1);
this.tempLockerType = AGRP_TEMP_LOCKER_TYPE_NONE;
this.tempLockerType = V_TEMP_LOCKER_TYPE_NONE;
this.hotBarItems = new Array(9).fill(-1);
this.activeHotBarSlot = -1;
this.toggleUseItem = false;
this.itemActionState = AGRP_ITEM_ACTION_NONE;
this.itemActionState = V_ITEM_ACTION_NONE;
this.itemActionItem = -1;
this.paintBallItemCache = [];
@@ -104,7 +103,7 @@ class ClientData {
this.returnToDimension = null;
this.returnToHouse = null;
this.returnToBusiness = null;
this.returnToType = AGRP_RETURNTO_TYPE_NONE;
this.returnToType = V_RETURNTO_TYPE_NONE;
// Animation
this.currentAnimation = -1;
@@ -119,7 +118,7 @@ class ClientData {
this.usingSkinSelect = false;
this.keyBinds = [];
this.incomingDamageMultiplier = 1;
this.weaponDamageEvent = AGRP_WEAPON_DAMAGE_EVENT_NORMAL;
this.weaponDamageEvent = V_WEAPON_DAMAGE_EVENT_NORMAL;
this.lastJobVehicle = null;
this.health = 100;
this.locale = 0;
@@ -128,8 +127,8 @@ class ClientData {
this.scene = "";
this.playerBlip = null;
this.alcoholLevel = 0;
this.pedState = AGRP_PEDSTATE_NONE;
this.promptType = AGRP_PROMPT_NONE;
this.pedState = V_PEDSTATE_NONE;
this.promptType = V_PROMPT_NONE;
this.privateMessageReplyTo = null;
this.enteringExitingProperty = null;
this.inProperty = null;
@@ -144,12 +143,12 @@ class ClientData {
this.jobRouteEditNextLocationDelay = 0;
this.jobRouteEditNextLocationArriveMessage = "";
this.jobRouteEditNextLocationGotoMessage = "";
this.jobRouteEditNextLocationType = AGRP_JOB_ROUTE_LOC_TYPE_NONE;
this.jobRouteEditNextLocationType = V_JOB_ROUTE_LOC_TYPE_NONE;
// Casino Stuff
this.casinoChips = 0; // This might become an item with a useId of a business (for chips belonging to specific casinos)
this.casinoCardHand = [];
this.casinoPlayingGame = AGRP_CASINO_GAME_NONE;
this.casinoPlayingGame = V_CASINO_GAME_NONE;
}
};
@@ -222,7 +221,7 @@ function initClient(client) {
playerInitialized[client.index] = true;
//setEntityData(client, "agrp.isInitialized", true, false);
//setEntityData(client, "v.rp.isInitialized", true, false);
logToConsole(LOG_DEBUG, `[AGRP.Account] Initializing GUI for ${getPlayerDisplayForConsole(client)} ...`);
sendPlayerCurrencyString(client);

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: command.js
// DESC: Provides command data, functions and usage

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: config.js
// DESC: Provides server configuration
@@ -198,18 +197,18 @@ let globalConfig = {
geoIPCityDatabaseFilePath: "modules/geoip/geoip-city.mmdb",
randomTipInterval: 600000,
weaponEquippableTypes: [
AGRP_ITEM_USE_TYPE_WEAPON,
AGRP_ITEM_USE_TYPE_TAZER,
AGRP_ITEM_USE_TYPE_EXTINGUISHER,
AGRP_ITEM_USE_TYPE_SPRAYPAINT,
AGRP_ITEM_USE_TYPE_PEPPERSPRAY,
V_ITEM_USE_TYPE_WEAPON,
V_ITEM_USE_TYPE_TAZER,
V_ITEM_USE_TYPE_EXTINGUISHER,
V_ITEM_USE_TYPE_SPRAYPAINT,
V_ITEM_USE_TYPE_PEPPERSPRAY,
],
onFootOnlyItems: [
AGRP_ITEM_USE_TYPE_VEHREPAIR,
AGRP_ITEM_USE_TYPE_VEHCOLOUR,
AGRP_ITEM_USE_TYPE_VEHUPGRADE_PART,
AGRP_ITEM_USE_TYPE_VEHLIVERY,
AGRP_ITEM_USE_TYPE_VEHTIRE,
V_ITEM_USE_TYPE_VEHREPAIR,
V_ITEM_USE_TYPE_VEHCOLOUR,
V_ITEM_USE_TYPE_VEHUPGRADE_PART,
V_ITEM_USE_TYPE_VEHLIVERY,
V_ITEM_USE_TYPE_VEHTIRE,
],
vehicleInactiveRespawnDelay: 1800000, // 20 minutes
chatSectionHeaderLength: 96,

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: core.js
// DESC: Provides core data structures, function, and operations

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: crime.js
// DESC: Provides crime data structures, functions, and operations

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: database.js
// DESC: Provides database handling, functions and usage

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: developer.js
// DESC: Provides developer operation, commands, functions and usage

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: discord.js
// DESC: Provides discord bridging and connection functions and usage
@@ -9,9 +8,9 @@
// ===========================================================================
// Discord Webhook Types
const AGRP_DISCORD_WEBHOOK_NONE = 0;
const AGRP_DISCORD_WEBHOOK_LOG = 1;
const AGRP_DISCORD_WEBHOOK_ADMIN = 2;
const V_DISCORD_WEBHOOK_NONE = 0;
const V_DISCORD_WEBHOOK_LOG = 1;
const V_DISCORD_WEBHOOK_ADMIN = 2;
// ===========================================================================
@@ -111,7 +110,7 @@ function messageDiscordChatChannel(messageString) {
messageString = removeColoursInMessage(messageString);
messageString = replaceProfanityInMessage(messageString);
triggerDiscordWebHook(messageString, getServerId(), AGRP_DISCORD_WEBHOOK_LOG);
triggerDiscordWebHook(messageString, getServerId(), V_DISCORD_WEBHOOK_LOG);
}
// ===========================================================================
@@ -131,7 +130,7 @@ function messageDiscordEventChannel(messageString) {
messageString = removeColoursInMessage(messageString);
messageString = replaceProfanityInMessage(messageString);
triggerDiscordWebHook(messageString, getServerId(), AGRP_DISCORD_WEBHOOK_LOG);
triggerDiscordWebHook(messageString, getServerId(), V_DISCORD_WEBHOOK_LOG);
}
// ===========================================================================
@@ -150,7 +149,7 @@ function messageDiscordAdminChannel(messageString) {
}
messageString = removeColoursInMessage(messageString);
triggerDiscordWebHook(messageString, getServerId(), AGRP_DISCORD_WEBHOOK_ADMIN);
triggerDiscordWebHook(messageString, getServerId(), V_DISCORD_WEBHOOK_ADMIN);
}
// ===========================================================================
@@ -178,7 +177,7 @@ function messageDiscordClanWebhook(clanIndex, requiredFlagValue, messageString)
// ===========================================================================
function triggerDiscordWebHook(messageString, serverId = getServerId(), type = AGRP_DISCORD_WEBHOOK_LOG) {
function triggerDiscordWebHook(messageString, serverId = getServerId(), type = V_DISCORD_WEBHOOK_LOG) {
if (!getGlobalConfig().discord.webhook.enabled) {
return false;
}

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: economy.js
// DESC: Provides economy/financial utils, functions and usage
@@ -188,19 +187,19 @@ function repossessFirstAsset(client) {
// ===========================================================================
function getAllVehiclesOwnedByPlayer(client) {
return getServerData().vehicles.filter((v) => v.ownerType == AGRP_VEHOWNER_PLAYER && v.ownerId == getPlayerCurrentSubAccount(client).databaseId);
return getServerData().vehicles.filter((v) => v.ownerType == V_VEHOWNER_PLAYER && v.ownerId == getPlayerCurrentSubAccount(client).databaseId);
}
// ===========================================================================
function getAllBusinessesOwnedByPlayer(client) {
return getServerData().businesses.filter((b) => b.ownerType == AGRP_BIZ_OWNER_PLAYER && b.ownerId == getPlayerCurrentSubAccount(client).databaseId);
return getServerData().businesses.filter((b) => b.ownerType == V_BIZ_OWNER_PLAYER && b.ownerId == getPlayerCurrentSubAccount(client).databaseId);
}
// ===========================================================================
function getAllHousesOwnedByPlayer(client) {
return getServerData().houses.filter((h) => h.ownerType == AGRP_HOUSE_OWNER_PLAYER && h.ownerId == getPlayerCurrentSubAccount(client).databaseId);
return getServerData().houses.filter((h) => h.ownerType == V_HOUSE_OWNER_PLAYER && h.ownerId == getPlayerCurrentSubAccount(client).databaseId);
}
// ===========================================================================

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: email.js
// DESC: Provides email handling, functions and usage
@@ -9,9 +8,9 @@
// ===========================================================================
// Email Methods
const AGRP_EMAIL_METHOD_NONE = 0; // None
const AGRP_EMAIL_METHOD_SMTP_MODULE = "smtp"; // Use SMTP module
const AGRP_EMAIL_METHOD_GET_REQUEST = "http"; // Use HTTP request (httpGet to custom PHP page)
const V_EMAIL_METHOD_NONE = 0; // None
const V_EMAIL_METHOD_SMTP_MODULE = "smtp"; // Use SMTP module
const V_EMAIL_METHOD_GET_REQUEST = "http"; // Use HTTP request (httpGet to custom PHP page)
// ===========================================================================
@@ -24,7 +23,7 @@ function initEmailScript() {
async function sendEmail(toEmail, toName, subject, body) {
switch (getEmailConfig().method) {
case AGRP_EMAIL_METHOD_SMTP_MODULE:
case V_EMAIL_METHOD_SMTP_MODULE:
if (!checkForSMTPModule()) {
return false;
}
@@ -46,7 +45,7 @@ async function sendEmail(toEmail, toName, subject, body) {
});
break;
case AGRP_EMAIL_METHOD_GET_REQUEST:
case V_EMAIL_METHOD_GET_REQUEST:
let tempURL = getEmailConfig().http.baseURL;
tempURL = tempURL.replace("{0}", encodeURIComponent(getEmailConfig().http.password));
tempURL = tempURL.replace("{1}", encodeURIComponent(toEmail));

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: event.js
// DESC: Provides handlers for built in GTAC and Asshat-Gaming created events
@@ -34,7 +33,7 @@ function addAllEventHandlers() {
addEventHandler("onPedEnteredSphereEx", onPedEnteredSphere);
addEventHandler("onPedExitedSphereEx", onPedExitedSphere);
if (getGame() == AGRP_GAME_MAFIA_ONE) {
if (getGame() == V_GAME_MAFIA_ONE) {
addEventHandler("onPedFall", onPedFall);
}
}
@@ -168,7 +167,7 @@ function onEntityProcess(event, entity) {
function onPedEnteringVehicle(event, ped, vehicle, seat) {
if (ped.isType(ELEMENT_PLAYER)) {
let client = getClientFromPlayerElement(ped);
getPlayerData(client).pedState = AGRP_PEDSTATE_ENTERINGVEHICLE;
getPlayerData(client).pedState = V_PEDSTATE_ENTERINGVEHICLE;
if (!getVehicleData(vehicle)) {
return false;
@@ -203,7 +202,7 @@ function onPedExitingVehicle(event, ped, vehicle) {
if (ped.isType(ELEMENT_PLAYER)) {
let client = getClientFromPlayerElement(ped);
getPlayerData(client).pedState = AGRP_PEDSTATE_EXITINGVEHICLE;
getPlayerData(client).pedState = V_PEDSTATE_EXITINGVEHICLE;
}
}
@@ -324,7 +323,7 @@ function onPlayerDeath(client, killer, weapon, pedPiece) {
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Player ${getPlayerDisplayForConsole(client)} died!`);
logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} died.`);
getPlayerData(client).pedState = AGRP_PEDSTATE_DEAD;
getPlayerData(client).pedState = V_PEDSTATE_DEAD;
updatePlayerSpawnedState(client, false);
setPlayerControlState(client, false);
setTimeout(function () {
@@ -417,7 +416,7 @@ function onPedSpawn(ped) {
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} spawned!`);
//if (ped.type == ELEMENT_PLAYER) {
// if (getGame() != AGRP_GAME_MAFIA_ONE) {
// if (getGame() != V_GAME_MAFIA_ONE) {
// //setTimeout(onPlayerSpawn, 250, getClientFromPlayerElement(ped));
// //onPlayerSpawn(getClientFromPlayerElement(ped));
// }
@@ -470,7 +469,7 @@ async function onPlayerSpawn(client) {
if (isGameFeatureSupported("pedScale")) {
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped scale (${getPlayerCurrentSubAccount(client).pedScale})`);
setEntityData(getPlayerPed(client), "agrp.scale", getPlayerCurrentSubAccount(client).pedScale, true);
setEntityData(getPlayerPed(client), "v.rp.scale", getPlayerCurrentSubAccount(client).pedScale, true);
}
//if (isPlayerSwitchingCharacter(client) || isPlayerCreatingCharacter(client)) {
@@ -495,7 +494,7 @@ async function onPlayerSpawn(client) {
// Tried this. Doesn't work for some reason.
// Mafia Connected needs fixed to set position on spawn.
//if (getGame() == AGRP_GAME_MAFIA_ONE) {
//if (getGame() == V_GAME_MAFIA_ONE) {
// setPlayerPosition(client, getPlayerCurrentSubAccount(client).spawnPosition);
// setPlayerHeading(client, getPlayerCurrentSubAccount(client).spawnHeading);
// setPlayerDimension(client, getPlayerCurrentSubAccount(client).dimension);
@@ -536,7 +535,7 @@ async function onPlayerSpawn(client) {
if (areServerElementsSupported() && isGameFeatureSupported("walkStyle")) {
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting player walking style for ${getPlayerDisplayForConsole(client)}`);
setEntityData(getPlayerPed(client), "agrp.walkStyle", getPlayerCurrentSubAccount(client).walkStyle, true);
setEntityData(getPlayerPed(client), "v.rp.walkStyle", getPlayerCurrentSubAccount(client).walkStyle, true);
}
if (isGameFeatureSupported("fightStyle")) {
@@ -571,20 +570,20 @@ async function onPlayerSpawn(client) {
//sendPlayerGlobalKeyBindsState(client, !isPlayerAccountSettingEnabled(client, "NoKeyBinds"));
//if(isGTAIV()) {
// setEntityData(getPlayerPed(client), "agrp.bodyPartHair", getPlayerCurrentSubAccount(client).bodyParts.hair, true);
// setEntityData(getPlayerPed(client), "agrp.bodyPartHead", getPlayerCurrentSubAccount(client).bodyParts.head, true);
// setEntityData(getPlayerPed(client), "agrp.bodyPartUpper", getPlayerCurrentSubAccount(client).bodyParts.upper, true);
// setEntityData(getPlayerPed(client), "agrp.bodyPartLower", getPlayerCurrentSubAccount(client).bodyParts.lower, true);
// setEntityData(getPlayerPed(client), "agrp.bodyPropHair", getPlayerCurrentSubAccount(client).bodyProps.hair, true);
// setEntityData(getPlayerPed(client), "agrp.bodyPropEyes", getPlayerCurrentSubAccount(client).bodyProps.eyes, true);
// setEntityData(getPlayerPed(client), "agrp.bodyPartHead", getPlayerCurrentSubAccount(client).bodyProps.head, true);
// setEntityData(getPlayerPed(client), "agrp.bodyPartLeftHand", getPlayerCurrentSubAccount(client).bodyProps.leftHand, true);
// setEntityData(getPlayerPed(client), "agrp.bodyPartRightHand", getPlayerCurrentSubAccount(client).bodyProps.rightHand, true);
// setEntityData(getPlayerPed(client), "agrp.bodyPartLeftWrist", getPlayerCurrentSubAccount(client).bodyProps.leftWrist, true);
// setEntityData(getPlayerPed(client), "agrp.bodyPartRightWrist", getPlayerCurrentSubAccount(client).bodyProps.rightWrist, true);
// setEntityData(getPlayerPed(client), "agrp.bodyPartHip", getPlayerCurrentSubAccount(client).bodyProps.hip, true);
// setEntityData(getPlayerPed(client), "agrp.bodyPartLeftFoot", getPlayerCurrentSubAccount(client).bodyProps.leftFoot, true);
// setEntityData(getPlayerPed(client), "agrp.bodyPartRightFoot", getPlayerCurrentSubAccount(client).bodyProps.rightFoot, true);
// setEntityData(getPlayerPed(client), "v.rp.bodyPartHair", getPlayerCurrentSubAccount(client).bodyParts.hair, true);
// setEntityData(getPlayerPed(client), "v.rp.bodyPartHead", getPlayerCurrentSubAccount(client).bodyParts.head, true);
// setEntityData(getPlayerPed(client), "v.rp.bodyPartUpper", getPlayerCurrentSubAccount(client).bodyParts.upper, true);
// setEntityData(getPlayerPed(client), "v.rp.bodyPartLower", getPlayerCurrentSubAccount(client).bodyParts.lower, true);
// setEntityData(getPlayerPed(client), "v.rp.bodyPropHair", getPlayerCurrentSubAccount(client).bodyProps.hair, true);
// setEntityData(getPlayerPed(client), "v.rp.bodyPropEyes", getPlayerCurrentSubAccount(client).bodyProps.eyes, true);
// setEntityData(getPlayerPed(client), "v.rp.bodyPartHead", getPlayerCurrentSubAccount(client).bodyProps.head, true);
// setEntityData(getPlayerPed(client), "v.rp.bodyPartLeftHand", getPlayerCurrentSubAccount(client).bodyProps.leftHand, true);
// setEntityData(getPlayerPed(client), "v.rp.bodyPartRightHand", getPlayerCurrentSubAccount(client).bodyProps.rightHand, true);
// setEntityData(getPlayerPed(client), "v.rp.bodyPartLeftWrist", getPlayerCurrentSubAccount(client).bodyProps.leftWrist, true);
// setEntityData(getPlayerPed(client), "v.rp.bodyPartRightWrist", getPlayerCurrentSubAccount(client).bodyProps.rightWrist, true);
// setEntityData(getPlayerPed(client), "v.rp.bodyPartHip", getPlayerCurrentSubAccount(client).bodyProps.hip, true);
// setEntityData(getPlayerPed(client), "v.rp.bodyPartLeftFoot", getPlayerCurrentSubAccount(client).bodyProps.leftFoot, true);
// setEntityData(getPlayerPed(client), "v.rp.bodyPartRightFoot", getPlayerCurrentSubAccount(client).bodyProps.rightFoot, true);
//}
if (isGTAIV()) {
@@ -592,7 +591,7 @@ async function onPlayerSpawn(client) {
}
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped state to ready`);
getPlayerData(client).pedState = AGRP_PEDSTATE_READY;
getPlayerData(client).pedState = V_PEDSTATE_READY;
if (areServerElementsSupported()) {
syncPlayerProperties(client);
@@ -609,11 +608,11 @@ async function onPlayerSpawn(client) {
sendNameTagDistanceToClient(client, getServerConfig().nameTagDistance);
}
if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE || getGame() == AGRP_GAME_GTA_IV) {
if (!areServerElementsSupported() || getGame() == V_GAME_MAFIA_ONE || getGame() == V_GAME_GTA_IV) {
logToConsole(LOG_DEBUG, `[AGRP.Event] Sending properties, jobs, and vehicles to ${getPlayerDisplayForConsole(client)} (no server elements)`);
sendAllBusinessesToPlayer(client);
sendAllHousesToPlayer(client);
if (getGame() != AGRP_GAME_GTA_IV) {
if (getGame() != V_GAME_GTA_IV) {
sendAllJobsToPlayer(client);
}
requestPlayerPedNetworkId(client);
@@ -634,7 +633,7 @@ async function onPlayerSpawn(client) {
logToConsole(LOG_DEBUG, `[AGRP.Event] Updating all player name tags`);
updateAllPlayerNameTags();
setPlayerWeaponDamageEvent(client, AGRP_WEAPON_DAMAGE_EVENT_NORMAL);
setPlayerWeaponDamageEvent(client, V_WEAPON_DAMAGE_EVENT_NORMAL);
if (doesPlayerHaveGUIEnabled(client) && getServerConfig().useGUI == true) {
if (checkForGeoIPModule()) {
@@ -715,7 +714,7 @@ function onPedExitedVehicle(event, ped, vehicle, seat) {
if (ped.isType(ELEMENT_PLAYER)) {
let client = getClientFromPlayerElement(ped);
if (client != null) {
getPlayerData(client).pedState = AGRP_PEDSTATE_READY;
getPlayerData(client).pedState = V_PEDSTATE_READY;
if (getVehicleData(vehicle).spawnLocked == false && canPlayerManageVehicle(client, vehicle) == true) {
getVehicleData(vehicle).spawnPosition = getVehiclePosition(vehicle);
@@ -739,7 +738,7 @@ function onPedExitedVehicle(event, ped, vehicle, seat) {
getVehicleData(vehicle).lastActiveTime = getCurrentUnixTimestamp();
logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)} exited a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("agrp.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`);
logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)} exited a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("v.rp.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`);
}
}
}
@@ -768,14 +767,14 @@ function onPedEnteredVehicle(event, ped, vehicle, seat) {
return false;
}
logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)} entered a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("agrp.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`);
logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)} entered a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("v.rp.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`);
getPlayerData(client).lastVehicle = vehicle;
getVehicleData(vehicle).lastActiveTime = getCurrentUnixTimestamp();
if (seat == AGRP_VEHSEAT_DRIVER) {
if (seat == V_VEHSEAT_DRIVER) {
vehicle.engine = getVehicleData(vehicle).engine;
setEntityData(vehicle, "agrp.engine", getVehicleData(vehicle).engine, true);
setEntityData(vehicle, "v.rp.engine", getVehicleData(vehicle).engine, true);
//vehicle.netFlags.sendSync = getVehicleData(vehicle).engine;
if (getVehicleData(vehicle).buyPrice > 0) {
@@ -793,23 +792,23 @@ function onPedEnteredVehicle(event, ped, vehicle, seat) {
let ownerType = getLocaleString(client, "NotOwned");
ownerType = toLowerCase(getVehicleOwnerTypeText(getVehicleData(vehicle).ownerType));
switch (getVehicleData(vehicle).ownerType) {
case AGRP_VEHOWNER_CLAN:
case V_VEHOWNER_CLAN:
ownerName = getClanData(getClanIndexFromDatabaseId(getVehicleData(vehicle).ownerId)).name;
ownerType = getLocaleString(client, "Clan");
break;
case AGRP_VEHOWNER_JOB:
case V_VEHOWNER_JOB:
ownerName = getJobData(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)).name;
ownerType = getLocaleString(client, "Job");
break;
case AGRP_VEHOWNER_PLAYER:
case V_VEHOWNER_PLAYER:
let subAccountData = loadSubAccountFromId(getVehicleData(vehicle).ownerId);
ownerName = `${subAccountData.firstName} ${subAccountData.lastName}`;
ownerType = getLocaleString(client, "Player");
break;
case AGRP_VEHOWNER_BIZ:
case V_VEHOWNER_BIZ:
ownerName = getBusinessData(getBusinessIdFromDatabaseId(getVehicleData(vehicle).ownerId)).name;
ownerType = getLocaleString(client, "Business");
break;
@@ -839,7 +838,7 @@ function onPedEnteredVehicle(event, ped, vehicle, seat) {
let currentSubAccount = getPlayerCurrentSubAccount(client);
if (isPlayerWorking(client)) {
if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_JOB) {
if (getVehicleData(vehicle).ownerType == V_VEHOWNER_JOB) {
if (getVehicleData(vehicle).ownerId == getPlayerCurrentSubAccount(client).job) {
getPlayerCurrentSubAccount(client).lastJobVehicle = vehicle;
if (!hasPlayerSeenActionTip(client, "JobRouteStart")) {
@@ -884,7 +883,7 @@ function onPedEnteringVehicle(event, ped, vehicle, seat) {
if (ped.isType(ELEMENT_PLAYER)) {
let client = getClientFromPlayerElement(ped);
if (client != null) {
if (seat == AGRP_VEHSEAT_DRIVER) {
if (seat == V_VEHSEAT_DRIVER) {
//vehicle.netFlags.sendSync = getVehicleData(vehicle).engine;
}
onPlayerEnteringVehicle(client, vehicle, seat);
@@ -908,7 +907,7 @@ function onPedExitingVehicle(event, ped, vehicle, seat) {
if (ped.isType(ELEMENT_PLAYER)) {
let client = getClientFromPlayerElement(ped);
if (client != null) {
if (seat == AGRP_VEHSEAT_DRIVER) {
if (seat == V_VEHSEAT_DRIVER) {
//vehicle.netFlags.sendSync = getVehicleData(vehicle).engine;
}
onPlayerExitingVehicle(client, vehicle, seat);

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: fishing.js
// DESC: Provides fishing functions and commands
@@ -9,59 +8,59 @@
// ===========================================================================
// Fishing Catch Types (Probably not going to be used, in favor of items and their use type)
const AGRP_FISHING_CATCH_TYPE_NONE = 0;
const AGRP_FISHING_CATCH_TYPE_FISH = 1;
const AGRP_FISHING_CATCH_TYPE_JUNK = 2;
const V_FISHING_CATCH_TYPE_NONE = 0;
const V_FISHING_CATCH_TYPE_FISH = 1;
const V_FISHING_CATCH_TYPE_JUNK = 2;
// Fishing Line States
const AGRP_FISHING_LINE_STATE_NONE = 0;
const AGRP_FISHING_LINE_STATE_READY = 1;
const AGRP_FISHING_LINE_STATE_CASTING = 2;
const AGRP_FISHING_LINE_STATE_CASTED = 3;
const AGRP_FISHING_LINE_STATE_REELING = 4;
const AGRP_FISHING_LINE_STATE_HOOKED = 5;
const V_FISHING_LINE_STATE_NONE = 0;
const V_FISHING_LINE_STATE_READY = 1;
const V_FISHING_LINE_STATE_CASTING = 2;
const V_FISHING_LINE_STATE_CASTED = 3;
const V_FISHING_LINE_STATE_REELING = 4;
const V_FISHING_LINE_STATE_HOOKED = 5;
// ===========================================================================
let fishingCollectables = [
// Fish
["Salmon", AGRP_FISHING_CATCH_TYPE_FISH],
["Tuna", AGRP_FISHING_CATCH_TYPE_FISH],
["Crab", AGRP_FISHING_CATCH_TYPE_FISH],
["Trout", AGRP_FISHING_CATCH_TYPE_FISH],
["Sea Bass", AGRP_FISHING_CATCH_TYPE_FISH],
["Shark", AGRP_FISHING_CATCH_TYPE_FISH],
["Turtle", AGRP_FISHING_CATCH_TYPE_FISH],
["Manta Ray", AGRP_FISHING_CATCH_TYPE_FISH],
["Cat Fish", AGRP_FISHING_CATCH_TYPE_FISH],
["Blue Marlin", AGRP_FISHING_CATCH_TYPE_FISH],
["Salmon", V_FISHING_CATCH_TYPE_FISH],
["Tuna", V_FISHING_CATCH_TYPE_FISH],
["Crab", V_FISHING_CATCH_TYPE_FISH],
["Trout", V_FISHING_CATCH_TYPE_FISH],
["Sea Bass", V_FISHING_CATCH_TYPE_FISH],
["Shark", V_FISHING_CATCH_TYPE_FISH],
["Turtle", V_FISHING_CATCH_TYPE_FISH],
["Manta Ray", V_FISHING_CATCH_TYPE_FISH],
["Cat Fish", V_FISHING_CATCH_TYPE_FISH],
["Blue Marlin", V_FISHING_CATCH_TYPE_FISH],
// Junk
["Rusty Can", AGRP_FISHING_CATCH_TYPE_JUNK],
["Old Pants", AGRP_FISHING_CATCH_TYPE_JUNK],
["Old Shoes", AGRP_FISHING_CATCH_TYPE_JUNK],
["Garbage", AGRP_FISHING_CATCH_TYPE_JUNK],
["Baby Diaper", AGRP_FISHING_CATCH_TYPE_JUNK],
["Old Tire", AGRP_FISHING_CATCH_TYPE_JUNK],
["Old Car Battery", AGRP_FISHING_CATCH_TYPE_JUNK],
["Horse Hoove", AGRP_FISHING_CATCH_TYPE_JUNK],
["Soggy Log", AGRP_FISHING_CATCH_TYPE_JUNK],
["Soggy Dildo", AGRP_FISHING_CATCH_TYPE_JUNK],
["Clump of Seaweed", AGRP_FISHING_CATCH_TYPE_JUNK],
["Rusty Can", V_FISHING_CATCH_TYPE_JUNK],
["Old Pants", V_FISHING_CATCH_TYPE_JUNK],
["Old Shoes", V_FISHING_CATCH_TYPE_JUNK],
["Garbage", V_FISHING_CATCH_TYPE_JUNK],
["Baby Diaper", V_FISHING_CATCH_TYPE_JUNK],
["Old Tire", V_FISHING_CATCH_TYPE_JUNK],
["Old Car Battery", V_FISHING_CATCH_TYPE_JUNK],
["Horse Hoove", V_FISHING_CATCH_TYPE_JUNK],
["Soggy Log", V_FISHING_CATCH_TYPE_JUNK],
["Soggy Dildo", V_FISHING_CATCH_TYPE_JUNK],
["Clump of Seaweed", V_FISHING_CATCH_TYPE_JUNK],
];
// ===========================================================================
let fishingAnimations = {
[AGRP_GAME_GTA_III]: {
[V_GAME_GTA_III]: {
"fishingLineCasting": "bathit1",
"fishingLineReeling": "aimdown",
},
[AGRP_GAME_GTA_VC]: {
[V_GAME_GTA_VC]: {
"fishingLineCasting": "frontpunch",
"fishingLineReeling": "aimdown",
},
[AGRP_GAME_GTA_SA]: {
[V_GAME_GTA_SA]: {
"fishingLineCasting": "none",
"fishingLineReeling": "none",
}
@@ -70,7 +69,7 @@ let fishingAnimations = {
// ===========================================================================
let fishingParticleEffects = {
[AGRP_GAME_GTA_III]: {
[V_GAME_GTA_III]: {
"fishingLineCast": [
"MediumSprayingWater",
0.2,
@@ -99,7 +98,7 @@ function castFishingLineCommand(command, params, client) {
return false;
}
if (doesPlayerHaveItemOfUseTypeEquipped(client, AGRP_ITEM_USE_TYPE_FISHINGROD)) {
if (doesPlayerHaveItemOfUseTypeEquipped(client, V_ITEM_USE_TYPE_FISHINGROD)) {
messagePlayerError(client, getLocaleString(client, "NeedFishingRod"));
return false;
}
@@ -132,7 +131,7 @@ function resetFishingLineCommand(client) {
return false;
}
if (doesPlayerHaveItemOfUseTypeEquipped(client, AGRP_ITEM_USE_TYPE_FISHINGROD)) {
if (doesPlayerHaveItemOfUseTypeEquipped(client, V_ITEM_USE_TYPE_FISHINGROD)) {
messagePlayerError(client, getLocaleString(client, "NeedFishingRod"));
return false;
}
@@ -151,7 +150,7 @@ function resetFishingLineCommand(client) {
showSmallGameMessage(client, messageText);
getPlayerData(client).fishingLineState = AGRP_FISHING_LINE_STATE_NONE;
getPlayerData(client).fishingLineState = V_FISHING_LINE_STATE_NONE;
getPlayerData(client).fishingLineCastStart = 0;
}
@@ -173,7 +172,7 @@ function castPlayerFishingLine(client, strength) {
showParticleEffect(frontPosition, getGameConfig().particleEffects[getGame()][particleEffectName], fishingParticleEffects[getGame()].fishingLineCast[1], fishingParticleEffects[getGame()].fishingLineCast[2]);
getPlayerData(client).fishingLineCastPosition = frontPosition;
getPlayerData(client).fishingLineState = AGRP_FISHING_LINE_STATE_CASTED;
getPlayerData(client).fishingLineState = V_FISHING_LINE_STATE_CASTED;
}, strength * 10);
}
@@ -197,13 +196,13 @@ function isPlayerInFishingSpot(client) {
// ===========================================================================
function isPlayerFishing(client) {
return (getPlayerData(client).fishingLineState != AGRP_FISHING_LINE_STATE_NONE);
return (getPlayerData(client).fishingLineState != V_FISHING_LINE_STATE_NONE);
}
// ===========================================================================
function isPlayerFishing(client) {
return (getPlayerData(client).fishingLineState != AGRP_FISHING_LINE_STATE_NONE);
return (getPlayerData(client).fishingLineState != V_FISHING_LINE_STATE_NONE);
}
// ===========================================================================

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: forensics.js
// DESC: Provides forensics functions and commands (bullet casings, blood, etc)
@@ -9,13 +8,13 @@
// ===========================================================================
// Forensic Types
const AGRP_FORENSICS_NONE = 0;
const AGRP_FORENSICS_BULLET = 1; // Bullet. The actual tip that hits a target. Has rifling and ballistics information of the weapon.
const AGRP_FORENSICS_BLOOD = 2; // Blood. Automatically applied to ground and bullets that hit and outfit worn when somebody is shot
const AGRP_FORENSICS_BODY = 3; // Body. A dead body lol
const AGRP_FORENSICS_HAIR = 4; // Hair.
const AGRP_FORENSICS_SWEAT = 5; // Sweat. Automatically applied to clothing when worn
const AGRP_FORENSICS_SALIVA = 6; // Saliva. Automatically applied to drinks when drank and unfinished food items when eaten
const AGRP_FORENSICS_BULLETCASINGS = 7; // Bullet casings. Automatically dropped when fired from a weapon except when used in a vehicle (driveby)
const V_FORENSICS_NONE = 0;
const V_FORENSICS_BULLET = 1; // Bullet. The actual tip that hits a target. Has rifling and ballistics information of the weapon.
const V_FORENSICS_BLOOD = 2; // Blood. Automatically applied to ground and bullets that hit and outfit worn when somebody is shot
const V_FORENSICS_BODY = 3; // Body. A dead body lol
const V_FORENSICS_HAIR = 4; // Hair.
const V_FORENSICS_SWEAT = 5; // Sweat. Automatically applied to clothing when worn
const V_FORENSICS_SALIVA = 6; // Saliva. Automatically applied to drinks when drank and unfinished food items when eaten
const V_FORENSICS_BULLETCASINGS = 7; // Bullet casings. Automatically dropped when fired from a weapon except when used in a vehicle (driveby)
// ===========================================================================

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: gate.js
// DESC: Provides gate functions and commands
@@ -9,14 +8,14 @@
// ===========================================================================
// Gate Owner Types
const AGRP_GATEOWNER_NONE = 0; // Not owned
const AGRP_GATEOWNER_PLAYER = 1; // Owner is a player (character/subaccount)
const AGRP_GATEOWNER_JOB = 2; // Owned by a job
const AGRP_GATEOWNER_CLAN = 3; // Owned by a clan
const AGRP_GATEOWNER_FACTION = 4; // Owned by a faction
const AGRP_GATEOWNER_PUBLIC = 5; // Public gate. Technically not owned. This probably won't be used.
const AGRP_GATEOWNER_BUSINESS = 6; // Owned by a business. Back lots, unloading areas, and other stuff like that
const AGRP_GATEOWNER_HOUSE = 7; // Owned by a house. Like for mansions with closed private areas.
const V_GATEOWNER_NONE = 0; // Not owned
const V_GATEOWNER_PLAYER = 1; // Owner is a player (character/subaccount)
const V_GATEOWNER_JOB = 2; // Owned by a job
const V_GATEOWNER_CLAN = 3; // Owned by a clan
const V_GATEOWNER_FACTION = 4; // Owned by a faction
const V_GATEOWNER_PUBLIC = 5; // Public gate. Technically not owned. This probably won't be used.
const V_GATEOWNER_BUSINESS = 6; // Owned by a business. Back lots, unloading areas, and other stuff like that
const V_GATEOWNER_HOUSE = 7; // Owned by a house. Like for mansions with closed private areas.
// ===========================================================================
@@ -28,7 +27,7 @@ class GateData {
this.enabled = false;
this.position = toVector3(0.0, 0.0, 0.0);
this.locked = true;
this.ownerType = AGRP_GATEOWNER_NONE;
this.ownerType = V_GATEOWNER_NONE;
this.ownerId = 0;
if (dbAssoc) {
@@ -55,17 +54,17 @@ function initGateScript() {
function doesPlayerHaveGateKeys(client, vehicle) {
let gateData = getGateData(vehicle);
if (gateData.ownerType == AGRP_GATEOWNER_PUBLIC) {
if (gateData.ownerType == V_GATEOWNER_PUBLIC) {
return true;
}
if (gateData.ownerType == AGRP_GATEOWNER_PLAYER) {
if (gateData.ownerType == V_GATEOWNER_PLAYER) {
if (gateData.ownerId == getPlayerCurrentSubAccount(client).databaseId) {
return true;
}
}
if (gateData.ownerType == AGRP_GATEOWNER_CLAN) {
if (gateData.ownerType == V_GATEOWNER_CLAN) {
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageClans"))) {
return true;
}
@@ -77,7 +76,7 @@ function doesPlayerHaveGateKeys(client, vehicle) {
}
}
if (gateData.ownerType == AGRP_GATEOWNER_FACTION) {
if (gateData.ownerType == V_GATEOWNER_FACTION) {
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageFactions"))) {
return true;
}
@@ -89,7 +88,7 @@ function doesPlayerHaveGateKeys(client, vehicle) {
}
}
if (gateData.ownerType == AGRP_GATEOWNER_JOB) {
if (gateData.ownerType == V_GATEOWNER_JOB) {
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageJobs"))) {
return true;
}
@@ -99,7 +98,7 @@ function doesPlayerHaveGateKeys(client, vehicle) {
}
}
if (gateData.ownerType == AGRP_GATEOWNER_BUSINESS) {
if (gateData.ownerType == V_GATEOWNER_BUSINESS) {
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageBusinesses"))) {
return true;
}
@@ -109,7 +108,7 @@ function doesPlayerHaveGateKeys(client, vehicle) {
}
}
if (gateData.ownerType == AGRP_GATEOWNER_HOUSE) {
if (gateData.ownerType == V_GATEOWNER_HOUSE) {
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageHouses"))) {
return true;
}

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: gps.js
// DESC: Provides GPS functions and commands
@@ -9,36 +8,36 @@
// ===========================================================================
// GPS State Types
const AGRP_GPS_TYPE_NONE = 0; // None (invalid)
const AGRP_GPS_TYPE_BUSINESS = 1; // Business
const AGRP_GPS_TYPE_POLICE = 2; // Police Station
const AGRP_GPS_TYPE_HOSPITAL = 3; // Hospital
const AGRP_GPS_TYPE_JOB = 4; // Job
const AGRP_GPS_TYPE_GAMELOC = 5; // Game Location
const V_GPS_TYPE_NONE = 0; // None (invalid)
const V_GPS_TYPE_BUSINESS = 1; // Business
const V_GPS_TYPE_POLICE = 2; // Police Station
const V_GPS_TYPE_HOSPITAL = 3; // Hospital
const V_GPS_TYPE_JOB = 4; // Job
const V_GPS_TYPE_GAMELOC = 5; // Game Location
// ===========================================================================
function gpsCommand(command, params, client) {
messagePlayerNormal(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderBusinessList")));
let locationType = AGRP_GPS_TYPE_NONE;
let useType = AGRP_ITEM_USE_TYPE_NONE;
let locationType = V_GPS_TYPE_NONE;
let useType = V_ITEM_USE_TYPE_NONE;
let blipColour = "white";
switch (toLowerCase(params)) {
case "police":
blipColour = "businessBlue"
locationType = AGRP_GPS_TYPE_POLICE;
locationType = V_GPS_TYPE_POLICE;
break;
case "hospital":
blipColour = "businessBlue"
locationType = AGRP_GPS_TYPE_HOSPITAL;
locationType = V_GPS_TYPE_HOSPITAL;
break;
case "job":
blipColour = "businessBlue"
locationType = AGRP_GPS_TYPE_JOB;
locationType = V_GPS_TYPE_JOB;
break;
case "skin":
@@ -46,8 +45,8 @@ function gpsCommand(command, params, client) {
case "clothes":
case "player":
blipColour = "businessBlue"
locationType = AGRP_GPS_TYPE_BUSINESS;
useType = AGRP_ITEM_USE_TYPE_SKIN;
locationType = V_GPS_TYPE_BUSINESS;
useType = V_ITEM_USE_TYPE_SKIN;
break;
case "gun":
@@ -57,29 +56,29 @@ function gpsCommand(command, params, client) {
case "wep":
case "weps":
blipColour = "businessBlue"
locationType = AGRP_GPS_TYPE_BUSINESS;
useType = AGRP_ITEM_USE_TYPE_WEAPON;
locationType = V_GPS_TYPE_BUSINESS;
useType = V_ITEM_USE_TYPE_WEAPON;
break;
case "food":
case "eat":
blipColour = "businessBlue"
locationType = AGRP_GPS_TYPE_BUSINESS;
useType = AGRP_ITEM_USE_TYPE_FOOD;
locationType = V_GPS_TYPE_BUSINESS;
useType = V_ITEM_USE_TYPE_FOOD;
break;
case "drink":
blipColour = "businessBlue"
locationType = AGRP_GPS_TYPE_BUSINESS;
useType = AGRP_ITEM_USE_TYPE_DRINK;
locationType = V_GPS_TYPE_BUSINESS;
useType = V_ITEM_USE_TYPE_DRINK;
break;
case "alcohol":
case "booze":
case "bar":
blipColour = "businessBlue"
locationType = AGRP_GPS_TYPE_BUSINESS;
useType = AGRP_ITEM_USE_TYPE_ALCOHOL;
locationType = V_GPS_TYPE_BUSINESS;
useType = V_ITEM_USE_TYPE_ALCOHOL;
break;
case "repair":
@@ -88,8 +87,8 @@ function gpsCommand(command, params, client) {
case "spray":
case "fix":
blipColour = "businessBlue"
locationType = AGRP_GPS_TYPE_BUSINESS;
useType = AGRP_ITEM_USE_TYPE_VEHREPAIR;
locationType = V_GPS_TYPE_BUSINESS;
useType = V_ITEM_USE_TYPE_VEHREPAIR;
break;
case "vehiclecolour":
@@ -97,14 +96,14 @@ function gpsCommand(command, params, client) {
case "carcolour":
case "colour":
blipColour = "businessBlue"
locationType = AGRP_GPS_TYPE_BUSINESS;
useType = AGRP_ITEM_USE_TYPE_VEHCOLOUR;
locationType = V_GPS_TYPE_BUSINESS;
useType = V_ITEM_USE_TYPE_VEHCOLOUR;
break;
default: {
let itemTypeId = getItemTypeFromParams(params);
if (getItemTypeData(itemTypeId) != false) {
locationType = AGRP_GPS_TYPE_BUSINESS;
locationType = V_GPS_TYPE_BUSINESS;
blipColour = "businessBlue";
useType = getItemTypeData(itemTypeId).useType;
} else {
@@ -116,12 +115,12 @@ function gpsCommand(command, params, client) {
}
}
if (locationType == AGRP_GPS_TYPE_NONE) {
if (locationType == V_GPS_TYPE_NONE) {
messagePlayerError(client, getLocaleString(client, "InvalidGPSLocation"));
return false;
}
if (locationType == AGRP_GPS_TYPE_BUSINESS) {
if (locationType == V_GPS_TYPE_BUSINESS) {
let businessId = getClosestBusinessWithBuyableItemOfUseType(useType);
if (!businessId) {
messagePlayerError(client, getLocaleString(client, "NoBusinessWithItemType"));
@@ -138,7 +137,7 @@ function gpsCommand(command, params, client) {
messagePlayerSuccess(client, "Look for the blinking icon on your mini map");
}
if (locationType == AGRP_GPS_TYPE_GAMELOC) {
if (locationType == V_GPS_TYPE_GAMELOC) {
hideAllBlipsForPlayerGPS(client);
blinkGenericGPSBlipForPlayer(client, position, 0, getColourByType(blipColour), 10);
messagePlayerSuccess(client, "Look for the blinking icon on your mini map");

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: gui.js
// DESC: Provides GUI functions and usage

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: help.js
// DESC: Provides update info, help commands, and documentation

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: house.js
// DESC: Provides house commands, functions, and usage
@@ -9,19 +8,19 @@
// ===========================================================================
// House Location Types
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
const V_HOUSE_LOC_NONE = 0; // None
const V_HOUSE_LOC_GATE = 1; // Center of any moveable gate that belongs to the house
const V_HOUSE_LOC_GARAGE = 2; // Location for garage (pos1 = outside, pos2 = inside). Use pos to teleport or spawn veh/ped
// ===========================================================================
// House Owner Types
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.
const V_HOUSE_OWNER_NONE = 0; // Not owned
const V_HOUSE_OWNER_PLAYER = 1; // Owner is a player (character/subaccount)
const V_HOUSE_OWNER_JOB = 2; // Owned by a job
const V_HOUSE_OWNER_CLAN = 3; // Owned by a clan
const V_HOUSE_OWNER_FACTION = 4; // Owned by a faction
const V_HOUSE_OWNER_PUBLIC = 5; // Is a public house. Technically not owned. This probably won't be used.
// ===========================================================================
@@ -32,7 +31,7 @@ class HouseData {
constructor(dbAssoc = false) {
this.databaseId = 0
this.description = "";
this.ownerType = AGRP_HOUSE_OWNER_NONE;
this.ownerType = V_HOUSE_OWNER_NONE;
this.ownerId = 0;
this.buyPrice = 0;
this.rentPrice = 0;
@@ -42,7 +41,7 @@ class HouseData {
this.index = -1;
this.needsSaved = false;
this.interiorLights = true;
this.propertyType = AGRP_PROPERTY_TYPE_HOUSE;
this.propertyType = V_PROPERTY_TYPE_HOUSE;
this.itemCache = [];
this.locations = [];
@@ -269,7 +268,7 @@ function setHouseDescriptionCommand(command, params, client) {
let oldDescription = getHouseData(houseId).description;
getHouseData(houseId).description = newHouseDescription;
setEntityData(getHouseData(houseId).entrancePickup, "agrp.label.name", getHouseData(houseId).description, true);
setEntityData(getHouseData(houseId).entrancePickup, "v.rp.label.name", getHouseData(houseId).description, true);
getHouseData(houseId).needsSaved = true;
@@ -302,13 +301,13 @@ function setHouseOwnerCommand(command, params, client) {
}
if (!doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageHouses"))) {
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
if (getHouseData(houseId).ownerType == V_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
messagePlayerError(client, getLocaleString(client, "CantModifyHouse"));
return false;
}
}
getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_PLAYER;
getHouseData(houseId).ownerType = V_HOUSE_OWNER_PLAYER;
getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(newHouseOwner).databaseId;
getHouseData(houseId).needsSaved = true;
@@ -334,13 +333,13 @@ function removeHouseOwnerCommand(command, params, client) {
}
if (!doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageHouses"))) {
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
if (getHouseData(houseId).ownerType == V_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
messagePlayerError(client, getLocaleString(client, "CantModifyHouse"));
return false;
}
}
getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_NONE;
getHouseData(houseId).ownerType = V_HOUSE_OWNER_NONE;
getHouseData(houseId).ownerId = -1;
getHouseData(houseId).needsSaved = true;
@@ -373,7 +372,7 @@ function setHouseClanCommand(command, params, client) {
return false;
}
if (getHouseData(houseId).ownerType != AGRP_VEHOWNER_PLAYER) {
if (getHouseData(houseId).ownerType != V_VEHOWNER_PLAYER) {
messagePlayerError(client, getLocaleString(client, "MustOwnHouse"));
return false;
}
@@ -384,7 +383,7 @@ function setHouseClanCommand(command, params, client) {
}
showPlayerPrompt(client, getLocaleString(client, "SetHouseClanConfirmMessage"), getLocaleString(client, "SetHouseClanConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
getPlayerData(client).promptType = AGRP_PROMPT_GIVEHOUSETOCLAN;
getPlayerData(client).promptType = V_PROMPT_GIVEHOUSETOCLAN;
//messagePlayerSuccess(`{MAINCOLOUR}You gave house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan!`);
}
@@ -1054,7 +1053,7 @@ function createHouseEntrancePickup(houseId) {
return false;
}
if (areServerElementsSupported() && getGame() != AGRP_GAME_MAFIA_ONE && getGame() != AGRP_GAME_GTA_IV) {
if (areServerElementsSupported() && getGame() != V_GAME_MAFIA_ONE && getGame() != V_GAME_GTA_IV) {
let entrancePickup = null;
if (isGameFeatureSupported("pickup")) {
let pickupModelId = getGameConfig().pickupModels[getGame()].House;
@@ -1131,8 +1130,8 @@ function createHouseEntranceBlip(houseId) {
setElementStreamOutDistance(entranceBlip, getGlobalConfig().houseBlipStreamOutDistance);
}
setEntityData(entranceBlip, "agrp.owner.type", AGRP_BLIP_HOUSE_ENTRANCE, false);
setEntityData(entranceBlip, "agrp.owner.id", houseId, false);
setEntityData(entranceBlip, "v.rp.owner.type", V_BLIP_HOUSE_ENTRANCE, false);
setEntityData(entranceBlip, "v.rp.owner.id", houseId, false);
houseData.entranceBlip = entranceBlip;
}
@@ -1239,8 +1238,8 @@ function createHouseExitBlip(houseId) {
setElementStreamOutDistance(exitBlip, getGlobalConfig().houseBlipStreamOutDistance);
}
setElementTransient(exitBlip, false);
setEntityData(exitBlip, "agrp.owner.type", AGRP_BLIP_HOUSE_EXIT, false);
setEntityData(exitBlip, "agrp.owner.id", houseId, false);
setEntityData(exitBlip, "v.rp.owner.type", V_BLIP_HOUSE_EXIT, false);
setEntityData(exitBlip, "v.rp.owner.id", houseId, false);
getHouseData(houseId).exitBlip = exitBlip;
}
}
@@ -1249,22 +1248,22 @@ function createHouseExitBlip(houseId) {
function getHouseOwnerTypeText(ownerType) {
switch (ownerType) {
case AGRP_HOUSE_OWNER_CLAN:
case V_HOUSE_OWNER_CLAN:
return "clan";
case AGRP_HOUSE_OWNER_PLAYER:
case V_HOUSE_OWNER_PLAYER:
return "player";
case AGRP_HOUSE_OWNER_NONE:
case V_HOUSE_OWNER_NONE:
return "not owned";
case AGRP_HOUSE_OWNER_PUBLIC:
case V_HOUSE_OWNER_PUBLIC:
return "not owned";
case AGRP_HOUSE_OWNER_JOB:
case V_HOUSE_OWNER_JOB:
return "job";
case AGRP_HOUSE_OWNER_BIZ:
case V_HOUSE_OWNER_BIZ:
return "business";
default:
@@ -1299,28 +1298,28 @@ function getHouseInfoCommand(command, params, client) {
let ownerName = "Unknown";
switch (getHouseData(houseId).ownerType) {
case AGRP_HOUSE_OWNER_CLAN:
case V_HOUSE_OWNER_CLAN:
ownerName = getClanData(houseData).name;
break;
case AGRP_HOUSE_OWNER_PLAYER:
case V_HOUSE_OWNER_PLAYER:
let subAccountData = loadSubAccountFromId(houseData.ownerId);
ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`;
break;
case AGRP_HOUSE_OWNER_NONE:
case V_HOUSE_OWNER_NONE:
ownerName = "None";
break;
case AGRP_HOUSE_OWNER_PUBLIC:
case V_HOUSE_OWNER_PUBLIC:
ownerName = "Public";
break;
case AGRP_HOUSE_OWNER_BIZ:
case V_HOUSE_OWNER_BIZ:
ownerName = getBusinessDataFromDatabaseId(houseData.ownerId).name;
break;
case AGRP_HOUSE_OWNER_JOB:
case V_HOUSE_OWNER_JOB:
ownerName = getJobData(houseData.ownerId).name;
break;
}
@@ -1455,7 +1454,7 @@ function buyHouseCommand(command, params, client) {
return false;
}
getPlayerData(client).promptType = AGRP_PROMPT_BUYHOUSE;
getPlayerData(client).promptType = V_PROMPT_BUYHOUSE;
showPlayerPrompt(client, getLocaleString(client, "BuyHouseConfirmMessage"), getLocaleString(client, "BuyHouseConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
}
@@ -1614,7 +1613,7 @@ function cacheHouseItems(houseId) {
getHouseData(houseId).itemCache = [];
for (let i in getServerData().items) {
if (getItemData(i).ownerType == AGRP_ITEM_OWNER_HOUSE && getItemData(i).ownerId == getHouseData(houseId).databaseId) {
if (getItemData(i).ownerType == V_ITEM_OWNER_HOUSE && getItemData(i).ownerId == getHouseData(houseId).databaseId) {
getHouseData(houseId).itemCache.push(i);
}
}
@@ -1643,7 +1642,7 @@ function getHouseIdFromDatabaseId(databaseId) {
//function clearPlayerHouseGameScripts(client, houseId) {
// for(let i in getHouseData(houseId).gameScripts) {
// sendPlayerGameScriptState(client, AGRP_GAMESCRIPT_DENY);
// sendPlayerGameScriptState(client, V_GAMESCRIPT_DENY);
// }
//}
@@ -1665,11 +1664,11 @@ function canPlayerSetHouseInteriorLights(client, houseId) {
return true;
}
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
if (getHouseData(houseId).ownerType == V_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
return true;
}
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_CLAN && getHouseData(houseId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
if (getHouseData(houseId).ownerType == V_HOUSE_OWNER_CLAN && getHouseData(houseId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageHouses"))) {
return true;
}
@@ -1685,11 +1684,11 @@ function canPlayerLockUnlockHouse(client, houseId) {
return true;
}
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
if (getHouseData(houseId).ownerType == V_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
return true;
}
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_CLAN && getHouseData(houseId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
if (getHouseData(houseId).ownerType == V_HOUSE_OWNER_CLAN && getHouseData(houseId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageHouses"))) {
return true;
}
@@ -1739,13 +1738,13 @@ function canPlayerManageHouse(client, houseId) {
return true;
}
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER) {
if (getHouseData(houseId).ownerType == V_HOUSE_OWNER_PLAYER) {
if (getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
return true;
}
}
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_CLAN) {
if (getHouseData(houseId).ownerType == V_HOUSE_OWNER_CLAN) {
if (getHouseData(houseId).ownerId == getPlayerClan(client)) {
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageHouses"))) {
return true;
@@ -1779,7 +1778,7 @@ function getHouseFromParams(params) {
// ===========================================================================
function updateHousePickupLabelData(houseId) {
if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE || getGame() == AGRP_GAME_GTA_IV) {
if (!areServerElementsSupported() || getGame() == V_GAME_MAFIA_ONE || getGame() == V_GAME_GTA_IV) {
sendHouseToPlayer(null, houseId, getHouseData(houseId).description, getHouseData(houseId).entrancePosition, getHouseEntranceBlipModelForNetworkEvent(houseId), getHouseEntrancePickupModelForNetworkEvent(houseId), getHouseData(houseId).buyPrice, getHouseData(houseId).rentPrice, getHouseData(houseId).hasInterior, getHouseData(houseId).locked);
return false;
}
@@ -1787,26 +1786,26 @@ function updateHousePickupLabelData(houseId) {
let houseData = getHouseData(houseId);
if (houseData.entrancePickup != null) {
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", AGRP_LABEL_HOUSE, true);
setEntityData(houseData.entrancePickup, "agrp.label.name", houseData.description, true);
setEntityData(houseData.entrancePickup, "agrp.label.locked", houseData.locked, true);
setEntityData(houseData.entrancePickup, "agrp.label.price", houseData.buyPrice, true);
setEntityData(houseData.entrancePickup, "agrp.label.rentprice", houseData.rentPrice, true);
setEntityData(houseData.entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTER, true);
setEntityData(houseData.entrancePickup, "v.rp.owner.type", V_PICKUP_HOUSE_ENTRANCE, false);
setEntityData(houseData.entrancePickup, "v.rp.owner.id", houseId, false);
setEntityData(houseData.entrancePickup, "v.rp.label.type", V_LABEL_HOUSE, true);
setEntityData(houseData.entrancePickup, "v.rp.label.name", houseData.description, true);
setEntityData(houseData.entrancePickup, "v.rp.label.locked", houseData.locked, true);
setEntityData(houseData.entrancePickup, "v.rp.label.price", houseData.buyPrice, true);
setEntityData(houseData.entrancePickup, "v.rp.label.rentprice", houseData.rentPrice, true);
setEntityData(houseData.entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_ENTER, true);
if (houseData.buyPrice > 0) {
setEntityData(houseData.entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_BUYHOUSE, true);
setEntityData(houseData.entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_BUYHOUSE, true);
} else if (houseData.rentPrice > 0) {
setEntityData(houseData.entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_RENTHOUSE, true);
setEntityData(houseData.entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_RENTHOUSE, true);
}
}
if (houseData.exitPickup != null) {
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", AGRP_LABEL_EXIT, true);
setEntityData(houseData.exitPickup, "v.rp.owner.type", V_PICKUP_HOUSE_EXIT, false);
setEntityData(houseData.exitPickup, "v.rp.owner.id", houseId, false);
setEntityData(houseData.exitPickup, "v.rp.label.type", V_LABEL_EXIT, true);
}
}

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: insurance.js
// DESC: Provides insurance commands, functions, and usage
@@ -9,33 +8,33 @@
// ===========================================================================
// Insurance Account Owner Types
const AGRP_INS_ACCT_OWNER_NONE = 0; // None
const AGRP_INS_ACCT_OWNER_PLAYER = 1; // Player owns insurance company
const AGRP_INS_ACCT_OWNER_BIZ = 2; // Business owns insurance company
const AGRP_INS_ACCT_OWNER_CLAN = 3; // Clan owns insurance company
const V_INS_ACCT_OWNER_NONE = 0; // None
const V_INS_ACCT_OWNER_PLAYER = 1; // Player owns insurance company
const V_INS_ACCT_OWNER_BIZ = 2; // Business owns insurance company
const V_INS_ACCT_OWNER_CLAN = 3; // Clan owns insurance company
// ===========================================================================
// Insurance Account Entity Types
const AGRP_INS_ACCT_ENTITY_NONE = 0; // None
const AGRP_INS_ACCT_ENTITY_PLAYER_HEALTH = 1; // Health Insurance
const AGRP_INS_ACCT_ENTITY_PLAYER_LIFE = 2; // Life Insurance
const AGRP_INS_ACCT_ENTITY_VEH = 3; // Vehicle Insurance
const AGRP_INS_ACCT_ENTITY_BIZ = 4; // Business Insurance
const AGRP_INS_ACCT_ENTITY_HOUSE = 5; // House Insurance
const V_INS_ACCT_ENTITY_NONE = 0; // None
const V_INS_ACCT_ENTITY_PLAYER_HEALTH = 1; // Health Insurance
const V_INS_ACCT_ENTITY_PLAYER_LIFE = 2; // Life Insurance
const V_INS_ACCT_ENTITY_VEH = 3; // Vehicle Insurance
const V_INS_ACCT_ENTITY_BIZ = 4; // Business Insurance
const V_INS_ACCT_ENTITY_HOUSE = 5; // House Insurance
// ===========================================================================
// Insurance Account History Types
const AGRP_INS_ACCT_HISTORY_NONE = 0; // None
const AGRP_INS_ACCT_HISTORY_PLAYER_MEDICAL = 1; // Medical insurance was used (player disease/injury)
const AGRP_INS_ACCT_HISTORY_PLAYER_DEATH = 2; // Life insurance was used (player death)
const AGRP_INS_ACCT_HISTORY_VEH_DAMAGE = 3; // Vehicle was damaged, but not destroyed
const AGRP_INS_ACCT_HISTORY_VEH_WRECKED = 4; // Vehicle was completely destroyed
const AGRP_INS_ACCT_HISTORY_VEH_THEFT = 5; // Vehicle was stolen
const AGRP_INS_ACCT_HISTORY_BIZ_DAMAGE = 6; // Business was damaged (broken items/window/door)
const AGRP_INS_ACCT_HISTORY_BIZ_THEFT = 7; // Business was stolen from
const AGRP_INS_ACCT_HISTORY_HOUSE_DAMAGE = 8; // House was damaged
const AGRP_INS_ACCT_HISTORY_HOUSE_THEFT = 9; // House was stolen from
const V_INS_ACCT_HISTORY_NONE = 0; // None
const V_INS_ACCT_HISTORY_PLAYER_MEDICAL = 1; // Medical insurance was used (player disease/injury)
const V_INS_ACCT_HISTORY_PLAYER_DEATH = 2; // Life insurance was used (player death)
const V_INS_ACCT_HISTORY_VEH_DAMAGE = 3; // Vehicle was damaged, but not destroyed
const V_INS_ACCT_HISTORY_VEH_WRECKED = 4; // Vehicle was completely destroyed
const V_INS_ACCT_HISTORY_VEH_THEFT = 5; // Vehicle was stolen
const V_INS_ACCT_HISTORY_BIZ_DAMAGE = 6; // Business was damaged (broken items/window/door)
const V_INS_ACCT_HISTORY_BIZ_THEFT = 7; // Business was stolen from
const V_INS_ACCT_HISTORY_HOUSE_DAMAGE = 8; // House was damaged
const V_INS_ACCT_HISTORY_HOUSE_THEFT = 9; // House was stolen from
// ===========================================================================

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: drink.js
// DESC: Provides features and usage for the drink item type

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: food.js
// DESC: Provides features and usage for the food item type

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: handcuff.js
// DESC: Provides features and usage for the handcuff item type
@@ -11,20 +10,20 @@
// ===========================================================================
function isPlayerHandCuffed(client) {
return (getPlayerData(client).pedState == AGRP_PEDSTATE_BINDED);
return (getPlayerData(client).pedState == V_PEDSTATE_BINDED);
}
// ===========================================================================
function handCuffPlayer(client) {
getPlayerData(client).pedState = AGRP_PEDSTATE_BINDED;
getPlayerData(client).pedState = V_PEDSTATE_BINDED;
setPlayerControlState(client, false);
}
// ===========================================================================
function unHandCuffPlayer(client) {
getPlayerData(client).pedState = AGRP_PEDSTATE_READY;
getPlayerData(client).pedState = V_PEDSTATE_READY;
setPlayerControlState(client, true);
}

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: phone.js
// DESC: Provides features and usage for the phone item type
@@ -10,7 +9,7 @@
function getItemWithPhoneNumber(phoneNumber) {
for (let i in getServerData().items) {
if (getItemTypeData(getItemData(i).itemTypeIndex).useType == AGRP_ITEM_USE_TYPE_PHONE) {
if (getItemTypeData(getItemData(i).itemTypeIndex).useType == V_ITEM_USE_TYPE_PHONE) {
if (getItemData(i).value == phoneNumber) {
return i;
}
@@ -31,15 +30,15 @@ function ringPhoneForNearbyPlayers(itemIndex) {
/*
if(isPhoneItemEnabled(itemIndex)) {
switch(getItemData(itemIndex).ownerType) {
case AGRP_ITEM_OWNER_GROUND:
case V_ITEM_OWNER_GROUND:
playRingtoneForPlayersInRange(getItemData(itemIndex).position, getItemData(i).extra);
break;
case AGRP_ITEM_OWNER_VEHTRUNK:
case V_ITEM_OWNER_VEHTRUNK:
playRingtoneForPlayersInRange(getVehiclePosition(getItemData(itemIndex).ownerId), getItemData(i).extra);
break;
case AGRP_ITEM_OWNER_VEHDASH:
case V_ITEM_OWNER_VEHDASH:
playRingtoneForPlayersInRange(getVehiclePosition(getItemData(itemIndex).ownerId), getItemData(i).extra);
break;
}

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: handcuff.js
// DESC: Provides features and usage for the handcuff item type
@@ -11,20 +10,20 @@
// ===========================================================================
function isPlayerTied(client) {
return (getPlayerData(client).pedState == AGRP_PEDSTATE_BINDED);
return (getPlayerData(client).pedState == V_PEDSTATE_BINDED);
}
// ===========================================================================
function ropeTiePlayer(client) {
getPlayerData(client).pedState = AGRP_PEDSTATE_BINDED;
getPlayerData(client).pedState = V_PEDSTATE_BINDED;
setPlayerControlState(client, false);
}
// ===========================================================================
function ropeUnTiePlayer(client) {
getPlayerData(client).pedState = AGRP_PEDSTATE_READY;
getPlayerData(client).pedState = V_PEDSTATE_READY;
setPlayerControlState(client, true);
}

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: tazer.js
// DESC: Provides features and usage for the tazer item type
@@ -11,13 +10,13 @@
// ===========================================================================
function isPlayerTazed(client) {
return (getPlayerData(client).pedState == AGRP_PEDSTATE_TAZED);
return (getPlayerData(client).pedState == V_PEDSTATE_TAZED);
}
// ===========================================================================
function tazePlayer(client) {
getPlayerData(client).pedState = AGRP_PEDSTATE_TAZED;
getPlayerData(client).pedState = V_PEDSTATE_TAZED;
setPlayerControlState(client, false);
let animationId = getAnimationFromParams("tazed");
@@ -34,7 +33,7 @@ function tazePlayer(client) {
// ===========================================================================
function unTazePlayer(client) {
getPlayerData(client).pedState = AGRP_PEDSTATE_READY;
getPlayerData(client).pedState = V_PEDSTATE_READY;
setPlayerControlState(client, true);
setPlayerPosition(client, getPlayerData(client).currentAnimationPositionReturnTo);

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: walkie-talkie.js
// DESC: Provides features and usage for the walkie-talkie item type
@@ -9,7 +8,7 @@
// ===========================================================================
function getPlayerActiveWalkieTalkieFrequency(client) {
let walkieTalkieSlot = getPlayerFirstItemSlotByUseType(client, AGRP_ITEM_USE_TYPE_WALKIETALKIE);
let walkieTalkieSlot = getPlayerFirstItemSlotByUseType(client, V_ITEM_USE_TYPE_WALKIETALKIE);
if (walkieTalkieSlot != -1) {
if (getItemData(getPlayerData(client).hotBarItems[walkieTalkieSlot])) {
@@ -32,7 +31,7 @@ function walkieTalkieTransmit(radioFrequency, messageText, transmittingPlayer) {
// if(isPlayerSpawned(clients[i])) {
// if(!isSamePlayer(transmittingPlayer, clients[i])) {
// if(getPlayerActiveWalkieTalkieFrequency(clients[i]) == radioFrequency) {
// if(getItemData(getPlayerData(clients[i]).hotBarItems[getPlayerFirstItemSlotByUseType(clients[i], AGRP_ITEM_USE_TYPE_WALKIETALKIE)]).enabled) {
// if(getItemData(getPlayerData(clients[i]).hotBarItems[getPlayerFirstItemSlotByUseType(clients[i], V_ITEM_USE_TYPE_WALKIETALKIE)]).enabled) {
// walkieTalkieIncomingToNearbyPlayers(clients[i], messageText);
// }
// }
@@ -43,7 +42,7 @@ function walkieTalkieTransmit(radioFrequency, messageText, transmittingPlayer) {
let items = getServerData().items;
for (let i in items) {
if (items[i].enabled) {
if (getItemTypeData(items[i].itemTypeIndex).useType == AGRP_ITEM_USE_TYPE_WALKIETALKIE) {
if (getItemTypeData(items[i].itemTypeIndex).useType == V_ITEM_USE_TYPE_WALKIETALKIE) {
if (items[i].value == radioFrequency) {
walkieTalkieIncomingToNearbyPlayers(null, messageText, getItemPosition(i));
}
@@ -126,7 +125,7 @@ function walkieTalkieChatCommand(command, params, client) {
return false;
}
let walkieTalkieSlot = getPlayerFirstItemSlotByUseType(client, AGRP_ITEM_USE_TYPE_WALKIETALKIE);
let walkieTalkieSlot = getPlayerFirstItemSlotByUseType(client, V_ITEM_USE_TYPE_WALKIETALKIE);
if (!getItemData(getPlayerData(client).hotBarItems[walkieTalkieSlot]).enabled) {
messagePlayerError(client, "Please turn on a walkie talkie first!");
return false;

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: job.js
// DESC: Provides job functions and usage
@@ -9,37 +8,37 @@
// ===========================================================================
// Job Types
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;
const V_JOB_NONE = 0;
const V_JOB_POLICE = 1;
const V_JOB_MEDICAL = 2;
const V_JOB_FIRE = 3;
const V_JOB_BUS = 4;
const V_JOB_TAXI = 5;
const V_JOB_GARBAGE = 6;
const V_JOB_WEAPON = 7;
const V_JOB_DRUG = 8;
const V_JOB_PIZZA = 9;
const V_JOB_GENERIC = 10;
// ===========================================================================
// Job Route States
const AGRP_JOB_ROUTE_STATE_NONE = 0; // None
const AGRP_JOB_ROUTE_STATE_INPROGRESS = 1; // Route is in progress. Player is in between stops but not at the last one.
const AGRP_JOB_ROUTE_STATE_LASTSTOP = 2; // Player is heading to the last stop on the route
const AGRP_JOB_ROUTE_STATE_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_JOB_ROUTE_STATE_ATSTOP = 4; // For bus/trash stops that freeze player, this is the state when they're at one
const V_JOB_ROUTE_STATE_NONE = 0; // None
const V_JOB_ROUTE_STATE_INPROGRESS = 1; // Route is in progress. Player is in between stops but not at the last one.
const V_JOB_ROUTE_STATE_LASTSTOP = 2; // Player is heading to the last stop on the route
const V_JOB_ROUTE_STATE_PAUSED = 3; // Route is paused for some reason. For police, this could be player accepted callout and once finished, patrol route will resume
const V_JOB_ROUTE_STATE_ATSTOP = 4; // For bus/trash stops that freeze player, this is the state when they're at one
// ===========================================================================
// Job Route Location Types
const AGRP_JOB_ROUTE_LOC_TYPE_NONE = 0; // None
const AGRP_JOB_ROUTE_LOC_TYPE_CHECKPOINT = 1; // Checkpoint (used for bus routes)
const AGRP_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE = 2; // Burning vehicle (used for firefighter job)
const AGRP_JOB_ROUTE_LOC_TYPE_INJURED_PED = 3; // Injured ped (used for paramedic job)
const AGRP_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE = 4; // Mess/Garbage on ground (used for street sweeper job)
const AGRP_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN = 5; // Garbage in bin (used for trash collector job)
const AGRP_JOB_ROUTE_LOC_TYPE_FIRE = 5; // Scripted fire, placed on buildings and such
const V_JOB_ROUTE_LOC_TYPE_NONE = 0; // None
const V_JOB_ROUTE_LOC_TYPE_CHECKPOINT = 1; // Checkpoint (used for bus routes)
const V_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE = 2; // Burning vehicle (used for firefighter job)
const V_JOB_ROUTE_LOC_TYPE_INJURED_PED = 3; // Injured ped (used for paramedic job)
const V_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE = 4; // Mess/Garbage on ground (used for street sweeper job)
const V_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN = 5; // Garbage in bin (used for trash collector job)
const V_JOB_ROUTE_LOC_TYPE_FIRE = 5; // Scripted fire, placed on buildings and such
// ===========================================================================
@@ -57,7 +56,7 @@ class JobData {
constructor(dbAssoc = false) {
this.databaseId = 0;
this.serverId = 0;
this.type = AGRP_JOB_NONE;
this.type = V_JOB_NONE;
this.name = "Unnamed";
this.enabled = true;
this.blipModel = -1
@@ -176,7 +175,7 @@ class JobRouteLocationData {
this.position = toVector3(0.0, 0.0, 0.0);
this.stopDelay = 0;
this.pay = 0;
this.type = AGRP_JOB_ROUTE_LOC_TYPE_NONE;
this.type = V_JOB_ROUTE_LOC_TYPE_NONE;
this.gotoMessage = "";
this.departMessage = "";
this.whoCreated = 0;
@@ -469,60 +468,60 @@ class JobRouteLocationType {
// For use with the /jobrouteloctype command
let jobRouteLocationTypes = {
[AGRP_GAME_GTA_III]: [
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"),
[V_GAME_GTA_III]: [
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"),
],
[AGRP_GAME_GTA_VC]: [
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"),
[V_GAME_GTA_VC]: [
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"),
],
[AGRP_GAME_GTA_SA]: [
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"),
[V_GAME_GTA_SA]: [
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"),
],
[AGRP_GAME_GTA_IV]: [
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"),
[V_GAME_GTA_IV]: [
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"),
],
[AGRP_GAME_MAFIA_ONE]: [
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"),
[V_GAME_MAFIA_ONE]: [
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"),
],
[AGRP_GAME_MAFIA_TWO]: [
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"),
[V_GAME_MAFIA_TWO]: [
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"),
],
[AGRP_GAME_MAFIA_ONE_DE]: [
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"),
[V_GAME_MAFIA_ONE_DE]: [
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"),
new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"),
],
}
@@ -811,11 +810,11 @@ 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", 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", 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);
setEntityData(getServerData().jobs[i].locations[j].pickup, "v.rp.owner.type", V_PICKUP_JOB, false);
setEntityData(getServerData().jobs[i].locations[j].pickup, "v.rp.owner.id", j, false);
setEntityData(getServerData().jobs[i].locations[j].pickup, "v.rp.label.type", V_LABEL_JOB, true);
setEntityData(getServerData().jobs[i].locations[j].pickup, "v.rp.label.name", getServerData().jobs[i].name, true);
setEntityData(getServerData().jobs[i].locations[j].pickup, "v.rp.label.jobType", getServerData().jobs[i].databaseId, true);
setElementOnAllDimensions(getServerData().jobs[i].locations[j].pickup, false);
setElementDimension(getServerData().jobs[i].locations[j].pickup, getServerData().jobs[i].locations[j].dimension);
addToWorld(getServerData().jobs[i].locations[j].pickup);
@@ -840,7 +839,7 @@ function showJobInformationToPlayer(client, jobType) {
}
switch (jobType) {
case AGRP_JOB_POLICE:
case V_JOB_POLICE:
if (!canPlayerUsePoliceJob(client)) {
return false;
}
@@ -853,7 +852,7 @@ function showJobInformationToPlayer(client, jobType) {
messagePlayerInfo(client, "- When finished, use /stopwork to stop working.");
break;
case AGRP_JOB_MEDICAL:
case V_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.");
@@ -862,7 +861,7 @@ function showJobInformationToPlayer(client, jobType) {
messagePlayerInfo(client, "- When finished, use /stopwork to stop working.");
break;
case AGRP_JOB_FIRE:
case V_JOB_FIRE:
if (!canClientUseFireJob(client)) {
return false;
}
@@ -874,7 +873,7 @@ function showJobInformationToPlayer(client, jobType) {
messagePlayerInfo(client, "- When finished, use /stopwork to stop working.");
break;
case AGRP_JOB_BUS:
case V_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.");
@@ -883,7 +882,7 @@ function showJobInformationToPlayer(client, jobType) {
messagePlayerInfo(client, "- When finished, use /stopwork to stop working.");
break;
case AGRP_JOB_TAXI:
case V_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.");
@@ -893,7 +892,7 @@ function showJobInformationToPlayer(client, jobType) {
messagePlayerInfo(client, "- When finished, use /stopwork to stop working.");
break;
case AGRP_JOB_GARBAGE:
case V_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.");
@@ -904,10 +903,10 @@ function showJobInformationToPlayer(client, jobType) {
messagePlayerInfo(client, "- When finished, use /stopwork to stop working.");
break;
case AGRP_JOB_WEAPON:
case V_JOB_WEAPON:
break;
case AGRP_JOB_DRUG:
case V_JOB_DRUG:
break;
default:
@@ -949,7 +948,7 @@ function takeJobCommand(command, params, client) {
return false;
}
if (getPlayerCurrentSubAccount(client).job > AGRP_JOB_NONE) {
if (getPlayerCurrentSubAccount(client).job > V_JOB_NONE) {
messagePlayerInfo(client, getLocaleString(client, "QuitJobToTakeAnother", "{ALTCOLOUR}/quitjob{MAINCOLOUR}"));
return false;
}
@@ -981,7 +980,7 @@ function startWorkingCommand(command, params, client) {
return false;
}
if (getVehicleData(closestVehicle).ownerType != AGRP_VEHOWNER_JOB) {
if (getVehicleData(closestVehicle).ownerType != V_VEHOWNER_JOB) {
messagePlayerError(client, getLocaleString(client, "NotAJobVehicle"));
return false;
}
@@ -993,7 +992,7 @@ function startWorkingCommand(command, params, client) {
jobData = getJobData(getJobIdFromDatabaseId(getVehicleData(closestVehicle).ownerId));
} else {
if (getPlayerCurrentSubAccount(client).job == AGRP_JOB_NONE) {
if (getPlayerCurrentSubAccount(client).job == V_JOB_NONE) {
messagePlayerError(client, getLocaleString(client, "DontHaveAJob"));
messagePlayerInfo(client, "You can get a job by going the yellow points on the map.");
return false;
@@ -1054,41 +1053,41 @@ function startWorking(client) {
switchPlayerActiveHotBarSlot(client, -1);
getPlayerCurrentSubAccount(client).skin = getPlayerSkin(client);
storePlayerItemsInTempLocker(client);
getPlayerData(client).tempLockerType = AGRP_TEMP_LOCKER_TYPE_JOB;
getPlayerData(client).tempLockerType = V_TEMP_LOCKER_TYPE_JOB;
messagePlayerInfo(client, getLocaleString(client, "ItemsStoredForJob"));
getPlayerCurrentSubAccount(client).isWorking = true;
let jobId = getPlayerCurrentSubAccount(client).job;
switch (getJobIndexFromDatabaseId(jobId)) {
case AGRP_JOB_POLICE:
case V_JOB_POLICE:
messagePlayerInfo(client, getLocaleString(client, "JobEquipAndUniformLabel", `{ALTCOLOUR}/uniform{MAINCOLOUR}, {ALTCOLOUR}/equip{MAINCOLOUR}`));
break;
case AGRP_JOB_MEDICAL:
case V_JOB_MEDICAL:
messagePlayerInfo(client, getLocaleString(client, "JobEquipAndUniformLabel", `{ALTCOLOUR}/uniform{MAINCOLOUR}, {ALTCOLOUR}/equip{MAINCOLOUR}`));
break;
case AGRP_JOB_FIRE:
case V_JOB_FIRE:
messagePlayerInfo(client, getLocaleString(client, "JobEquipAndUniformLabel", `{ALTCOLOUR}/uniform{MAINCOLOUR}, {ALTCOLOUR}/equip{MAINCOLOUR}`));
break;
case AGRP_JOB_BUS:
case V_JOB_BUS:
messagePlayerInfo(client, getLocaleString(client, "GetStartedJobVehicle", getGroupedLocaleString(client, "VehicleTypes", "Bus")));
break;
case AGRP_JOB_TAXI:
case V_JOB_TAXI:
messagePlayerInfo(client, getLocaleString(client, "GetStartedJobVehicle", getGroupedLocaleString(client, "VehicleTypes", "Taxi")));
break;
case AGRP_JOB_GARBAGE:
case V_JOB_GARBAGE:
messagePlayerInfo(client, getLocaleString(client, "GetStartedJobVehicle", getGroupedLocaleString(client, "VehicleTypes", "GarbageTruck")));
break;
case AGRP_JOB_WEAPON:
case V_JOB_WEAPON:
break;
case AGRP_JOB_DRUG:
case V_JOB_DRUG:
break;
default:
@@ -1131,10 +1130,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 == AGRP_ITEM_USE_TYPE_WALKIETALKIE) {
if (getItemTypeData(getItemTypeIndexFromDatabaseId(getJobData(jobId).equipment[equipmentId].items[i].itemType)).useType == V_ITEM_USE_TYPE_WALKIETALKIE) {
value = getJobData(jobId).walkieTalkieFrequency;
}
let itemId = createItem(getItemTypeIndexFromDatabaseId(getJobData(jobId).equipment[equipmentId].items[i].itemType), value, AGRP_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId);
let itemId = createItem(getItemTypeIndexFromDatabaseId(getJobData(jobId).equipment[equipmentId].items[i].itemType), value, V_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId);
getItemData(itemId).needsSaved = false;
getItemData(itemId).databaseId = -1; // Make sure it doesnt save
let freeSlot = getPlayerFirstEmptyHotBarSlot(client);
@@ -1188,37 +1187,37 @@ function stopWorking(client) {
/*
switch (getJobType(jobId)) {
case AGRP_JOB_POLICE:
case V_JOB_POLICE:
messagePlayerInfo(client, "Your uniform, equipment, and vehicle have been returned to the police station");
break;
case AGRP_JOB_MEDICAL:
case V_JOB_MEDICAL:
messagePlayerInfo(client, "Your uniform, equipment, and vehicle have been returned to the hospital");
break;
case AGRP_JOB_FIRE:
case V_JOB_FIRE:
messagePlayerInfo(client, "Your uniform, equipment, and vehicle have been returned to the fire station");
break;
case AGRP_JOB_BUS:
case V_JOB_BUS:
messagePlayerInfo(client, "Your vehicle has been returned to the bus depot");
break;
case AGRP_JOB_TAXI:
case V_JOB_TAXI:
messagePlayerInfo(client, "Your vehicle has been returned to the taxi depot");
break;
case AGRP_JOB_GARBAGE:
case V_JOB_GARBAGE:
messagePlayerInfo(client, "Your vehicle has been returned to the city trash dump");
break;
case AGRP_JOB_WEAPON:
case V_JOB_WEAPON:
break;
case AGRP_JOB_DRUG:
case V_JOB_DRUG:
break;
case AGRP_JOB_GENERIC:
case V_JOB_GENERIC:
messagePlayerInfo(client, "Your vehicle has been respawned at your job location");
break;
@@ -1259,7 +1258,7 @@ function jobUniformCommand(command, params, client) {
return false;
}
if (getVehicleData(closestVehicle).ownerType != AGRP_VEHOWNER_JOB) {
if (getVehicleData(closestVehicle).ownerType != V_VEHOWNER_JOB) {
messagePlayerError(client, getLocaleString(client, "NotAJobVehicle"));
return false;
}
@@ -1271,7 +1270,7 @@ function jobUniformCommand(command, params, client) {
jobData = getJobData(getJobIdFromDatabaseId(getVehicleData(closestVehicle).ownerId));
} else {
if (getPlayerCurrentSubAccount(client).job == AGRP_JOB_NONE) {
if (getPlayerCurrentSubAccount(client).job == V_JOB_NONE) {
messagePlayerError(client, getLocaleString(client, "NotYourJob"));
messagePlayerInfo(client, getLocaleString(client, "JobPoints"));
return false;
@@ -1362,7 +1361,7 @@ function jobEquipmentCommand(command, params, client) {
return false;
}
if (getVehicleData(closestVehicle).ownerType != AGRP_VEHOWNER_JOB) {
if (getVehicleData(closestVehicle).ownerType != V_VEHOWNER_JOB) {
messagePlayerError(client, getLocaleString(client, "NotAJobVehicle"));
return false;
}
@@ -1374,7 +1373,7 @@ function jobEquipmentCommand(command, params, client) {
jobData = getJobData(getJobIdFromDatabaseId(getVehicleData(closestVehicle).ownerId));
} else {
if (getPlayerCurrentSubAccount(client).job == AGRP_JOB_NONE) {
if (getPlayerCurrentSubAccount(client).job == V_JOB_NONE) {
messagePlayerError(client, getLocaleString(client, "NotYourJob"));
if (hasPlayerSeenActionTip(client, "JobLocations")) {
@@ -2407,7 +2406,7 @@ function jobStopRouteCommand(command, params, client) {
return false;
}
//if(!doesPlayerHaveJobType(client, AGRP_JOB_BUS) && !doesPlayerHaveJobType(client, AGRP_JOB_GARBAGE)) {
//if(!doesPlayerHaveJobType(client, V_JOB_BUS) && !doesPlayerHaveJobType(client, V_JOB_GARBAGE)) {
// messagePlayerError(client, "Your job doesn't use a route!");
// return false;
//}
@@ -3193,11 +3192,11 @@ function createJobLocationPickup(jobId, locationId) {
tempJobData.locations[locationId].pickup = pickup;
setElementDimension(pickup, tempJobData.locations[locationId].dimension);
setElementOnAllDimensions(pickup, false);
setEntityData(pickup, "agrp.owner.type", AGRP_PICKUP_JOB, false);
setEntityData(pickup, "agrp.owner.id", locationId, false);
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);
setEntityData(pickup, "v.rp.owner.type", V_PICKUP_JOB, false);
setEntityData(pickup, "v.rp.owner.id", locationId, false);
setEntityData(pickup, "v.rp.label.type", V_LABEL_JOB, true);
setEntityData(pickup, "v.rp.label.name", tempJobData.name, true);
setEntityData(pickup, "v.rp.label.jobType", tempJobData.databaseId, true);
addToWorld(pickup);
}
} else {
@@ -3597,7 +3596,7 @@ function createJobRoute(routeName, closestJobLocation, whoCreated = defaultNoAcc
// ===========================================================================
function createJobRouteLocation(routeLocationName, position, jobRouteData, whoCreated = defaultNoAccountId, delay = 0, arriveMessage = "", gotoMessage = "", type = AGRP_JOB_ROUTE_LOC_TYPE_NONE) {
function createJobRouteLocation(routeLocationName, position, jobRouteData, whoCreated = defaultNoAccountId, delay = 0, arriveMessage = "", gotoMessage = "", type = V_JOB_ROUTE_LOC_TYPE_NONE) {
let tempJobRouteLocationData = new JobRouteLocationData(false);
tempJobRouteLocationData.name = routeLocationName;
tempJobRouteLocationData.routeId = jobRouteData.databaseId;

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: bus.js
// DESC: Provides bus driver job functions and usage

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: drug.js
// DESC: Provides drug runner/dealer job functions and usage

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: fire.js
// DESC: Provides firefighter job functions and usage

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: garbage.js
// DESC: Provides garbage collector job functions and usage

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: medic.js
// DESC: Provides paramedic job functions and usage

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: pizza-delivery.js
// DESC: Provides pizza delivery driver job functions and usage

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: police.js
// DESC: Provides police officer job functions and usage
@@ -24,7 +23,7 @@ function policeTazerCommand(command, params, client) {
return false;
}
if (!doesPlayerHaveJobType(client, AGRP_JOB_POLICE)) {
if (!doesPlayerHaveJobType(client, V_JOB_POLICE)) {
messagePlayerError(client, "You don't have a police job.");
return false;
}
@@ -50,7 +49,7 @@ function policeCuffCommand(command, params, client) {
return false;
}
if (!doesPlayerHaveJobType(client, AGRP_JOB_POLICE)) {
if (!doesPlayerHaveJobType(client, V_JOB_POLICE)) {
messagePlayerError(client, "You don't have a police job.");
return false;
}
@@ -76,7 +75,7 @@ function policeArrestCommand(command, params, client) {
return false;
}
if (!doesPlayerHaveJobType(client, AGRP_JOB_POLICE)) {
if (!doesPlayerHaveJobType(client, V_JOB_POLICE)) {
messagePlayerError(client, "You don't have a police job.");
return false;
}
@@ -102,7 +101,7 @@ function policeSearchCommand(command, params, client) {
return false;
}
if (!doesPlayerHaveJobType(client, AGRP_JOB_POLICE)) {
if (!doesPlayerHaveJobType(client, V_JOB_POLICE)) {
messagePlayerError(client, "You don't have a police job.");
return false;
}
@@ -128,7 +127,7 @@ function policeDragCommand(command, params, client) {
return false;
}
if (!doesPlayerHaveJobType(client, AGRP_JOB_POLICE)) {
if (!doesPlayerHaveJobType(client, V_JOB_POLICE)) {
messagePlayerError(client, "You don't have a police job.");
return false;
}
@@ -154,7 +153,7 @@ function policeDetainCommand(command, params, client) {
return false;
}
if (!doesPlayerHaveJobType(client, AGRP_JOB_POLICE)) {
if (!doesPlayerHaveJobType(client, V_JOB_POLICE)) {
messagePlayerError(client, "You don't have a police job.");
return false;
}

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: taxi.js
// DESC: Provides taxi driver job functions and usage
@@ -24,7 +23,7 @@ function taxiSetFareCommand(command, params, client) {
return false;
}
if (!doesPlayerHaveJobType(client, AGRP_JOB_TAXI)) {
if (!doesPlayerHaveJobType(client, V_JOB_TAXI)) {
messagePlayerError(client, "You don't have a taxi job.");
return false;
}

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: weapon.js
// DESC: Provides weapons dealer job functions and usage

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: keybind.js
// DESC: Provides keybind handlers and functions
@@ -10,7 +9,7 @@
// ===========================================================================
class KeyBindData {
constructor(dbAssoc = false, key = 0, commandString = "", keyState = AGRP_KEYSTATE_UP) {
constructor(dbAssoc = false, key = 0, commandString = "", keyState = V_KEYSTATE_UP) {
this.databaseId = 0;
this.key = key;
this.account = 0;
@@ -89,7 +88,7 @@ function removeKeyBindCommand(command, params, client) {
// ===========================================================================
function resetKeyBindsCommand(command, params, client) {
getPlayerData(client).promptType = AGRP_PROMPT_RESETKEYBINDS;
getPlayerData(client).promptType = V_PROMPT_RESETKEYBINDS;
showPlayerPrompt(client, getLocaleString(client, "ResetAllKeyBindsConfirm"), getLocaleString(client, "GUIWarningTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
//removePlayerKeyBind(client, keyId);
//messagePlayerSuccess(client, `You removed the keybind for the {ALTCOLOUR}${toUpperCase(getKeyNameFromId(keyId))} {MAINCOLOUR}key`);
@@ -98,7 +97,7 @@ function resetKeyBindsCommand(command, params, client) {
// ===========================================================================
function copyKeyBindsToServerCommand(command, params, client) {
getPlayerData(client).promptType = AGRP_PROMPT_COPYKEYBINDSTOSERVER;
getPlayerData(client).promptType = V_PROMPT_COPYKEYBINDSTOSERVER;
showPlayerPrompt(client, getLocaleString(client, "CopyAllKeyBindsToServerConfirm"), getLocaleString(client, "GUIWarningTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
//removePlayerKeyBind(client, keyId);
//messagePlayerSuccess(client, `You removed the keybind for the {ALTCOLOUR}${toUpperCase(getKeyNameFromId(keyId))} {MAINCOLOUR}key`);
@@ -113,7 +112,7 @@ function addPlayerKeyBind(client, keyId, command, params, tempKey = false) {
}
getPlayerData(client).keyBinds.push(keyBindData);
sendAddAccountKeyBindToClient(client, keyId, AGRP_KEYSTATE_UP);
sendAddAccountKeyBindToClient(client, keyId, V_KEYSTATE_UP);
if (!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "enter")) {
let keyId = getPlayerKeyBindForCommand(client, "enter");

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: locale.js
// DESC: Provides locale structures, functions and usage

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: misc.js
// DESC: Provides any uncategorized functions and usage
@@ -9,48 +8,48 @@
// ===========================================================================
// Pickup Types
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;
const V_PICKUP_NONE = 0;
const V_PICKUP_JOB = 1;
const V_PICKUP_BUSINESS_ENTRANCE = 2;
const V_PICKUP_BUSINESS_EXIT = 3;
const V_PICKUP_HOUSE_ENTRANCE = 4;
const V_PICKUP_HOUSE_EXIT = 5;
const V_PICKUP_EXIT = 6;
// ===========================================================================
// Blip Owner Types
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;
const V_BLIP_NONE = 0;
const V_BLIP_JOB = 1;
const V_BLIP_BUSINESS_ENTRANCE = 2;
const V_BLIP_BUSINESS_EXIT = 3;
const V_BLIP_HOUSE_ENTRANCE = 4;
const V_BLIP_HOUSE_EXIT = 5;
const V_BLIP_EXIT = 6;
// ===========================================================================
// Ped States
const AGRP_PEDSTATE_NONE = 0; // 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
const V_PEDSTATE_NONE = 0; // None
const V_PEDSTATE_READY = 1; // Ready
const V_PEDSTATE_DRIVER = 2; // Driving a vehicle
const V_PEDSTATE_PASSENGER = 3; // In a vehicle as passenger
const V_PEDSTATE_DEAD = 4; // Dead
const V_PEDSTATE_ENTERINGPROPERTY = 5; // Entering a property
const V_PEDSTATE_EXITINGPROPERTY = 6; // Exiting a property
const V_PEDSTATE_ENTERINGVEHICLE = 7; // Entering a vehicle
const V_PEDSTATE_EXITINGVEHICLE = 8; // Exiting a vehicle
const V_PEDSTATE_BINDED = 9; // Binded by rope or handcuffs
const V_PEDSTATE_TAZED = 10; // Under incapacitating effect of tazer
const V_PEDSTATE_INTRUNK = 11; // In vehicle trunk
const V_PEDSTATE_INITEM = 12; // In item (crate, box, etc)
const V_PEDSTATE_HANDSUP = 13; // Has hands up (surrendering)
const V_PEDSTATE_SPAWNING = 14; // Spawning
// Property Types
const AGRP_PROPERTY_TYPE_NONE = 0; // None
const AGRP_PROPERTY_TYPE_BUSINESS = 1; // Business
const AGRP_PROPERTY_TYPE_HOUSE = 2; // House
const V_PROPERTY_TYPE_NONE = 0; // None
const V_PROPERTY_TYPE_BUSINESS = 1; // Business
const V_PROPERTY_TYPE_HOUSE = 2; // House
// ===========================================================================
@@ -116,7 +115,7 @@ function suicideCommand(command, params, client) {
// ===========================================================================
function toggleMouseCameraCommand(command, params, client) {
if (getGame() != AGRP_GAME_GTA_VC) {
if (getGame() != V_GAME_GTA_VC) {
sendPlayerMouseCameraToggle(client);
}
return true;
@@ -206,7 +205,7 @@ function enterExitPropertyCommand(command, params, client) {
let isBusiness = false;
// Make sure they aren't already trying to enter/exit a property
if (getPlayerData(client).pedState == AGRP_PEDSTATE_ENTERINGPROPERTY || getPlayerData(client).pedState == AGRP_PEDSTATE_EXITINGPROPERTY) {
if (getPlayerData(client).pedState == V_PEDSTATE_ENTERINGPROPERTY || getPlayerData(client).pedState == V_PEDSTATE_EXITINGPROPERTY) {
messagePlayerError(client, getLocaleString(client, "UnableToDoThat"));
return false;
}
@@ -219,29 +218,29 @@ function enterExitPropertyCommand(command, params, client) {
// Needs further testing and tweaks.
if (getPlayerData(client).currentPickup != null) {
if (getDistance(getPlayerData(client).currentPickup.position, getPlayerPosition(client)) <= 2) {
let ownerType = getEntityData(getPlayerData(client).currentPickup, "agrp.owner.type");
let ownerId = getEntityData(getPlayerData(client).currentPickup, "agrp.owner.id");
let ownerType = getEntityData(getPlayerData(client).currentPickup, "v.rp.owner.type");
let ownerId = getEntityData(getPlayerData(client).currentPickup, "v.rp.owner.id");
switch (ownerType) {
case AGRP_PICKUP_BUSINESS_ENTRANCE:
case V_PICKUP_BUSINESS_ENTRANCE:
isBusiness = true;
isEntrance = true;
closestProperty = getServerData().businesses[ownerId];
break;
case AGRP_PICKUP_BUSINESS_EXIT:
case V_PICKUP_BUSINESS_EXIT:
isBusiness = true;
isEntrance = false;
closestProperty = getServerData().businesses[ownerId];
break;
case AGRP_PICKUP_HOUSE_ENTRANCE:
case V_PICKUP_HOUSE_ENTRANCE:
isBusiness = false;
isEntrance = true;
closestProperty = getServerData().houses[ownerId];
break;
case AGRP_PICKUP_HOUSE_EXIT:
case V_PICKUP_HOUSE_EXIT:
isBusiness = false;
isEntrance = false;
closestProperty = getServerData().houses[ownerId];
@@ -361,8 +360,8 @@ function enterExitPropertyCommand(command, params, client) {
}
clearPlayerStateToEnterExitProperty(client);
getPlayerData(client).pedState = AGRP_PEDSTATE_ENTERINGPROPERTY;
getPlayerData(client).enteringExitingProperty = [(isBusiness) ? AGRP_PROPERTY_TYPE_BUSINESS : AGRP_PROPERTY_TYPE_HOUSE, closestProperty.index];
getPlayerData(client).pedState = V_PEDSTATE_ENTERINGPROPERTY;
getPlayerData(client).enteringExitingProperty = [(isBusiness) ? V_PROPERTY_TYPE_BUSINESS : V_PROPERTY_TYPE_HOUSE, closestProperty.index];
meActionToNearbyPlayers(client, getLanguageLocaleString(englishId, "EntersProperty", typeString, nameString));
@@ -393,8 +392,8 @@ function enterExitPropertyCommand(command, params, client) {
}
clearPlayerStateToEnterExitProperty(client);
getPlayerData(client).pedState = AGRP_PEDSTATE_EXITINGPROPERTY;
getPlayerData(client).enteringExitingProperty = [(isBusiness) ? AGRP_PROPERTY_TYPE_BUSINESS : AGRP_PROPERTY_TYPE_HOUSE, closestProperty.index];
getPlayerData(client).pedState = V_PEDSTATE_EXITINGPROPERTY;
getPlayerData(client).enteringExitingProperty = [(isBusiness) ? V_PROPERTY_TYPE_BUSINESS : V_PROPERTY_TYPE_HOUSE, closestProperty.index];
meActionToNearbyPlayers(client, getLanguageLocaleString(englishId, "ExitsProperty", typeString, nameString));
@@ -604,7 +603,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 == AGRP_RETURNTO_TYPE_SKINSELECT) {
if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == V_RETURNTO_TYPE_SKINSELECT) {
messagePlayerAlert(client, "You canceled the skin change.");
restorePlayerCamera(client);
@@ -618,11 +617,11 @@ function stuckPlayerCommand(command, params, client) {
getPlayerData(client).returnToInterior = null;
getPlayerData(client).returnToDimension = null;
getPlayerData(client).returnToType = AGRP_RETURNTO_TYPE_NONE;
getPlayerData(client).returnToType = V_RETURNTO_TYPE_NONE;
}
}
//if(getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == AGRP_RETURNTO_TYPE_ADMINGET) {
//if(getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == V_RETURNTO_TYPE_ADMINGET) {
// messagePlayerError(client, `You were teleported by an admin and can't use the stuck command`);
// return false;
//}
@@ -922,7 +921,7 @@ function deletePlayerBlip(client) {
// ===========================================================================
function processPlayerDeath(client) {
getPlayerData(client).pedState = AGRP_PEDSTATE_DEAD;
getPlayerData(client).pedState = V_PEDSTATE_DEAD;
updatePlayerSpawnedState(client, false);
setPlayerControlState(client, false);
setTimeout(function () {
@@ -984,13 +983,13 @@ function processPlayerDeath(client) {
// ===========================================================================
function isPlayerSurrendered(client) {
return (getPlayerData(client).pedState == AGRP_PEDSTATE_TAZED || getPlayerData(client).pedState == AGRP_PEDSTATE_HANDSUP);
return (getPlayerData(client).pedState == V_PEDSTATE_TAZED || getPlayerData(client).pedState == V_PEDSTATE_HANDSUP);
}
// ===========================================================================
function isPlayerRestrained(client) {
return (getPlayerData(client).pedState == AGRP_PEDSTATE_BINDED);
return (getPlayerData(client).pedState == V_PEDSTATE_BINDED);
}
// ===========================================================================
@@ -998,13 +997,13 @@ function isPlayerRestrained(client) {
function getPlayerInPropertyData(client) {
let businessId = getPlayerBusiness(client);
if (businessId != -1) {
getPlayerData(client).inProperty = [AGRP_PROPERTY_TYPE_BUSINESS, businessId];
getPlayerData(client).inProperty = [V_PROPERTY_TYPE_BUSINESS, businessId];
return false;
}
let houseId = getPlayerHouse(client);
if (houseId != -1) {
getPlayerData(client).inProperty = [AGRP_PROPERTY_TYPE_HOUSE, houseId];
getPlayerData(client).inProperty = [V_PROPERTY_TYPE_HOUSE, houseId];
return false;
}

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: connected.js
// DESC: Provides wrapped natives for GTA Connected and Mafia Connected mods
@@ -193,8 +192,8 @@ function getVehicleHeading(vehicle) {
// ===========================================================================
function setVehicleHeading(vehicle, heading) {
//if (getGame() == AGRP_GAME_GTA_IV) {
// return sendNetworkEventToPlayer("agrp.vehPosition", null, getVehicleForNetworkEvent(vehicle), heading);
//if (getGame() == V_GAME_GTA_IV) {
// return sendNetworkEventToPlayer("v.rp.vehPosition", null, getVehicleForNetworkEvent(vehicle), heading);
//}
return vehicle.heading = heading;
}
@@ -227,7 +226,7 @@ function getVehicleSyncer(vehicle) {
// ===========================================================================
function getVehicleForNetworkEvent(vehicle) {
//if (getGame() == AGRP_GAME_GTA_IV) {
//if (getGame() == V_GAME_GTA_IV) {
// if (getVehicleData(vehicle).ivNetworkId != -1) {
// return getVehicleData(vehicle).ivNetworkId;
// }
@@ -267,8 +266,8 @@ 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() == AGRP_GAME_GTA_IV) {
triggerNetworkEvent("agrp.localPlayerSkin", client, getGameConfig().skins[getGame()][skinIndex][0]);
if (getGame() == V_GAME_GTA_IV) {
triggerNetworkEvent("v.rp.localPlayerSkin", client, getGameConfig().skins[getGame()][skinIndex][0]);
} else {
getPlayerPed(client).modelIndex = getGameConfig().skins[getGame()][skinIndex][0];
}
@@ -581,24 +580,24 @@ function repairVehicle(vehicle) {
// ===========================================================================
function setVehicleLights(vehicle, lights) {
setEntityData(vehicle, "agrp.lights", lights, true);
sendNetworkEventToPlayer("agrp.veh.lights", null, vehicle.id, lights);
setEntityData(vehicle, "v.rp.lights", lights, true);
sendNetworkEventToPlayer("v.rp.veh.lights", null, vehicle.id, lights);
}
// ===========================================================================
function setVehicleEngine(vehicle, engine) {
//vehicle.engine = engine;
setEntityData(vehicle, "agrp.engine", engine, true);
sendNetworkEventToPlayer("agrp.veh.engine", null, vehicle.id, engine);
setEntityData(vehicle, "v.rp.engine", engine, true);
sendNetworkEventToPlayer("v.rp.veh.engine", null, vehicle.id, engine);
}
// ===========================================================================
function setVehicleLocked(vehicle, locked) {
vehicle.locked = locked;
setEntityData(vehicle, "agrp.locked", locked, true);
sendNetworkEventToPlayer("agrp.veh.locked", null, vehicle.id, locked);
setEntityData(vehicle, "v.rp.locked", locked, true);
sendNetworkEventToPlayer("v.rp.veh.locked", null, vehicle.id, locked);
}
// ===========================================================================
@@ -672,15 +671,15 @@ function createGamePed(modelIndex, position, heading, toClient = null) {
// ===========================================================================
function getIsland(position) {
if (getGame() == AGRP_GAME_GTA_III) {
if (getGame() == V_GAME_GTA_III) {
if (position.x > 616) {
return AGRP_ISLAND_PORTLAND;
return V_ISLAND_PORTLAND;
} else if (position.x < -283) {
return AGRP_ISLAND_SHORESIDEVALE;
return V_ISLAND_SHORESIDEVALE;
}
return AGRP_ISLAND_STAUNTON;
return V_ISLAND_STAUNTON;
} else {
return AGRP_ISLAND_NONE;
return V_ISLAND_NONE;
}
//return game.getIslandFromPosition(position);
@@ -725,7 +724,7 @@ function setPlayerFightStyle(client, fightStyleId) {
return false;
}
setEntityData(getPlayerElement(client), "agrp.fightStyle", [getGameConfig().fightStyles[getGame()][fightStyleId][1][0], getGameConfig().fightStyles[getGame()][fightStyleId][1][1]]);
setEntityData(getPlayerElement(client), "v.rp.fightStyle", [getGameConfig().fightStyles[getGame()][fightStyleId][1][0], getGameConfig().fightStyles[getGame()][fightStyleId][1][1]]);
forcePlayerToSyncElementProperties(null, getPlayerElement(client));
}
@@ -744,7 +743,7 @@ function getPlayerElement(client) {
// ===========================================================================
function setElementPosition(element, position) {
sendNetworkEventToPlayer("agrp.elementPosition", null, element.id, position);
sendNetworkEventToPlayer("v.rp.elementPosition", null, element.id, position);
}
// ===========================================================================
@@ -762,14 +761,14 @@ function getElementHeading(element) {
// ===========================================================================
function setElementInterior(element, interior) {
setEntityData(element, "agrp.interior", interior, true);
setEntityData(element, "v.rp.interior", interior, true);
forcePlayerToSyncElementProperties(null, element);
}
// ===========================================================================
function setElementCollisionsEnabled(element, state) {
sendNetworkEventToPlayer("agrp.elementCollisions", null, element.id, state);
sendNetworkEventToPlayer("v.rp.elementCollisions", null, element.id, state);
}
// ===========================================================================
@@ -1003,7 +1002,7 @@ function setConstantsAsGlobalVariablesInDatabase() {
let entries = Object.entries(global);
for (let i in entries) {
logToConsole(LOG_DEBUG, `[AGRP.Database] Checking entry ${i} (${entries[i]})`);
if (toString(i).slice(0, 3).indexOf("AGRP_") != -1) {
if (toString(i).slice(0, 3).indexOf("V_") != -1) {
logToConsole(LOG_DEBUG, `[AGRP.Database] Adding ${i} (${entries[i]}) to database global variables`);
}
}
@@ -1126,7 +1125,7 @@ function getClosestCivilian(position) {
// ===========================================================================
function getVehiclesInRange(position, range) {
//if (getGame() == AGRP_GAME_GTA_IV) {
//if (getGame() == V_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);
@@ -1159,7 +1158,7 @@ function getVehicleFirstEmptySeat(vehicle) {
// ===========================================================================
function isVehicleTrain(vehicle) {
if (getGame() == AGRP_GAME_GTA_III) {
if (getGame() == V_GAME_GTA_III) {
if (vehicle.modelIndex == 124) {
return true;
}
@@ -1190,13 +1189,13 @@ function setVehicleHealth(vehicle, health) {
function givePlayerWeapon(client, weaponId, ammo, active = true) {
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to give weapon (Weapon: ${weaponId}, Ammo: ${ammo})`);
sendNetworkEventToPlayer("agrp.giveWeapon", client, weaponId, ammo, active);
sendNetworkEventToPlayer("v.rp.giveWeapon", client, weaponId, ammo, active);
}
// ===========================================================================
function setPlayerWantedLevel(client, wantedLevel) {
sendNetworkEventToPlayer("agrp.wantedLevel", client, wantedLevel);
sendNetworkEventToPlayer("v.rp.wantedLevel", client, wantedLevel);
return true;
}
@@ -1255,7 +1254,7 @@ function getPlayerPed(client) {
return null;
}
//if (getGame() == AGRP_GAME_GTA_IV) {
//if (getGame() == V_GAME_GTA_IV) {
// return getPlayerData(client).ped;
//} else {
return client.player;
@@ -1363,7 +1362,7 @@ function serverBanIP(ip) {
// ===========================================================================
function setVehicleTrunkState(vehicle, trunkState) {
sendNetworkEventToPlayer("agrp.veh.trunk", null, getVehicleForNetworkEvent(vehicle), trunkState);
sendNetworkEventToPlayer("v.rp.veh.trunk", null, getVehicleForNetworkEvent(vehicle), trunkState);
}
// ===========================================================================
@@ -1490,7 +1489,7 @@ function deletePlayerPed(client) {
if (areServerElementsSupported()) {
destroyElement(client.player);
} else {
sendNetworkEventToPlayer("agrp.deleteLocalPlayerPed", client);
sendNetworkEventToPlayer("v.rp.deleteLocalPlayerPed", client);
}
}

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: connected.js
// DESC: Provides wrapped natives for GTA Connected and Mafia Connected mods
@@ -164,8 +163,8 @@ function getVehicleHeading(vehicle) {
// ===========================================================================
function setVehicleHeading(vehicle, heading) {
if (getGame() == AGRP_GAME_GTA_IV) {
return sendNetworkEventToPlayer("agrp.vehPosition", null, getVehicleForNetworkEvent(vehicle), heading);
if (getGame() == V_GAME_GTA_IV) {
return sendNetworkEventToPlayer("v.rp.vehPosition", null, getVehicleForNetworkEvent(vehicle), heading);
}
return vehicle.heading = heading;
}
@@ -198,7 +197,7 @@ function getVehicleSyncer(vehicle) {
// ===========================================================================
function getVehicleForNetworkEvent(vehicle) {
if (getGame() == AGRP_GAME_GTA_IV) {
if (getGame() == V_GAME_GTA_IV) {
if (getVehicleData(vehicle).ivNetworkId != -1) {
return getVehicleData(vehicle).ivNetworkId;
}
@@ -238,8 +237,8 @@ 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() == AGRP_GAME_GTA_IV) {
triggerNetworkEvent("agrp.localPlayerSkin", client, getGameConfig().skins[getGame()][skinIndex][0]);
if (getGame() == V_GAME_GTA_IV) {
triggerNetworkEvent("v.rp.localPlayerSkin", client, getGameConfig().skins[getGame()][skinIndex][0]);
} else {
getPlayerPed(client).modelIndex = getGameConfig().skins[getGame()][skinIndex][0];
}
@@ -531,15 +530,15 @@ function repairVehicle(vehicle) {
// ===========================================================================
function setVehicleLights(vehicle, lights) {
setEntityData(vehicle, "agrp.lights", lights, true);
sendNetworkEventToPlayer("agrp.veh.lights", null, vehicle.id, lights);
setEntityData(vehicle, "v.rp.lights", lights, true);
sendNetworkEventToPlayer("v.rp.veh.lights", null, vehicle.id, lights);
}
// ===========================================================================
function setVehicleEngine(vehicle, engine) {
vehicle.engine = engine;
setEntityData(vehicle, "agrp.engine", engine, true);
setEntityData(vehicle, "v.rp.engine", engine, true);
}
// ===========================================================================
@@ -674,7 +673,7 @@ function getPlayerElement(client) {
// ===========================================================================
function setElementPosition(element, position) {
sendNetworkEventToPlayer("agrp.elementPosition", null, element.id, position);
sendNetworkEventToPlayer("v.rp.elementPosition", null, element.id, position);
}
// ===========================================================================
@@ -698,7 +697,7 @@ function setElementInterior(element, interior) {
// ===========================================================================
function setElementCollisionsEnabled(element, state) {
//sendNetworkEventToPlayer("agrp.elementCollisions", null, element.id, state);
//sendNetworkEventToPlayer("v.rp.elementCollisions", null, element.id, state);
}
// ===========================================================================
@@ -941,7 +940,7 @@ function getClosestCivilian(position) {
// ===========================================================================
function getVehiclesInRange(position, range) {
if (getGame() == AGRP_GAME_GTA_IV) {
if (getGame() == V_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);
@@ -1000,14 +999,14 @@ function setVehicleHealth(vehicle, health) {
function givePlayerWeapon(client, weaponId, ammo, active = true) {
//logToConsole(LOG_DEBUG, `[AGRP.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to give weapon (Weapon: ${weaponId}, Ammo: ${ammo})`);
//sendNetworkEventToPlayer("agrp.giveWeapon", client, weaponId, ammo, active);
//sendNetworkEventToPlayer("v.rp.giveWeapon", client, weaponId, ammo, active);
client.giveWeapon(weaponId, ammo);
}
// ===========================================================================
function setPlayerWantedLevel(client, wantedLevel) {
//sendNetworkEventToPlayer("agrp.wantedLevel", client, wantedLevel);
//sendNetworkEventToPlayer("v.rp.wantedLevel", client, wantedLevel);
return true;
}
@@ -1110,7 +1109,7 @@ function despawnPlayer(client) {
// ===========================================================================
function getGame() {
return AGRP_GAME_GTA_V;
return V_GAME_GTA_V;
}
// ===========================================================================
@@ -1155,7 +1154,7 @@ function serverBanIP(ip) {
// ===========================================================================
function setVehicleTrunkState(vehicle, trunkState) {
//sendNetworkEventToPlayer("agrp.veh.trunk", null, getVehicleForNetworkEvent(vehicle), trunkState);
//sendNetworkEventToPlayer("v.rp.veh.trunk", null, getVehicleForNetworkEvent(vehicle), trunkState);
}
// ===========================================================================
@@ -1247,7 +1246,7 @@ function deletePlayerPed(client) {
//if (areServerElementsSupported()) {
// destroyElement(client.player);
//} else {
// sendNetworkEventToPlayer("agrp.deleteLocalPlayerPed", client);
// sendNetworkEventToPlayer("v.rp.deleteLocalPlayerPed", client);
//}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: npc.js
// DESC: Provides NPC usage and functions
@@ -9,27 +8,27 @@
// ===========================================================================
// NPC Trigger Condition Match Types
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)
const V_NPC_COND_MATCH_NONE = 0; // None (invalid)
const V_NPC_COND_MATCH_EQ = 1; // Must be equal to
const V_NPC_COND_MATCH_GT = 2; // Must be greater than
const V_NPC_COND_MATCH_LT = 3; // Must be less than
const V_NPC_COND_MATCH_GTEQ = 4; // Must be greater than or equal to
const V_NPC_COND_MATCH_LTEQ = 5; // Must be less than or equal to
const V_NPC_COND_MATCH_CONTAINS = 6; // Must contain string (case insensitive)
const V_NPC_COND_MATCH_CONTAINS_CASE = 7; // Must contain string (case sensitive)
const V_NPC_COND_MATCH_EXACT = 8; // Must match string exactly (case insensitive)
const V_NPC_COND_MATCH_EXACT_CASE = 9; // Must match string exactly (case insensitive)
// ===========================================================================
// NPC Owner Types
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
const V_NPC_OWNER_NONE = 0; // Not owned
const V_NPC_OWNER_PLAYER = 1; // Owned by a player (character/subaccount)
const V_NPC_OWNER_JOB = 2; // Owned by a job
const V_NPC_OWNER_CLAN = 3; // Owned by a clan
const V_NPC_OWNER_FACTION = 4; // Owned by a faction (not used at the moment)
const V_NPC_OWNER_PUBLIC = 5; // Public NPC. Anybody can do stuff with it.
const V_NPC_OWNER_BIZ = 6; // Owned by a business
// ===========================================================================
@@ -57,14 +56,14 @@ class NPCData {
this.fightStyle = 0;
this.health = 100;
this.armour = 100;
this.currentAction = AGRP_NPC_ACTION_NONE;
this.currentAction = V_NPC_ACTION_NONE;
this.triggers = [];
this.typeFlags = 0;
this.heedThreats = false;
this.threats = 0;
this.invincible = false;
this.animationName = "";
this.ownerType = AGRP_NPC_OWNER_NONE;
this.ownerType = V_NPC_OWNER_NONE;
this.ownerId = 0;
this.enabled = false;
@@ -481,11 +480,11 @@ function spawnNPC(npcIndex) {
let ped = createGamePed(npcData.skin, npcData.position, npcData.rotation.z);
if (ped) {
getNPCData(npcIndex).ped = ped;
setEntityData(ped, "agrp.dataIndex", npcIndex, false);
setEntityData(ped, "v.rp.dataIndex", npcIndex, false);
if (npcData.animationName != "") {
let animationId = getAnimationFromParams(npcData.animationName);
if (animationId != false) {
setEntityData(ped, "agrp.anim", animationId, true);
setEntityData(ped, "v.rp.anim", animationId, true);
}
}
setElementDimension(ped, npcData.dimension);
@@ -614,7 +613,7 @@ function setNPCClanCommand(command, params, client) {
return false;
}
getNPCData(closestNPC).ownerType = AGRP_NPC_OWNER_CLAN;
getNPCData(closestNPC).ownerType = V_NPC_OWNER_CLAN;
getNPCData(closestNPC).ownerId = getClanData(clanId).databaseId;
getNPCData(closestNPC).needsSaved = true;
@@ -649,7 +648,7 @@ function toggleNPCLookAtClosestPlayerCommand(command, params, client) {
getNPCData(closestNPC).lookAtClosestPlayer = !getNPCData(closestNPC).lookAtClosestPlayer;
getNPCData(closestNPC).needsSaved = true;
setEntityData(getNPCData(closestNPC).ped, "agrp.lookAtClosestPlayer", getNPCData(closestNPC).lookAtClosestPlayer, true);
setEntityData(getNPCData(closestNPC).ped, "v.rp.lookAtClosestPlayer", getNPCData(closestNPC).lookAtClosestPlayer, true);
forcePlayerToSyncElementProperties(null, getNPCData(closestNPC).ped);
//messagePlayerSuccess(client, getLocaleString(client, "NPCLookAtClosestPlayerSet", `{ALTCOLOUR}${getNPCData(closestNPC).name}{MAINCOLOUR}));
}
@@ -674,28 +673,28 @@ function getNPCInfoCommand(command, params, client) {
let ownerName = "Nobody";
let ownerType = "None";
switch (npcData.ownerType) {
case AGRP_NPC_OWNER_CLAN:
case V_NPC_OWNER_CLAN:
ownerName = getClanData(getClanIndexFromDatabaseId(npcData.ownerId)).name;
ownerType = "clan";
break;
case AGRP_NPC_OWNER_JOB:
case V_NPC_OWNER_JOB:
ownerName = getJobData(getJobIndexFromDatabaseId(npcData.ownerId)).name;
ownerType = "job";
break;
case AGRP_NPC_OWNER_PLAYER:
case V_NPC_OWNER_PLAYER:
let subAccountData = loadSubAccountFromId(npcData.ownerId);
ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`;
ownerType = "player";
break;
case AGRP_NPC_OWNER_BIZ:
case V_NPC_OWNER_BIZ:
ownerName = getBusinessData(getBusinessIdFromDatabaseId(npcData.ownerId)).name;
ownerType = "business";
break;
case AGRP_NPC_OWNER_PUBLIC:
case V_NPC_OWNER_PUBLIC:
ownerName = "Nobody";
ownerType = "public";
break;

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: paintball.js
// DESC: Provides paintball/airsoft arena functions and commands
@@ -13,7 +12,7 @@ let paintBallItems = [];
// ===========================================================================
let paintBallItemNames = {
[AGRP_GAME_GTA_III]: [
[V_GAME_GTA_III]: [
"Colt 45",
"Uzi",
"Shotgun",
@@ -21,7 +20,7 @@ let paintBallItemNames = {
"Sniper Rifle",
],
[AGRP_GAME_GTA_VC]: [
[V_GAME_GTA_VC]: [
"Colt 45",
"Pump Shotgun",
"Ingram",
@@ -30,7 +29,7 @@ let paintBallItemNames = {
"Sniper Rifle",
],
[AGRP_GAME_GTA_SA]: [
[V_GAME_GTA_SA]: [
"Desert Eagle",
"Shotgun",
"MP5",
@@ -38,7 +37,7 @@ let paintBallItemNames = {
"Sniper Rifle",
],
[AGRP_GAME_GTA_IV]: [
[V_GAME_GTA_IV]: [
"Glock 9mm",
"Micro Uzi",
"Stubby Shotgun",
@@ -67,7 +66,7 @@ function startPaintBall(client) {
}
storePlayerItemsInTempLocker(client);
getPlayerData(client).tempLockerType = AGRP_TEMP_LOCKER_TYPE_PAINTBALL;
getPlayerData(client).tempLockerType = V_TEMP_LOCKER_TYPE_PAINTBALL;
getPlayerData(client).inPaintBall = true;
getPlayerData(client).paintBallBusiness = getPlayerBusiness(client);
@@ -114,7 +113,7 @@ function stopPaintBall(client) {
getPlayerData(client).inPaintBall = false;
getPlayerData(client).paintBallBusiness = false;
getPlayerData(client).tempLockerType = AGRP_TEMP_LOCKER_TYPE_NONE;
getPlayerData(client).tempLockerType = V_TEMP_LOCKER_TYPE_NONE;
getPlayerData(client).paintBallKills = 0;
getPlayerData(client).paintBallDeaths = 0;
@@ -128,7 +127,7 @@ function stopPaintBall(client) {
function givePlayerPaintBallItems(client) {
logToConsole(LOG_DEBUG, `[AGRP.PaintBall]: Giving ${getPlayerDisplayForConsole(client)} paintball items ...`);
for (let i in paintBallItems) {
let itemId = createItem(paintBallItems[i], 999999, AGRP_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId);
let itemId = createItem(paintBallItems[i], 999999, V_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId);
getItemData(itemId).needsSaved = false;
getItemData(itemId).databaseId = -1; // Make sure it doesnt save
let freeSlot = getPlayerFirstEmptyHotBarSlot(client);

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: prompt.js
// DESC: Provides prompt (yes/no confirmations) functions and usage
@@ -9,15 +8,15 @@
// ===========================================================================
// Prompts (used for prompt responses)
const AGRP_PROMPT_NONE = 0;
const AGRP_PROMPT_CREATEFIRSTCHAR = 1;
const AGRP_PROMPT_BIZORDER = 2;
const AGRP_PROMPT_GIVEVEHTOCLAN = 3;
const AGRP_PROMPT_GIVEBIZTOCLAN = 4;
const AGRP_PROMPT_GIVEHOUSETOCLAN = 5;
const AGRP_PROMPT_BUYBIZ = 6;
const AGRP_PROMPT_BUYHOUSE = 7;
const AGRP_PROMPT_RESETKEYBINDS = 8;
const V_PROMPT_NONE = 0;
const V_PROMPT_CREATEFIRSTCHAR = 1;
const V_PROMPT_BIZORDER = 2;
const V_PROMPT_GIVEVEHTOCLAN = 3;
const V_PROMPT_GIVEBIZTOCLAN = 4;
const V_PROMPT_GIVEHOUSETOCLAN = 5;
const V_PROMPT_BUYBIZ = 6;
const V_PROMPT_BUYHOUSE = 7;
const V_PROMPT_RESETKEYBINDS = 8;
// ===========================================================================
@@ -29,21 +28,21 @@ function initPromptScript() {
// ===========================================================================
function playerPromptAnswerNo(client) {
if (getPlayerData(client).promptType == AGRP_PROMPT_NONE) {
if (getPlayerData(client).promptType == V_PROMPT_NONE) {
return false;
}
logToConsole(LOG_DEBUG, `[AGRP.Prompt] ${getPlayerDisplayForConsole(client)} answered NO to their prompt (${getPlayerData(client).promptType})`);
switch (getPlayerData(client).promptType) {
case AGRP_PROMPT_CREATEFIRSTCHAR:
case V_PROMPT_CREATEFIRSTCHAR:
logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} chose not to create a first character. Kicking them from the server ...`);
showPlayerErrorGUI(client, getLocaleString(client, "DidNotCreateCharacter"), getLocaleString(client, getLocaleString(client, "GUIWarningTitle")));
getPlayerData(targetClient).customDisconnectReason = "FailedToCreateCharacter";
setTimeout(function () { disconnectPlayer(client); }, 5000);
break;
case AGRP_PROMPT_BIZORDER:
case V_PROMPT_BIZORDER:
if (getPlayerData(client).businessOrderAmount > 0) {
if (doesPlayerUseGUI(client)) {
showPlayerErrorGUI(client, getLocaleString(client, "BusinessOrderCanceled"), getLocaleString(client, "GUIWarning"));
@@ -62,25 +61,25 @@ function playerPromptAnswerNo(client) {
break;
}
getPlayerData(client).promptType = AGRP_PROMPT_NONE;
getPlayerData(client).promptType = V_PROMPT_NONE;
}
// ===========================================================================
function playerPromptAnswerYes(client) {
if (getPlayerData(client).promptType == AGRP_PROMPT_NONE) {
if (getPlayerData(client).promptType == V_PROMPT_NONE) {
return false;
}
logToConsole(LOG_DEBUG, `[AGRP.Prompt] ${getPlayerDisplayForConsole(client)} answered YES to their prompt (${getPlayerData(client).promptType})`);
switch (getPlayerData(client).promptType) {
case AGRP_PROMPT_CREATEFIRSTCHAR: {
case V_PROMPT_CREATEFIRSTCHAR: {
showPlayerNewCharacterGUI(client);
break;
}
case AGRP_PROMPT_BIZORDER: {
case V_PROMPT_BIZORDER: {
if (getPlayerData(client).businessOrderAmount > 0) {
if (getBusinessData(getPlayerData(client).businessOrderBusiness).till < getPlayerData(client).businessOrderCost) {
logToConsole(LOG_DEBUG, `[AGRP.Prompt] ${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)`);
@@ -97,7 +96,7 @@ function playerPromptAnswerYes(client) {
logToConsole(LOG_DEBUG, `[AGRP.Prompt] ${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, getLocaleString(client, "BusinessOrderSuccessInfo", getPlayerData(client).businessOrderAmount, getItemTypeData(getPlayerData(client).businessOrderItem).name, getItemValueDisplay(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue), getPlayerData(client).businessOrderCost), getLocaleString(client, "GUIInfoTitle"));
createItem(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue, AGRP_ITEM_OWNER_BIZFLOOR, getBusinessData(getPlayerData(client).businessOrderBusiness).databaseId, getPlayerData(client).businessOrderAmount);
createItem(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue, V_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);
@@ -112,7 +111,7 @@ function playerPromptAnswerYes(client) {
break;
}
case AGRP_PROMPT_GIVEVEHTOCLAN: {
case V_PROMPT_GIVEVEHTOCLAN: {
if (!isPlayerInAnyVehicle(client)) {
messagePlayerError(client, getLocaleString(client, "MustBeInVehicle"));
return false;
@@ -123,7 +122,7 @@ function playerPromptAnswerYes(client) {
return false;
}
if (getVehicleData(getPlayerVehicle(client)).ownerType != AGRP_VEHOWNER_PLAYER) {
if (getVehicleData(getPlayerVehicle(client)).ownerType != V_VEHOWNER_PLAYER) {
messagePlayerError(client, getLocaleString(client, "MustOwnVehicle"));
return false;
}
@@ -133,21 +132,21 @@ function playerPromptAnswerYes(client) {
return false;
}
getVehicleData(getPlayerVehicle(client)).ownerType = AGRP_VEHOWNER_CLAN;
getVehicleData(getPlayerVehicle(client)).ownerType = V_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 AGRP_PROMPT_GIVEHOUSETOCLAN: {
case V_PROMPT_GIVEHOUSETOCLAN: {
let houseId = getPlayerHouse(client);
if (!houseId) {
messagePlayerError(client, getLocaleString(client, "InvalidHouse"));
return false;
}
if (getHouseData(houseId).ownerType != AGRP_VEHOWNER_PLAYER) {
if (getHouseData(houseId).ownerType != V_VEHOWNER_PLAYER) {
messagePlayerError(client, getLocaleString(client, "MustOwnHouse"));
return false;
}
@@ -157,21 +156,21 @@ function playerPromptAnswerYes(client) {
return false;
}
getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_CLAN;
getHouseData(houseId).ownerType = V_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 AGRP_PROMPT_GIVEBIZTOCLAN: {
case V_PROMPT_GIVEBIZTOCLAN: {
let businessId = getPlayerBusiness(client);
if (!businessId) {
messagePlayerError(client, getLocaleString(client, "InvalidBusiness"));
return false;
}
if (getBusinessData(businessId).ownerType != AGRP_VEHOWNER_PLAYER) {
if (getBusinessData(businessId).ownerType != V_VEHOWNER_PLAYER) {
messagePlayerError(client, getLocaleString(client, "MustOwnBusiness"));
return false;
}
@@ -181,14 +180,14 @@ function playerPromptAnswerYes(client) {
return false;
}
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_CLAN;
getBusinessData(businessId).ownerType = V_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 AGRP_PROMPT_BUYHOUSE: {
case V_PROMPT_BUYHOUSE: {
let houseId = getPlayerHouse(client);
if (!houseId) {
messagePlayerError(client, getLocaleString(client, "InvalidHouse"));
@@ -205,7 +204,7 @@ function playerPromptAnswerYes(client) {
return false;
}
getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_PLAYER;
getHouseData(houseId).ownerType = V_HOUSE_OWNER_PLAYER;
getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(client).databaseId;
getHouseData(houseId).buyPrice = 0;
getHouseData(houseId).needsSaved = true;
@@ -216,7 +215,7 @@ function playerPromptAnswerYes(client) {
break;
}
case AGRP_PROMPT_BUYBIZ: {
case V_PROMPT_BUYBIZ: {
let businessId = getPlayerBusiness(client);
if (!businessId) {
messagePlayerError(client, getLocaleString(client, "InvalidBusiness"));
@@ -233,7 +232,7 @@ function playerPromptAnswerYes(client) {
return false;
}
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_PLAYER;
getBusinessData(businessId).ownerType = V_BIZ_OWNER_PLAYER;
getBusinessData(businessId).ownerId = getPlayerCurrentSubAccount(client).databaseId;
getBusinessData(businessId).buyPrice = 0;
getBusinessData(businessId).needsSaved = true;
@@ -245,7 +244,7 @@ function playerPromptAnswerYes(client) {
break;
}
case AGRP_PROMPT_RESETKEYBINDS: {
case V_PROMPT_RESETKEYBINDS: {
// TODO: Needs database query!
//for (let i in getPlayerData(client).keyBinds) {
@@ -265,7 +264,7 @@ function playerPromptAnswerYes(client) {
break;
}
case AGRP_PROMPT_COPYKEYBINDSTOSERVER: {
case V_PROMPT_COPYKEYBINDSTOSERVER: {
//messagePlayerSuccess(client, getLocaleString(client, "KeyBindsCopiedToServer", serverName));
break;
}
@@ -277,7 +276,7 @@ function playerPromptAnswerYes(client) {
}
}
getPlayerData(client).promptType = AGRP_PROMPT_NONE;
getPlayerData(client).promptType = V_PROMPT_NONE;
}
// ===========================================================================
@@ -295,7 +294,7 @@ function playerPromptAnswerNoCommand(command, params, client) {
// ===========================================================================
function showPlayerTwoFactorAuthenticationGUI(client) {
sendNetworkEventToPlayer("agrp.2fa", client);
sendNetworkEventToPlayer("v.rp.2fa", client);
}
// ===========================================================================

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: property.js
// DESC: Provides property (house, business, etc) with functions and usage
@@ -9,35 +8,35 @@
// ===========================================================================
// Property Types
const AGRP_PROP_TYPE_NONE = 0; // None (invalid)
const AGRP_PROP_TYPE_BIZ_NORMAL = 1; // Normal business (sells items)
const AGRP_PROP_TYPE_BIZ_BANK = 2; // Bank business
const AGRP_PROP_TYPE_BIZ_PUBLIC = 3; // Public business (Government, public service, etc)
const AGRP_PROP_TYPE_BIZ_PAINTBALL = 4; // Paintball arena. Player joins paintball/airsoft when they enter
const AGRP_PROP_TYPE_BIZ_DEALERSHIP = 5; // Vehicle Dealership (also for airplane, boat, etc)
const AGRP_PROP_TYPE_HOUSE = 6; // House
const V_PROP_TYPE_NONE = 0; // None (invalid)
const V_PROP_TYPE_BIZ_NORMAL = 1; // Normal business (sells items)
const V_PROP_TYPE_BIZ_BANK = 2; // Bank business
const V_PROP_TYPE_BIZ_PUBLIC = 3; // Public business (Government, public service, etc)
const V_PROP_TYPE_BIZ_PAINTBALL = 4; // Paintball arena. Player joins paintball/airsoft when they enter
const V_PROP_TYPE_BIZ_DEALERSHIP = 5; // Vehicle Dealership (also for airplane, boat, etc)
const V_PROP_TYPE_HOUSE = 6; // House
// ===========================================================================
// Property Location Types
const AGRP_PROP_LOC_NONE = 0; // None
const AGRP_PROP_LOC_GATE = 1; // Moveable gate that belongs to the property
const AGRP_PROP_LOC_GARAGE = 2; // Location for attached garage (pos1 = outside, pos2 = inside). Use pos to teleport or spawn veh/ped
const AGRP_PROP_LOC_FUEL = 3; // Fuel pump
const AGRP_PROP_LOC_DRIVETHRU = 4; // Drivethrough
const AGRP_PROP_LOC_VENDMACHINE = 5; // Vending machine
const AGRP_PROP_LOC_ATM = 6; // ATM
const AGRP_PROP_LOC_PAYPHONE = 7; // Payphone
const V_PROP_LOC_NONE = 0; // None
const V_PROP_LOC_GATE = 1; // Moveable gate that belongs to the property
const V_PROP_LOC_GARAGE = 2; // Location for attached garage (pos1 = outside, pos2 = inside). Use pos to teleport or spawn veh/ped
const V_PROP_LOC_FUEL = 3; // Fuel pump
const V_PROP_LOC_DRIVETHRU = 4; // Drivethrough
const V_PROP_LOC_VENDMACHINE = 5; // Vending machine
const V_PROP_LOC_ATM = 6; // ATM
const V_PROP_LOC_PAYPHONE = 7; // Payphone
// ===========================================================================
// Property Owner Types
const AGRP_PROP_OWNER_NONE = 0; // Not owned
const AGRP_PROP_OWNER_PLAYER = 1; // Owned by a player (character/subaccount)
const AGRP_PROP_OWNER_JOB = 2; // Owned by a job
const AGRP_PROP_OWNER_CLAN = 3; // Owned by a clan
const AGRP_PROP_OWNER_FACTION = 4; // Owned by a faction (not used at the moment)
const AGRP_PROP_OWNER_PUBLIC = 5; // Public property. Used for goverment/official places like police, fire, city hall, DMV, etc
const V_PROP_OWNER_NONE = 0; // Not owned
const V_PROP_OWNER_PLAYER = 1; // Owned by a player (character/subaccount)
const V_PROP_OWNER_JOB = 2; // Owned by a job
const V_PROP_OWNER_CLAN = 3; // Owned by a clan
const V_PROP_OWNER_FACTION = 4; // Owned by a faction (not used at the moment)
const V_PROP_OWNER_PUBLIC = 5; // Public property. Used for goverment/official places like police, fire, city hall, DMV, etc
// ===========================================================================
@@ -49,7 +48,7 @@ class PropertyData {
constructor(dbAssoc = false) {
this.databaseId = 0;
this.name = "";
this.ownerType = AGRP_PROP_OWNER_NONE;
this.ownerType = V_PROP_OWNER_NONE;
this.ownerId = 0;
this.buyPrice = 0;
this.locked = false;
@@ -57,7 +56,7 @@ class PropertyData {
this.index = -1;
this.needsSaved = false;
this.interiorLights = true;
this.propertyType = AGRP_PROP_TYPE_NONE;
this.propertyType = V_PROP_TYPE_NONE;
this.entrancePosition = false;
this.entranceRotation = 0.0;
@@ -82,7 +81,7 @@ class PropertyData {
this.streamingRadioStation = 0;
this.streamingRadioStationIndex = -1;
this.labelHelpType = AGRP_PROPLABEL_INFO_NONE;
this.labelHelpType = V_PROPLABEL_INFO_NONE;
if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["prop_id"]);
@@ -353,7 +352,7 @@ function setPropertyNameCommand(command, params, client) {
let oldPropertyName = getPropertyData(propertyIndex).name;
getPropertyData(propertyIndex).name = newPropertyName;
setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.label.name", getPropertyData(propertyIndex).name, true);
setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.label.name", getPropertyData(propertyIndex).name, true);
getPropertyData(propertyIndex).needsSaved = true;
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} renamed property ${getInlinePropertyColour(propertyIndex)}${oldPropertyName}{MAINCOLOUR} to ${getInlinePropertyColour(propertyIndex)}${newPropertyName}`);
}
@@ -384,7 +383,7 @@ function setPropertyOwnerCommand(command, params, client) {
return false;
}
getPropertyData(propertyIndex).ownerType = AGRP_BIZ_OWNER_PLAYER;
getPropertyData(propertyIndex).ownerType = V_BIZ_OWNER_PLAYER;
getPropertyData(propertyIndex).ownerId = getPlayerCurrentSubAccount(newPropertyOwner).databaseId;
getPropertyData(propertyIndex).needsSaved = true;
@@ -417,7 +416,7 @@ function setPropertyJobCommand(command, params, client) {
return false;
}
getPropertyData(propertyIndex).ownerType = AGRP_BIZ_OWNER_JOB;
getPropertyData(propertyIndex).ownerType = V_BIZ_OWNER_JOB;
getPropertyData(propertyIndex).ownerId = getJobData(jobId).databaseId;
getPropertyData(propertyIndex).needsSaved = true;
@@ -441,7 +440,7 @@ function setPropertyClanCommand(command, params, client) {
return false;
}
if (getPropertyData(business).ownerType != AGRP_VEHOWNER_PLAYER) {
if (getPropertyData(business).ownerType != V_VEHOWNER_PLAYER) {
messagePlayerError(client, getLocaleString(client, "MustOwnProperty"));
return false;
}
@@ -452,9 +451,9 @@ function setPropertyClanCommand(command, params, client) {
}
showPlayerPrompt(client, getLocaleString(client, "SetPropertyClanConfirmMessage"), getLocaleString(client, "SetPropertyClanConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
getPlayerData(client).promptType = AGRP_PROMPT_BIZGIVETOCLAN;
getPlayerData(client).promptType = V_PROMPT_BIZGIVETOCLAN;
//getPropertyData(propertyIndex).ownerType = AGRP_BIZ_OWNER_CLAN;
//getPropertyData(propertyIndex).ownerType = V_BIZ_OWNER_CLAN;
//getPropertyData(propertyIndex).ownerId = getClanData(clanId).databaseId;
//getPropertyData(propertyIndex).needsSaved = true;
}
@@ -476,7 +475,7 @@ function setPropertyRankCommand(command, params, client) {
return false;
}
if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_CLAN) {
if (getVehicleData(vehicle).ownerType == V_VEHOWNER_CLAN) {
let clanId = getClanIndexFromDatabaseId(getPropertyData(propertyIndex).ownerId);
rankId = getClanRankFromParams(clanId, params);
if (!getClanRankData(clanId, rankId)) {
@@ -485,7 +484,7 @@ function setPropertyRankCommand(command, params, client) {
}
getPropertyData(propertyIndex).rank = getClanRankData(clanId, rankId).databaseId;
messagePlayerSuccess(client, `{MAINCOLOUR}You set property ${getInlinePropertyColour(propertyIndex)}${getPropertyData(propertyIndex).name} {MAINCOLOUR}rank to {ALTCOLOUR}${getClanRankData(clanId, rankId).name} {MAINCOLOUR}of the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan!`);
} else if (getPropertyData(propertyIndex).ownerType == AGRP_VEHOWNER_JOB) {
} else if (getPropertyData(propertyIndex).ownerType == V_VEHOWNER_JOB) {
getPropertyData(propertyIndex).rank = rankId;
messagePlayerSuccess(client, `{MAINCOLOUR}You set property ${getInlinePropertyColour(propertyIndex)}${getPropertyData(propertyIndex).name} {MAINCOLOUR}rank to {ALTCOLOUR}${rankId} {MAINCOLOUR}of the {jobYellow}${getJobData(getJobIdFromDatabaseId(getPropertyData(propertyIndex).ownerId)).name} {MAINCOLOUR}job!`);
}
@@ -564,7 +563,7 @@ function setPropertyJobCommand(command, params, client) {
return false;
}
getPropertyData(propertyIndex).ownerType = AGRP_BIZ_OWNER_JOB;
getPropertyData(propertyIndex).ownerType = V_BIZ_OWNER_JOB;
getPropertyData(propertyIndex).ownerId = getJobData(jobId).databaseId;
getPropertyData(propertyIndex).needsSaved = true;
@@ -585,7 +584,7 @@ function setPropertyPublicCommand(command, params, client) {
return false;
}
getPropertyData(propertyIndex).ownerType = AGRP_BIZ_OWNER_PUBLIC;
getPropertyData(propertyIndex).ownerType = V_BIZ_OWNER_PUBLIC;
getPropertyData(propertyIndex).ownerId = 0;
getPropertyData(propertyIndex).needsSaved = true;
@@ -606,7 +605,7 @@ function removePropertyOwnerCommand(command, params, client) {
return false;
}
getPropertyData(propertyIndex).ownerType = AGRP_BIZ_OWNER_NONE;
getPropertyData(propertyIndex).ownerType = V_BIZ_OWNER_NONE;
getPropertyData(propertyIndex).ownerId = -1;
getPropertyData(propertyIndex).needsSaved = true;
@@ -671,7 +670,7 @@ function setPropertyPaintBallCommand(command, params, client) {
return false;
}
getPropertyData(propertyIndex).type = AGRP_BIZ_TYPE_PAINTBALL;
getPropertyData(propertyIndex).type = V_BIZ_TYPE_PAINTBALL;
getPropertyData(propertyIndex).needsSaved = true;
messagePlayerSuccess(client, getLocaleString(client, "PropertyIsNowPaintBall"));
}
@@ -694,24 +693,24 @@ function getPropertyInfoCommand(command, params, client) {
let ownerName = "Unknown";
switch (propertyData.ownerType) {
case AGRP_BIZ_OWNER_CLAN:
case V_BIZ_OWNER_CLAN:
ownerName = getClanData(propertyData.ownerId).name;
break;
case AGRP_BIZ_OWNER_JOB:
case V_BIZ_OWNER_JOB:
ownerName = getJobData(propertyData.ownerId).name;
break;
case AGRP_BIZ_OWNER_PLAYER:
case V_BIZ_OWNER_PLAYER:
let subAccountData = loadSubAccountFromId(propertyData.ownerId);
ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`;
break;
case AGRP_BIZ_OWNER_PUBLIC:
case V_BIZ_OWNER_PUBLIC:
ownerName = "Public";
break;
case AGRP_BIZ_OWNER_NONE:
case V_BIZ_OWNER_NONE:
//submitBugReport(client, `[AUTOMATED REPORT] getPropertyInfoCommand() - Invalid ownerType for business ${propertyIndex}/${getPropertyData(propertyIndex).databaseId}`);
ownerName = "None";
break;
@@ -1014,7 +1013,7 @@ function giveDefaultItemsToPropertyCommand(command, params, client) {
let itemTypeId = getItemTypeFromParams(getGameConfig().defaultPropertyItems[getGame()][typeParam][i][0]);
let itemTypeData = getItemTypeData(itemTypeId);
if (itemTypeData) {
let newItemIndex = createItem(itemTypeId, itemTypeData.orderValue, AGRP_ITEM_OWNER_BIZFLOOR, getPropertyData(propertyIndex).databaseId, getGameConfig().defaultPropertyItems[getGame()][typeParam][i][1]);
let newItemIndex = createItem(itemTypeId, itemTypeData.orderValue, V_ITEM_OWNER_BIZFLOOR, getPropertyData(propertyIndex).databaseId, getGameConfig().defaultPropertyItems[getGame()][typeParam][i][1]);
getItemData(newItemIndex).buyPrice = applyServerInflationMultiplier(itemTypeData.orderPrice) * getGameConfig().defaultPropertyItems[getGame()][typeParam][i][2];
}
}
@@ -1034,8 +1033,8 @@ function setPropertyDealershipCommand(command, params, client) {
return false;
}
getPropertyData(propertyIndex).labelHelpType == AGRP_PROPLABEL_INFO_ENTERVEHICLE;
getPropertyData(propertyIndex).type = AGRP_BIZ_TYPE_DEALERSHIP;
getPropertyData(propertyIndex).labelHelpType == V_PROPLABEL_INFO_ENTERVEHICLE;
getPropertyData(propertyIndex).type = V_BIZ_TYPE_DEALERSHIP;
updatePropertyPickupLabelData(propertyIndex);
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set the property type of ${getInlinePropertyColour(propertyIndex)}${getPropertyData(propertyIndex).name}{MAINCOLOUR} to dealership`);
}
@@ -1141,7 +1140,7 @@ function setPropertyBuyPriceCommand(command, params, client) {
}
getPropertyData(propertyIndex).buyPrice = amount;
setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.label.price", getPropertyData(propertyIndex).buyPrice, true);
setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.label.price", getPropertyData(propertyIndex).buyPrice, true);
getPropertyData(propertyIndex).needsSaved = true;
messagePlayerSuccess(client, `{MAINCOLOUR}You set property ${getInlinePropertyColour(propertyIndex)}${getPropertyData(propertyIndex).name}'s{MAINCOLOUR} for-sale price to {ALTCOLOUR}${getCurrencyString(amount)}`);
@@ -1223,7 +1222,7 @@ function orderItemForPropertyCommand(command, params, client) {
let orderTotalCost = pricePerItem * amount;
//getPlayerData(client).promptType = AGRP_PROMPT_BIZORDER;
//getPlayerData(client).promptType = V_PROMPT_BIZORDER;
getPlayerData(client).businessOrderAmount = amount;
getPlayerData(client).businessOrderProperty = propertyIndex;
getPlayerData(client).businessOrderItem = itemType;
@@ -1232,7 +1231,7 @@ function orderItemForPropertyCommand(command, params, client) {
getPropertyData(propertyIndex).needsSaved = true;
showPlayerPrompt(client, `Ordering ${amount} ${getPluralForm(getItemTypeData(itemType).name)} (${getItemValueDisplay(itemType, value)}) at ${getCurrencyString(pricePerItem)} each will cost a total of ${getCurrencyString(orderTotalCost)}`, "Property Order Cost");
getPlayerData(client).promptType = AGRP_PROMPT_BIZORDER;
getPlayerData(client).promptType = V_PROMPT_BIZORDER;
}
// ===========================================================================
@@ -1292,7 +1291,7 @@ function buyPropertyCommand(command, params, client) {
}
showPlayerPrompt(client, getLocaleString(client, "BuyPropertyConfirmMessage"), getLocaleString(client, "BuyPropertyConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
getPlayerData(client).promptType = AGRP_PROMPT_BIZBUY;
getPlayerData(client).promptType = V_PROMPT_BIZBUY;
}
// ===========================================================================
@@ -1578,7 +1577,7 @@ function createPropertyEntrancePickup(propertyIndex) {
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating entrance pickup for property ${propertyData.name}`);
if (areServerElementsSupported() && getGame() != AGRP_GAME_MAFIA_ONE) {
if (areServerElementsSupported() && getGame() != V_GAME_MAFIA_ONE) {
let entrancePickup = null;
if (isGameFeatureSupported("pickup")) {
let pickupModelId = getGameConfig().pickupModels[getGame()].Property;
@@ -1859,17 +1858,17 @@ function exitProperty(client) {
function getPropertyOwnerTypeText(ownerType) {
switch (ownerType) {
case AGRP_BIZ_OWNER_CLAN:
case V_BIZ_OWNER_CLAN:
return "clan";
case AGRP_BIZ_OWNER_JOB:
case V_BIZ_OWNER_JOB:
return "job";
case AGRP_BIZ_OWNER_PLAYER:
case V_BIZ_OWNER_PLAYER:
return "player";
case AGRP_BIZ_OWNER_NONE:
case AGRP_BIZ_OWNER_PUBLIC:
case V_BIZ_OWNER_NONE:
case V_BIZ_OWNER_PUBLIC:
return "not owned";
default:
@@ -2003,7 +2002,7 @@ function setPropertyDataIndexes() {
//}
for (let j in getServerData().properties[i].locations) {
if (getServerData().properties[i].locations[j].type == AGRP_BIZ_LOC_ATM) {
if (getServerData().properties[i].locations[j].type == V_BIZ_LOC_ATM) {
getServerData().atmLocationCache.push([i, j, getServerData().properties[i].locations[j].position]);
}
}
@@ -2019,7 +2018,7 @@ function addToPropertyInventory(propertyIndex, itemType, amount, buyPrice) {
tempItemData.buyPrice = buyPrice;
tempItemData.itemType = getItemTypeData(itemType).databaseId;
tempItemData.ownerId = getPropertyData(propertyIndex).databaseId;
tempItemData.ownerType = AGRP_ITEMOWNER_BIZ;
tempItemData.ownerType = V_ITEMOWNER_BIZ;
tempItemData.ownerIndex = propertyIndex;
tempItemData.itemTypeIndex = itemType;
saveItemToDatabase(tempItemData);
@@ -2102,7 +2101,7 @@ function buyFromPropertyCommand(command, params, client) {
}
takePlayerCash(client, totalCost);
createItem(getItemData(getPropertyData(propertyIndex).floorItemCache[itemSlot - 1]).itemTypeIndex, getItemData(getPropertyData(propertyIndex).floorItemCache[itemSlot - 1]).value, AGRP_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId, amount);
createItem(getItemData(getPropertyData(propertyIndex).floorItemCache[itemSlot - 1]).itemTypeIndex, getItemData(getPropertyData(propertyIndex).floorItemCache[itemSlot - 1]).value, V_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId, amount);
cachePlayerHotBarItems(client);
getPropertyData(propertyIndex).till = getPropertyData(propertyIndex).till + totalCost;
@@ -2112,7 +2111,7 @@ function buyFromPropertyCommand(command, params, client) {
}
let useType = getItemTypeData(getItemData(getPropertyData(propertyIndex).floorItemCache[itemSlot - 1]).itemTypeIndex).useType;
if (useType == AGRP_ITEM_USE_TYPE_WEAPON || AGRP_ITEM_USE_TYPE_TAZER || useType == AGRP_ITEM_USE_TYPE_AMMO_CLIP) {
if (useType == V_ITEM_USE_TYPE_WEAPON || V_ITEM_USE_TYPE_TAZER || useType == V_ITEM_USE_TYPE_AMMO_CLIP) {
if (isPlayerWeaponBanned(client) && !isPlayerExemptFromAntiCheat(client)) {
messagePlayerError(client, getLocaleString(client, "WeaponBanned"));
return false;
@@ -2197,7 +2196,7 @@ function storeItemInPropertyStorageCommand(command, params, client) {
return false;
}
getItemData(getPropertyData(propertyIndex).floorItemCache[itemSlot - 1]).ownerType = AGRP_ITEM_OWNER_BIZSTORAGE;
getItemData(getPropertyData(propertyIndex).floorItemCache[itemSlot - 1]).ownerType = V_ITEM_OWNER_BIZSTORAGE;
getPropertyData(propertyIndex).storageItemCache[firstSlot] = getPropertyData(propertyIndex).floorItemCache[itemSlot - 1];
getPropertyData(propertyIndex).storageItemCache[itemSlot - 1] = -1;
messagePlayerSuccess(client, `You moved the ${getItemTypeData(getItemData(getPropertyData(propertyIndex).storageItemCache[firstSlot]).itemTypeIndex).name}s in slot ${itemSlot} to the business storage in slot ${firstSlot}`);
@@ -2232,7 +2231,7 @@ function stockItemOnPropertyFloorCommand(command, params, client) {
return false;
}
getItemData(getPropertyData(propertyIndex).storageItemCache[itemSlot - 1]).ownerType = AGRP_ITEM_OWNER_BIZFLOOR;
getItemData(getPropertyData(propertyIndex).storageItemCache[itemSlot - 1]).ownerType = V_ITEM_OWNER_BIZFLOOR;
getPropertyData(propertyIndex).floorItemCache[firstSlot] = getPropertyData(propertyIndex).storageItemCache[itemSlot - 1];
getPropertyData(propertyIndex).storageItemCache[itemSlot - 1] = -1;
messagePlayerSuccess(client, `You moved the ${getItemTypeData(getItemData(getPropertyData(propertyIndex).storageItemCache[firstSlot]).itemTypeIndex).name}s in slot ${itemSlot} of the business storage to the business floor slot ${firstSlot}`);
@@ -2272,14 +2271,14 @@ function cachePropertyItems(propertyIndex) {
//let propertyData = getPropertyData(propertyIndex);
//logToConsole(LOG_VERBOSE, `[AGRP.Property] Caching business items for business ${propertyIndex} (${propertyData.name}) ...`);
//getPropertyData(propertyIndex).floorItemCache = getServerData().items.filter(item => item.ownerType == AGRP_ITEM_OWNER_BIZFLOOR && item.ownerId == propertyData.databaseId).map(i => i.index);
//getPropertyData(propertyIndex).storageItemCache = getServerData().items.filter(item => item.ownerType == AGRP_ITEM_OWNER_BIZSTORAGE && item.ownerId == propertyData.databaseId);
//getPropertyData(propertyIndex).floorItemCache = getServerData().items.filter(item => item.ownerType == V_ITEM_OWNER_BIZFLOOR && item.ownerId == propertyData.databaseId).map(i => i.index);
//getPropertyData(propertyIndex).storageItemCache = getServerData().items.filter(item => item.ownerType == V_ITEM_OWNER_BIZSTORAGE && item.ownerId == propertyData.databaseId);
logToConsole(LOG_VERBOSE, `[AGRP.Property] Caching business items for business ${propertyIndex} (${getPropertyData(propertyIndex).name}) ...`);
for (let i in getServerData().items) {
if (getItemData(i).ownerType == AGRP_ITEM_OWNER_BIZFLOOR && getItemData(i).ownerId == getPropertyData(propertyIndex).databaseId) {
if (getItemData(i).ownerType == V_ITEM_OWNER_BIZFLOOR && getItemData(i).ownerId == getPropertyData(propertyIndex).databaseId) {
getPropertyData(propertyIndex).floorItemCache.push(i);
} else if (getItemData(i).ownerType == AGRP_ITEM_OWNER_BIZSTORAGE && getItemData(i).ownerId == getPropertyData(propertyIndex).databaseId) {
} else if (getItemData(i).ownerType == V_ITEM_OWNER_BIZSTORAGE && getItemData(i).ownerId == getPropertyData(propertyIndex).databaseId) {
getPropertyData(propertyIndex).storageItemCache.push(i);
}
}
@@ -2303,50 +2302,50 @@ function updatePropertyPickupLabelData(propertyIndex) {
}
if (getPropertyData(propertyIndex).exitPickup != null) {
setEntityData(getPropertyData(propertyIndex).exitPickup, "agrp.owner.type", AGRP_PICKUP_BUSINESS_EXIT, false);
setEntityData(getPropertyData(propertyIndex).exitPickup, "agrp.owner.id", propertyIndex, false);
setEntityData(getPropertyData(propertyIndex).exitPickup, "agrp.label.type", AGRP_LABEL_EXIT, true);
setEntityData(getPropertyData(propertyIndex).exitPickup, "v.rp.owner.type", V_PICKUP_BUSINESS_EXIT, false);
setEntityData(getPropertyData(propertyIndex).exitPickup, "v.rp.owner.id", propertyIndex, false);
setEntityData(getPropertyData(propertyIndex).exitPickup, "v.rp.label.type", V_LABEL_EXIT, true);
}
if (getPropertyData(propertyIndex).entrancePickup != null) {
setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.owner.type", AGRP_PICKUP_BUSINESS_ENTRANCE, false);
setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.owner.id", propertyIndex, false);
setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.label.type", AGRP_LABEL_BUSINESS, true);
setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.label.name", getPropertyData(propertyIndex).name, true);
setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.label.locked", getPropertyData(propertyIndex).locked, true);
setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_NONE, true);
setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.owner.type", V_PICKUP_BUSINESS_ENTRANCE, false);
setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.owner.id", propertyIndex, false);
setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.label.type", V_LABEL_BUSINESS, true);
setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.label.name", getPropertyData(propertyIndex).name, true);
setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.label.locked", getPropertyData(propertyIndex).locked, true);
setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_NONE, true);
switch (getPropertyData(propertyIndex).labelHelpType) {
case AGRP_PROPLABEL_INFO_ENTERVEHICLE: {
setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTERVEHICLE, true);
case V_PROPLABEL_INFO_ENTERVEHICLE: {
setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_ENTERVEHICLE, true);
break;
}
case AGRP_PROPLABEL_INFO_ENTER: {
setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTER, true);
case V_PROPLABEL_INFO_ENTER: {
setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_ENTER, true);
break;
}
case AGRP_PROPLABEL_INFO_REPAIR: {
setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_REPAIR, true);
case V_PROPLABEL_INFO_REPAIR: {
setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_REPAIR, true);
break;
}
default: {
if (getPropertyData(propertyIndex).hasInterior) {
setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTER, true);
setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_ENTER, true);
} else {
if (doesPropertyHaveAnyItemsToBuy(propertyIndex)) {
setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_BUY, true);
setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_BUY, true);
} else {
removeEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.label.help");
removeEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.label.help");
}
}
break;
}
}
setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.label.price", getPropertyData(propertyIndex).buyPrice, true);
setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.label.price", getPropertyData(propertyIndex).buyPrice, true);
}
}
@@ -2424,7 +2423,7 @@ function doesPropertyHaveAnyItemsToBuy(propertyIndex) {
//function clearPlayerPropertyGameScripts(client, propertyIndex) {
// for(let i in getPropertyData(propertyIndex).gameScripts) {
// sendPlayerGameScriptState(client, AGRP_GAMESCRIPT_DENY);
// sendPlayerGameScriptState(client, V_GAMESCRIPT_DENY);
// }
//}
@@ -2446,11 +2445,11 @@ function canPlayerWithdrawFromPropertyTill(client, propertyIndex) {
return true;
}
if (getPropertyData(propertyIndex).ownerType == AGRP_BIZ_OWNER_PLAYER && getPropertyData(propertyIndex).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
if (getPropertyData(propertyIndex).ownerType == V_BIZ_OWNER_PLAYER && getPropertyData(propertyIndex).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
return true;
}
if (getPropertyData(propertyIndex).ownerType == AGRP_BIZ_OWNER_CLAN && getPropertyData(propertyIndex).ownerId == getClanData(getPlayerClan(client)).databaseId) {
if (getPropertyData(propertyIndex).ownerType == V_BIZ_OWNER_CLAN && getPropertyData(propertyIndex).ownerId == getClanData(getPlayerClan(client)).databaseId) {
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManagePropertyes"))) {
return true;
}
@@ -2466,11 +2465,11 @@ function canPlayerSetPropertyInteriorLights(client, propertyIndex) {
return true;
}
if (getPropertyData(propertyIndex).ownerType == AGRP_BIZ_OWNER_PLAYER && getPropertyData(propertyIndex).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
if (getPropertyData(propertyIndex).ownerType == V_BIZ_OWNER_PLAYER && getPropertyData(propertyIndex).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
return true;
}
if (getPropertyData(propertyIndex).ownerType == AGRP_BIZ_OWNER_CLAN && getPropertyData(propertyIndex).ownerId == getClanData(getPlayerClan(client)).databaseId) {
if (getPropertyData(propertyIndex).ownerType == V_BIZ_OWNER_CLAN && getPropertyData(propertyIndex).ownerId == getClanData(getPlayerClan(client)).databaseId) {
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManagePropertyes"))) {
return true;
}
@@ -2486,11 +2485,11 @@ function canPlayerLockUnlockProperty(client, propertyIndex) {
return true;
}
if (getPropertyData(propertyIndex).ownerType == AGRP_BIZ_OWNER_PLAYER && getPropertyData(propertyIndex).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
if (getPropertyData(propertyIndex).ownerType == V_BIZ_OWNER_PLAYER && getPropertyData(propertyIndex).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
return true;
}
if (getPropertyData(propertyIndex).ownerType == AGRP_BIZ_OWNER_CLAN && getPropertyData(propertyIndex).ownerId == getClanData(getPlayerClan(client)).databaseId) {
if (getPropertyData(propertyIndex).ownerType == V_BIZ_OWNER_CLAN && getPropertyData(propertyIndex).ownerId == getClanData(getPlayerClan(client)).databaseId) {
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManagePropertyes"))) {
return true;
}
@@ -2506,13 +2505,13 @@ function canPlayerManageProperty(client, propertyIndex) {
return true;
}
if (getPropertyData(propertyIndex).ownerType == AGRP_BIZ_OWNER_PLAYER) {
if (getPropertyData(propertyIndex).ownerType == V_BIZ_OWNER_PLAYER) {
if (getPropertyData(propertyIndex).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
return true;
}
}
if (getPropertyData(propertyIndex).ownerType == AGRP_BIZ_OWNER_CLAN) {
if (getPropertyData(propertyIndex).ownerType == V_BIZ_OWNER_CLAN) {
if (getPropertyData(propertyIndex).ownerId == getPlayerClan(client)) {
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManagePropertyes"))) {
return true;
@@ -2634,7 +2633,7 @@ function doesPropertyHaveBuyableItemOfUseType(propertyIndex, useType) {
// ===========================================================================
function getInlinePropertyColour(propertyIndex) {
if (getPropertyData(propertyIndex).type == AGRP_PROP_TYPE_HOUSE) {
if (getPropertyData(propertyIndex).type == V_PROP_TYPE_HOUSE) {
return "{houseGreen}";
} else {
return "{businessBlue}";
@@ -2644,7 +2643,7 @@ function getInlinePropertyColour(propertyIndex) {
// ===========================================================================
function getPropertyTypeName(propertyIndex) {
if (getPropertyData(propertyIndex).type == AGRP_PROP_TYPE_HOUSE) {
if (getPropertyData(propertyIndex).type == V_PROP_TYPE_HOUSE) {
return "House";
} else {
return "Business";

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: race.js
// DESC: Provides racing usage and functions

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: radio.js
// DESC: Provides radio station streaming
@@ -128,7 +127,7 @@ function playStreamingRadioCommand(command, params, client) {
let clients = getClients();
for (let i in clients) {
if (getEntityData(clients[i], "agrp.inHouse") == houseId) {
if (getEntityData(clients[i], "v.rp.inHouse") == houseId) {
playRadioStreamForPlayer(clients[i], "");
}
}
@@ -141,7 +140,7 @@ function playStreamingRadioCommand(command, params, client) {
let clients = getClients();
for (let i in clients) {
if (getEntityData(clients[i], "agrp.inHouse") == houseId) {
if (getEntityData(clients[i], "v.rp.inHouse") == houseId) {
playRadioStreamForPlayer(clients[i], getRadioStationData(radioStationId - 1).url, true, getPlayerStreamingRadioVolume(clients[i]));
}
}

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: security.js
// DESC: Provides security functions and usage

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: staff.js
// DESC: Provides staff commands, functions and usage
@@ -900,7 +899,7 @@ function getPlayerCommand(command, params, client) {
getPlayerData(targetClient).returnToHeading = getPlayerPosition(targetClient);
getPlayerData(targetClient).returnToDimension = getPlayerDimension(targetClient);
getPlayerData(targetClient).returnToInterior = getPlayerInterior(targetClient);
getPlayerData(targetClient).returnToType = AGRP_RETURNTO_TYPE_ADMINGET;
getPlayerData(targetClient).returnToType = V_RETURNTO_TYPE_ADMINGET;
setPlayerPosition(targetClient, getPosBehindPos(getPlayerPosition(client), getPlayerHeading(client), 2));
setPlayerHeading(targetClient, getPlayerHeading(client));
@@ -952,7 +951,7 @@ function returnPlayerCommand(command, params, client) {
getPlayerData(targetClient).returnToInterior = null;
getPlayerData(targetClient).returnToHouse = null;
getPlayerData(targetClient).returnToBusiness = null;
getPlayerData(targetClient).returnToType = AGRP_RETURNTO_TYPE_NONE;
getPlayerData(targetClient).returnToType = V_RETURNTO_TYPE_NONE;
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} returned {ALTCOLOUR}${getPlayerName(targetClient)}{MAINCOLOUR} to their previous position.`, true);
messagePlayerAlert(targetClient, `An admin has returned you to your previous location`);

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: startup.js
// DESC: Provides startup/shutdown procedures

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: subaccount.js
// DESC: Provides subaccount (character) functions and usage
@@ -514,12 +513,12 @@ function selectCharacter(client, characterId = -1) {
logToConsole(LOG_DEBUG, `[AGRP.SubAccount] Spawning ${getPlayerDisplayForConsole(client)} as character ID ${getPlayerData(client).currentSubAccount} with skin ${skin} (${spawnPosition.x}, ${spawnPosition.y}, ${spawnPosition.z})`);
//setPlayerCameraLookAt(client, getPosBehindPos(spawnPosition, spawnHeading, 5), spawnPosition);
getPlayerData(client).pedState = AGRP_PEDSTATE_SPAWNING;
getPlayerData(client).pedState = V_PEDSTATE_SPAWNING;
if (getGame() <= AGRP_GAME_GTA_IV_EFLC) {
if (getGame() <= V_GAME_GTA_IV_EFLC) {
spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0], spawnInterior, spawnDimension);
onPlayerSpawn(client);
} else if (getGame() == AGRP_GAME_MAFIA_ONE) {
} else if (getGame() == V_GAME_MAFIA_ONE) {
//spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0]);
//logToConsole(LOG_DEBUG, `[AGRP.SubAccount] Spawning ${getPlayerDisplayForConsole(client)} as ${getGameConfig().skins[getGame()][skin][1]} (${getGameConfig().skins[getGame()][skin][0]})`);
spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0]);

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: theme.js
// DESC: Provides server theme content

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: timers.js
// DESC: Provides timer functions and features
@@ -237,7 +236,7 @@ function checkServerGameTime() {
getServerConfig().minute = dateTime.getMinutes();
}
if (getGame() == AGRP_GAME_MAFIA_ONE) {
if (getGame() == V_GAME_MAFIA_ONE) {
if (getGameConfig().mainWorldScene[getGame()] == "FREERIDE") {
if (isServerGoingToChangeMapsSoon(getServerConfig().hour, getServerConfig().minute)) {
sendMapChangeWarningToPlayer(null, true);
@@ -300,7 +299,7 @@ function checkPayDays() {
}
for (let i in getServerData().businesses) {
if (getBusinessData(i).ownerType != AGRP_BIZ_OWNER_NONE && getBusinessData(i).ownerType != AGRP_BIZ_OWNER_PUBLIC && getBusinessData(i).ownerType != AGRP_BIZ_OWNER_FACTION) {
if (getBusinessData(i).ownerType != V_BIZ_OWNER_NONE && getBusinessData(i).ownerType != V_BIZ_OWNER_PUBLIC && getBusinessData(i).ownerType != V_BIZ_OWNER_FACTION) {
getBusinessData(i).till += 1000;
}
}

View File

@@ -1,131 +1,130 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: trigger.js
// DESC: Provides trigger system functions and usage
// TYPE: Server (JavaScript)
// ===========================================================================
const AGRP_TRIG_TYPE_NONE = 0;
const AGRP_TRIG_TYPE_BIZ_OWNER_CHANGE = 1;
const AGRP_TRIG_TYPE_BIZ_NAME_CHANGE = 2;
const AGRP_TRIG_TYPE_BIZ_LOCK_CHANGE = 3;
const AGRP_TRIG_TYPE_BIZ_PLAYER_ENTER = 4;
const AGRP_TRIG_TYPE_BIZ_PLAYER_EXIT = 5;
const AGRP_TRIG_TYPE_BIZ_NPC_ENTER = 6;
const AGRP_TRIG_TYPE_BIZ_NPC_EXIT = 7;
const AGRP_TRIG_TYPE_BIZ_DAMAGE = 8;
const AGRP_TRIG_TYPE_BIZ_ROBBED = 9;
const AGRP_TRIG_TYPE_BIZ_PLAYER_PURCHASE = 10;
const AGRP_TRIG_TYPE_BIZ_NPC_PURCHASE = 11;
const AGRP_TRIG_TYPE_HOUSE_OWNER_CHANGE = 12;
const AGRP_TRIG_TYPE_HOUSE_NAME_CHANGE = 13;
const AGRP_TRIG_TYPE_HOUSE_LOCK_CHANGE = 14;
const AGRP_TRIG_TYPE_HOUSE_PLAYER_ENTER = 15;
const AGRP_TRIG_TYPE_HOUSE_PLAYER_EXIT = 16;
const AGRP_TRIG_TYPE_HOUSE_NPC_ENTER = 17;
const AGRP_TRIG_TYPE_HOUSE_NPC_EXIT = 18;
const AGRP_TRIG_TYPE_HOUSE_DAMAGE = 19;
const AGRP_TRIG_TYPE_HOUSE_ROBBED = 20;
const AGRP_TRIG_TYPE_VEH_OWNER_CHANGE = 21;
const AGRP_TRIG_TYPE_VEH_PLAYER_ENTER = 22;
const AGRP_TRIG_TYPE_VEH_PLAYER_EXIT = 23;
const AGRP_TRIG_TYPE_VEH_NPC_ENTER = 24;
const AGRP_TRIG_TYPE_VEH_NPC_EXIT = 25;
const AGRP_TRIG_TYPE_VEH_COLLISION = 26;
const AGRP_TRIG_TYPE_VEH_DAMAGED = 27;
const AGRP_TRIG_TYPE_VEH_SHOT = 28;
const AGRP_TRIG_TYPE_VEH_TRUNK_CHANGE = 29;
const AGRP_TRIG_TYPE_VEH_ITEM_TAKEN = 30;
const AGRP_TRIG_TYPE_VEH_ITEM_STORED = 31;
const AGRP_TRIG_TYPE_VEH_ENGINE_CHANGE = 32;
const AGRP_TRIG_TYPE_VEH_LIGHTS_CHANGE = 33;
const AGRP_TRIG_TYPE_VEH_SIREN_CHANGE = 34;
const AGRP_TRIG_TYPE_VEH_LOCK_CHANGE = 35;
const AGRP_TRIG_TYPE_VEH_REPAIRED = 36;
const AGRP_TRIG_TYPE_VEH_COLOUR_CHANGE = 37;
const AGRP_TRIG_TYPE_VEH_EXTRA_CHANGE = 38;
const AGRP_TRIG_TYPE_PLAYER_SHOUT = 39;
const AGRP_TRIG_TYPE_PLAYER_TALK = 40;
const AGRP_TRIG_TYPE_PLAYER_WHISPER = 41;
const V_TRIG_TYPE_NONE = 0;
const V_TRIG_TYPE_BIZ_OWNER_CHANGE = 1;
const V_TRIG_TYPE_BIZ_NAME_CHANGE = 2;
const V_TRIG_TYPE_BIZ_LOCK_CHANGE = 3;
const V_TRIG_TYPE_BIZ_PLAYER_ENTER = 4;
const V_TRIG_TYPE_BIZ_PLAYER_EXIT = 5;
const V_TRIG_TYPE_BIZ_NPC_ENTER = 6;
const V_TRIG_TYPE_BIZ_NPC_EXIT = 7;
const V_TRIG_TYPE_BIZ_DAMAGE = 8;
const V_TRIG_TYPE_BIZ_ROBBED = 9;
const V_TRIG_TYPE_BIZ_PLAYER_PURCHASE = 10;
const V_TRIG_TYPE_BIZ_NPC_PURCHASE = 11;
const V_TRIG_TYPE_HOUSE_OWNER_CHANGE = 12;
const V_TRIG_TYPE_HOUSE_NAME_CHANGE = 13;
const V_TRIG_TYPE_HOUSE_LOCK_CHANGE = 14;
const V_TRIG_TYPE_HOUSE_PLAYER_ENTER = 15;
const V_TRIG_TYPE_HOUSE_PLAYER_EXIT = 16;
const V_TRIG_TYPE_HOUSE_NPC_ENTER = 17;
const V_TRIG_TYPE_HOUSE_NPC_EXIT = 18;
const V_TRIG_TYPE_HOUSE_DAMAGE = 19;
const V_TRIG_TYPE_HOUSE_ROBBED = 20;
const V_TRIG_TYPE_VEH_OWNER_CHANGE = 21;
const V_TRIG_TYPE_VEH_PLAYER_ENTER = 22;
const V_TRIG_TYPE_VEH_PLAYER_EXIT = 23;
const V_TRIG_TYPE_VEH_NPC_ENTER = 24;
const V_TRIG_TYPE_VEH_NPC_EXIT = 25;
const V_TRIG_TYPE_VEH_COLLISION = 26;
const V_TRIG_TYPE_VEH_DAMAGED = 27;
const V_TRIG_TYPE_VEH_SHOT = 28;
const V_TRIG_TYPE_VEH_TRUNK_CHANGE = 29;
const V_TRIG_TYPE_VEH_ITEM_TAKEN = 30;
const V_TRIG_TYPE_VEH_ITEM_STORED = 31;
const V_TRIG_TYPE_VEH_ENGINE_CHANGE = 32;
const V_TRIG_TYPE_VEH_LIGHTS_CHANGE = 33;
const V_TRIG_TYPE_VEH_SIREN_CHANGE = 34;
const V_TRIG_TYPE_VEH_LOCK_CHANGE = 35;
const V_TRIG_TYPE_VEH_REPAIRED = 36;
const V_TRIG_TYPE_VEH_COLOUR_CHANGE = 37;
const V_TRIG_TYPE_VEH_EXTRA_CHANGE = 38;
const V_TRIG_TYPE_PLAYER_SHOUT = 39;
const V_TRIG_TYPE_PLAYER_TALK = 40;
const V_TRIG_TYPE_PLAYER_WHISPER = 41;
// ===========================================================================
// Need to plan this out
const AGRP_TRIG_COND_TYPE_NONE = 0;
const AGRP_TRIG_COND_TYPE_VEH_OCCUPANT = 1;
const AGRP_TRIG_COND_TYPE_VEH_DRIVER = 3;
const AGRP_TRIG_COND_TYPE_VEH_OWNER_TYPE = 2;
const AGRP_TRIG_COND_TYPE_VEH_OWNER_ID = 4;
const V_TRIG_COND_TYPE_NONE = 0;
const V_TRIG_COND_TYPE_VEH_OCCUPANT = 1;
const V_TRIG_COND_TYPE_VEH_DRIVER = 3;
const V_TRIG_COND_TYPE_VEH_OWNER_TYPE = 2;
const V_TRIG_COND_TYPE_VEH_OWNER_ID = 4;
// ===========================================================================
// Need to plan this out
const AGRP_TRIG_COND_MATCH_NONE = 0;
const AGRP_TRIG_COND_MATCH_EXACT_VALUE = 1;
const AGRP_TRIG_COND_MATCH_GREATER_THAN = 2;
const AGRP_TRIG_COND_MATCH_LESS_THAN = 2;
const AGRP_TRIG_COND_MATCH_NOT_EQUAL = 3;
const AGRP_TRIG_COND_MATCH_CLAN = 4;
const AGRP_TRIG_COND_MATCH_JOB = 5;
const AGRP_TRIG_COND_MATCH_BIZ = 6;
const AGRP_TRIG_COND_MATCH_HOUSE = 7;
const AGRP_TRIG_COND_MATCH_VEH = 8;
const AGRP_TRIG_COND_MATCH_NPC = 9;
const V_TRIG_COND_MATCH_NONE = 0;
const V_TRIG_COND_MATCH_EXACT_VALUE = 1;
const V_TRIG_COND_MATCH_GREATER_THAN = 2;
const V_TRIG_COND_MATCH_LESS_THAN = 2;
const V_TRIG_COND_MATCH_NOT_EQUAL = 3;
const V_TRIG_COND_MATCH_CLAN = 4;
const V_TRIG_COND_MATCH_JOB = 5;
const V_TRIG_COND_MATCH_BIZ = 6;
const V_TRIG_COND_MATCH_HOUSE = 7;
const V_TRIG_COND_MATCH_VEH = 8;
const V_TRIG_COND_MATCH_NPC = 9;
// ===========================================================================
const AGRP_TRIG_RESP_TYPE_NONE = 0;
const AGRP_TRIG_RESP_SHOUT = 1;
const AGRP_TRIG_RESP_TALK = 2;
const AGRP_TRIG_RESP_WHISPER = 3;
const V_TRIG_RESP_TYPE_NONE = 0;
const V_TRIG_RESP_SHOUT = 1;
const V_TRIG_RESP_TALK = 2;
const V_TRIG_RESP_WHISPER = 3;
// ===========================================================================
let triggerTypes = {
BusinessOwnerChange: AGRP_TRIG_TYPE_BIZ_OWNER_CHANGE,
BusinessNameChange: AGRP_TRIG_TYPE_BIZ_NAME_CHANGE,
BusinessLockChange: AGRP_TRIG_TYPE_BIZ_LOCK_CHANGE,
BusinessPlayerEnter: AGRP_TRIG_TYPE_BIZ_PLAYER_ENTER,
BusinessPlayerExit: AGRP_TRIG_TYPE_BIZ_PLAYER_EXIT,
BusinessNPCEnter: AGRP_TRIG_TYPE_BIZ_NPC_ENTER,
BusinessNPCExit: AGRP_TRIG_TYPE_BIZ_NPC_EXIT,
BusinessDamage: AGRP_TRIG_TYPE_BIZ_DAMAGE,
BusinessRobbed: AGRP_TRIG_TYPE_BIZ_ROBBED,
BusinessPlayerPurchase: AGRP_TRIG_TYPE_BIZ_PLAYER_PURCHASE,
BusinessNPCPurchase: AGRP_TRIG_TYPE_BIZ_NPC_PURCHASE,
HouseOwnerChange: AGRP_TRIG_TYPE_HOUSE_OWNER_CHANGE,
HouseNameChange: AGRP_TRIG_TYPE_HOUSE_NAME_CHANGE,
HouseLockChange: AGRP_TRIG_TYPE_HOUSE_LOCK_CHANGE,
HousePlayerEnter: AGRP_TRIG_TYPE_HOUSE_PLAYER_ENTER,
HousePlayerExit: AGRP_TRIG_TYPE_HOUSE_PLAYER_EXIT,
HouseNPCEnter: AGRP_TRIG_TYPE_HOUSE_NPC_ENTER,
HouseNPCExit: AGRP_TRIG_TYPE_HOUSE_NPC_EXIT,
HouseDamage: AGRP_TRIG_TYPE_HOUSE_DAMAGE,
HouseRobbed: AGRP_TRIG_TYPE_HOUSE_ROBBED,
VehicleOwnerChange: AGRP_TRIG_TYPE_VEH_OWNER_CHANGE,
VehiclePlayerEnter: AGRP_TRIG_TYPE_VEH_PLAYER_ENTER,
VehiclePlayerExit: AGRP_TRIG_TYPE_VEH_PLAYER_EXIT,
VehicleNPCEnter: AGRP_TRIG_TYPE_VEH_NPC_ENTER,
VehicleNPCExit: AGRP_TRIG_TYPE_VEH_NPC_EXIT,
VehicleCollision: AGRP_TRIG_TYPE_VEH_COLLISION,
VehicleDamaged: AGRP_TRIG_TYPE_VEH_DAMAGED,
VehicleShot: AGRP_TRIG_TYPE_VEH_SHOT,
VehicleTrunkChange: AGRP_TRIG_TYPE_VEH_TRUNK_CHANGE,
VehicleItemTaken: AGRP_TRIG_TYPE_VEH_ITEM_TAKEN,
VehicleItemStored: AGRP_TRIG_TYPE_VEH_ITEM_STORED,
VehicleEngineChange: AGRP_TRIG_TYPE_VEH_ENGINE_CHANGE,
VehicleLightsChange: AGRP_TRIG_TYPE_VEH_LIGHTS_CHANGE,
VehicleSirenChange: AGRP_TRIG_TYPE_VEH_SIREN_CHANGE,
VehicleLockChange: AGRP_TRIG_TYPE_VEH_LOCK_CHANGE,
VehicleRepaired: AGRP_TRIG_TYPE_VEH_REPAIRED,
VehicleColourChange: AGRP_TRIG_TYPE_VEH_COLOUR_CHANGE,
VehicleExtraChange: AGRP_TRIG_TYPE_VEH_EXTRA_CHANGE,
PlayerShout: AGRP_TRIG_TYPE_PLAYER_SHOUT,
PlayerTalk: AGRP_TRIG_TYPE_PLAYER_TALK,
PlayerWhisper: AGRP_TRIG_TYPE_PLAYER_WHISPER,
BusinessOwnerChange: V_TRIG_TYPE_BIZ_OWNER_CHANGE,
BusinessNameChange: V_TRIG_TYPE_BIZ_NAME_CHANGE,
BusinessLockChange: V_TRIG_TYPE_BIZ_LOCK_CHANGE,
BusinessPlayerEnter: V_TRIG_TYPE_BIZ_PLAYER_ENTER,
BusinessPlayerExit: V_TRIG_TYPE_BIZ_PLAYER_EXIT,
BusinessNPCEnter: V_TRIG_TYPE_BIZ_NPC_ENTER,
BusinessNPCExit: V_TRIG_TYPE_BIZ_NPC_EXIT,
BusinessDamage: V_TRIG_TYPE_BIZ_DAMAGE,
BusinessRobbed: V_TRIG_TYPE_BIZ_ROBBED,
BusinessPlayerPurchase: V_TRIG_TYPE_BIZ_PLAYER_PURCHASE,
BusinessNPCPurchase: V_TRIG_TYPE_BIZ_NPC_PURCHASE,
HouseOwnerChange: V_TRIG_TYPE_HOUSE_OWNER_CHANGE,
HouseNameChange: V_TRIG_TYPE_HOUSE_NAME_CHANGE,
HouseLockChange: V_TRIG_TYPE_HOUSE_LOCK_CHANGE,
HousePlayerEnter: V_TRIG_TYPE_HOUSE_PLAYER_ENTER,
HousePlayerExit: V_TRIG_TYPE_HOUSE_PLAYER_EXIT,
HouseNPCEnter: V_TRIG_TYPE_HOUSE_NPC_ENTER,
HouseNPCExit: V_TRIG_TYPE_HOUSE_NPC_EXIT,
HouseDamage: V_TRIG_TYPE_HOUSE_DAMAGE,
HouseRobbed: V_TRIG_TYPE_HOUSE_ROBBED,
VehicleOwnerChange: V_TRIG_TYPE_VEH_OWNER_CHANGE,
VehiclePlayerEnter: V_TRIG_TYPE_VEH_PLAYER_ENTER,
VehiclePlayerExit: V_TRIG_TYPE_VEH_PLAYER_EXIT,
VehicleNPCEnter: V_TRIG_TYPE_VEH_NPC_ENTER,
VehicleNPCExit: V_TRIG_TYPE_VEH_NPC_EXIT,
VehicleCollision: V_TRIG_TYPE_VEH_COLLISION,
VehicleDamaged: V_TRIG_TYPE_VEH_DAMAGED,
VehicleShot: V_TRIG_TYPE_VEH_SHOT,
VehicleTrunkChange: V_TRIG_TYPE_VEH_TRUNK_CHANGE,
VehicleItemTaken: V_TRIG_TYPE_VEH_ITEM_TAKEN,
VehicleItemStored: V_TRIG_TYPE_VEH_ITEM_STORED,
VehicleEngineChange: V_TRIG_TYPE_VEH_ENGINE_CHANGE,
VehicleLightsChange: V_TRIG_TYPE_VEH_LIGHTS_CHANGE,
VehicleSirenChange: V_TRIG_TYPE_VEH_SIREN_CHANGE,
VehicleLockChange: V_TRIG_TYPE_VEH_LOCK_CHANGE,
VehicleRepaired: V_TRIG_TYPE_VEH_REPAIRED,
VehicleColourChange: V_TRIG_TYPE_VEH_COLOUR_CHANGE,
VehicleExtraChange: V_TRIG_TYPE_VEH_EXTRA_CHANGE,
PlayerShout: V_TRIG_TYPE_PLAYER_SHOUT,
PlayerTalk: V_TRIG_TYPE_PLAYER_TALK,
PlayerWhisper: V_TRIG_TYPE_PLAYER_WHISPER,
};
// ===========================================================================
@@ -138,7 +137,7 @@ let triggerTypes = {
class TriggerData {
constructor(dbAssoc) {
this.databaseId = 0
this.type = AGRP_TRIG_TYPE_NONE;
this.type = V_TRIG_TYPE_NONE;
this.enabled = false;
this.whoAdded = 0;
this.whenAdded = 0;
@@ -168,8 +167,8 @@ class TriggerConditionData {
this.index = -1;
this.triggerId = 0;
this.triggerIndex = -1;
this.type = AGRP_TRIG_COND_TYPE_NONE;
this.matchType = AGRP_TRIG_COND_MATCH_NONE;
this.type = V_TRIG_COND_TYPE_NONE;
this.matchType = V_TRIG_COND_MATCH_NONE;
this.enabled = false;
this.whoAdded = 0;
this.whenAdded = 0;
@@ -199,7 +198,7 @@ class TriggerResponseData {
this.triggerId = 0;
this.triggerIndex = -1;
this.priority = 0;
this.type = AGRP_TRIG_RESP_TYPE_NONE;
this.type = V_TRIG_RESP_TYPE_NONE;
this.enabled = false;
this.whoAdded = 0;
this.whenAdded = 0;

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: tutorial.js
// DESC: Provides tutorial functions and features

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: utilities.js
// DESC: Provides util functions and arrays with data
@@ -88,7 +87,7 @@ function updateServerRules() {
timeWeatherRule.push(tempText);
}
} else {
if (getGame() == AGRP_GAME_MAFIA_ONE) {
if (getGame() == V_GAME_MAFIA_ONE) {
if (isNightTime(getServerConfig().hour)) {
tempText = "Night";
} else {
@@ -260,8 +259,8 @@ function checkPlayerPedStates() {
if (getPlayerData(clients[i])) {
if (getPlayerData(clients[i]).pedState) {
if (isPlayerInAnyVehicle(clients[i])) {
if (getPlayerData(clients[i]).pedState == AGRP_PEDSTATE_EXITINGVEHICLE) {
getPlayerData(clients[i]).pedState == AGRP_PEDSTATE_READY;
if (getPlayerData(clients[i]).pedState == V_PEDSTATE_EXITINGVEHICLE) {
getPlayerData(clients[i]).pedState == V_PEDSTATE_READY;
}
}
}
@@ -441,7 +440,7 @@ function isClientInitialized(client) {
// ===========================================================================
function getPedForNetworkEvent(ped) {
//if (getGame() == AGRP_GAME_GTA_IV) {
//if (getGame() == V_GAME_GTA_IV) {
// return ped;
//} else {
// return ped.id;
@@ -525,15 +524,15 @@ function processPlayerEnteringExitingProperty(client) {
}
let pedState = getPlayerData(client).pedState;
if (pedState != AGRP_PEDSTATE_ENTERINGPROPERTY && pedState != AGRP_PEDSTATE_EXITINGPROPERTY) {
if (pedState != V_PEDSTATE_ENTERINGPROPERTY && pedState != V_PEDSTATE_EXITINGPROPERTY) {
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.Utilities]: Aborting property enter/exit for player ${getPlayerDisplayForConsole(client)}. Ped state is not entering or exiting property.`);
return false;
}
let propertyData = null;
if (getPlayerData(client).enteringExitingProperty[0] == AGRP_PROPERTY_TYPE_BUSINESS) {
if (getPlayerData(client).enteringExitingProperty[0] == V_PROPERTY_TYPE_BUSINESS) {
propertyData = getBusinessData(getPlayerData(client).enteringExitingProperty[1]);
} else if (getPlayerData(client).enteringExitingProperty[0] == AGRP_PROPERTY_TYPE_HOUSE) {
} else if (getPlayerData(client).enteringExitingProperty[0] == V_PROPERTY_TYPE_HOUSE) {
propertyData = getHouseData(getPlayerData(client).enteringExitingProperty[1]);
}
@@ -542,7 +541,7 @@ function processPlayerEnteringExitingProperty(client) {
return false;
}
if (pedState == AGRP_PEDSTATE_ENTERINGPROPERTY) {
if (pedState == V_PEDSTATE_ENTERINGPROPERTY) {
logToConsole(LOG_VERBOSE, `[AGRP.Utilities]: Processing property ENTER for player ${getPlayerDisplayForConsole(client)} ...`);
if (isGameFeatureSupported("interiorScene") && propertyData.exitScene != "") {
logToConsole(LOG_VERBOSE, `[AGRP.Utilities]: Player ${getPlayerDisplayForConsole(client)} is entering a property with interior scene (${propertyData.exitScene})`);
@@ -563,8 +562,8 @@ function processPlayerEnteringExitingProperty(client) {
updateInteriorLightsForPlayer(client, propertyData.interiorLights);
}, 1000);
if (getPlayerData(client).enteringExitingProperty[0] == AGRP_PROPERTY_TYPE_BUSINESS) {
if (propertyData.type == AGRP_BIZ_TYPE_PAINTBALL) {
if (getPlayerData(client).enteringExitingProperty[0] == V_PROPERTY_TYPE_BUSINESS) {
if (propertyData.type == V_BIZ_TYPE_PAINTBALL) {
startPaintBall(client);
}
}
@@ -579,8 +578,8 @@ function processPlayerEnteringExitingProperty(client) {
getPlayerData(client).inProperty = [getPlayerData(client).enteringExitingProperty[0], getPlayerData(client).enteringExitingProperty[1]];
getPlayerData(client).enteringExitingProperty = null;
getPlayerData(client).pedState = AGRP_PEDSTATE_READY;
} else if (pedState == AGRP_PEDSTATE_EXITINGPROPERTY) {
getPlayerData(client).pedState = V_PEDSTATE_READY;
} else if (pedState == V_PEDSTATE_EXITINGPROPERTY) {
logToConsole(LOG_VERBOSE, `[AGRP.Utilities]: Processing property EXIT for player ${getPlayerDisplayForConsole(client)} from property ID ${propertyData.index}/${propertyData.databaseId} ...`);
if (isGameFeatureSupported("interiorScene") && propertyData.entranceScene != "") {
logToConsole(LOG_VERBOSE, `[AGRP.Utilities]: Player ${getPlayerDisplayForConsole(client)} is exiting a property with external interior scene (${propertyData.entranceScene})`);
@@ -596,22 +595,22 @@ function processPlayerEnteringExitingProperty(client) {
// Check if exiting property was into another house/business
let inProperty = false;
let inPropertyType = AGRP_PROPERTY_TYPE_NONE;
let inPropertyType = V_PROPERTY_TYPE_NONE;
let inBusiness = getPlayerBusiness(client);
if (inBusiness != -1) {
inProperty = getBusinessData(inBusiness);
inPropertyType = AGRP_PROPERTY_TYPE_BUSINESS;
inPropertyType = V_PROPERTY_TYPE_BUSINESS;
} else {
let inHouse = getPlayerHouse(client);
if (inHouse != -1) {
inProperty = getHouseData(inHouse);
inPropertyType = AGRP_PROPERTY_TYPE_HOUSE;
inPropertyType = V_PROPERTY_TYPE_HOUSE;
}
}
setTimeout(function () {
if (getGame() != AGRP_GAME_MAFIA_ONE && getGame() != AGRP_GAME_GTA_IV) {
if (getGame() != V_GAME_MAFIA_ONE && getGame() != V_GAME_GTA_IV) {
if (isFadeCameraSupported()) {
fadeCamera(client, true, 1.0);
}
@@ -635,7 +634,7 @@ function processPlayerEnteringExitingProperty(client) {
getPlayerData(client).inProperty = [inPropertyType, inProperty.index];
getPlayerData(client).enteringExitingProperty = null;
getPlayerData(client).pedState = AGRP_PEDSTATE_READY;
getPlayerData(client).pedState = V_PEDSTATE_READY;
}
}

View File

@@ -1,7 +1,6 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: vehicle.js
// DESC: Provides vehicle functions and usage
@@ -9,13 +8,13 @@
// ===========================================================================
// Vehicle Owner Types
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)
const V_VEHOWNER_NONE = 0; // Not owned
const V_VEHOWNER_PLAYER = 1; // Owned by a player (character/subaccount)
const V_VEHOWNER_JOB = 2; // Owned by a job
const V_VEHOWNER_CLAN = 3; // Owned by a clan
const V_VEHOWNER_FACTION = 4; // Owned by a faction (not used at the moment)
const V_VEHOWNER_PUBLIC = 5; // Public vehicle. Anybody can drive it.
const V_VEHOWNER_BIZ = 6; // Owned by a business (also includes dealerships since they're businesses)
// ===========================================================================
@@ -40,7 +39,7 @@ class VehicleData {
this.syncHeading = 0.0;
// Ownership
this.ownerType = AGRP_VEHOWNER_NONE;
this.ownerType = V_VEHOWNER_NONE;
this.ownerId = 0;
this.buyPrice = 0;
this.rentPrice = 0;
@@ -325,7 +324,7 @@ function spawnAllVehicles() {
for (let i in getServerData().vehicles) {
let vehicle = spawnVehicle(getServerData().vehicles[i]);
getServerData().vehicles[i].vehicle = vehicle;
setEntityData(vehicle, "agrp.dataSlot", i, false);
setEntityData(vehicle, "v.rp.dataSlot", i, false);
}
setAllVehicleIndexes();
}
@@ -338,7 +337,7 @@ function spawnAllVehicles() {
*/
function getVehicleData(vehicle) {
if (isVehicleObject(vehicle)) {
let dataIndex = getEntityData(vehicle, "agrp.dataSlot");
let dataIndex = getEntityData(vehicle, "v.rp.dataSlot");
if (typeof getServerData().vehicles[dataIndex] != "undefined") {
return getServerData().vehicles[dataIndex];
}
@@ -363,7 +362,7 @@ function createVehicleCommand(command, params, client) {
}
let heading = getPlayerHeading(client);
if (getGame() == AGRP_GAME_MAFIA_ONE) {
if (getGame() == V_GAME_MAFIA_ONE) {
heading = degToRad(getPlayerHeading(client));
}
@@ -503,7 +502,7 @@ function deleteVehicleCommand(command, params, client) {
return false;
}
let dataIndex = getEntityData(vehicle, "agrp.dataSlot");
let dataIndex = getEntityData(vehicle, "v.rp.dataSlot");
let vehicleName = getVehicleName(vehicle);
quickDatabaseQuery(`UPDATE veh_main SET veh_deleted = 1 WHERE veh_id = ${getVehicleData(vehicle).databaseId}`);
@@ -541,7 +540,7 @@ function vehicleEngineCommand(command, params, client) {
getVehicleData(vehicle).engine = !getVehicleData(vehicle).engine;
vehicle.engine = getVehicleData(vehicle).engine;
setEntityData(vehicle, "agrp.engine", getVehicleData(vehicle).engine, true);
setEntityData(vehicle, "v.rp.engine", getVehicleData(vehicle).engine, true);
getVehicleData(vehicle).needsSaved = true;
@@ -667,7 +666,7 @@ function vehicleAdminLiveryCommand(command, params, client) {
getVehicleData(vehicle).livery = livery;
getVehicleData(vehicle).needsSaved = true;
setEntityData(vehicle, "agrp.livery", livery, true);
setEntityData(vehicle, "v.rp.livery", livery, true);
forcePlayerToSyncElementProperties(null, vehicle);
//meActionToNearbyPlayers(client, `sets the ${getVehicleName(vehicle)}'s livery/paintjob'`);
@@ -706,10 +705,10 @@ function buyVehicleCommand(command, params, client) {
getPlayerData(client).buyingVehicle = vehicle;
getVehicleData(vehicle).engine = true;
vehicle.engine = true;
setEntityData(vehicle, "agrp.engine", getVehicleData(vehicle).engine, true);
setEntityData(vehicle, "v.rp.engine", getVehicleData(vehicle).engine, true);
getVehicleData(vehicle).needsSaved = true;
setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_TESTDRIVE, vehicle.id, getVehiclePosition(vehicle));
setPlayerBuyingVehicleState(client, V_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);
@@ -777,7 +776,7 @@ function rentVehicleCommand(command, params, client) {
// ===========================================================================
function enterVehicleAsPassengerCommand(command, params, client) {
sendNetworkEventToPlayer("agrp.passenger", client);
sendNetworkEventToPlayer("v.rp.passenger", client);
}
// ===========================================================================
@@ -804,17 +803,17 @@ function doesPlayerHaveVehicleKeys(client, vehicle) {
return true;
}
if (vehicleData.ownerType == AGRP_VEHOWNER_PUBLIC) {
if (vehicleData.ownerType == V_VEHOWNER_PUBLIC) {
return true;
}
if (vehicleData.ownerType == AGRP_VEHOWNER_PLAYER) {
if (vehicleData.ownerType == V_VEHOWNER_PLAYER) {
if (vehicleData.ownerId == getPlayerCurrentSubAccount(client).databaseId) {
return true;
}
}
if (vehicleData.ownerType == AGRP_VEHOWNER_CLAN) {
if (vehicleData.ownerType == V_VEHOWNER_CLAN) {
if (vehicleData.ownerId == getPlayerCurrentSubAccount(client).clan) {
if (vehicleData.clanRank <= getPlayerCurrentSubAccount(client).clanRank) {
return true;
@@ -822,7 +821,7 @@ function doesPlayerHaveVehicleKeys(client, vehicle) {
}
}
if (vehicleData.ownerType == AGRP_VEHOWNER_FACTION) {
if (vehicleData.ownerType == V_VEHOWNER_FACTION) {
if (vehicleData.ownerId == getPlayerCurrentSubAccount(client).faction) {
if (vehicleData.factionRank <= getPlayerCurrentSubAccount(client).factionRank) {
return true;
@@ -830,7 +829,7 @@ function doesPlayerHaveVehicleKeys(client, vehicle) {
}
}
if (vehicleData.ownerType == AGRP_VEHOWNER_JOB) {
if (vehicleData.ownerType == V_VEHOWNER_JOB) {
if (vehicleData.ownerId == getPlayerCurrentSubAccount(client).job) {
return true;
}
@@ -854,13 +853,13 @@ function canPlayerManageVehicle(client, vehicle, exemptAdminFlag = false) {
}
}
if (vehicleData.ownerType == AGRP_VEHOWNER_PLAYER) {
if (vehicleData.ownerType == V_VEHOWNER_PLAYER) {
if (vehicleData.ownerId == getPlayerData(client).accountData.databaseId) {
return true;
}
}
if (vehicleData.ownerType == AGRP_VEHOWNER_CLAN) {
if (vehicleData.ownerType == V_VEHOWNER_CLAN) {
if (vehicleData.ownerId == getPlayerCurrentSubAccount(client).clan) {
if (doesPlayerHaveClanPermission(client, "ManageVehicles")) {
return true;
@@ -868,7 +867,7 @@ function canPlayerManageVehicle(client, vehicle, exemptAdminFlag = false) {
}
}
if (vehicleData.ownerType == AGRP_VEHOWNER_BIZ) {
if (vehicleData.ownerType == V_VEHOWNER_BIZ) {
if (canPlayerManageBusiness(client, getBusinessIdFromDatabaseId(vehicleData.ownerId), exemptAdminFlag)) {
return true;
}
@@ -905,7 +904,7 @@ function setVehicleJobCommand(command, params, client) {
// return false;
//}
getVehicleData(vehicle).ownerType = AGRP_VEHOWNER_JOB;
getVehicleData(vehicle).ownerType = V_VEHOWNER_JOB;
getVehicleData(vehicle).ownerId = getJobData(jobId).databaseId;
getVehicleData(vehicle).needsSaved = true;
@@ -934,7 +933,7 @@ function setVehicleRankCommand(command, params, client) {
return false;
}
if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_CLAN) {
if (getVehicleData(vehicle).ownerType == V_VEHOWNER_CLAN) {
rankId = getClanRankFromParams(getVehicleData(vehicle).ownerId, params);
if (!getClanRankData(getVehicleData(vehicle).ownerId, rankId)) {
messagePlayerError(client, getLocaleString(client, "InvalidClanRank"));
@@ -942,7 +941,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} minimum rank to {ALTCOLOUR}${getClanRankData(getVehicleData(vehicle).ownerId, rankId).name}{MAINCOLOUR} of the {clanOrange}${getClanData(getVehicleData(vehicle).ownerId).name}{MAINCOLOUR} clan!`, true);
} else if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_JOB) {
} else if (getVehicleData(vehicle).ownerType == V_VEHOWNER_JOB) {
getVehicleData(vehicle).rank = rankId;
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} minimum rank to {ALTCOLOUR}${rankId}{MAINCOLOUR} of the {jobYellow}${getJobData(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)).name}{MAINCOLOUR} job!`, true);
}
@@ -971,7 +970,7 @@ function setVehicleClanCommand(command, params, client) {
return false;
}
if (getVehicleData(vehicle).ownerType != AGRP_VEHOWNER_PLAYER) {
if (getVehicleData(vehicle).ownerType != V_VEHOWNER_PLAYER) {
messagePlayerError(client, getLocaleString(client, "MustOwnVehicle"));
return false;
}
@@ -982,7 +981,7 @@ function setVehicleClanCommand(command, params, client) {
}
showPlayerPrompt(client, getLocaleString(client, "SetVehicleClanConfirmMessage"), getLocaleString(client, "SetVehicleClanConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
getPlayerData(client).promptType = AGRP_PROMPT_GIVEVEHTOCLAN;
getPlayerData(client).promptType = V_PROMPT_GIVEVEHTOCLAN;
getVehicleData(vehicle).needsSaved = true;
}
@@ -1012,7 +1011,7 @@ function setVehicleBusinessCommand(command, params, client) {
return false;
}
getVehicleData(vehicle).ownerType = AGRP_VEHOWNER_BIZ;
getVehicleData(vehicle).ownerType = V_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`, true);
@@ -1041,7 +1040,7 @@ function setVehicleOwnerCommand(command, params, client) {
return false;
}
getVehicleData(vehicle).ownerType = AGRP_VEHOWNER_PLAYER;
getVehicleData(vehicle).ownerType = V_VEHOWNER_PLAYER;
getVehicleData(vehicle).ownerId = getPlayerCurrentSubAccount(targetClient).databaseId;
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} owner to {ALTCOLOUR}${getClientSubAccountName(targetClient)}`, true);
@@ -1064,7 +1063,7 @@ function setVehiclePublicCommand(command, params, client) {
return false;
}
getVehicleData(vehicle).ownerType = AGRP_VEHOWNER_PUBLIC;
getVehicleData(vehicle).ownerType = V_VEHOWNER_PUBLIC;
getVehicleData(vehicle).ownerId = 0;
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} to a public vehicle!`, true);
@@ -1153,7 +1152,7 @@ function removeVehicleOwnerCommand(command, params, client) {
return false;
}
getVehicleData(vehicle).ownerType = AGRP_VEHOWNER_NONE;
getVehicleData(vehicle).ownerType = V_VEHOWNER_NONE;
getVehicleData(vehicle).ownerId = 0;
getVehicleData(vehicle).needsSaved = true;
@@ -1182,28 +1181,28 @@ function getVehicleInfoCommand(command, params, client) {
let ownerName = "Nobody";
let ownerType = "None";
switch (vehicleData.ownerType) {
case AGRP_VEHOWNER_CLAN:
case V_VEHOWNER_CLAN:
ownerName = getClanData(getClanIndexFromDatabaseId(vehicleData.ownerId)).name;
ownerType = "clan";
break;
case AGRP_VEHOWNER_JOB:
case V_VEHOWNER_JOB:
ownerName = getJobData(getJobIdFromDatabaseId(vehicleData.ownerId)).name;
ownerType = "job";
break;
case AGRP_VEHOWNER_PLAYER:
case V_VEHOWNER_PLAYER:
let subAccountData = loadSubAccountFromId(vehicleData.ownerId);
ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`;
ownerType = "player";
break;
case AGRP_VEHOWNER_BIZ:
case V_VEHOWNER_BIZ:
ownerName = getBusinessData(getBusinessIdFromDatabaseId(vehicleData.ownerId)).name;
ownerType = "business";
break;
case AGRP_VEHOWNER_PUBLIC:
case V_VEHOWNER_PUBLIC:
ownerName = "Nobody";
ownerType = "public";
break;
@@ -1259,28 +1258,28 @@ function getLastVehicleInfoCommand(command, params, client) {
let ownerName = "Nobody";
let ownerType = "None";
switch (vehicleData.ownerType) {
case AGRP_VEHOWNER_CLAN:
case V_VEHOWNER_CLAN:
ownerName = getClanData(vehicleData.ownerId).name;
ownerType = "clan";
break;
case AGRP_VEHOWNER_JOB:
case V_VEHOWNER_JOB:
ownerName = getJobData(vehicleData.ownerId).name;
ownerType = "job";
break;
case AGRP_VEHOWNER_PLAYER:
case V_VEHOWNER_PLAYER:
let subAccountData = loadSubAccountFromId(vehicleData.ownerId);
ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`;
ownerType = "player";
break;
case AGRP_VEHOWNER_BIZ:
case V_VEHOWNER_BIZ:
ownerName = getBusinessData(vehicleData.ownerId).name;
ownerType = "business";
break;
case AGRP_VEHOWNER_PUBLIC:
case V_VEHOWNER_PUBLIC:
ownerName = "None";
ownerType = "public";
break;
@@ -1391,7 +1390,7 @@ function respawnEmptyVehiclesCommand(command, params, client) {
function respawnJobVehiclesCommand(command, params, client) {
for (let i in getServerData().vehicles) {
if (getServerData().vehicles[i].ownerType == AGRP_VEHOWNER_JOB) {
if (getServerData().vehicles[i].ownerType == V_VEHOWNER_JOB) {
respawnVehicle(getServerData().vehicles[i].vehicle);
}
}
@@ -1403,7 +1402,7 @@ function respawnJobVehiclesCommand(command, params, client) {
function respawnClanVehiclesCommand(command, params, client) {
for (let i in getServerData().vehicles) {
if (getServerData().vehicles[i].ownerType == AGRP_VEHOWNER_CLAN) {
if (getServerData().vehicles[i].ownerType == V_VEHOWNER_CLAN) {
respawnVehicle(getServerData().vehicles[i].vehicle);
}
}
@@ -1415,7 +1414,7 @@ function respawnClanVehiclesCommand(command, params, client) {
function respawnPlayerVehiclesCommand(command, params, client) {
for (let i in getServerData().vehicles) {
if (getServerData().vehicles[i].ownerType == AGRP_VEHOWNER_PLAYER) {
if (getServerData().vehicles[i].ownerType == V_VEHOWNER_PLAYER) {
respawnVehicle(getServerData().vehicles[i].vehicle);
}
}
@@ -1427,7 +1426,7 @@ function respawnPlayerVehiclesCommand(command, params, client) {
function respawnPublicVehiclesCommand(command, params, client) {
for (let i in getServerData().vehicles) {
if (getServerData().vehicles[i].ownerType == AGRP_VEHOWNER_PUBLIC) {
if (getServerData().vehicles[i].ownerType == V_VEHOWNER_PUBLIC) {
respawnVehicle(getServerData().vehicles[i].vehicle);
}
}
@@ -1439,7 +1438,7 @@ function respawnPublicVehiclesCommand(command, params, client) {
function respawnBusinessVehiclesCommand(command, params, client) {
for (let i in getServerData().vehicles) {
if (getServerData().vehicles[i].ownerType == AGRP_VEHOWNER_BIZ) {
if (getServerData().vehicles[i].ownerType == V_VEHOWNER_BIZ) {
respawnVehicle(getServerData().vehicles[i].vehicle);
}
}
@@ -1467,7 +1466,7 @@ function respawnVehicle(vehicle) {
vehicles[i].engine = false;
}
if (vehicles[i].ownerType == AGRP_VEHOWNER_JOB) {
if (vehicles[i].ownerType == V_VEHOWNER_JOB) {
vehicles[i].locked = true;
}
@@ -1476,7 +1475,7 @@ function respawnVehicle(vehicle) {
let newVehicle = spawnVehicle(vehicles[i]);
vehicles[i].vehicle = newVehicle;
setEntityData(newVehicle, "agrp.dataSlot", i, false);
setEntityData(newVehicle, "v.rp.dataSlot", i, false);
}
}
@@ -1527,12 +1526,12 @@ function spawnVehicle(vehicleData) {
//setVehicleHealth(vehicle, 1000);
repairVehicle(vehicle);
setEntityData(vehicle, "agrp.livery", vehicleData.livery, true);
setEntityData(vehicle, "agrp.upgrades", vehicleData.extras, true);
setEntityData(vehicle, "agrp.interior", vehicleData.interior, true);
setEntityData(vehicle, "agrp.engine", vehicleData.engine, true);
setEntityData(vehicle, "v.rp.livery", vehicleData.livery, true);
setEntityData(vehicle, "v.rp.upgrades", vehicleData.extras, true);
setEntityData(vehicle, "v.rp.interior", vehicleData.interior, true);
setEntityData(vehicle, "v.rp.engine", vehicleData.engine, true);
setEntityData(vehicle, "agrp.server", true, true);
setEntityData(vehicle, "v.rp.server", true, true);
forcePlayerToSyncElementProperties(null, vehicle);
setElementTransient(vehicle, false);
@@ -1555,19 +1554,19 @@ function isVehicleAtPayAndSpray(vehicle) {
function getVehicleOwnerTypeText(ownerType) {
switch (ownerType) {
case AGRP_VEHOWNER_CLAN:
case V_VEHOWNER_CLAN:
return "clan";
case AGRP_VEHOWNER_JOB:
case V_VEHOWNER_JOB:
return "job";
case AGRP_VEHOWNER_PLAYER:
case V_VEHOWNER_PLAYER:
return "player";
case AGRP_VEHOWNER_BIZ:
case V_VEHOWNER_BIZ:
return "business";
case AGRP_VEHOWNER_PUBLIC:
case V_VEHOWNER_PUBLIC:
return "public";
default:
@@ -1578,7 +1577,7 @@ function getVehicleOwnerTypeText(ownerType) {
// ===========================================================================
function isVehicleOwnedByJob(vehicle, jobId) {
if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_JOB) {
if (getVehicleData(vehicle).ownerType == V_VEHOWNER_JOB) {
return (getVehicleData(vehicle).ownerId == jobId);
}
return false;
@@ -1612,14 +1611,14 @@ function createNewDealershipVehicle(modelIndex, spawnPosition, spawnRotation, pr
tempVehicleData.spawnLocked = true;
tempVehicleData.spawnPosition = spawnPosition;
tempVehicleData.spawnRotation = spawnRotation;
tempVehicleData.ownerType = AGRP_VEHOWNER_BIZ;
tempVehicleData.ownerType = V_VEHOWNER_BIZ;
tempVehicleData.ownerId = dealershipId;
tempVehicleData.needsSaved = true;
tempVehicleData.interior = interior;
tempVehicleData.dimension = dimension;
let slot = getServerData().vehicles.push(tempVehicleData);
setEntityData(vehicle, "agrp.dataSlot", slot - 1, false);
setEntityData(vehicle, "v.rp.dataSlot", slot - 1, false);
}
// ===========================================================================
@@ -1647,7 +1646,7 @@ function createTemporaryVehicle(modelIndex, position, heading, interior = 0, dim
setAllVehicleIndexes();
if (areServerElementsSupported()) {
setEntityData(vehicle, "agrp.dataSlot", slot - 1, false);
setEntityData(vehicle, "v.rp.dataSlot", slot - 1, false);
}
return vehicle;
@@ -1677,7 +1676,7 @@ function createPermanentVehicle(modelIndex, position, heading, interior = 0, dim
setAllVehicleIndexes();
if (areServerElementsSupported()) {
setEntityData(vehicle, "agrp.dataSlot", slot - 1, false);
setEntityData(vehicle, "v.rp.dataSlot", slot - 1, false);
}
return vehicle;
@@ -1702,22 +1701,22 @@ function processVehiclePurchasing() {
function checkVehiclePurchasing(client) {
if (!isPlayerLoggedIn(client)) {
setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_NONE, null, null);
setPlayerBuyingVehicleState(client, V_VEHBUYSTATE_NONE, null, null);
return false;
}
if (!isPlayerSpawned(client)) {
setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_NONE, null, null);
setPlayerBuyingVehicleState(client, V_VEHBUYSTATE_NONE, null, null);
return false;
}
if (!getPlayerData(client)) {
setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_NONE, null, null);
setPlayerBuyingVehicleState(client, V_VEHBUYSTATE_NONE, null, null);
return false;
}
if (!getPlayerData(client).buyingVehicle) {
setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_NONE, null, null);
setPlayerBuyingVehicleState(client, V_VEHBUYSTATE_NONE, null, null);
return false;
}
@@ -1727,7 +1726,7 @@ function checkVehiclePurchasing(client) {
messagePlayerError(client, getLocaleString(client, "DealershipPurchaseExitedVehicle"));
respawnVehicle(getPlayerData(client).buyingVehicle);
getPlayerData(client).buyingVehicle = false;
setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_NONE, null, null);
setPlayerBuyingVehicleState(client, V_VEHBUYSTATE_NONE, null, null);
}
return false;
}
@@ -1738,24 +1737,24 @@ function checkVehiclePurchasing(client) {
messagePlayerError(client, getLocaleString(client, "VehiclePurchaseNotEnoughMoney"));
respawnVehicle(getPlayerData(client).buyingVehicle);
getPlayerData(client).buyingVehicle = false;
setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_NONE, null, null);
setPlayerBuyingVehicleState(client, V_VEHBUYSTATE_NONE, null, null);
return false;
}
getServerData().purchasingVehicleCache.splice(getServerData().purchasingVehicleCache.indexOf(client), 1);
if (getVehicleData(getPlayerData(client).buyingVehicle).ownerType == AGRP_VEHOWNER_BIZ || getVehicleData(getPlayerData(client).buyingVehicle).ownerType == AGRP_VEHOWNER_NONE) {
if (getVehicleData(getPlayerData(client).buyingVehicle).ownerType == V_VEHOWNER_BIZ || getVehicleData(getPlayerData(client).buyingVehicle).ownerType == V_VEHOWNER_NONE) {
createNewDealershipVehicle(getVehicleData(getPlayerData(client).buyingVehicle).model, getVehicleData(getPlayerData(client).buyingVehicle).spawnPosition, getVehicleData(getPlayerData(client).buyingVehicle).spawnRotation, getVehicleData(getPlayerData(client).buyingVehicle).buyPrice, getVehicleData(getPlayerData(client).buyingVehicle).ownerId);
}
takePlayerCash(client, getVehicleData(getPlayerData(client).buyingVehicle).buyPrice);
updatePlayerCash(client);
getVehicleData(getPlayerData(client).buyingVehicle).ownerId = getPlayerCurrentSubAccount(client).databaseId;
getVehicleData(getPlayerData(client).buyingVehicle).ownerType = AGRP_VEHOWNER_PLAYER;
getVehicleData(getPlayerData(client).buyingVehicle).ownerType = V_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, AGRP_VEHBUYSTATE_NONE, null, null);
setPlayerBuyingVehicleState(client, V_VEHBUYSTATE_NONE, null, null);
return true;
}
}
@@ -1782,9 +1781,9 @@ function processVehicleBurning() {
function cacheAllVehicleItems() {
for (let i in getServerData().vehicles) {
for (let j in getServerData().items) {
if (getItemData(j).ownerType == AGRP_ITEM_OWNER_VEHTRUNK && getItemData(j).ownerId == getServerData().vehicles[i].databaseId) {
if (getItemData(j).ownerType == V_ITEM_OWNER_VEHTRUNK && getItemData(j).ownerId == getServerData().vehicles[i].databaseId) {
getServerData().vehicles[i].trunkItemCache.push(j);
} else if (getItemData(j).ownerType == AGRP_ITEM_OWNER_VEHDASH && getItemData(j).ownerId == getServerData().vehicles[i].databaseId) {
} else if (getItemData(j).ownerType == V_ITEM_OWNER_VEHDASH && getItemData(j).ownerId == getServerData().vehicles[i].databaseId) {
getServerData().vehicles[i].dashItemCache.push(j);
}
}
@@ -1815,16 +1814,16 @@ function setAllVehicleIndexes() {
// ===========================================================================
function doesVehicleHaveMegaphone(vehicle) {
if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_JOB) {
if (getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == AGRP_JOB_POLICE) {
if (getVehicleData(vehicle).ownerType == V_VEHOWNER_JOB) {
if (getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == V_JOB_POLICE) {
return true;
}
if (getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == AGRP_JOB_FIRE) {
if (getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == V_JOB_FIRE) {
return true;
}
if (getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == AGRP_JOB_MEDICAL) {
if (getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == V_JOB_MEDICAL) {
return true;
}
}