diff --git a/files/images/server-logo.png b/files/images/server-logo.png
new file mode 100644
index 00000000..00d67502
Binary files /dev/null and b/files/images/server-logo.png differ
diff --git a/locale/chinese.json b/locale/chinese.json
index 9f689e8d..5286e7db 100644
--- a/locale/chinese.json
+++ b/locale/chinese.json
@@ -389,5 +389,9 @@
"FixingStuck": "Fixing your position and virtual world ...",
"CantUseCommandYet": "You must wait before you can use this command again!",
"NotATester": "You are not a tester!",
- "AccessDenied": "AccessDenied"
+ "AccessDenied": "AccessDenied",
+ "InvalidSkin": "That skin is invalid!",
+ "HeaderInteriorTypes": "Interiors List",
+ "ViewInventoryKeyPressTip": "Press {1} to see your items",
+ "ViewInventoryCommandTip": "Use {1} to see your items"
}
diff --git a/locale/english.json b/locale/english.json
index 873af6b4..5f68c88e 100644
--- a/locale/english.json
+++ b/locale/english.json
@@ -389,5 +389,9 @@
"FixingStuck": "Fixing your position and virtual world ...",
"CantUseCommandYet": "You must wait before you can use this command again!",
"NotATester": "You are not a tester!",
- "AccessDenied": "AccessDenied"
+ "AccessDenied": "AccessDenied",
+ "InvalidSkin": "That skin is invalid!",
+ "HeaderInteriorTypes": "Interiors List",
+ "ViewInventoryKeyPressTip": "Press {1} to see your items",
+ "ViewInventoryCommandTip": "Use {1} to see your items"
}
diff --git a/locale/polish.json b/locale/polish.json
index 70f96050..e38d5e1f 100644
--- a/locale/polish.json
+++ b/locale/polish.json
@@ -389,5 +389,9 @@
"FixingStuck": "Fixing your position and virtual world ...",
"CantUseCommandYet": "You must wait before you can use this command again!",
"NotATester": "You are not a tester!",
- "AccessDenied": "AccessDenied"
+ "AccessDenied": "AccessDenied",
+ "InvalidSkin": "That skin is invalid!",
+ "HeaderInteriorTypes": "Interiors List",
+ "ViewInventoryKeyPressTip": "Press {1} to see your items",
+ "ViewInventoryCommandTip": "Use {1} to see your items"
}
diff --git a/locale/russian.json b/locale/russian.json
index 7580425c..82a535d2 100644
--- a/locale/russian.json
+++ b/locale/russian.json
@@ -320,73 +320,77 @@
},
"ADDED-21JAN2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations.",
- "HeaderPlayerHousesList": "Player Houses ({1})",
- "HeaderPlayerStaffFlagsList": "Player Staff Flags ({1})",
- "HeaderStaffFlagsList": "Staff Flags",
- "NonRPName": "Non-RP name! Choose a new one:",
- "InvalidStaffFlag": "Staff flag not found!",
- "InvalidClanFlag": "Clan flag not found!",
- "InvalidLocale": "Language not found!",
- "HeaderJobUniformList": "Job Uniforms ({1})",
- "HeaderJobEquipmentList": "Job Equipment ({1})",
- "InvalidJobUniform": "Job uniform not found!",
- "InvalidJobEquipment": "Job equipment not found!",
- "HeaderVehiclesInRangeList": "Vehicles within {1}",
- "NoVehiclesWithInRange": "There are no vehicles within {1}",
- "AmountNotNumber": "The amount must be a number!",
- "NeedToBeWorking": "You need to be working! Use {1} at a job location or near a job vehicle.",
- "NeedToBeOnJobRoute": "You need to be doing a job route! Use {1} in a job vehicle",
- "CurrentJobRouteDeleted": "The job route you were on has been deleted by an admin",
- "CurrentJobRouteVehicleColoursChanged": "Your job route's vehicle colours were changed by an admin",
- "NotYourJob": "This is not your job!",
- "JobPoints": "You can get a job by going the yellow points on the map.",
- "QuitJobToTakeAnother": "If you want this job, use {1} to quit your current job.",
- "NotAJobVehicle": "This is not a job vehicle!",
- "NotYourJobVehicle": "This is not your job's vehicle!",
- "JobRouteDisabled": "The job route you were on has been disabled by an admin",
- "HeaderPickupTypes": "Pickup Types",
- "HeaderBlipTypes": "Map Icon Types",
- "InvalidGPSLocation": "There are no locations with that name or type",
- "HeaderBusinessList": "Businesses",
- "VehicleForSale": "This {1} is buyable for {2}! Use {3} if you want to buy it",
- "VehicleForRent": "This {1} is rentable for {2}! Use {3} if you want to rent it",
+ "HeaderPlayerHousesList": "Дома Игрока ({1})",
+ "HeaderPlayerStaffFlagsList": "Флаги игрока персонала ({1})",
+ "HeaderStaffFlagsList": "Флаги персонала",
+ "NonRPName": "Ваше имя не подходит для ролевой игры! Выберете другое:",
+ "InvalidStaffFlag": "Не удалось найти флаг персонала!",
+ "InvalidClanFlag": "Не удалось найти флаг клана!",
+ "InvalidLocale": "Не удалось найти язык!",
+ "HeaderJobUniformList": "Рабочие униформы ({1})",
+ "HeaderJobEquipmentList": "Рабочие снаряжение ({1})",
+ "InvalidJobUniform": "Не удалось найти рабочую униформу!",
+ "InvalidJobEquipment": "Не удалось найти рабочее снаряжение!",
+ "HeaderVehiclesInRangeList": "Транспорт в пределах {1}",
+ "NoVehiclesWithInRange": "Нет транспорта в пределах {1}",
+ "AmountNotNumber": "Количество должно быть введено цифрой!",
+ "NeedToBeWorking": "Вы должны быть на работе! Используйте {1} на месте работы или возле рабочего транспорта.",
+ "NeedToBeOnJobRoute": "Вы должны быть на рабочем маршруте! Используйте {1} в рабочем транспорте",
+ "CurrentJobRouteDeleted": "Рабочий маршрут на котором вы находились был удален администратором",
+ "CurrentJobRouteVehicleColoursChanged": "Цвет транспорта на маршруте был изменен администратором",
+ "NotYourJob": "Это работа пренадлежит не вам!",
+ "JobPoints": "Вы можете устроиться на работу ориентируясь по желтым значкам на карте.",
+ "QuitJobToTakeAnother": "Если хотите покинуть работу, ипользуйте {1}.",
+ "NotAJobVehicle": "Это не рабочий транспорт!",
+ "NotYourJobVehicle": "Этот транспорт пренадлежит не вашей работе!",
+ "JobRouteDisabled": "Рабочий маршрут на котором вы были был удален администратором",
+ "HeaderPickupTypes": "Типы подбираемых предметов",
+ "HeaderBlipTypes": "Типы иконок карты",
+ "InvalidGPSLocation": "Не существует локаций с таки именем или такого типа",
+ "HeaderBusinessList": "Бизнесы",
+ "VehicleForSale": "Этот {1} можно купить за {2}! Используйте {3} если хотите его купить",
+ "VehicleForRent": "Этот {1} может быть орендован за {2}! Используйте {3} если хотите его орендовать",
"ADDED-31JAN2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations.",
- "LoginFailedInvalidPassword": "Invalid password! {1} attempts remaining",
- "LoginFailedNoPassword": "You must enter a password! ! {1} attempts remaining",
- "RegistrationFailedNoPassword": "You must enter a password!",
- "RegistrationFailedNoPasswordConfirm": "You must confirm the password!",
- "RegistrationFailedNoEmail": "You must enter an email!",
- "AccountNameAlreadyRegistered": "Your name is already registered!",
- "AlreadyLoggedIn": "You are already logged in!",
- "RegistrationFailedInvalidEmail": "That email is invalid!",
- "RegistrationFailedPasswordMismatch": "The passwords don't match!",
- "RegistrationFailedCreateError": "Your account couldn't be created!",
- "RegistrationSuccess": "Your account has been created!",
- "RegistrationEmailVerifyReminder": "Don't forget to verify your email! A verification code has been sent to you.",
- "RegistrationCreateCharReminder": "To play on the server, you will need to make a character.",
- "NoCharactersGUIMessage": "You have no characters. Would you like to make one?",
- "NoCharactersGUIWindowTitle": "No characters",
- "NoCharactersChatMessage": "You have no characters. Use {1} to make one.",
- "NeedEmailFor2FA": "You need to add your email to your account to use two-factor authentication.",
- "NeedEmailVerifiedFor2FA": "You need to verify your email to use two-factor authentication.",
- "SetEmailHelpTip": "Use {1} to set your email.",
- "VerifyEmailHelpTip": "Use {1} to verify your email.",
+ "LoginFailedInvalidPassword": "Неправельный пароль! Осталось {1} попыток",
+ "LoginFailedNoPassword": "Вы должны ввести пароль! Осталось {1} попыток",
+ "RegistrationFailedNoPassword": "Вы должны ввести пароль!",
+ "RegistrationFailedNoPasswordConfirm": "Вы должны подтвердить пароль!",
+ "RegistrationFailedNoEmail": "Вы должны ввести адрес электронной почты!",
+ "AccountNameAlreadyRegistered": "Ваше имя уже зарегистрировано!",
+ "AlreadyLoggedIn": "Вы уже вошли!",
+ "RegistrationFailedInvalidEmail": "Такого адреса не существует!",
+ "RegistrationFailedPasswordMismatch": "Пароли не совпадают!",
+ "RegistrationFailedCreateError": "Не удалось создать аккаунт!",
+ "RegistrationSuccess": "Ваш аккаунт был успешно создан!",
+ "RegistrationEmailVerifyReminder": "Не забудьте подтвердить ваш электронный адрес, код подверждения был послан вам на электронную почту.",
+ "RegistrationCreateCharReminder": "Чтобы играть на сервере, вам нужно будет создать персонажа.",
+ "NoCharactersGUIMessage": "У вас нет персонажей. Не хотите создать?",
+ "NoCharactersGUIWindowTitle": "Нет персонажей",
+ "NoCharactersChatMessage": "У вас нет персонажей. Используйте {1} чтобы создать.",
+ "NeedEmailFor2FA": "Вам нужно добавить ваш адрес электронной почты чтобы использовать двухфакторную аунтентификацию.",
+ "NeedEmailVerifiedFor2FA": "Вам нужно подтвердить вашу электронную почту чтобы использовать двухфакторную аунтентификацию.",
+ "SetEmailHelpTip": "Используйте {1} чтобы установить ваш адрес электронной почты.",
+ "VerifyEmailHelpTip": "Используйте {1} чтобы подтвердить ваш адрес электронной почты.",
"ADDED-13FEB2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations.",
- "NearbyRadio": "Nearby radio",
- "FromRadio": "From radio",
- "ToRadio": "To radio",
- "NeedToEnterPropertyCommand": "You need to enter the {1} first! Use {2} to enter and exit",
- "NeedToEnterPropertyKeyPress": "You need to enter the {1} first! Press {2} to enter and exit",
- "InventoryFullCantCarry": "You don't have any space to carry this (full inventory)!",
- "NotEnoughCashNeedAmountMore": "You don't have enough money! You need {1} more!",
- "AmountMustBeMoreThan": "The amount must be more than {1}!",
- "WeaponBanned": "You are not allowed to buy or use weapons!",
- "TimeNotNumber": "The time must be a number",
- "HeaderDefaultBusinessItemTypes": "Business Item Templates",
- "FixingStuck": "Fixing your position and virtual world ...",
- "CantUseCommandYet": "You must wait before you can use this command again!",
- "NotATester": "You are not a tester!",
- "AccessDenied": "AccessDenied"
+ "NearbyRadio": "Ближайшее радио",
+ "FromRadio": "Из радио",
+ "ToRadio": "В радио",
+ "NeedToEnterPropertyCommand": "Вам нужно сначало ввести {1}! Используйте {2} чтобы выйти",
+ "NeedToEnterPropertyKeyPress": "Вам нужно сначало ввести {1}! Используйте {2} чтобы выйти",
+ "InventoryFullCantCarry": "У вас недостаточно места в инвентаре(Инвентарь заполнен)!",
+ "NotEnoughCashNeedAmountMore": "У вас недостаточно денег! У вас не хватает {1}!",
+ "AmountMustBeMoreThan": "Количество должно быть больше {1}!",
+ "WeaponBanned": "Вам нельзя покупать оружие!",
+ "TimeNotNumber": "Время должно быть назначено цифрой",
+ "HeaderDefaultBusinessItemTypes": "Шаблоны предметов бизнеса",
+ "FixingStuck": "Исправляет вашу текущую позицию и виртуальный мир ...",
+ "CantUseCommandYet": "Подождите некоторое время перед тем как использовать комманду снова!",
+ "NotATester": "Вы не тестировщик!",
+ "AccessDenied": "Доступ запрещен",
+ "InvalidSkin": "That skin is invalid!",
+ "HeaderInteriorTypes": "Interiors List",
+ "ViewInventoryKeyPressTip": "Press {1} to see your items",
+ "ViewInventoryCommandTip": "Use {1} to see your items"
}
diff --git a/locale/spanish.json b/locale/spanish.json
index 520ef55f..7562b925 100644
--- a/locale/spanish.json
+++ b/locale/spanish.json
@@ -393,5 +393,9 @@
"FixingStuck": "Fixing your position and virtual world ...",
"CantUseCommandYet": "You must wait before you can use this command again!",
"NotATester": "You are not a tester!",
- "AccessDenied": "AccessDenied"
+ "AccessDenied": "AccessDenied",
+ "InvalidSkin": "That skin is invalid!",
+ "HeaderInteriorTypes": "Interiors List",
+ "ViewInventoryKeyPressTip": "Press {1} to see your items",
+ "ViewInventoryCommandTip": "Use {1} to see your items"
}
diff --git a/meta.xml b/meta.xml
index a4c5301a..79e7de37 100644
--- a/meta.xml
+++ b/meta.xml
@@ -9,6 +9,7 @@
+
@@ -93,6 +94,7 @@
+
@@ -111,27 +113,29 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/scripts/client/business.js b/scripts/client/business.js
new file mode 100644
index 00000000..3bcee937
--- /dev/null
+++ b/scripts/client/business.js
@@ -0,0 +1,84 @@
+// ===========================================================================
+// Vortrex's Roleplay Resource
+// https://github.com/VortrexFTW/gtac_roleplay
+// ===========================================================================
+// FILE: business.js
+// DESC: Provides business functions and usage
+// TYPE: Client (JavaScript)
+// ===========================================================================
+
+class BusinessData {
+ constructor(businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems) {
+ this.index = -1;
+ this.businessId = businessId;
+ this.name = name;
+ this.entrancePosition = entrancePosition;
+ this.blipModel = blipModel;
+ this.pickupModel = pickupModel;
+ this.hasInterior = hasInterior;
+ this.hasItems = hasItems;
+ this.blipId = -1;
+ }
+}
+
+// ===========================================================================
+
+function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems) {
+ if(getGame() == VRR_GAME_GTA_IV) {
+ if(getBusinessData(businessId) != false) {
+ if(blipModel == -1) {
+ natives.removeBlipAndClearIndex(getBusinessData(businessId).blipId);
+ getBusinessData(businessId).blipId = -1;
+ //businesses.splice(getBusinessData(businessId).index, 1);
+ //setAllBusinessDataIndexes();
+ } else {
+ if(getBusinessData(businessId).blipId != -1) {
+ natives.setBlipCoordinates(getBusinessData(businessId).blipId, getBusinessData(businessId).entrancePosition);
+ natives.changeBlipSprite(getBusinessData(businessId).blipId, getBusinessData(businessId).blipModel);
+ natives.changeBlipNameFromAscii(getBusinessData(businessId).blipId, `${name.substr(0, 24)}${(name.length > 24) ? " ...": ""}`);
+ } else {
+ let blipId = natives.addBlipForCoord(entrancePosition);
+ if(blipId) {
+ getBusinessData(businessId).blipId = blipId;
+ natives.changeBlipSprite(blipId, blipModel);
+ natives.setBlipMarkerLongDistance(blipId, false);
+ }
+ }
+ }
+ } else {
+ if(blipModel != -1) {
+ let tempBusinessData = new BusinessData(businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems);
+ let blipId = natives.addBlipForCoord(entrancePosition);
+ if(blipId) {
+ tempBusinessData.blipId = blipId;
+ natives.changeBlipSprite(blipId, blipModel);
+ natives.setBlipMarkerLongDistance(blipId, false);
+ natives.changeBlipNameFromAscii(blipId, `${name.substr(0, 24)}${(name.length > 24) ? " ...": ""}`);
+ }
+ businesses.push(tempBusinessData);
+ setAllBusinessDataIndexes();
+ }
+ }
+ }
+}
+
+// ===========================================================================
+
+/**
+ * @param {number} businessId - The ID of the business (initially provided by server)
+ * @return {BusinessData} The business's data (class instance)
+ */
+function getBusinessData(businessId) {
+ let tempBusinessData = businesses.find((b) => b.businessId == businessId);
+ return (typeof tempBusinessData != "undefined") ? tempBusinessData : false;
+}
+
+// ===========================================================================
+
+function setAllBusinessDataIndexes() {
+ for(let i in businesses) {
+ businesses[i].index = i;
+ }
+}
+
+// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/content.js b/scripts/client/content.js
index d09d8074..214655ea 100644
--- a/scripts/client/content.js
+++ b/scripts/client/content.js
@@ -8,7 +8,7 @@
// ===========================================================================
function getCustomImage(imageName) {
- let contentResource = findResourceByName(getGameData().extraContentResource[getGame()]);
+ let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
if(contentResource != null) {
if(contentResource.isStarted) {
let image = contentResource.exports.getCustomImage(imageName);
@@ -23,7 +23,7 @@ function getCustomImage(imageName) {
// ===========================================================================
function getCustomFont(fontName) {
- let contentResource = findResourceByName(getGameData().extraContentResource[getGame()]);
+ let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
if(contentResource != null) {
if(contentResource.isStarted) {
let font = contentResource.exports.getCustomFont(fontName);
@@ -38,7 +38,7 @@ function getCustomFont(fontName) {
// ===========================================================================
function getCustomAudio(audioName) {
- let contentResource = findResourceByName(getGameData().extraContentResource[getGame()]);
+ let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
if(contentResource != null) {
if(contentResource.isStarted) {
let audioFile = contentResource.exports.getCustomAudio(audioName);
@@ -53,7 +53,7 @@ function getCustomAudio(audioName) {
// ===========================================================================
function playCustomAudio(audioName, volume = 0.5, loop = false) {
- let contentResource = findResourceByName(getGameData().extraContentResource[getGame()]);
+ let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
if(contentResource != null) {
if(contentResource.isStarted) {
contentResource.exports.playCustomAudio(audioName, volume, loop);
diff --git a/scripts/client/gui.js b/scripts/client/gui.js
index 6b62002b..86bd4cf3 100644
--- a/scripts/client/gui.js
+++ b/scripts/client/gui.js
@@ -104,6 +104,7 @@ function closeAllWindows() {
listDialog.window.shown = false;
resetPassword.window.shown = false;
passwordChange.window.shown = false;
+
mexui.setInput(false);
mexui.focusedControl = false;
@@ -299,14 +300,22 @@ function processGUIKeyPress(keyCode) {
if(guiSubmitKey != false) {
guiSubmitKey();
}
- } else if(keyCode == SDLK_LEFT) {
+ } else if(keyCode == getKeyIdFromParams("left") || keyCode == getKeyIdFromParams("a")) {
if(guiLeftKey != false) {
guiLeftKey();
}
- } else if(keyCode == SDLK_RIGHT) {
+ } else if(keyCode == getKeyIdFromParams("right") || keyCode == getKeyIdFromParams("d")) {
if(guiRightKey != false) {
guiRightKey();
}
+ } else if(keyCode == getKeyIdFromParams("down") || keyCode == getKeyIdFromParams("s")) {
+ if(guiDownKey != false) {
+ guiDownKey();
+ }
+ } else if(keyCode == getKeyIdFromParams("up") || keyCode == getKeyIdFromParams("w")) {
+ if(guiUpKey != false) {
+ guiUpKey();
+ }
}
}
diff --git a/scripts/client/gui/clanmgr.js b/scripts/client/gui/clanmgr.js
index 54d33359..631635dd 100644
--- a/scripts/client/gui/clanmgr.js
+++ b/scripts/client/gui/clanmgr.js
@@ -15,4 +15,6 @@ let clanManager = {
vehiclesTab: null,
businessesTab: null,
housesTab: null,
-};
\ No newline at end of file
+};
+
+// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/gui/login.js b/scripts/client/gui/login.js
index 60f4b15f..51b5fa03 100644
--- a/scripts/client/gui/login.js
+++ b/scripts/client/gui/login.js
@@ -22,7 +22,7 @@ let login = {
function initLoginGUI() {
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating login GUI ...`);
- login.window = mexui.window(game.width/2-150, game.height/2-130, 300, 260, 'LOGIN', {
+ login.window = mexui.window(game.width/2-150, game.height/2-135, 300, 275, 'LOGIN', {
main: {
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
transitionTime: 500,
@@ -42,7 +42,7 @@ function initLoginGUI() {
login.window.titleBarIconSize = toVector2(0,0);
login.window.titleBarHeight = 0;
- login.logoImage = login.window.image(5, 20, 290, 80, mainLogoPath, {
+ login.logoImage = login.window.image(5, 20, 290, 100, mainLogoPath, {
focused: {
borderColour: toColour(0, 0, 0, 0),
},
@@ -168,4 +168,6 @@ function switchToPasswordResetGUI() {
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing password reset dialog window`);
showResetPasswordGUI();
return false;
-}
\ No newline at end of file
+}
+
+// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/gui/newchar.js b/scripts/client/gui/newchar.js
index 8de5c579..fa7ff169 100644
--- a/scripts/client/gui/newchar.js
+++ b/scripts/client/gui/newchar.js
@@ -21,7 +21,7 @@ let newCharacter = {
function initNewCharacterGUI() {
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating new character GUI ...`);
- newCharacter.window = mexui.window(game.width/2-130, game.height/2-100, 300, 200, 'New Character', {
+ newCharacter.window = mexui.window(game.width/2-130, game.height/2-115, 300, 230, 'New Character', {
main: {
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
transitionTime: 500,
@@ -46,7 +46,7 @@ function initNewCharacterGUI() {
},
});
- newCharacter.messageLabel = newCharacter.window.text(20, 75, 260, 20, 'Name your character', {
+ newCharacter.messageLabel = newCharacter.window.text(20, 100, 260, 20, 'Name your character', {
main: {
textSize: 10.0,
textAlign: 0.5,
@@ -58,7 +58,7 @@ function initNewCharacterGUI() {
},
});
- newCharacter.firstNameInput = newCharacter.window.textInput(20, 100, 260, 25, '', {
+ newCharacter.firstNameInput = newCharacter.window.textInput(20, 125, 260, 25, '', {
main: {
backgroundColour: toColour(0, 0, 0, 120),
textColour: toColour(200, 200, 200, 255),
@@ -77,7 +77,7 @@ function initNewCharacterGUI() {
});
newCharacter.firstNameInput.placeholder = "First Name";
- newCharacter.lastNameInput = newCharacter.window.textInput(20, 130, 260, 25, '', {
+ newCharacter.lastNameInput = newCharacter.window.textInput(20, 155, 260, 25, '', {
main: {
backgroundColour: toColour(0, 0, 0, 120),
textColour: toColour(200, 200, 200, 255),
@@ -96,7 +96,7 @@ function initNewCharacterGUI() {
});
newCharacter.lastNameInput.placeholder = "Last Name";
- newCharacter.createCharacterButton = newCharacter.window.button(20, 160, 260, 25, 'CREATE CHARACTER', {
+ newCharacter.createCharacterButton = newCharacter.window.button(20, 185, 260, 25, 'CREATE CHARACTER', {
main: {
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
textColour: toColour(255, 255, 255, 255),
diff --git a/scripts/client/house.js b/scripts/client/house.js
new file mode 100644
index 00000000..aca1deca
--- /dev/null
+++ b/scripts/client/house.js
@@ -0,0 +1,82 @@
+// ===========================================================================
+// Vortrex's Roleplay Resource
+// https://github.com/VortrexFTW/gtac_roleplay
+// ===========================================================================
+// FILE: house.js
+// DESC: Provides house functions and usage
+// TYPE: Client (JavaScript)
+// ===========================================================================
+
+class HouseData {
+ constructor(houseId, entrancePosition, blipModel, pickupModel, hasInterior) {
+ this.index = -1;
+ this.houseId = houseId;
+ this.entrancePosition = entrancePosition;
+ this.blipModel = blipModel;
+ this.pickupModel = pickupModel;
+ this.hasInterior = hasInterior;
+ this.blipId = -1;
+ }
+}
+
+// ===========================================================================
+
+function receiveHouseFromServer(houseId, entrancePosition, blipModel, pickupModel, hasInterior) {
+ if(getGame() == VRR_GAME_GTA_IV) {
+ if(getHouseData(houseId) != false) {
+ if(blipModel == -1) {
+ natives.removeBlipAndClearIndex(getHouseData(houseId).blipId);
+ getHouseData(houseId).blipId = -1;
+ //houses.splice(getHouseData(houseId).index, 1);
+ //setAllHouseDataIndexes();
+ } else {
+ if(getHouseData(houseId).blipId != -1) {
+ natives.setBlipCoordinates(getHouseData(houseId).blipId, getHouseData(houseId).entrancePosition);
+ natives.changeBlipSprite(getHouseData(houseId).blipId, getHouseData(houseId).blipModel);
+ //natives.changeBlipNameFromAscii(getHouseData(houseId).blipId, `${name.substr(0, 24)}${(name.length > 24) ? " ...": ""}`);
+ } else {
+ let blipId = natives.addBlipForCoord(entrancePosition);
+ if(blipId) {
+ getHouseData(houseId).blipId = blipId;
+ natives.changeBlipSprite(blipId, blipModel);
+ natives.setBlipMarkerLongDistance(blipId, false);
+ }
+ }
+ }
+ } else {
+ if(blipModel != -1) {
+ let tempHouseData = new HouseData(houseId, entrancePosition, blipModel, pickupModel, hasInterior, hasItems);
+ let blipId = natives.addBlipForCoord(entrancePosition);
+ if(blipId) {
+ tempHouseData.blipId = blipId;
+ natives.changeBlipSprite(blipId, blipModel);
+ natives.setBlipMarkerLongDistance(blipId, false);
+ //natives.changeBlipNameFromAscii(blipId, `${name.substr(0, 24)}${(name.length > 24) ? " ...": ""}`);
+ }
+ houses.push(tempHouseData);
+ setAllHouseDataIndexes();
+ }
+ }
+ }
+}
+
+// ===========================================================================
+
+/**
+ * @param {number} houseId - The ID of the house (initially provided by server)
+ * @return {HouseData} The house's data (class instance)
+ */
+function getHouseData(houseId) {
+ let tempHouseData = houses.find((h) => h.houseId == houseId);
+ return (typeof tempHouseData != "undefined") ? tempHouseData : false;
+}
+
+// ===========================================================================
+
+function setAllHouseDataIndexes() {
+ for(let i in houses) {
+ houses[i].index = i;
+ }
+}
+
+// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/label.js b/scripts/client/label.js
index 70e2df8e..d794b549 100644
--- a/scripts/client/label.js
+++ b/scripts/client/label.js
@@ -249,42 +249,54 @@ function renderJobLabel(name, position, jobType) {
function processLabelRendering() {
if(renderLabels && areWorldLabelsSupported()) {
if(localPlayer != null) {
- let pickups = getElementsByType(ELEMENT_PICKUP);
- for(let i in pickups) {
- if(pickups[i].getData("vrr.label.type") != null) {
- if(getDistance(localPlayer.position, pickups[i].position) <= renderLabelDistance) {
- if(!pickups[i].isOnScreen) {
- let price = "0";
- let rentPrice = "0";
- let labelInfoType = VRR_PROPLABEL_INFO_NONE;
- if(pickups[i].getData("vrr.label.price") != null) {
- price = makeLargeNumberReadable(pickups[i].getData("vrr.label.price"));
- }
-
- if(pickups[i].getData("vrr.label.rentprice") != null) {
- rentPrice = makeLargeNumberReadable(pickups[i].getData("vrr.label.rentprice"));
- }
-
- if(pickups[i].getData("vrr.label.help") != null) {
- labelInfoType = pickups[i].getData("vrr.label.help");
- }
-
- switch(pickups[i].getData("vrr.label.type")) {
- case VRR_LABEL_BUSINESS:
- renderPropertyEntranceLabel(pickups[i].getData("vrr.label.name"), pickups[i].position, pickups[i].getData("vrr.label.locked"), true, price, rentPrice, labelInfoType);
- break;
-
- case VRR_LABEL_HOUSE:
- renderPropertyEntranceLabel("House", pickups[i].position, pickups[i].getData("vrr.label.locked"), false, price, rentPrice, labelInfoType);
- break;
-
- case VRR_LABEL_JOB:
- renderJobLabel(pickups[i].getData("vrr.label.name"), pickups[i].position, pickups[i].getData("vrr.label.jobType"));
- break;
-
- case VRR_LABEL_EXIT:
- renderPropertyExitLabel(pickups[i].position);
- break;
+ if(!areServerElementsSupported()) {
+ //for(let i in businesses) {
+ // if(getDistance(localPlayer.position, businesses[i].entrancePosition) <= 75.0) {
+ // natives.drawColouredCylinder(businesses[i].entrancePosition, 0.0, 0.0, 0, 153, 255);
+ // }
+ //}
+
+ // natives.getScreenViewportId
+ // natives.getGameViewportId
+ // natives.getViewportPositionOfCoord
+ } else {
+ let pickups = getElementsByType(ELEMENT_PICKUP);
+ for(let i in pickups) {
+ if(pickups[i].getData("vrr.label.type") != null) {
+ if(getDistance(localPlayer.position, pickups[i].position) <= renderLabelDistance) {
+ if(!pickups[i].isOnScreen) {
+ let price = "0";
+ let rentPrice = "0";
+ let labelInfoType = VRR_PROPLABEL_INFO_NONE;
+ if(pickups[i].getData("vrr.label.price") != null) {
+ price = makeLargeNumberReadable(pickups[i].getData("vrr.label.price"));
+ }
+
+ if(pickups[i].getData("vrr.label.rentprice") != null) {
+ rentPrice = makeLargeNumberReadable(pickups[i].getData("vrr.label.rentprice"));
+ }
+
+ if(pickups[i].getData("vrr.label.help") != null) {
+ labelInfoType = pickups[i].getData("vrr.label.help");
+ }
+
+ switch(pickups[i].getData("vrr.label.type")) {
+ case VRR_LABEL_BUSINESS:
+ renderPropertyEntranceLabel(pickups[i].getData("vrr.label.name"), pickups[i].position, pickups[i].getData("vrr.label.locked"), true, price, rentPrice, labelInfoType);
+ break;
+
+ case VRR_LABEL_HOUSE:
+ renderPropertyEntranceLabel("House", pickups[i].position, pickups[i].getData("vrr.label.locked"), false, price, rentPrice, labelInfoType);
+ break;
+
+ case VRR_LABEL_JOB:
+ renderJobLabel(pickups[i].getData("vrr.label.name"), pickups[i].position, pickups[i].getData("vrr.label.jobType"));
+ break;
+
+ case VRR_LABEL_EXIT:
+ renderPropertyExitLabel(pickups[i].position);
+ break;
+ }
}
}
}
diff --git a/scripts/client/main.js b/scripts/client/main.js
index 7292f970..e28117a2 100644
--- a/scripts/client/main.js
+++ b/scripts/client/main.js
@@ -69,4 +69,9 @@ let forceWantedLevel = 0;
// Pre-cache all allowed skins
let allowedSkins = getAllowedSkins(getGame());
+let businesses = [];
+let houses = [];
+let jobs = [];
+let vehicles = [];
+
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/native/connected.js b/scripts/client/native/connected.js
index 69335fb2..f62b24bc 100644
--- a/scripts/client/native/connected.js
+++ b/scripts/client/native/connected.js
@@ -52,7 +52,7 @@ function deleteGameElement(element, position) {
// ===========================================================================
function createGameVehicle(modelIndex, position, heading) {
- return game.createVehicle(getGameData().vehicles[getGame()][modelIndex][0], position, heading);
+ return game.createVehicle(getGameConfig().vehicles[getGame()][modelIndex][0], position, heading);
}
// ===========================================================================
diff --git a/scripts/client/server.js b/scripts/client/server.js
index b5bb5da8..2bd4bf32 100644
--- a/scripts/client/server.js
+++ b/scripts/client/server.js
@@ -85,7 +85,6 @@ function addAllNetworkHandlers() {
addNetworkEventHandler("vrr.localPlayerSkin", setLocalPlayerSkin);
addNetworkEventHandler("vrr.forcePedAnim", forcePedAnimation);
addNetworkEventHandler("vrr.hideAllGUI", hideAllGUI);
- addNetworkEventHandler("vrr.gameScript", setGameScriptState);
addNetworkEventHandler("vrr.clientInfo", serverRequestedClientInfo);
addNetworkEventHandler("vrr.interiorLights", updateInteriorLightsState);
@@ -101,6 +100,13 @@ function addAllNetworkHandlers() {
addNetworkEventHandler("vrr.logLevel", setLogLevel);
addNetworkEventHandler("vrr.infiniteRun", setLocalPlayerInfiniteRun);
+
+ addNetworkEventHandler("vrr.business", receiveBusinessFromServer);
+ addNetworkEventHandler("vrr.house", receiveHouseFromServer);
+
+ addNetworkEventHandler("vrr.holdObject", makePedHoldObject);
+
+ addNetworkEventHandler("vrr.playerPedId", sendLocalPlayerNetworkIdToServer);
}
// ===========================================================================
@@ -133,6 +139,8 @@ function setPlayer2DRendering(hudState, labelState, smallGameMessageState, score
natives.displayCash(hudState);
natives.displayAmmo(hudState);
natives.displayHud(hudState);
+ natives.displayRadar(hudState);
+ natives.displayAreaName(hudState);
} else {
if(typeof setHUDEnabled != "undefined") {
setHUDEnabled(hudState);
@@ -205,18 +213,6 @@ function setEnterPropertyKey(key) {
// ===========================================================================
-function setGameScriptState(scriptName, state) {
- if(state == VRR_GAMESCRIPT_FORCE) {
- logToConsole(`[VRR.Server] Starting game script '${scriptName}'`);
- game.startNewScript(scriptName);
- } else if(state == VRR_GAMESCRIPT_DENY) {
- logToConsole(`[VRR.Server] Terminating game script '${scriptName}'`);
- game.terminateScript(scriptName);
- }
-}
-
-// ===========================================================================
-
function serverRequestedClientInfo() {
sendServerClientInfo();
}
@@ -266,6 +262,9 @@ function setElementCollisionsEnabled(elementId, state) {
function setLocalPlayerPedPartsAndProps(parts, props) {
for(let i in parts) {
localPlayer.changeBodyPart(parts[0], parts[1], parts[2]);
+ }
+
+ for(let i in props) {
localPlayer.changeBodyProp(props[0], props[1]);
}
}
@@ -304,11 +303,26 @@ function setLocalPlayerInfiniteRun(state) {
function setLocalPlayerSkin(skinId) {
if(getGame() == VRR_GAME_GTA_IV) {
- //natives.changePlayerModel(natives.getPlayerId(), skinId);
- localPlayer.skin = allowedSkins[skinSelectorIndex][0];
+ natives.changePlayerModel(natives.getPlayerId(), skinId);
+ //localPlayer.skin = allowedSkins[skinSelectorIndex][0];
+ //localPlayer.modelIndex = allowedSkins[skinSelectorIndex][0];
} else {
localPlayer.skin = skinId;
}
}
+// ===========================================================================
+
+function makePedHoldObject(pedId, modelIndex) {
+ if(getGame() == VRR_GAME_GTA_IV) {
+ natives.givePedAmbientObject(natives.getPedFromNetworkId(pedId), getGameConfig().objects[getGame()][modelIndex][1])
+ }
+}
+
+// ===========================================================================
+
+function sendLocalPlayerNetworkIdToServer() {
+ sendNetworkEventToServer("vrr.playerPedId", natives.getNetworkIdFromPed(localPlayer));
+}
+
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/skin-select.js b/scripts/client/skin-select.js
index 2f3149e7..2b361383 100644
--- a/scripts/client/skin-select.js
+++ b/scripts/client/skin-select.js
@@ -55,7 +55,8 @@ function processSkinSelectKeyPress(keyCode) {
skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1];
if(getGame() == VRR_GAME_GTA_IV) {
//natives.changePlayerModel(natives.getPlayerId(), allowedSkins[skinSelectorIndex][0]);
- localPlayer.skin = allowedSkins[skinSelectorIndex][0];
+ //localPlayer.skin = allowedSkins[skinSelectorIndex][0];
+ //localPlayer.modelIndex = allowedSkins[skinSelectorIndex][0];
} else {
localPlayer.skin = allowedSkins[skinSelectorIndex][0];
}
@@ -69,7 +70,8 @@ function processSkinSelectKeyPress(keyCode) {
skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1];
if(getGame() == VRR_GAME_GTA_IV) {
//natives.changePlayerModel(natives.getPlayerId(), allowedSkins[skinSelectorIndex][0]);
- localPlayer.skin = allowedSkins[skinSelectorIndex][0];
+ //localPlayer.skin = allowedSkins[skinSelectorIndex][0];
+ //localPlayer.modelIndex = allowedSkins[skinSelectorIndex][0];
} else {
localPlayer.skin = allowedSkins[skinSelectorIndex][0];
}
diff --git a/scripts/client/startup.js b/scripts/client/startup.js
index 1dcdcb3a..bd38327f 100644
--- a/scripts/client/startup.js
+++ b/scripts/client/startup.js
@@ -24,6 +24,146 @@ function initClientScripts() {
// ===========================================================================
+function setUpInitialGame() {
+ if(getGame() == VRR_GAME_GTA_III) {
+ game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0);
+ game.setGameStat(STAT_PROGRESSMADE, 9999);
+ game.setGameStat(STAT_TOTALPROGRESSINGAME, 9999);
+ game.SET_CAR_DENSITY_MULTIPLIER(3.0);
+ game.SET_PED_DENSITY_MULTIPLIER(3.0);
+ game.onMission = true;
+ SetStandardControlsEnabled(true);
+ return true;
+ }
+
+ if(getGame() == VRR_GAME_GTA_VC) {
+ game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0);
+ game.setGameStat(STAT_PROGRESSMADE, 9999);
+ game.setGameStat(STAT_TOTALPROGRESSINGAME, 9999);
+ game.SET_CAR_DENSITY_MULTIPLIER(3.0);
+ game.SET_PED_DENSITY_MULTIPLIER(3.0);
+
+ game.REQUEST_ANIMATION("bikev");
+ game.REQUEST_ANIMATION("bikeh");
+ game.REQUEST_ANIMATION("biked");
+ game.REQUEST_ANIMATION("knife");
+ game.REQUEST_ANIMATION("python");
+ game.REQUEST_ANIMATION("shotgun");
+ game.REQUEST_ANIMATION("buddy");
+ game.REQUEST_ANIMATION("tec");
+ game.REQUEST_ANIMATION("uzi");
+ game.REQUEST_ANIMATION("rifle");
+ game.REQUEST_ANIMATION("m60");
+ game.REQUEST_ANIMATION("sniper");
+ game.REQUEST_ANIMATION("grenade");
+ game.REQUEST_ANIMATION("flame");
+ game.REQUEST_ANIMATION("medic");
+ game.REQUEST_ANIMATION("sunbathe");
+ //game.REQUEST_ANIMATION("playidles");
+ game.REQUEST_ANIMATION("riot");
+ game.REQUEST_ANIMATION("strip");
+ game.REQUEST_ANIMATION("lance");
+ game.REQUEST_ANIMATION("skate");
+
+ game.LOAD_ALL_MODELS_NOW();
+ game.onMission = true;
+ SetStandardControlsEnabled(true);
+ return true;
+ }
+
+ if(getGame() == VRR_GAME_GTA_SA) {
+ game.setGameStat(STAT_WEAPONTYPE_PISTOL_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_PISTOL_SILENCED_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_DESERT_EAGLE_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_SHOTGUN_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_SAWNOFF_SHOTGUN_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_SPAS12_SHOTGUN_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_MICRO_UZI_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_MP5_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_AK47_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_M4_SKILL, 400);
+ game.setGameStat(STAT_DRIVING_SKILL, 9999);
+ game.setGameStat(STAT_FAT, 9999);
+ game.setGameStat(STAT_ENERGY, 9999);
+ game.setGameStat(STAT_CYCLE_SKILL, 9999);
+ game.setGameStat(STAT_BIKE_SKILL, 9999);
+ game.setGameStat(STAT_GAMBLING, 9999);
+ game.setGameStat(STAT_PROGRESS_MADE, 9999);
+ game.setGameStat(STAT_RESPECT, 0);
+ game.setGameStat(STAT_RESPECT_TOTAL, 0);
+ game.setGameStat(STAT_SEX_APPEAL, 0);
+ game.setGameStat(STAT_STAMINA, 9999);
+ game.setGameStat(STAT_TOTAL_PROGRESS, 9999);
+ game.setGameStat(STAT_UNDERWATER_STAMINA, 9999);
+ game.setGameStat(STAT_BODY_MUSCLE, 9999);
+
+ game.setDefaultInteriors(false);
+ game.onMission = true;
+ return true;
+ }
+
+ if(getGame() == VRR_GAME_GTA_IV) {
+ natives.allowEmergencyServices(false);
+ natives.setCreateRandomCops(true);
+ natives.setMaxWantedLevel(0);
+ natives.setWantedMultiplier(0.0);
+ natives.allowPlayerToCarryNonMissionObjects(natives.getPlayerId(), true);
+ natives.setPlayerTeam(natives.getPlayerId(), 0);
+ natives.loadAllObjectsNow();
+ natives.setCellphoneRanked(false);
+ natives.setOverrideNoSprintingOnPhoneInMultiplayer(false);
+ natives.setSyncWeatherAndGameTime(false);
+ natives.usePlayerColourInsteadOfTeamColour(true);
+ natives.disablePauseMenu(true);
+ natives.allowReactionAnims(localPlayer, true);
+ natives.allowGameToPauseForStreaming(false);
+ natives.allowStuntJumpsToTrigger(false);
+ natives.setPickupsFixCars(false);
+
+ // HUD and Display
+ //natives.displayCash(false);
+ //natives.displayAmmo(false);
+ //natives.displayHud(false);
+ //natives.displayRadar(false);
+ //natives.displayAreaName(false);
+ //natives.displayPlayerNames(false);
+ natives.setPoliceRadarBlips(false);
+ natives.removeTemporaryRadarBlipsForPickups();
+ natives.displayNonMinigameHelpMessages(false);
+ natives.setDisplayPlayerNameAndIcon(natives.getPlayerId(), false);
+
+ // Item/Money Dropping
+ natives.setMoneyCarriedByAllNewPeds(0);
+ natives.setDeadPedsDropWeapons(false);
+ natives.setPlayersDropMoneyInNetworkGame(false);
+
+ // Population
+ //natives.dontSuppressAnyCarModels(5.0);
+ //natives.dontSuppressAnyPedModels(5.0);
+ //natives.forceGenerateParkedCarsTooCloseToOthers(true);
+ //natives.setParkedCarDensityMultiplier(5.0);
+ //natives.setRandomCarDensityMultiplier(5.0);
+ //natives.setPedDensityMultiplier(5.0);
+ //natives.setCarDensityMultiplier(5.0);
+ //natives.setScenarioPedDensityMultiplier(5.0, 5.0);
+ natives.switchRandomTrains(true);
+ natives.switchRandomBoats(true);
+ natives.switchAmbientPlanes(true);
+ natives.switchMadDrivers(false);
+
+ natives.requestAnims("DANCING");
+ return true;
+ }
+
+ if(getGame() == VRR_GAME_MAFIA_ONE) {
+ game.mapEnabled = false;
+ game.setTrafficEnabled(false);
+ return true;
+ }
+}
+
+// ===========================================================================
+
initClientScripts();
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/sync.js b/scripts/client/sync.js
index 3da59074..2ffe01e3 100644
--- a/scripts/client/sync.js
+++ b/scripts/client/sync.js
@@ -14,18 +14,6 @@ function processSync(event, deltaTime) {
sendNetworkEventToServer("vrr.player.heading", localPlayer.heading);
}
- //if(game.game == VRR_GAME_GTA_SA) {
- // let lookAtPos = getLocalPlayerLookAtPosition();
- // sendNetworkEventToServer("vrr.player.lookat", lookAtPos);
- // setEntityData(localPlayer, "vrr.headLook", lookAtPos);
- // let peds = getPeds();
- // for(let i in peds) {
- // if(doesEntityDataExist(peds[i], "vrr.headLook")) {
- // peds[i].lookAt(getEntityData(peds[i], "vrr.headLook"), 99999);
- // }
- // }
- //}
-
if(localPlayer.health <= 0) {
if(!calledDeathEvent) {
logToConsole(LOG_DEBUG, `Local player died`);
@@ -116,7 +104,7 @@ function syncVehicleProperties(vehicle) {
}
if(getGame() == VRR_GAME_GTA_SA) {
- let allUpgrades = getGameData().vehicleUpgrades[getGame()];
+ let allUpgrades = getGameConfig().vehicleUpgrades[getGame()];
for(let i in allUpgrades) {
vehicle.removeUpgrade(i);
}
@@ -391,4 +379,14 @@ function syncElementProperties(element) {
}
}
+
+
+// ===========================================================================
+
+function receiveHouseFromServer(houseId, entrancePosition, blipModel, pickupModel, hasInterior) {
+ if(getGame() == VRR_GAME_GTA_IV) {
+
+ }
+}
+
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/utilities.js b/scripts/client/utilities.js
index ed0abb08..64570a19 100644
--- a/scripts/client/utilities.js
+++ b/scripts/client/utilities.js
@@ -275,9 +275,17 @@ function runClientCode(code, returnTo) {
function enterVehicleAsPassenger() {
if(localPlayer.vehicle == null) {
let tempVehicle = getClosestVehicle(localPlayer.position);
- if(tempVehicle != null) {
- localPlayer.enterVehicle(tempVehicle, false);
- }
+ if(getGame() != VRR_GAME_GTA_IV) {
+ if(tempVehicle != null) {
+ localPlayer.enterVehicle(tempVehicle, false);
+ }
+ } else {
+ for(let i = 0 ; i <= natives.getMaximumNumberOfPassengers(tempVehicle); i++) {
+ if(natives.isCarPassengerSeatFree(tempVehicle, i)) {
+ natives.taskEnterCarAsPassenger(localPlayer, tempVehicle, i, 1);
+ }
+ }
+ }
}
}
@@ -348,6 +356,9 @@ function setLocalPlayerInterior(interior) {
if(!isGTAIV()) {
localPlayer.interior = interior;
game.cameraInterior = interior;
+ } else {
+ let interiorId = natives.getInteriorAtCoords(localPlayer.position);
+ natives.activateInterior(interiorId, true);
}
}
@@ -401,7 +412,11 @@ function clearLocalPedState() {
// ===========================================================================
function getWeaponSlot(weaponId) {
- return weaponSlots[game.game][weaponId];
+ if(getGame() == VRR_GAME_GTA_IV) {
+ return false;
+ }
+
+ return weaponSlots[getGame()][weaponId];
}
// ===========================================================================
@@ -498,6 +513,10 @@ function setLocalPlayerCash(amount) {
if(typeof localPlayer.money != "undefined") {
localPlayer.money = toInteger(amount);
}
+
+ if(getGame() == VRR_GAME_GTA_IV) {
+ natives.setMultiplayerHudCash(amount);
+ }
}
// ===========================================================================
@@ -615,12 +634,12 @@ function forceLocalPlayerEquippedWeaponItem() {
if(forceWeapon != 0) {
if(localPlayer.weapon != forceWeapon) {
localPlayer.weapon = forceWeapon;
- if(getGame() <= VRR_GAME_GTA_IV) {
+ if(getGame() < VRR_GAME_GTA_IV) {
localPlayer.setWeaponClipAmmunition(getWeaponSlot(forceWeapon), forceWeaponClipAmmo);
localPlayer.setWeaponAmmunition(getWeaponSlot(forceWeapon), forceWeaponAmmo);
}
} else {
- if(getGame() <= VRR_GAME_GTA_IV) {
+ if(getGame() < VRR_GAME_GTA_IV) {
forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(forceWeapon));
forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(forceWeapon));
}
@@ -745,119 +764,6 @@ function processNearbyPickups() {
// ===========================================================================
-function setUpInitialGame() {
- if(getGame() == VRR_GAME_GTA_III) {
- game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0);
- game.setGameStat(STAT_PROGRESSMADE, 9999);
- game.setGameStat(STAT_TOTALPROGRESSINGAME, 9999);
- game.SET_CAR_DENSITY_MULTIPLIER(3.0);
- game.SET_PED_DENSITY_MULTIPLIER(3.0);
- game.onMission = true;
- SetStandardControlsEnabled(true);
- return true;
- }
-
- if(getGame() == VRR_GAME_GTA_VC) {
- game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0);
- game.setGameStat(STAT_PROGRESSMADE, 9999);
- game.setGameStat(STAT_TOTALPROGRESSINGAME, 9999);
- game.SET_CAR_DENSITY_MULTIPLIER(3.0);
- game.SET_PED_DENSITY_MULTIPLIER(3.0);
-
- game.REQUEST_ANIMATION("bikev");
- game.REQUEST_ANIMATION("bikeh");
- game.REQUEST_ANIMATION("biked");
- game.REQUEST_ANIMATION("knife");
- game.REQUEST_ANIMATION("python");
- game.REQUEST_ANIMATION("shotgun");
- game.REQUEST_ANIMATION("buddy");
- game.REQUEST_ANIMATION("tec");
- game.REQUEST_ANIMATION("uzi");
- game.REQUEST_ANIMATION("rifle");
- game.REQUEST_ANIMATION("m60");
- game.REQUEST_ANIMATION("sniper");
- game.REQUEST_ANIMATION("grenade");
- game.REQUEST_ANIMATION("flame");
- game.REQUEST_ANIMATION("medic");
- game.REQUEST_ANIMATION("sunbathe");
- //game.REQUEST_ANIMATION("playidles");
- game.REQUEST_ANIMATION("riot");
- game.REQUEST_ANIMATION("strip");
- game.REQUEST_ANIMATION("lance");
- game.REQUEST_ANIMATION("skate");
-
- game.LOAD_ALL_MODELS_NOW();
- game.onMission = true;
- SetStandardControlsEnabled(true);
- return true;
- }
-
- if(getGame() == VRR_GAME_GTA_SA) {
- game.setGameStat(STAT_WEAPONTYPE_PISTOL_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_PISTOL_SILENCED_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_DESERT_EAGLE_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_SHOTGUN_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_SAWNOFF_SHOTGUN_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_SPAS12_SHOTGUN_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_MICRO_UZI_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_MP5_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_AK47_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_M4_SKILL, 400);
- game.setGameStat(STAT_DRIVING_SKILL, 9999);
- game.setGameStat(STAT_FAT, 9999);
- game.setGameStat(STAT_ENERGY, 9999);
- game.setGameStat(STAT_CYCLE_SKILL, 9999);
- game.setGameStat(STAT_BIKE_SKILL, 9999);
- game.setGameStat(STAT_GAMBLING, 9999);
- game.setGameStat(STAT_PROGRESS_MADE, 9999);
- game.setGameStat(STAT_RESPECT, 0);
- game.setGameStat(STAT_RESPECT_TOTAL, 0);
- game.setGameStat(STAT_SEX_APPEAL, 0);
- game.setGameStat(STAT_STAMINA, 9999);
- game.setGameStat(STAT_TOTAL_PROGRESS, 9999);
- game.setGameStat(STAT_UNDERWATER_STAMINA, 9999);
- game.setGameStat(STAT_BODY_MUSCLE, 9999);
-
- game.setDefaultInteriors(false);
- game.onMission = true;
- return true;
- }
-
- if(getGame() == VRR_GAME_GTA_IV) {
- natives.allowEmergencyServices(false);
- natives.setCreateRandomCops(true);
- natives.setMaxWantedLevel(0);
- natives.setWantedMultiplier(0.0);
- natives.allowPlayerToCarryNonMissionObjects(natives.getPlayerId(), true);
- natives.setPlayerTeam(natives.getPlayerId(), 0);
- natives.loadAllObjectsNow();
- natives.setCellphoneRanked(false);
- natives.setOverrideNoSprintingOnPhoneInMultiplayer(false);
- natives.setPlayersDropMoneyInNetworkGame(false);
- natives.setSyncWeatherAndGameTime(false);
- natives.usePlayerColourInsteadOfTeamColour(true);
- natives.setDisplayPlayerNameAndIcon(natives.getPlayerId(), false);
- natives.removeTemporaryRadarBlipsForPickups();
- natives.setPickupsFixCars(false);
- natives.displayCash(false);
- natives.displayAmmo(false);
- natives.displayHud(false);
- natives.displayAreaName(false);
- natives.setPoliceRadarBlips(false);
-
- natives.requestAnims("DANCING");
- return true;
- }
-
- if(getGame() == VRR_GAME_MAFIA_ONE) {
- game.mapEnabled = false;
- game.setTrafficEnabled(false);
- return true;
- }
-}
-
-// ===========================================================================
-
function processGameSpecifics() {
if(game.game < VRR_GAME_GTA_IV) {
game.clearMessages();
diff --git a/scripts/server/accent.js b/scripts/server/accent.js
index 6b76c45e..41cea951 100644
--- a/scripts/server/accent.js
+++ b/scripts/server/accent.js
@@ -63,8 +63,7 @@ function listAccentsCommand(command, params, client) {
let chunkedList = splitArrayIntoChunks(accentList, 8);
- messagePlayerInfo(client, `{clanOrange}== {jobYellow}Accents {clanOrange}==================================`);
-
+ messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "AccentList")));
for(let i in chunkedList) {
messagePlayerInfo(client, chunkedList[i].join(", "));
}
@@ -112,7 +111,7 @@ function addAccentCommand(command, params, client) {
getGlobalConfig().accents.push(newAccentName);
saveAccentConfig();
- messageAdmins(`${client.name} {MAINCOLOUR}added a new accent: ${newAccentName}`);
+ messageAdmins(`${client.name}{MAINCOLOUR} added a new accent: ${newAccentName}`);
}
// ===========================================================================
@@ -132,7 +131,7 @@ function removeAccentCommand(command, params, client) {
getGlobalConfig().accents.push(newAccentName);
saveAccentConfig();
- messageAdmins(`${client.name} {MAINCOLOUR}added a new accent: ${newAccentName}`);
+ messageAdmins(`${client.name}{MAINCOLOUR} added a new accent: ${newAccentName}`);
}
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/server/account.js b/scripts/server/account.js
index ff9764c5..549fcdff 100644
--- a/scripts/server/account.js
+++ b/scripts/server/account.js
@@ -599,7 +599,6 @@ function loginSuccess(client) {
getPlayerData(client).accountData.ipAddress = client.ip;
- //sendRemovedWorldObjectsToPlayer(client);
sendPlayerChatScrollLines(client, getPlayerData(client).accountData.chatScrollLines);
messagePlayerNormal(null, `👋 ${getPlayerName(client)} has joined the server`, getColourByName("softYellow"));
@@ -1127,6 +1126,7 @@ function initClient(client) {
updatePlayerSnowState(client);
showConnectCameraToPlayer(client);
+
messageClient(`Please wait ...`, client, getColourByName("softGreen"));
setTimeout(function() {
diff --git a/scripts/server/animation.js b/scripts/server/animation.js
index ff253583..4c18f00f 100644
--- a/scripts/server/animation.js
+++ b/scripts/server/animation.js
@@ -70,7 +70,7 @@ function stopPlayerAnimationCommand(command, params, client) {
// ===========================================================================
function showAnimationListCommand(command, params, client) {
- let animList = getGameData().animations[getServerGame()].map(function(x) { return x[0]; });
+ let animList = getGameConfig().animations[getServerGame()].map(function(x) { return x[0]; });
let chunkedList = splitArrayIntoChunks(animList, 10);
@@ -88,7 +88,7 @@ function showAnimationListCommand(command, params, client) {
* @return {Array} The animation's data (array)
*/
function getAnimationData(animationSlot, gameId = getServerGame()) {
- return getGameData().animations[gameId][animationSlot];
+ return getGameConfig().animations[gameId][animationSlot];
}
// ===========================================================================
@@ -145,13 +145,13 @@ function makePlayerStopAnimation(client) {
function getAnimationFromParams(params) {
if(isNaN(params)) {
- for(let i in getGameData().animations[getServerGame()]) {
- if(toLowerCase(getGameData().animations[getServerGame()][i][0]).indexOf(toLowerCase(params)) != -1) {
+ for(let i in getGameConfig().animations[getServerGame()]) {
+ if(toLowerCase(getGameConfig().animations[getServerGame()][i][0]).indexOf(toLowerCase(params)) != -1) {
return i;
}
}
} else {
- if(typeof getGameData().animations[getServerGame()][params] != "undefined") {
+ if(typeof getGameConfig().animations[getServerGame()][params] != "undefined") {
return toInteger(params);
}
}
diff --git a/scripts/server/anticheat.js b/scripts/server/anticheat.js
index e82b5079..38ff2b63 100644
--- a/scripts/server/anticheat.js
+++ b/scripts/server/anticheat.js
@@ -9,57 +9,8 @@
function initAntiCheatScript() {
logToConsole(LOG_DEBUG, "[VRR.AntiCheat]: Initializing anticheat script ...");
- getServerData().antiCheat.whiteListedGameScripts = loadAntiCheatGameScriptWhiteListFromDatabase();
- getServerData().antiCheat.blackListedGameScripts = loadAntiCheatGameScriptBlackListFromDatabase();
logToConsole(LOG_DEBUG, "[VRR.AntiCheat]: Anticheat script initialized!");
}
-// ===========================================================================
-
-function loadAntiCheatGameScriptWhiteListFromDatabase() {
- logToConsole(LOG_DEBUG, `[VRR.AntiCheat] Loading whitelisted game scripts ...`);
- let dbConnection = connectToDatabase();
- let tempWhiteListedGameScripts = [];
-
- if(dbConnection) {
- let dbQueryString = `SELECT * FROM ac_script_wl WHERE ac_script_wl_enabled = 1 AND ac_script_wl_server = ${getServerId()}`;
- let dbQuery = queryDatabase(dbConnection, dbQueryString);
- if(dbQuery) {
- if(dbQuery.numRows > 0) {
- let dbAssoc = fetchQueryAssoc(dbQuery);
- let tempWhiteListedGameScriptData = new WhiteListedGameScriptData(dbAssoc);
- tempWhiteListedGameScripts.push(tempWhiteListedGameScriptData);
- logToConsole(LOG_DEBUG, `[VRR.AntiCheat] Whitelisted game script '${tempWhiteListedGameScriptData.scriptName}' loaded successfully!`);
- }
- }
- disconnectFromDatabase(dbConnection);
- }
- logToConsole(LOG_DEBUG, `[VRR.AntiCheat] ${tempWhiteListedGameScripts.length} whitelisted game scripts loaded!`);
- return tempWhiteListedGameScripts;
-}
-
-// ===========================================================================
-
-function loadAntiCheatGameScriptBlackListFromDatabase() {
- logToConsole(LOG_DEBUG, `[VRR.AntiCheat] Loading blacklisted game scripts ...`);
- let dbConnection = connectToDatabase();
- let tempBlackListedGameScripts = [];
-
- if(dbConnection) {
- let dbQueryString = `SELECT * FROM ac_script_bl WHERE ac_script_bl_enabled = 1 AND ac_script_bl_server = ${getServerId()}`;
- let dbQuery = queryDatabase(dbConnection, dbQueryString);
- if(dbQuery) {
- if(dbQuery.numRows > 0) {
- let dbAssoc = fetchQueryAssoc(dbQuery);
- let tempBlackListedGameScriptData = new BlackListedGameScriptData(dbAssoc);
- tempBlackListedGameScripts.push(tempBlackListedGameScriptData);
- logToConsole(LOG_DEBUG, `[VRR.AntiCheat] Blacklisted game script '${tempBlackListedGameScriptData.scriptName}' loaded successfully!`);
- }
- }
- disconnectFromDatabase(dbConnection);
- }
- logToConsole(LOG_DEBUG, `[VRR.AntiCheat] ${tempBlackListedGameScripts.length} blacklisted game scripts loaded!`);
- return tempBlackListedGameScripts;
-}
// ===========================================================================
@@ -76,170 +27,6 @@ function clearPlayerStateToEnterExitProperty(client) {
// ===========================================================================
-/**
- * This is a command handler function.
- *
- * @param {string} command - The command name used by the player
- * @param {string} params - The parameters/args string used with the command by the player
- * @param {Client} client - The client/player that used the command
- * @return {bool} Whether or not the command was successful
- *
- */
- function addAntiCheatBlackListedScriptCommand(command, params, client) {
- if(areParamsEmpty(params)) {
- messagePlayerSyntax(client, getCommandSyntaxText(command));
- return false;
- }
-
- let scriptName = params;
- let tempBlackListedGameScriptData = new BlackListedGameScriptData(false);
- tempBlackListedGameScriptData.scriptName = scriptName;
- tempBlackListedGameScriptData.serverId = getServerId();
- tempBlackListedGameScriptData.enabled = true;
- tempBlackListedGameScriptData.needsSaved = true;
- getServerConfig().antiCheat.blackListedGameScripts.push(tempBlackListedGameScriptData);
-
- if(getServerConfig().antiCheat.gameScriptBlackListEnabled) {
- sendPlayerGameScriptState(null, scriptName, VRR_GAMESCRIPT_DENY);
- }
-
- messagePlayerSuccess(client, `You added {ALTCOLOUR}${scriptName} {MAINCOLOUR} to the anticheat game script blacklist`);
- return true;
-}
-
-// ===========================================================================
-
-/**
- * This is a command handler function.
- *
- * @param {string} command - The command name used by the player
- * @param {string} params - The parameters/args string used with the command by the player
- * @param {Client} client - The client/player that used the command
- * @return {bool} Whether or not the command was successful
- *
- */
- function addAntiCheatWhiteListedScriptCommand(command, params, client) {
- if(areParamsEmpty(params)) {
- messagePlayerSyntax(client, getCommandSyntaxText(command));
- return false;
- }
-
- let scriptName = params;
- let tempWhiteListedGameScriptData = new WhiteListedGameScriptData(false);
- tempWhiteListedGameScriptData.scriptName = scriptName;
- tempWhiteListedGameScriptData.serverId = getServerId();
- tempWhiteListedGameScriptData.enabled = true;
- tempWhiteListedGameScriptData.needsSaved = true;
- getServerConfig().antiCheat.whiteListedGameScripts.push(tempWhiteListedGameScriptData);
-
- if(getServerConfig().antiCheat.gameScriptWhiteListEnabled) {
- sendPlayerGameScriptState(null, scriptName, VRR_GAMESCRIPT_ALLOW);
- }
-
- messagePlayerSuccess(client, `You added {ALTCOLOUR}${scriptName} {MAINCOLOUR} to the anticheat game script whitelist`);
- return true;
-}
-
-// ===========================================================================
-
-/**
- * This is a command handler function.
- *
- * @param {string} command - The command name used by the player
- * @param {string} params - The parameters/args string used with the command by the player
- * @param {Client} client - The client/player that used the command
- * @return {bool} Whether or not the command was successful
- *
- */
- function removeAntiCheatWhiteListedScriptCommand(command, params, client) {
- if(areParamsEmpty(params)) {
- messagePlayerSyntax(client, getCommandSyntaxText(command));
- return false;
- }
-
- let whiteListScriptId = getAntiCheatWhiteListedScriptFromParams(params);
-
- getServerConfig().antiCheat.whiteListedGameScripts.splice(whiteListScriptId, 1);
-
- if(getServerConfig().antiCheat.gameScriptWhiteListEnabled) {
- sendPlayerGameScriptState(null, scriptName, VRR_GAMESCRIPT_NONE);
- }
-
- messagePlayerSuccess(client, `You removed {ALTCOLOUR}${scriptName} {MAINCOLOUR} from the anticheat game script whitelist`);
- return true;
-}
-
-// ===========================================================================
-
-/**
- * This is a command handler function.
- *
- * @param {string} command - The command name used by the player
- * @param {string} params - The parameters/args string used with the command by the player
- * @param {Client} client - The client/player that used the command
- * @return {bool} Whether or not the command was successful
- *
- */
- function removeAntiCheatBlackListedScriptCommand(command, params, client) {
- if(areParamsEmpty(params)) {
- messagePlayerSyntax(client, getCommandSyntaxText(command));
- return false;
- }
-
- let blackListScriptId = getAntiCheatBlackListedScriptFromParams(params);
-
- getServerConfig().antiCheat.blackListedGameScripts.splice(blackListScriptId, 1);
-
- if(getServerConfig().antiCheat.gameScriptBlackListEnabled) {
- sendPlayerGameScriptState(null, scriptName, VRR_GAMESCRIPT_NONE);
- }
-
- messagePlayerSuccess(client, `You removed {ALTCOLOUR}${scriptName} {MAINCOLOUR} from the anticheat game script blacklist`);
- return true;
-}
-
-// ===========================================================================
-
-/**
- * This is a command handler function.
- *
- * @param {string} command - The command name used by the player
- * @param {string} params - The parameters/args string used with the command by the player
- * @param {Client} client - The client/player that used the command
- * @return {bool} Whether or not the command was successful
- *
- */
- function toggleAntiCheatScriptWhiteListCommand(command, params, client) {
- getServerConfig().antiCheat.gameScriptWhiteListEnabled = !getServerConfig().antiCheat.gameScriptWhiteListEnabled;
- getServerConfig().needsSaved = true;
-
- messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned anticheat game script whitelist ${getBoolRedGreenInlineColour(getServerConfig().antiCheat.gameScriptWhiteListEnabled)}${toUpperCase(getOnOffFromBool(getServerConfig().antiCheat.gameScriptWhiteListEnabled))}`);
- updateServerRules();
- return true;
-}
-
-// ===========================================================================
-
-/**
- * This is a command handler function.
- *
- * @param {string} command - The command name used by the player
- * @param {string} params - The parameters/args string used with the command by the player
- * @param {Client} client - The client/player that used the command
- * @return {bool} Whether or not the command was successful
- *
- */
-function toggleAntiCheatScriptBlackListCommand(command, params, client) {
- getServerConfig().antiCheat.gameScriptBlackListEnabled = !getServerConfig().antiCheat.gameScriptBlackListEnabled;
- getServerConfig().needsSaved = true;
-
- messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned anticheat game script blacklist ${getBoolRedGreenInlineColour(getServerConfig().antiCheat.gameScriptBlackListEnabled)}${toUpperCase(getOnOffFromBool(getServerConfig().antiCheat.gameScriptBlackListEnabled))}`);
- updateServerRules();
- return true;
-}
-
-// ===========================================================================
-
function isPlayerExemptFromAntiCheat(client) {
if(hasBitFlag(getPlayerData(client).accountData.flags.moderation, getModerationFlagValue("ExemptFromAntiCheat"))) {
return true;
diff --git a/scripts/server/business.js b/scripts/server/business.js
index e68a0722..9335ea09 100644
--- a/scripts/server/business.js
+++ b/scripts/server/business.js
@@ -58,7 +58,7 @@ function loadBusinessesFromDatabase() {
while(dbAssoc = fetchQueryAssoc(dbQuery)) {
let tempBusinessData = new BusinessData(dbAssoc);
tempBusinessData.locations = loadBusinessLocationsFromDatabase(tempBusinessData.databaseId);
- tempBusinessData.gameScripts = loadBusinessGameScriptsFromDatabase(tempBusinessData.databaseId);
+ //tempBusinessData.gameScripts = loadBusinessGameScriptsFromDatabase(tempBusinessData.databaseId);
tempBusinesses.push(tempBusinessData);
logToConsole(LOG_INFO, `[VRR.Business]: Business '${tempBusinessData.name}' (ID ${tempBusinessData.databaseId}) loaded from database successfully!`);
}
@@ -105,6 +105,7 @@ function loadBusinessLocationsFromDatabase(businessId) {
// ===========================================================================
+/*
function loadBusinessGameScriptsFromDatabase(businessId) {
logToConsole(LOG_VERBOSE, `[VRR.Business]: Loading business game scripts for business ${businessId} from database ...`);
@@ -133,6 +134,7 @@ function loadBusinessGameScriptsFromDatabase(businessId) {
logToConsole(LOG_VERBOSE, `[VRR.Business]: ${tempBusinessGameScripts.length} game scripts for business ${businessId} loaded from database successfully!`);
return tempBusinessGameScripts;
}
+*/
// ===========================================================================
@@ -1335,7 +1337,7 @@ function createAllBusinessBlips() {
// ===========================================================================
-function createBusinessEntrancePickup(businessId) {
+function createBusinessEntrancePickup(businessId) {
if(!getServerConfig().createBusinessPickups) {
return false;
}
@@ -1348,18 +1350,26 @@ function createBusinessEntrancePickup(businessId) {
}
logToConsole(LOG_VERBOSE, `[VRR.Job]: Creating entrance pickup for business ${getBusinessData(businessId).name} (model ${pickupModelId})`);
-
- getBusinessData(businessId).entrancePickup = createGamePickup(pickupModelId, getBusinessData(businessId).entrancePosition, getGameConfig().pickupTypes[getServerGame()].business);
- setElementOnAllDimensions(getBusinessData(businessId).entrancePickup, false);
- setElementDimension(getBusinessData(businessId).entrancePickup, getBusinessData(businessId).entranceDimension);
- updateBusinessPickupLabelData(businessId);
- addToWorld(getBusinessData(businessId).entrancePickup);
+
+ if(areServerElementsSupported()) {
+ getBusinessData(businessId).entrancePickup = createGamePickup(pickupModelId, getBusinessData(businessId).entrancePosition, getGameConfig().pickupTypes[getServerGame()].business);
+ setElementOnAllDimensions(getBusinessData(businessId).entrancePickup, false);
+ setElementDimension(getBusinessData(businessId).entrancePickup, getBusinessData(businessId).entranceDimension);
+ updateBusinessPickupLabelData(businessId);
+ addToWorld(getBusinessData(businessId).entrancePickup);
+ } else {
+ sendBusinessEntranceToPlayer(null, businessId, getBusinessData(businessId), getBusinessData(businessId).entrancePosition, getBusinessData(businessId).entranceBlipModel, getBusinessData(businessId).entrancePickupModel, getBusinessData(businessId).hasInterior, false);
+ }
}
}
// ===========================================================================
function createBusinessEntranceBlip(businessId) {
+ if(!areServerElementsSupported()) {
+ return false;
+ }
+
if(!getServerConfig().createBusinessBlips) {
return false;
}
@@ -1372,11 +1382,15 @@ function createBusinessEntranceBlip(businessId) {
}
logToConsole(LOG_VERBOSE, `[VRR.Job]: Creating entrance blip for business ${getBusinessData(businessId).name} (model ${blipModelId})`);
-
- getBusinessData(businessId).entranceBlip = createGameBlip(getBusinessData(businessId).entrancePosition, blipModelId, 1, getColourByName("businessBlue"));
- setElementOnAllDimensions(getBusinessData(businessId).entranceBlip, false);
- setElementDimension(getBusinessData(businessId).entranceBlip, getBusinessData(businessId).entranceDimension);
- addToWorld(getBusinessData(businessId).entranceBlip);
+
+ if(areServerElementsSupported()) {
+ getBusinessData(businessId).entranceBlip = createGameBlip(getBusinessData(businessId).entrancePosition, blipModelId, 1, getColourByName("businessBlue"));
+ setElementOnAllDimensions(getBusinessData(businessId).entranceBlip, false);
+ setElementDimension(getBusinessData(businessId).entranceBlip, getBusinessData(businessId).entranceDimension);
+ addToWorld(getBusinessData(businessId).entranceBlip);
+ } else {
+ sendBusinessEntranceToPlayer(null, businessId, getBusinessData(businessId).name, getBusinessData(businessId).entrancePosition, blipModelId, getBusinessData(businessId).entrancePickupModel, getBusinessData(businessId).hasInterior, false);
+ }
}
}
@@ -1396,12 +1410,14 @@ function createBusinessExitPickup(businessId) {
}
logToConsole(LOG_VERBOSE, `[VRR.Job]: Creating exit pickup for business ${getBusinessData(businessId).name} (model ${pickupModelId})`);
-
- getBusinessData(businessId).exitPickup = createGamePickup(pickupModelId, getBusinessData(businessId).exitPosition, getGameConfig().pickupTypes[getServerGame()].business);
- setElementDimension(getBusinessData(businessId).exitPickup, getBusinessData(businessId).exitDimension);
- setElementOnAllDimensions(getBusinessData(businessId).exitPickup, false);
- updateBusinessPickupLabelData(businessId);
- addToWorld(getBusinessData(businessId).exitPickup);
+
+ if(areServerElementsSupported()) {
+ getBusinessData(businessId).exitPickup = createGamePickup(pickupModelId, getBusinessData(businessId).exitPosition, getGameConfig().pickupTypes[getServerGame()].business);
+ setElementDimension(getBusinessData(businessId).exitPickup, getBusinessData(businessId).exitDimension);
+ setElementOnAllDimensions(getBusinessData(businessId).exitPickup, false);
+ updateBusinessPickupLabelData(businessId);
+ addToWorld(getBusinessData(businessId).exitPickup);
+ }
}
}
}
@@ -1421,15 +1437,17 @@ function createBusinessExitBlip(businessId) {
blipModelId = getBusinessData(businessId).exitBlipModel;
}
- logToConsole(LOG_VERBOSE, `[VRR.Job]: Creating exit blip for business ${getBusinessData(businessId).name} (model ${blipModelId})`);
+ if(areServerElementsSupported()) {
+ logToConsole(LOG_VERBOSE, `[VRR.Job]: Creating exit blip for business ${getBusinessData(businessId).name} (model ${blipModelId})`);
- getBusinessData(businessId).exitBlip = createGameBlip(getBusinessData(businessId).exitPosition, blipModelId, 1, getColourByName("businessBlue"));
- setElementDimension(getBusinessData(businessId).exitBlip, getBusinessData(businessId).entranceDimension);
- setElementOnAllDimensions(getBusinessData(businessId).exitBlip, false);
- //getBusinessData(businessId).exitBlip.interior = getBusinessData(businessId).exitInterior;
- //setEntityData(getBusinessData(businessId).exitBlip, "vrr.owner.type", VRR_BLIP_BUSINESS_EXIT, false);
- //setEntityData(getBusinessData(businessId).exitBlip, "vrr.owner.id", businessId, false);
- addToWorld(getBusinessData(businessId).exitBlip);
+ getBusinessData(businessId).exitBlip = createGameBlip(getBusinessData(businessId).exitPosition, blipModelId, 1, getColourByName("businessBlue"));
+ setElementDimension(getBusinessData(businessId).exitBlip, getBusinessData(businessId).entranceDimension);
+ setElementOnAllDimensions(getBusinessData(businessId).exitBlip, false);
+ //getBusinessData(businessId).exitBlip.interior = getBusinessData(businessId).exitInterior;
+ //setEntityData(getBusinessData(businessId).exitBlip, "vrr.owner.type", VRR_BLIP_BUSINESS_EXIT, false);
+ //setEntityData(getBusinessData(businessId).exitBlip, "vrr.owner.id", businessId, false);
+ addToWorld(getBusinessData(businessId).exitBlip);
+ }
}
}
}
@@ -1535,6 +1553,10 @@ function doesBusinessHaveInterior(businessId) {
// ===========================================================================
function deleteBusinessEntrancePickup(businessId) {
+ if(!areServerElementsSupported()) {
+ return false;
+ }
+
if(getBusinessData(businessId).entrancePickup != null) {
//removeFromWorld(getBusinessData(businessId).entrancePickup);
deleteGameElement(getBusinessData(businessId).entrancePickup);
@@ -1545,6 +1567,10 @@ function deleteBusinessEntrancePickup(businessId) {
// ===========================================================================
function deleteBusinessExitPickup(businessId) {
+ if(!areServerElementsSupported()) {
+ return false;
+ }
+
if(getBusinessData(businessId).exitPickup != null) {
//removeFromWorld(getBusinessData(businessId).exitPickup);
deleteGameElement(getBusinessData(businessId).exitPickup);
@@ -1555,6 +1581,10 @@ function deleteBusinessExitPickup(businessId) {
// ===========================================================================
function deleteBusinessEntranceBlip(businessId) {
+ if(!areServerElementsSupported()) {
+ return false;
+ }
+
if(getBusinessData(businessId).entranceBlip != null) {
//removeFromWorld(getBusinessData(businessId).entranceBlip);
deleteGameElement(getBusinessData(businessId).entranceBlip);
@@ -1565,6 +1595,10 @@ function deleteBusinessEntranceBlip(businessId) {
// ===========================================================================
function deleteBusinessExitBlip(businessId) {
+ if(!areServerElementsSupported()) {
+ return false;
+ }
+
if(getBusinessData(businessId).exitBlip != null) {
//removeFromWorld(getBusinessData(businessId).exitBlip);
deleteGameElement(getBusinessData(businessId).exitBlip);
@@ -1907,6 +1941,10 @@ function getBusinessIdFromDatabaseId(databaseId) {
// ===========================================================================
function updateBusinessPickupLabelData(businessId) {
+ if(!areServerElementsSupported()) {
+ return false;
+ }
+
if(getBusinessData(businessId).exitPickup != null) {
setEntityData(getBusinessData(businessId).exitPickup, "vrr.owner.type", VRR_PICKUP_BUSINESS_EXIT, false);
setEntityData(getBusinessData(businessId).exitPickup, "vrr.owner.id", businessId, false);
@@ -2022,19 +2060,19 @@ function doesBusinessHaveAnyItemsToBuy(businessId) {
// ===========================================================================
-function sendPlayerBusinessGameScripts(client, businessId) {
- for(let i in getBusinessData(businessId).gameScripts) {
- sendPlayerGameScriptState(client, getBusinessData(businessId).gameScripts[i].state);
- }
-}
+//function sendPlayerBusinessGameScripts(client, businessId) {
+// for(let i in getBusinessData(businessId).gameScripts) {
+// sendPlayerGameScriptState(client, getBusinessData(businessId).gameScripts[i].state);
+// }
+//}
// ===========================================================================
-function clearPlayerBusinessGameScripts(client, businessId) {
- for(let i in getBusinessData(businessId).gameScripts) {
- sendPlayerGameScriptState(client, VRR_GAMESCRIPT_DENY);
- }
-}
+//function clearPlayerBusinessGameScripts(client, businessId) {
+// for(let i in getBusinessData(businessId).gameScripts) {
+// sendPlayerGameScriptState(client, VRR_GAMESCRIPT_DENY);
+// }
+//}
// ===========================================================================
diff --git a/scripts/server/class.js b/scripts/server/class.js
index 6219c2d1..a4d92a13 100644
--- a/scripts/server/class.js
+++ b/scripts/server/class.js
@@ -62,11 +62,11 @@ class ServerData {
this.antiCheat = {
enabled: false,
- checkGameScripts: false,
- gameScriptWhiteListEnabled: false,
- gameScriptBlackListEnabled: false,
- gameScriptWhiteList: [],
- gameScriptBlackList: [],
+ //checkGameScripts: false,
+ //gameScriptWhiteListEnabled: false,
+ //gameScriptBlackListEnabled: false,
+ //gameScriptWhiteList: [],
+ //gameScriptBlackList: [],
};
this.discordBotToken = "";
@@ -113,38 +113,14 @@ class ServerData {
this.minute = toInteger(dbAssoc["svr_start_time_min"]);
this.minuteDuration = toInteger(dbAssoc["svr_time_min_duration"]);
this.weather = toInteger(dbAssoc["svr_start_weather"]);
- this.fallingSnow = hasBitFlag(this.settings, getServerSettingsFlagValue("FallingSnow"));
- this.groundSnow = hasBitFlag(this.settings, getServerSettingsFlagValue("GroundSnow"));
- this.useGUI = hasBitFlag(this.settings, getServerSettingsFlagValue("GUI"));
this.guiColourPrimary = [toInteger(dbAssoc["svr_gui_col1_r"]), toInteger(dbAssoc["svr_gui_col1_g"]), toInteger(dbAssoc["svr_gui_col1_b"])];
this.guiColourSecondary = [toInteger(dbAssoc["svr_gui_col2_r"]), toInteger(dbAssoc["svr_gui_col2_g"]), toInteger(dbAssoc["svr_gui_col2_b"])];
this.guiTextColourPrimary = [toInteger(dbAssoc["svr_gui_textcol1_r"]), toInteger(dbAssoc["svr_gui_textcol1_g"]), toInteger(dbAssoc["svr_gui_textcol1_b"])];
//this.guiTextColourSecondary = [toInteger(dbAssoc["svr_gui_textcol2_r"]), toInteger(dbAssoc["svr_gui_textcol2_g"]), toInteger(dbAssoc["svr_gui_textcol2_b"])];
- this.showLogo = hasBitFlag(this.settings, getServerSettingsFlagValue("Logo"));
this.inflationMultiplier = toFloat(dbAssoc["svr_inflation_multiplier"]);
- this.testerOnly = hasBitFlag(this.settings, getServerSettingsFlagValue("Testing"));
-
- this.antiCheat = {
- enabled: hasBitFlag(this.settings, getServerSettingsFlagValue("Anticheat")),
- checkGameScripts: hasBitFlag(this.settings, getServerSettingsFlagValue("CheckGameScripts")),
- gameScriptBlackListEnabled: hasBitFlag(this.settings, getServerSettingsFlagValue("GameScriptBlackList")),
- gameScriptWhiteListEnabled: hasBitFlag(this.settings, getServerSettingsFlagValue("GameScriptWhiteList")),
- gameScriptWhiteList: [],
- gameScriptBlackList: [],
- };
this.discordBotToken = intToBool(dbAssoc["svr_discord_bot_token"]);
- this.discordEnabled = hasBitFlag(this.settings, getServerSettingsFlagValue("DiscordBot"));
-
- this.createJobPickups = hasBitFlag(this.settings, getServerSettingsFlagValue("JobPickups"));
- this.createBusinessPickups = hasBitFlag(this.settings, getServerSettingsFlagValue("BusinessPickups"));
- this.createHousePickups = hasBitFlag(this.settings, getServerSettingsFlagValue("HousePickups"));
- this.createJobBlips = hasBitFlag(this.settings, getServerSettingsFlagValue("JobBlips"));
- this.createBusinessBlips = hasBitFlag(this.settings, getServerSettingsFlagValue("BusinessBlips"));
- this.createHouseBlips = hasBitFlag(this.settings, getServerSettingsFlagValue("HouseBlips"));
-
this.introMusicURL = dbAssoc["svr_intro_music"];
- this.useRealTime = hasBitFlag(this.settings, getServerSettingsFlagValue("RealTime"));
this.realTimeZone = dbAssoc["svr_time_realtime_timezone"];
this.discordConfig = {
@@ -263,6 +239,8 @@ class ClientData {
this.locale = 0;
this.enteringVehicle = null;
+
+ this.pedId = -1;
}
};
@@ -672,7 +650,7 @@ class HouseData {
this.itemCache = [];
this.locations = [];
- this.gameScripts = [];
+ //this.gameScripts = [];
this.entrancePosition = false;
this.entranceRotation = 0.0;
diff --git a/scripts/server/client.js b/scripts/server/client.js
index 1e72c866..565fd7b7 100644
--- a/scripts/server/client.js
+++ b/scripts/server/client.js
@@ -74,6 +74,7 @@ function addAllNetworkHandlers() {
addNetworkEventHandler("vrr.skinSelected", playerFinishedSkinSelection);
addNetworkEventHandler("vrr.clientInfo", updateConnectionLogOnClientInfoReceive);
addNetworkEventHandler("vrr.vehBuyState", receiveVehiclePurchaseStateUpdateFromClient);
+ addNetworkEventHandler("vrr.playerPedId", receivePlayerPedNetworkId);
}
// ===========================================================================
@@ -223,29 +224,6 @@ function updatePlayerSnowState(client) {
// ===========================================================================
-function sendExcludedModelsForGroundSnowToPlayer(client) {
- if(getGameConfig().excludedGroundSnowModels[getServerGame()].length > 0) {
- for(let i in getGameConfig().excludedGroundSnowModels[getServerGame()]) {
- logToConsole(LOG_DEBUG, `[VRR.Misc] Sending excluded model ${i} for ground snow to ${getPlayerName(client)}`);
- sendNetworkEventToPlayer("vrr.excludeGroundSnow", client, getGameConfig().excludedGroundSnowModels[getServerGame()][i]);
- }
- }
-}
-
-// ===========================================================================
-
-function sendRemovedWorldObjectsToPlayer(client) {
- if(getGameConfig().removedWorldObjects[getServerGame()].length > 0) {
- for(let i in getGameConfig().removedWorldObjects[getServerGame()]) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending removed world object ${i} (${getGameConfig().removedWorldObjects[getServerGame()][i][0]}) to ${getPlayerName(client)}`);
- sendNetworkEventToPlayer("vrr.removeWorldObject", client, getGameConfig().removedWorldObjects[getServerGame()][i][0], getGameConfig().removedWorldObjects[getServerGame()][i][1], getGameConfig().removedWorldObjects[getServerGame()][i][2]);
- }
- }
- return true;
-}
-
-// ===========================================================================
-
function updatePlayerHotBar(client) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending updated hotbar data to ${getPlayerDisplayForConsole(client)}`);
let tempHotBarItems = [];
@@ -1053,12 +1031,6 @@ function setPlayerHeadLookPosition(client, position) {
// ===========================================================================
-function sendPlayerGameScriptState(client, scriptName, state) {
- sendNetworkEventToPlayer("vrr.gameScript", client, scriptName, state);
-}
-
-// ===========================================================================
-
function requestClientInfo(client) {
sendNetworkEventToPlayer("vrr.clientInfo", client);
}
@@ -1078,7 +1050,10 @@ function forcePlayerToSyncElementProperties(client, element) {
// ===========================================================================
function sendPlayerPedPartsAndProps(client) {
- sendNetworkEventToPlayer("vrr.ped")
+ let bodyParts = getPlayerCurrentSubAccount(client).bodyParts;
+ let bodyProps = getPlayerCurrentSubAccount(client).bodyProps;
+
+ sendNetworkEventToPlayer("vrr.ped", client, [bodyParts.hair, bodyParts.head, bodyParts.upper, bodyParts.lower], [bodyProps.hair, bodyProps.eyes, bodyProps.head, bodyProps.leftHand, bodyProps.rightHand, bodyProps.leftWrist, bodyProps.rightWrist, bodyParts.hip, bodyProps.leftFoot, bodyProps.rightFoot]);
}
// ===========================================================================
@@ -1134,4 +1109,56 @@ function setPlayerInfiniteRun(client, state) {
sendNetworkEventToPlayer("vrr.infiniteRun", client, state);
}
+// ==========================================================================
+
+function sendBusinessEntranceToPlayer(client, businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems) {
+ sendNetworkEventToPlayer("vrr.business", client, businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems);
+}
+
+// ==========================================================================
+
+function sendHouseEntranceToPlayer(client, houseId, entrancePosition, blipModel, pickupModel, hasInterior) {
+ sendNetworkEventToPlayer("vrr.house", client, houseId, entrancePosition, blipModel, pickupModel, hasInterior);
+}
+
+// ==========================================================================
+
+function sendAllBusinessEntrancesToPlayer(client) {
+ let businesses = getServerData().businesses;
+ for(let i in businesses) {
+ if(businesses[i].entranceBlipModel > 0) {
+ sendBusinessEntranceToPlayer(client, businesses[i].index, businesses[i].name, businesses[i].entrancePosition, businesses[i].entranceBlipModel, businesses[i].entrancePickupModel, businesses[i].hasInterior, false);
+ }
+ }
+}
+
+// ==========================================================================
+
+function sendAllHouseEntrancesToPlayer(client) {
+ let houses = getServerData().houses;
+ for(let i in houses) {
+ if(houses[i].entranceBlipModel > 0) {
+ sendBusinessEntranceToPlayer(client, businesses[i].index, houses[i].entrancePosition, houses[i].entranceBlipModel, houses[i].entrancePickupModel, houses[i].hasInterior);
+ }
+ }
+}
+
+// ==========================================================================
+
+function makePlayerHoldObjectModel(client, modelIndex) {
+ sendNetworkEventToPlayer("vrr.holdObject", client, getPlayerData(client).pedId, modelIndex);
+}
+
+// ==========================================================================
+
+function receivePlayerPedNetworkId(client, pedId) {
+ getPlayerData(client).pedId = pedId;
+}
+
+// ==========================================================================
+
+function requestPlayerPedNetworkId(client) {
+ sendNetworkEventToPlayer("vrr.playerPedId", client);
+}
+
// ==========================================================================
\ No newline at end of file
diff --git a/scripts/server/command.js b/scripts/server/command.js
index a7d1aaa6..c577d396 100644
--- a/scripts/server/command.js
+++ b/scripts/server/command.js
@@ -68,12 +68,6 @@ function loadCommands() {
commandData("stopanim", stopPlayerAnimationCommand, "", getStaffFlagValue("None"), true, true, "Stops your current animation"),
],
antiCheat: [
- commandData("addacscriptwl", addAntiCheatWhiteListedScriptCommand, "