Merge branch 'nightly'
This commit is contained in:
BIN
files/images/server-logo.png
Normal file
BIN
files/images/server-logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
@@ -387,5 +387,9 @@
|
|||||||
"TimeNotNumber": "The time must be a number",
|
"TimeNotNumber": "The time must be a number",
|
||||||
"HeaderDefaultBusinessItemTypes": "Business Item Templates",
|
"HeaderDefaultBusinessItemTypes": "Business Item Templates",
|
||||||
"FixingStuck": "Fixing your position and virtual world ...",
|
"FixingStuck": "Fixing your position and virtual world ...",
|
||||||
"CantUseCommandYet": "You must wait before you can use this command again!"
|
"CantUseCommandYet": "You must wait before you can use this command again!",
|
||||||
|
"NotATester": "You are not a tester!",
|
||||||
|
"AccessDenied": "AccessDenied",
|
||||||
|
"InvalidSkin": "That skin is invalid!",
|
||||||
|
"HeaderInteriorTypes": "Interiors"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -387,5 +387,9 @@
|
|||||||
"TimeNotNumber": "The time must be a number",
|
"TimeNotNumber": "The time must be a number",
|
||||||
"HeaderDefaultBusinessItemTypes": "Business Item Templates",
|
"HeaderDefaultBusinessItemTypes": "Business Item Templates",
|
||||||
"FixingStuck": "Fixing your position and virtual world ...",
|
"FixingStuck": "Fixing your position and virtual world ...",
|
||||||
"CantUseCommandYet": "You must wait before you can use this command again!"
|
"CantUseCommandYet": "You must wait before you can use this command again!",
|
||||||
|
"NotATester": "You are not a tester!",
|
||||||
|
"AccessDenied": "AccessDenied",
|
||||||
|
"InvalidSkin": "That skin is invalid!",
|
||||||
|
"HeaderInteriorTypes": "Interiors"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -387,5 +387,9 @@
|
|||||||
"TimeNotNumber": "The time must be a number",
|
"TimeNotNumber": "The time must be a number",
|
||||||
"HeaderDefaultBusinessItemTypes": "Business Item Templates",
|
"HeaderDefaultBusinessItemTypes": "Business Item Templates",
|
||||||
"FixingStuck": "Fixing your position and virtual world ...",
|
"FixingStuck": "Fixing your position and virtual world ...",
|
||||||
"CantUseCommandYet": "You must wait before you can use this command again!"
|
"CantUseCommandYet": "You must wait before you can use this command again!",
|
||||||
|
"NotATester": "You are not a tester!",
|
||||||
|
"AccessDenied": "AccessDenied",
|
||||||
|
"InvalidSkin": "That skin is invalid!",
|
||||||
|
"HeaderInteriorTypes": "Interiors"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -320,71 +320,75 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
"ADDED-21JAN2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations.",
|
"ADDED-21JAN2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations.",
|
||||||
"HeaderPlayerHousesList": "Player Houses ({1})",
|
"HeaderPlayerHousesList": "Дома Игрока ({1})",
|
||||||
"HeaderPlayerStaffFlagsList": "Player Staff Flags ({1})",
|
"HeaderPlayerStaffFlagsList": "Флаги игрока персонала ({1})",
|
||||||
"HeaderStaffFlagsList": "Staff Flags",
|
"HeaderStaffFlagsList": "Флаги персонала",
|
||||||
"NonRPName": "Non-RP name! Choose a new one:",
|
"NonRPName": "Ваше имя не подходит для ролевой игры! Выберете другое:",
|
||||||
"InvalidStaffFlag": "Staff flag not found!",
|
"InvalidStaffFlag": "Не удалось найти флаг персонала!",
|
||||||
"InvalidClanFlag": "Clan flag not found!",
|
"InvalidClanFlag": "Не удалось найти флаг клана!",
|
||||||
"InvalidLocale": "Language not found!",
|
"InvalidLocale": "Не удалось найти язык!",
|
||||||
"HeaderJobUniformList": "Job Uniforms ({1})",
|
"HeaderJobUniformList": "Рабочие униформы ({1})",
|
||||||
"HeaderJobEquipmentList": "Job Equipment ({1})",
|
"HeaderJobEquipmentList": "Рабочие снаряжение ({1})",
|
||||||
"InvalidJobUniform": "Job uniform not found!",
|
"InvalidJobUniform": "Не удалось найти рабочую униформу!",
|
||||||
"InvalidJobEquipment": "Job equipment not found!",
|
"InvalidJobEquipment": "Не удалось найти рабочее снаряжение!",
|
||||||
"HeaderVehiclesInRangeList": "Vehicles within {1}",
|
"HeaderVehiclesInRangeList": "Транспорт в пределах {1}",
|
||||||
"NoVehiclesWithInRange": "There are no vehicles within {1}",
|
"NoVehiclesWithInRange": "Нет транспорта в пределах {1}",
|
||||||
"AmountNotNumber": "The amount must be a number!",
|
"AmountNotNumber": "Количество должно быть введено цифрой!",
|
||||||
"NeedToBeWorking": "You need to be working! Use {1} at a job location or near a job vehicle.",
|
"NeedToBeWorking": "Вы должны быть на работе! Используйте {1} на месте работы или возле рабочего транспорта.",
|
||||||
"NeedToBeOnJobRoute": "You need to be doing a job route! Use {1} in a job vehicle",
|
"NeedToBeOnJobRoute": "Вы должны быть на рабочем маршруте! Используйте {1} в рабочем транспорте",
|
||||||
"CurrentJobRouteDeleted": "The job route you were on has been deleted by an admin",
|
"CurrentJobRouteDeleted": "Рабочий маршрут на котором вы находились был удален администратором",
|
||||||
"CurrentJobRouteVehicleColoursChanged": "Your job route's vehicle colours were changed by an admin",
|
"CurrentJobRouteVehicleColoursChanged": "Цвет транспорта на маршруте был изменен администратором",
|
||||||
"NotYourJob": "This is not your job!",
|
"NotYourJob": "Это работа пренадлежит не вам!",
|
||||||
"JobPoints": "You can get a job by going the yellow points on the map.",
|
"JobPoints": "Вы можете устроиться на работу ориентируясь по желтым значкам на карте.",
|
||||||
"QuitJobToTakeAnother": "If you want this job, use {1} to quit your current job.",
|
"QuitJobToTakeAnother": "Если хотите покинуть работу, ипользуйте {1}.",
|
||||||
"NotAJobVehicle": "This is not a job vehicle!",
|
"NotAJobVehicle": "Это не рабочий транспорт!",
|
||||||
"NotYourJobVehicle": "This is not your job's vehicle!",
|
"NotYourJobVehicle": "Этот транспорт пренадлежит не вашей работе!",
|
||||||
"JobRouteDisabled": "The job route you were on has been disabled by an admin",
|
"JobRouteDisabled": "Рабочий маршрут на котором вы были был удален администратором",
|
||||||
"HeaderPickupTypes": "Pickup Types",
|
"HeaderPickupTypes": "Типы подбираемых предметов",
|
||||||
"HeaderBlipTypes": "Map Icon Types",
|
"HeaderBlipTypes": "Типы иконок карты",
|
||||||
"InvalidGPSLocation": "There are no locations with that name or type",
|
"InvalidGPSLocation": "Не существует локаций с таки именем или такого типа",
|
||||||
"HeaderBusinessList": "Businesses",
|
"HeaderBusinessList": "Бизнесы",
|
||||||
"VehicleForSale": "This {1} is buyable for {2}! Use {3} if you want to buy it",
|
"VehicleForSale": "Этот {1} можно купить за {2}! Используйте {3} если хотите его купить",
|
||||||
"VehicleForRent": "This {1} is rentable for {2}! Use {3} if you want to rent it",
|
"VehicleForRent": "Этот {1} может быть орендован за {2}! Используйте {3} если хотите его орендовать",
|
||||||
|
|
||||||
"ADDED-31JAN2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations.",
|
"ADDED-31JAN2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations.",
|
||||||
"LoginFailedInvalidPassword": "Invalid password! {1} attempts remaining",
|
"LoginFailedInvalidPassword": "Неправельный пароль! Осталось {1} попыток",
|
||||||
"LoginFailedNoPassword": "You must enter a password! ! {1} attempts remaining",
|
"LoginFailedNoPassword": "Вы должны ввести пароль! Осталось {1} попыток",
|
||||||
"RegistrationFailedNoPassword": "You must enter a password!",
|
"RegistrationFailedNoPassword": "Вы должны ввести пароль!",
|
||||||
"RegistrationFailedNoPasswordConfirm": "You must confirm the password!",
|
"RegistrationFailedNoPasswordConfirm": "Вы должны подтвердить пароль!",
|
||||||
"RegistrationFailedNoEmail": "You must enter an email!",
|
"RegistrationFailedNoEmail": "Вы должны ввести адрес электронной почты!",
|
||||||
"AccountNameAlreadyRegistered": "Your name is already registered!",
|
"AccountNameAlreadyRegistered": "Ваше имя уже зарегистрировано!",
|
||||||
"AlreadyLoggedIn": "You are already logged in!",
|
"AlreadyLoggedIn": "Вы уже вошли!",
|
||||||
"RegistrationFailedInvalidEmail": "That email is invalid!",
|
"RegistrationFailedInvalidEmail": "Такого адреса не существует!",
|
||||||
"RegistrationFailedPasswordMismatch": "The passwords don't match!",
|
"RegistrationFailedPasswordMismatch": "Пароли не совпадают!",
|
||||||
"RegistrationFailedCreateError": "Your account couldn't be created!",
|
"RegistrationFailedCreateError": "Не удалось создать аккаунт!",
|
||||||
"RegistrationSuccess": "Your account has been created!",
|
"RegistrationSuccess": "Ваш аккаунт был успешно создан!",
|
||||||
"RegistrationEmailVerifyReminder": "Don't forget to verify your email! A verification code has been sent to you.",
|
"RegistrationEmailVerifyReminder": "Не забудьте подтвердить ваш электронный адрес, код подверждения был послан вам на электронную почту.",
|
||||||
"RegistrationCreateCharReminder": "To play on the server, you will need to make a character.",
|
"RegistrationCreateCharReminder": "Чтобы играть на сервере, вам нужно будет создать персонажа.",
|
||||||
"NoCharactersGUIMessage": "You have no characters. Would you like to make one?",
|
"NoCharactersGUIMessage": "У вас нет персонажей. Не хотите создать?",
|
||||||
"NoCharactersGUIWindowTitle": "No characters",
|
"NoCharactersGUIWindowTitle": "Нет персонажей",
|
||||||
"NoCharactersChatMessage": "You have no characters. Use {1} to make one.",
|
"NoCharactersChatMessage": "У вас нет персонажей. Используйте {1} чтобы создать.",
|
||||||
"NeedEmailFor2FA": "You need to add your email to your account to use two-factor authentication.",
|
"NeedEmailFor2FA": "Вам нужно добавить ваш адрес электронной почты чтобы использовать двухфакторную аунтентификацию.",
|
||||||
"NeedEmailVerifiedFor2FA": "You need to verify your email to use two-factor authentication.",
|
"NeedEmailVerifiedFor2FA": "Вам нужно подтвердить вашу электронную почту чтобы использовать двухфакторную аунтентификацию.",
|
||||||
"SetEmailHelpTip": "Use {1} to set your email.",
|
"SetEmailHelpTip": "Используйте {1} чтобы установить ваш адрес электронной почты.",
|
||||||
"VerifyEmailHelpTip": "Use {1} to verify your email.",
|
"VerifyEmailHelpTip": "Используйте {1} чтобы подтвердить ваш адрес электронной почты.",
|
||||||
|
|
||||||
"ADDED-13FEB2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations.",
|
"ADDED-13FEB2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations.",
|
||||||
"NearbyRadio": "Nearby radio",
|
"NearbyRadio": "Ближайшее радио",
|
||||||
"FromRadio": "From radio",
|
"FromRadio": "Из радио",
|
||||||
"ToRadio": "To radio",
|
"ToRadio": "В радио",
|
||||||
"NeedToEnterPropertyCommand": "You need to enter the {1} first! Use {2} to enter and exit",
|
"NeedToEnterPropertyCommand": "Вам нужно сначало ввести {1}! Используйте {2} чтобы выйти",
|
||||||
"NeedToEnterPropertyKeyPress": "You need to enter the {1} first! Press {2} to enter and exit",
|
"NeedToEnterPropertyKeyPress": "Вам нужно сначало ввести {1}! Используйте {2} чтобы выйти",
|
||||||
"InventoryFullCantCarry": "You don't have any space to carry this (full inventory)!",
|
"InventoryFullCantCarry": "У вас недостаточно места в инвентаре(Инвентарь заполнен)!",
|
||||||
"NotEnoughCashNeedAmountMore": "You don't have enough money! You need {1} more!",
|
"NotEnoughCashNeedAmountMore": "У вас недостаточно денег! У вас не хватает {1}!",
|
||||||
"AmountMustBeMoreThan": "The amount must be more than {1}!",
|
"AmountMustBeMoreThan": "Количество должно быть больше {1}!",
|
||||||
"WeaponBanned": "You are not allowed to buy or use weapons!",
|
"WeaponBanned": "Вам нельзя покупать оружие!",
|
||||||
"TimeNotNumber": "The time must be a number",
|
"TimeNotNumber": "Время должно быть назначено цифрой",
|
||||||
"HeaderDefaultBusinessItemTypes": "Business Item Templates",
|
"HeaderDefaultBusinessItemTypes": "Шаблоны предметов бизнеса",
|
||||||
"FixingStuck": "Fixing your position and virtual world ...",
|
"FixingStuck": "Исправляет вашу текущую позицию и виртуальный мир ...",
|
||||||
"CantUseCommandYet": "You must wait before you can use this command again!"
|
"CantUseCommandYet": "Подождите некоторое время перед тем как использовать комманду снова!",
|
||||||
|
"NotATester": "Вы не тестировщик!",
|
||||||
|
"AccessDenied": "Доступ запрещен",
|
||||||
|
"InvalidSkin": "That skin is invalid!",
|
||||||
|
"HeaderInteriorTypes": "Interiors"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -391,5 +391,9 @@
|
|||||||
"TimeNotNumber": "The time must be a number",
|
"TimeNotNumber": "The time must be a number",
|
||||||
"HeaderDefaultBusinessItemTypes": "Business Item Templates",
|
"HeaderDefaultBusinessItemTypes": "Business Item Templates",
|
||||||
"FixingStuck": "Fixing your position and virtual world ...",
|
"FixingStuck": "Fixing your position and virtual world ...",
|
||||||
"CantUseCommandYet": "You must wait before you can use this command again!"
|
"CantUseCommandYet": "You must wait before you can use this command again!",
|
||||||
|
"NotATester": "You are not a tester!",
|
||||||
|
"AccessDenied": "AccessDenied",
|
||||||
|
"InvalidSkin": "That skin is invalid!",
|
||||||
|
"HeaderInteriorTypes": "Interiors"
|
||||||
}
|
}
|
||||||
|
|||||||
9
meta.xml
9
meta.xml
@@ -9,6 +9,7 @@
|
|||||||
<script src="scripts/shared/gamedata.js" type="server" language="javascript" />
|
<script src="scripts/shared/gamedata.js" type="server" language="javascript" />
|
||||||
<script src="scripts/shared/gamedata.js" type="client" language="javascript" />
|
<script src="scripts/shared/gamedata.js" type="client" language="javascript" />
|
||||||
|
|
||||||
|
|
||||||
<!-- Multiplayer Mod (Wrapped Natives) -->
|
<!-- Multiplayer Mod (Wrapped Natives) -->
|
||||||
<script src="scripts/server/native/connected.js" type="server" language="javascript" />
|
<script src="scripts/server/native/connected.js" type="server" language="javascript" />
|
||||||
<script src="scripts/client/native/connected.js" type="client" language="javascript" />
|
<script src="scripts/client/native/connected.js" type="client" language="javascript" />
|
||||||
@@ -93,6 +94,7 @@
|
|||||||
<file type="client" src="files/images/skins/none.png" />
|
<file type="client" src="files/images/skins/none.png" />
|
||||||
<file type="client" src="files/images/mafiac-logo.png" />
|
<file type="client" src="files/images/mafiac-logo.png" />
|
||||||
<file type="client" src="files/images/gtac-logo.png" />
|
<file type="client" src="files/images/gtac-logo.png" />
|
||||||
|
<file type="client" src="files/images/server-logo.png" />
|
||||||
|
|
||||||
<!-- GUI -->
|
<!-- GUI -->
|
||||||
<script src="scripts/client/gui/login.js" type="client" language="javascript" />
|
<script src="scripts/client/gui/login.js" type="client" language="javascript" />
|
||||||
@@ -111,11 +113,9 @@
|
|||||||
<script src="scripts/client/gui/list.js" type="client" language="javascript" />
|
<script src="scripts/client/gui/list.js" type="client" language="javascript" />
|
||||||
|
|
||||||
<!-- Client Scripts -->
|
<!-- Client Scripts -->
|
||||||
<script src="scripts/client/main.js" type="client" language="javascript" />
|
|
||||||
<script src="scripts/client/chatbox.js" type="client" language="javascript" />
|
|
||||||
<script src="scripts/client/afk.js" type="client" language="javascript" />
|
<script src="scripts/client/afk.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/animation.js" type="client" language="javascript" />
|
<script src="scripts/client/animation.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/content.js" type="client" language="javascript" />
|
<script src="scripts/client/chatbox.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/event.js" type="client" language="javascript" />
|
<script src="scripts/client/event.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/gui.js" type="client" language="javascript" />
|
<script src="scripts/client/gui.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/item.js" type="client" language="javascript" />
|
<script src="scripts/client/item.js" type="client" language="javascript" />
|
||||||
@@ -123,12 +123,13 @@
|
|||||||
<script src="scripts/client/keybind.js" type="client" language="javascript" />
|
<script src="scripts/client/keybind.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/label.js" type="client" language="javascript" />
|
<script src="scripts/client/label.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/logo.js" type="client" language="javascript" />
|
<script src="scripts/client/logo.js" type="client" language="javascript" />
|
||||||
|
<script src="scripts/client/main.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/messaging.js" type="client" language="javascript" />
|
<script src="scripts/client/messaging.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/mousecam.js" type="client" language="javascript" />
|
<script src="scripts/client/mousecam.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/nametag.js" type="client" language="javascript" />
|
<script src="scripts/client/nametag.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/radio.js" type="client" language="javascript" />
|
<script src="scripts/client/radio.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/server.js" type="client" language="javascript" />
|
|
||||||
<script src="scripts/client/scoreboard.js" type="client" language="javascript" />
|
<script src="scripts/client/scoreboard.js" type="client" language="javascript" />
|
||||||
|
<script src="scripts/client/server.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/skin-select.js" type="client" language="javascript" />
|
<script src="scripts/client/skin-select.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/sync.js" type="client" language="javascript" />
|
<script src="scripts/client/sync.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/utilities.js" type="client" language="javascript" />
|
<script src="scripts/client/utilities.js" type="client" language="javascript" />
|
||||||
|
|||||||
@@ -56,14 +56,18 @@ function makePedStopAnimation(pedId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getGame() == VRR_GAME_GTA_VC || getGame() == VRR_GAME_GTA_SA) {
|
if(getGame() != VRR_GAME_GTA_IV) {
|
||||||
getElementFromId(pedId).clearAnimations();
|
if(getGame() == VRR_GAME_GTA_VC || getGame() == VRR_GAME_GTA_SA) {
|
||||||
} else {
|
getElementFromId(pedId).clearAnimations();
|
||||||
getElementFromId(pedId).clearObjective();
|
} else {
|
||||||
|
getElementFromId(pedId).clearObjective();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getElementFromId(pedId) == localPlayer) {
|
if(getElementFromId(pedId) == localPlayer) {
|
||||||
localPlayer.collisionsEnabled = true;
|
if(getGame() != VRR_GAME_GTA_IV) {
|
||||||
|
localPlayer.collisionsEnabled = true;
|
||||||
|
}
|
||||||
setLocalPlayerControlState(true, false);
|
setLocalPlayerControlState(true, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getCustomImage(imageName) {
|
function getCustomImage(imageName) {
|
||||||
let contentResource = findResourceByName(getGameData().extraContentResource[getGame()]);
|
let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
|
||||||
if(contentResource != null) {
|
if(contentResource != null) {
|
||||||
if(contentResource.isStarted) {
|
if(contentResource.isStarted) {
|
||||||
let image = contentResource.exports.getCustomImage(imageName);
|
let image = contentResource.exports.getCustomImage(imageName);
|
||||||
@@ -23,7 +23,7 @@ function getCustomImage(imageName) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getCustomFont(fontName) {
|
function getCustomFont(fontName) {
|
||||||
let contentResource = findResourceByName(getGameData().extraContentResource[getGame()]);
|
let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
|
||||||
if(contentResource != null) {
|
if(contentResource != null) {
|
||||||
if(contentResource.isStarted) {
|
if(contentResource.isStarted) {
|
||||||
let font = contentResource.exports.getCustomFont(fontName);
|
let font = contentResource.exports.getCustomFont(fontName);
|
||||||
@@ -38,7 +38,7 @@ function getCustomFont(fontName) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getCustomAudio(audioName) {
|
function getCustomAudio(audioName) {
|
||||||
let contentResource = findResourceByName(getGameData().extraContentResource[getGame()]);
|
let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
|
||||||
if(contentResource != null) {
|
if(contentResource != null) {
|
||||||
if(contentResource.isStarted) {
|
if(contentResource.isStarted) {
|
||||||
let audioFile = contentResource.exports.getCustomAudio(audioName);
|
let audioFile = contentResource.exports.getCustomAudio(audioName);
|
||||||
@@ -53,7 +53,7 @@ function getCustomAudio(audioName) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function playCustomAudio(audioName, volume = 0.5, loop = false) {
|
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 != null) {
|
||||||
if(contentResource.isStarted) {
|
if(contentResource.isStarted) {
|
||||||
contentResource.exports.playCustomAudio(audioName, volume, loop);
|
contentResource.exports.playCustomAudio(audioName, volume, loop);
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ function initGUI() {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
let closeAllWindows = function() {
|
function closeAllWindows() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Closing all GUI windows`);
|
logToConsole(LOG_DEBUG, `[VRR.GUI] Closing all GUI windows`);
|
||||||
infoDialog.window.shown = false;
|
infoDialog.window.shown = false;
|
||||||
yesNoDialog.window.shown = false;
|
yesNoDialog.window.shown = false;
|
||||||
@@ -104,6 +104,7 @@ let closeAllWindows = function() {
|
|||||||
listDialog.window.shown = false;
|
listDialog.window.shown = false;
|
||||||
resetPassword.window.shown = false;
|
resetPassword.window.shown = false;
|
||||||
passwordChange.window.shown = false;
|
passwordChange.window.shown = false;
|
||||||
|
|
||||||
mexui.setInput(false);
|
mexui.setInput(false);
|
||||||
mexui.focusedControl = false;
|
mexui.focusedControl = false;
|
||||||
|
|
||||||
@@ -116,7 +117,7 @@ let closeAllWindows = function() {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
let isAnyGUIActive = function() {
|
function isAnyGUIActive() {
|
||||||
if(!guiReady) {
|
if(!guiReady) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -299,14 +300,22 @@ function processGUIKeyPress(keyCode) {
|
|||||||
if(guiSubmitKey != false) {
|
if(guiSubmitKey != false) {
|
||||||
guiSubmitKey();
|
guiSubmitKey();
|
||||||
}
|
}
|
||||||
} else if(keyCode == SDLK_LEFT) {
|
} else if(keyCode == getKeyIdFromParams("left") || keyCode == getKeyIdFromParams("a")) {
|
||||||
if(guiLeftKey != false) {
|
if(guiLeftKey != false) {
|
||||||
guiLeftKey();
|
guiLeftKey();
|
||||||
}
|
}
|
||||||
} else if(keyCode == SDLK_RIGHT) {
|
} else if(keyCode == getKeyIdFromParams("right") || keyCode == getKeyIdFromParams("d")) {
|
||||||
if(guiRightKey != false) {
|
if(guiRightKey != false) {
|
||||||
guiRightKey();
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,3 +16,5 @@ let clanManager = {
|
|||||||
businessesTab: null,
|
businessesTab: null,
|
||||||
housesTab: null,
|
housesTab: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -46,7 +46,7 @@ function initErrorDialogGUI() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
errorDialog.okayButton = errorDialog.window.button(5, 105, 395, 30, 'OK', {
|
errorDialog.okayButton = errorDialog.window.button(5, 105, 390, 30, 'OK', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
|
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
|
||||||
textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], 255),
|
textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], 255),
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ function initInfoDialogGUI() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
infoDialog.okayButton = infoDialog.window.button(5, 105, 395, 30, 'OK', {
|
infoDialog.okayButton = infoDialog.window.button(5, 105, 390, 30, 'OK', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
|
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
|
||||||
textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], 255),
|
textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], 255),
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ let login = {
|
|||||||
|
|
||||||
function initLoginGUI() {
|
function initLoginGUI() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating login GUI ...`);
|
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: {
|
main: {
|
||||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
||||||
transitionTime: 500,
|
transitionTime: 500,
|
||||||
@@ -42,7 +42,7 @@ function initLoginGUI() {
|
|||||||
login.window.titleBarIconSize = toVector2(0,0);
|
login.window.titleBarIconSize = toVector2(0,0);
|
||||||
login.window.titleBarHeight = 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: {
|
focused: {
|
||||||
borderColour: toColour(0, 0, 0, 0),
|
borderColour: toColour(0, 0, 0, 0),
|
||||||
},
|
},
|
||||||
@@ -169,3 +169,5 @@ function switchToPasswordResetGUI() {
|
|||||||
showResetPasswordGUI();
|
showResetPasswordGUI();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -21,7 +21,7 @@ let newCharacter = {
|
|||||||
|
|
||||||
function initNewCharacterGUI() {
|
function initNewCharacterGUI() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating new character GUI ...`);
|
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: {
|
main: {
|
||||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
||||||
transitionTime: 500,
|
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: {
|
main: {
|
||||||
textSize: 10.0,
|
textSize: 10.0,
|
||||||
textAlign: 0.5,
|
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: {
|
main: {
|
||||||
backgroundColour: toColour(0, 0, 0, 120),
|
backgroundColour: toColour(0, 0, 0, 120),
|
||||||
textColour: toColour(200, 200, 200, 255),
|
textColour: toColour(200, 200, 200, 255),
|
||||||
@@ -77,7 +77,7 @@ function initNewCharacterGUI() {
|
|||||||
});
|
});
|
||||||
newCharacter.firstNameInput.placeholder = "First Name";
|
newCharacter.firstNameInput.placeholder = "First Name";
|
||||||
|
|
||||||
newCharacter.lastNameInput = newCharacter.window.textInput(20, 130, 260, 25, '', {
|
newCharacter.lastNameInput = newCharacter.window.textInput(20, 155, 260, 25, '', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(0, 0, 0, 120),
|
backgroundColour: toColour(0, 0, 0, 120),
|
||||||
textColour: toColour(200, 200, 200, 255),
|
textColour: toColour(200, 200, 200, 255),
|
||||||
@@ -96,7 +96,7 @@ function initNewCharacterGUI() {
|
|||||||
});
|
});
|
||||||
newCharacter.lastNameInput.placeholder = "Last Name";
|
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: {
|
main: {
|
||||||
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
|
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
|
||||||
textColour: toColour(255, 255, 255, 255),
|
textColour: toColour(255, 255, 255, 255),
|
||||||
|
|||||||
@@ -91,3 +91,5 @@ function hideJobRouteLocation() {
|
|||||||
jobRouteLocationSphere = null;
|
jobRouteLocationSphere = null;
|
||||||
jobRouteLocationBlip = null;
|
jobRouteLocationBlip = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -52,7 +52,7 @@ function deleteGameElement(element, position) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function createGameVehicle(modelIndex, position, heading) {
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ function addAllNetworkHandlers() {
|
|||||||
|
|
||||||
addNetworkEventHandler("vrr.pedAnim", makePedPlayAnimation);
|
addNetworkEventHandler("vrr.pedAnim", makePedPlayAnimation);
|
||||||
addNetworkEventHandler("vrr.pedStopAnim", makePedStopAnimation);
|
addNetworkEventHandler("vrr.pedStopAnim", makePedStopAnimation);
|
||||||
|
addNetworkEventHandler("vrr.localPlayerSkin", setLocalPlayerSkin);
|
||||||
addNetworkEventHandler("vrr.forcePedAnim", forcePedAnimation);
|
addNetworkEventHandler("vrr.forcePedAnim", forcePedAnimation);
|
||||||
addNetworkEventHandler("vrr.hideAllGUI", hideAllGUI);
|
addNetworkEventHandler("vrr.hideAllGUI", hideAllGUI);
|
||||||
addNetworkEventHandler("vrr.gameScript", setGameScriptState);
|
addNetworkEventHandler("vrr.gameScript", setGameScriptState);
|
||||||
@@ -128,10 +129,12 @@ function setPlayer2DRendering(hudState, labelState, smallGameMessageState, score
|
|||||||
logToConsole(LOG_DEBUG, `[VRR.Main] Updating render states (HUD: ${hudState}, Labels: ${labelState}, Bottom Text: ${smallGameMessageState}, Scoreboard: ${scoreboardState}, HotBar: ${hotBarState}, Item Action Delay: ${itemActionDelayState})`);
|
logToConsole(LOG_DEBUG, `[VRR.Main] Updating render states (HUD: ${hudState}, Labels: ${labelState}, Bottom Text: ${smallGameMessageState}, Scoreboard: ${scoreboardState}, HotBar: ${hotBarState}, Item Action Delay: ${itemActionDelayState})`);
|
||||||
renderHUD = hudState;
|
renderHUD = hudState;
|
||||||
|
|
||||||
if(typeof setHUDEnabled != "undefined") {
|
if(getGame() == VRR_GAME_GTA_IV) {
|
||||||
if(getGame() == VRR_GAME_GTA_IV) {
|
natives.displayCash(hudState);
|
||||||
natives.displayHud(false);
|
natives.displayAmmo(hudState);
|
||||||
} else {
|
natives.displayHud(hudState);
|
||||||
|
} else {
|
||||||
|
if(typeof setHUDEnabled != "undefined") {
|
||||||
setHUDEnabled(hudState);
|
setHUDEnabled(hudState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -298,3 +301,14 @@ function setLocalPlayerInfiniteRun(state) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setLocalPlayerSkin(skinId) {
|
||||||
|
if(getGame() == VRR_GAME_GTA_IV) {
|
||||||
|
//natives.changePlayerModel(natives.getPlayerId(), skinId);
|
||||||
|
localPlayer.skin = allowedSkins[skinSelectorIndex][0];
|
||||||
|
} else {
|
||||||
|
localPlayer.skin = skinId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -53,7 +53,12 @@ function processSkinSelectKeyPress(keyCode) {
|
|||||||
}
|
}
|
||||||
logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`);
|
logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`);
|
||||||
skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1];
|
skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1];
|
||||||
localPlayer.skin = allowedSkins[skinSelectorIndex][0];
|
if(getGame() == VRR_GAME_GTA_IV) {
|
||||||
|
//natives.changePlayerModel(natives.getPlayerId(), allowedSkins[skinSelectorIndex][0]);
|
||||||
|
localPlayer.skin = allowedSkins[skinSelectorIndex][0];
|
||||||
|
} else {
|
||||||
|
localPlayer.skin = allowedSkins[skinSelectorIndex][0];
|
||||||
|
}
|
||||||
} else if(keyCode == SDLK_PAGEDOWN) {
|
} else if(keyCode == SDLK_PAGEDOWN) {
|
||||||
if(skinSelectorIndex <= 0) {
|
if(skinSelectorIndex <= 0) {
|
||||||
skinSelectorIndex = allowedSkins.length-1;
|
skinSelectorIndex = allowedSkins.length-1;
|
||||||
@@ -62,7 +67,12 @@ function processSkinSelectKeyPress(keyCode) {
|
|||||||
}
|
}
|
||||||
logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`);
|
logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`);
|
||||||
skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1];
|
skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1];
|
||||||
localPlayer.skin = allowedSkins[skinSelectorIndex][0];
|
if(getGame() == VRR_GAME_GTA_IV) {
|
||||||
|
//natives.changePlayerModel(natives.getPlayerId(), allowedSkins[skinSelectorIndex][0]);
|
||||||
|
localPlayer.skin = allowedSkins[skinSelectorIndex][0];
|
||||||
|
} else {
|
||||||
|
localPlayer.skin = allowedSkins[skinSelectorIndex][0];
|
||||||
|
}
|
||||||
} else if(keyCode == SDLK_RETURN) {
|
} else if(keyCode == SDLK_RETURN) {
|
||||||
sendNetworkEventToServer("vrr.skinSelected", skinSelectorIndex);
|
sendNetworkEventToServer("vrr.skinSelected", skinSelectorIndex);
|
||||||
toggleSkinSelect(false);
|
toggleSkinSelect(false);
|
||||||
@@ -109,7 +119,13 @@ function toggleSkinSelect(state) {
|
|||||||
game.setCameraLookAt(frontCameraPosition, localPlayer.position, true);
|
game.setCameraLookAt(frontCameraPosition, localPlayer.position, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
localPlayer.skin = allowedSkins[skinSelectorIndex][0];
|
if(getGame() == VRR_GAME_GTA_IV) {
|
||||||
|
//natives.changePlayerModel(natives.getPlayerId(), allowedSkins[skinSelectorIndex][0]);
|
||||||
|
localPlayer.skin = allowedSkins[skinSelectorIndex][0];
|
||||||
|
} else {
|
||||||
|
localPlayer.skin = allowedSkins[skinSelectorIndex][0];
|
||||||
|
}
|
||||||
|
|
||||||
skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1];
|
skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1];
|
||||||
setLocalPlayerControlState(false, false);
|
setLocalPlayerControlState(false, false);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ function syncVehicleProperties(vehicle) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(getGame() == VRR_GAME_GTA_SA) {
|
if(getGame() == VRR_GAME_GTA_SA) {
|
||||||
let allUpgrades = getGameData().vehicleUpgrades[getGame()];
|
let allUpgrades = getGameConfig().vehicleUpgrades[getGame()];
|
||||||
for(let i in allUpgrades) {
|
for(let i in allUpgrades) {
|
||||||
vehicle.removeUpgrade(i);
|
vehicle.removeUpgrade(i);
|
||||||
}
|
}
|
||||||
@@ -392,3 +392,19 @@ function syncElementProperties(element) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function receiveBlipFromServer(model, position) {
|
||||||
|
if(getGame() == VRR_GAME_GTA_IV) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function receivePickupFromServer(model, position) {
|
||||||
|
if(getGame() == VRR_GAME_GTA_IV) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -188,8 +188,10 @@ function setLocalPlayerControlState(controlState, cursorState = false) {
|
|||||||
game.SET_PLAYER_CONTROL(localClient.index, boolToInt(controlState));
|
game.SET_PLAYER_CONTROL(localClient.index, boolToInt(controlState));
|
||||||
}
|
}
|
||||||
|
|
||||||
localPlayer.collisionsEnabled = controlState;
|
if(getGame() != VRR_GAME_GTA_IV) {
|
||||||
localPlayer.invincible = true;
|
localPlayer.collisionsEnabled = controlState;
|
||||||
|
localPlayer.invincible = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -283,26 +285,21 @@ function enterVehicleAsPassenger() {
|
|||||||
|
|
||||||
function giveLocalPlayerWeapon(weaponId, ammo, active) {
|
function giveLocalPlayerWeapon(weaponId, ammo, active) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Giving weapon ${weaponId} with ${ammo} ammo`);
|
logToConsole(LOG_DEBUG, `[VRR.Utilities] Giving weapon ${weaponId} with ${ammo} ammo`);
|
||||||
localPlayer.giveWeapon(weaponId, ammo, active);
|
|
||||||
forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(weaponId));
|
|
||||||
forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(weaponId));
|
|
||||||
forceWeapon = weaponId;
|
forceWeapon = weaponId;
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function giveLocalPlayerWeapon(weaponId, ammo, active) {
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Giving weapon ${weaponId} with ${ammo} ammo`);
|
|
||||||
if(getGame() == VRR_GAME_MAFIA_ONE) {
|
if(getGame() == VRR_GAME_MAFIA_ONE) {
|
||||||
localPlayer.giveWeapon(weaponId, 0, ammo);
|
localPlayer.giveWeapon(weaponId, 0, ammo);
|
||||||
forceWeaponAmmo = 0;
|
forceWeaponAmmo = 0;
|
||||||
forceWeaponClipAmmo = ammo;
|
forceWeaponClipAmmo = ammo;
|
||||||
} else {
|
} else {
|
||||||
localPlayer.giveWeapon(weaponId, ammo, active);
|
localPlayer.giveWeapon(weaponId, ammo, active);
|
||||||
forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(weaponId));
|
if(getGame() < VRR_GAME_GTA_IV) {
|
||||||
forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(weaponId));
|
forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(weaponId));
|
||||||
|
forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(weaponId));
|
||||||
|
} else {
|
||||||
|
forceWeaponAmmo = ammo;
|
||||||
|
forceWeaponClipAmmo = ammo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
forceWeapon = weaponId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -351,6 +348,9 @@ function setLocalPlayerInterior(interior) {
|
|||||||
if(!isGTAIV()) {
|
if(!isGTAIV()) {
|
||||||
localPlayer.interior = interior;
|
localPlayer.interior = interior;
|
||||||
game.cameraInterior = interior;
|
game.cameraInterior = interior;
|
||||||
|
} else {
|
||||||
|
let interiorId = natives.getInteriorAtCoords(localPlayer.position);
|
||||||
|
natives.activateInterior(interiorId, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -618,11 +618,15 @@ function forceLocalPlayerEquippedWeaponItem() {
|
|||||||
if(forceWeapon != 0) {
|
if(forceWeapon != 0) {
|
||||||
if(localPlayer.weapon != forceWeapon) {
|
if(localPlayer.weapon != forceWeapon) {
|
||||||
localPlayer.weapon = forceWeapon;
|
localPlayer.weapon = forceWeapon;
|
||||||
localPlayer.setWeaponClipAmmunition(getWeaponSlot(forceWeapon), forceWeaponClipAmmo);
|
if(getGame() <= VRR_GAME_GTA_IV) {
|
||||||
localPlayer.setWeaponAmmunition(getWeaponSlot(forceWeapon), forceWeaponAmmo);
|
localPlayer.setWeaponClipAmmunition(getWeaponSlot(forceWeapon), forceWeaponClipAmmo);
|
||||||
|
localPlayer.setWeaponAmmunition(getWeaponSlot(forceWeapon), forceWeaponAmmo);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(forceWeapon));
|
if(getGame() <= VRR_GAME_GTA_IV) {
|
||||||
forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(forceWeapon));
|
forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(forceWeapon));
|
||||||
|
forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(forceWeapon));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(localPlayer.weapon > 0) {
|
if(localPlayer.weapon > 0) {
|
||||||
@@ -835,13 +839,13 @@ function setUpInitialGame() {
|
|||||||
natives.setPlayersDropMoneyInNetworkGame(false);
|
natives.setPlayersDropMoneyInNetworkGame(false);
|
||||||
natives.setSyncWeatherAndGameTime(false);
|
natives.setSyncWeatherAndGameTime(false);
|
||||||
natives.usePlayerColourInsteadOfTeamColour(true);
|
natives.usePlayerColourInsteadOfTeamColour(true);
|
||||||
natives.setDisplayPlayerNameAndIcon(false);
|
natives.setDisplayPlayerNameAndIcon(natives.getPlayerId(), false);
|
||||||
natives.removeTemporaryRadarBlipsForPickups();
|
natives.removeTemporaryRadarBlipsForPickups();
|
||||||
natives.setPickupsFixCars(false);
|
natives.setPickupsFixCars(false);
|
||||||
natives.displayCash(true);
|
natives.displayCash(false);
|
||||||
natives.displayAmmo(true);
|
natives.displayAmmo(false);
|
||||||
natives.displayHud(true);
|
natives.displayHud(false);
|
||||||
natives.displayAreaName(true);
|
natives.displayAreaName(false);
|
||||||
natives.setPoliceRadarBlips(false);
|
natives.setPoliceRadarBlips(false);
|
||||||
|
|
||||||
natives.requestAnims("DANCING");
|
natives.requestAnims("DANCING");
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ function toggleAccountGUICommand(command, params, client) {
|
|||||||
|
|
||||||
if(!isPlayerLoggedIn(client)) {
|
if(!isPlayerLoggedIn(client)) {
|
||||||
if(getPlayerData().accountData.databaseId != 0) {
|
if(getPlayerData().accountData.databaseId != 0) {
|
||||||
if(getServerConfig().useGUI && doesPlayerHaveGUIEnabled(client)) {
|
if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
showPlayerLoginGUI(client);
|
showPlayerLoginGUI(client);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI`);
|
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI`);
|
||||||
} else {
|
} else {
|
||||||
@@ -115,7 +115,7 @@ function toggleAccountGUICommand(command, params, client) {
|
|||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled)`);
|
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled)`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(getServerConfig().useGUI && doesPlayerHaveGUIEnabled(client)) {
|
if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
showPlayerRegistrationGUI(client);
|
showPlayerRegistrationGUI(client);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the register GUI`);
|
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the register GUI`);
|
||||||
} else {
|
} else {
|
||||||
@@ -566,13 +566,31 @@ function loginSuccess(client) {
|
|||||||
client.administrator = true;
|
client.administrator = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(doesServerHaveTesterOnlyEnabled()) {
|
||||||
|
if(!hasBitFlag(getPlayerData(client).accountData.flags.moderation, getModerationFlagValue("IsTester"))) {
|
||||||
|
setTimeout(function() {
|
||||||
|
client.disconnect();
|
||||||
|
}, 3500);
|
||||||
|
|
||||||
|
if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
|
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the error GUI (not a tester).`);
|
||||||
|
showPlayerErrorGUI(client, getLocaleString(client, "NotATester"), getLocaleString(client, "AccessDenied"));
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the "not a tester" error message (GUI disabled).`);
|
||||||
|
messagePlayerError(client, getLocaleString(client, "NotATester"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(getPlayerData(client).subAccounts.length == 0) {
|
if(getPlayerData(client).subAccounts.length == 0) {
|
||||||
if(getServerConfig().useGUI && doesPlayerHaveGUIEnabled(client)) {
|
if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
showPlayerPromptGUI(client, `You have no characters. Would you like to make one?`, "No characters");
|
showPlayerPromptGUI(client, getLocaleString(client, "NoCharactersGUIMessage"), getLocaleString(client, "NoCharactersGUIWindowTitle"));
|
||||||
getPlayerData(client).promptType = VRR_PROMPT_CREATEFIRSTCHAR;
|
getPlayerData(client).promptType = VRR_PROMPT_CREATEFIRSTCHAR;
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the no characters prompt GUI`);
|
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the no characters prompt GUI`);
|
||||||
} else {
|
} else {
|
||||||
messagePlayerAlert(client, `You have no characters. Use /newchar to make one.`);
|
messagePlayerAlert(client, getLocaleString(client, "NoCharactersChatMessage", `{ALTCOLOUR}/newchar{MAINCOLOUR}`));
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the no characters message (GUI disabled)`);
|
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the no characters message (GUI disabled)`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -760,7 +778,7 @@ function checkLogin(client, password) {
|
|||||||
|
|
||||||
if(isPlayerLoggedIn(client)) {
|
if(isPlayerLoggedIn(client)) {
|
||||||
logToConsole(LOG_WARN, `[VRR.Account] ${getPlayerDisplayForConsole(client)} attempted to login but is already logged in`);
|
logToConsole(LOG_WARN, `[VRR.Account] ${getPlayerDisplayForConsole(client)} attempted to login but is already logged in`);
|
||||||
if(getServerConfig().useGUI && doesPlayerHaveGUIEnabled(client)) {
|
if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
showPlayerLoginSuccessGUI(client);
|
showPlayerLoginSuccessGUI(client);
|
||||||
} else {
|
} else {
|
||||||
messagePlayerError(client, "You are already logged in!");
|
messagePlayerError(client, "You are already logged in!");
|
||||||
@@ -771,7 +789,7 @@ function checkLogin(client, password) {
|
|||||||
|
|
||||||
if(!isPlayerRegistered(client)) {
|
if(!isPlayerRegistered(client)) {
|
||||||
logToConsole(LOG_WARN, `[VRR.Account] ${getPlayerDisplayForConsole(client)} attempted to login but is not registered`);
|
logToConsole(LOG_WARN, `[VRR.Account] ${getPlayerDisplayForConsole(client)} attempted to login but is not registered`);
|
||||||
if(getServerConfig().useGUI && doesPlayerHaveGUIEnabled(client)) {
|
if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
showPlayerRegistrationGUI(client);
|
showPlayerRegistrationGUI(client);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the register GUI`);
|
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the register GUI`);
|
||||||
} else {
|
} else {
|
||||||
@@ -783,7 +801,7 @@ function checkLogin(client, password) {
|
|||||||
|
|
||||||
if(areParamsEmpty(password)) {
|
if(areParamsEmpty(password)) {
|
||||||
logToConsole(LOG_WARN, `[VRR.Account] ${getPlayerDisplayForConsole(client)} attempted to login but failed (empty password). ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining`);
|
logToConsole(LOG_WARN, `[VRR.Account] ${getPlayerDisplayForConsole(client)} attempted to login but failed (empty password). ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining`);
|
||||||
if(getServerConfig().useGUI && doesPlayerHaveGUIEnabled(client)) {
|
if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
showPlayerLoginFailedGUI(client, `Invalid password! ${getPlayerData(client).loginAttemptsRemaining} tries remaining.`);
|
showPlayerLoginFailedGUI(client, `Invalid password! ${getPlayerData(client).loginAttemptsRemaining} tries remaining.`);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
|
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
|
||||||
} else {
|
} else {
|
||||||
@@ -799,7 +817,7 @@ function checkLogin(client, password) {
|
|||||||
|
|
||||||
if(!isAccountPasswordCorrect(getPlayerData(client).accountData, hashAccountPassword(getPlayerName(client), password))) {
|
if(!isAccountPasswordCorrect(getPlayerData(client).accountData, hashAccountPassword(getPlayerName(client), password))) {
|
||||||
logToConsole(LOG_WARN, `[VRR.Account] ${getPlayerDisplayForConsole(client)} attempted to login but failed (wrong password). ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining`);
|
logToConsole(LOG_WARN, `[VRR.Account] ${getPlayerDisplayForConsole(client)} attempted to login but failed (wrong password). ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining`);
|
||||||
if(getServerConfig().useGUI && doesPlayerHaveGUIEnabled(client)) {
|
if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
showPlayerLoginFailedGUI(client, `Invalid password! ${getPlayerData(client).loginAttemptsRemaining} tries remaining.`);
|
showPlayerLoginFailedGUI(client, `Invalid password! ${getPlayerData(client).loginAttemptsRemaining} tries remaining.`);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
|
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
|
||||||
} else {
|
} else {
|
||||||
@@ -819,7 +837,7 @@ function checkLogin(client, password) {
|
|||||||
// return true;
|
// return true;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
if(getServerConfig().useGUI && doesPlayerHaveGUIEnabled(client)) {
|
if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
showPlayerLoginSuccessGUI(client);
|
showPlayerLoginSuccessGUI(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -836,7 +854,7 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress
|
|||||||
logToConsole(LOG_DEBUG, `[VRR.Account]: Checking registration for ${getPlayerName(client)}`);
|
logToConsole(LOG_DEBUG, `[VRR.Account]: Checking registration for ${getPlayerName(client)}`);
|
||||||
|
|
||||||
if(isPlayerRegistered(client)) {
|
if(isPlayerRegistered(client)) {
|
||||||
if(getServerConfig().useGUI && doesPlayerHaveGUIEnabled(client)) {
|
if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
showPlayerLoginGUI(client);
|
showPlayerLoginGUI(client);
|
||||||
} else {
|
} else {
|
||||||
messagePlayerError(client, getLocaleString(client, "AlreadyRegistered"));
|
messagePlayerError(client, getLocaleString(client, "AlreadyRegistered"));
|
||||||
@@ -846,7 +864,7 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(isPlayerLoggedIn(client)) {
|
if(isPlayerLoggedIn(client)) {
|
||||||
if(getServerConfig().useGUI && doesPlayerHaveGUIEnabled(client)) {
|
if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
showPlayerLoginSuccessGUI(client);
|
showPlayerLoginSuccessGUI(client);
|
||||||
} else {
|
} else {
|
||||||
messagePlayerError(client, getLocaleString(client, "AlreadyLoggedIn"));
|
messagePlayerError(client, getLocaleString(client, "AlreadyLoggedIn"));
|
||||||
@@ -856,7 +874,7 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(areParamsEmpty(password)) {
|
if(areParamsEmpty(password)) {
|
||||||
if(getServerConfig().useGUI && doesPlayerHaveGUIEnabled(client)) {
|
if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
showPlayerRegistrationFailedGUI(client, getLocaleString(client, "RegistrationFailedNoPassword"));
|
showPlayerRegistrationFailedGUI(client, getLocaleString(client, "RegistrationFailedNoPassword"));
|
||||||
logToConsole(LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to create an account (password is blank)`);
|
logToConsole(LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to create an account (password is blank)`);
|
||||||
} else {
|
} else {
|
||||||
@@ -866,7 +884,7 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getServerConfig().useGUI && doesPlayerHaveGUIEnabled(client)) {
|
if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
if(areParamsEmpty(confirmPassword)) {
|
if(areParamsEmpty(confirmPassword)) {
|
||||||
showPlayerRegistrationFailedGUI(client, getLocaleString(client, "RegistrationFailedNoPasswordConfirm"));
|
showPlayerRegistrationFailedGUI(client, getLocaleString(client, "RegistrationFailedNoPasswordConfirm"));
|
||||||
logToConsole(LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to create an account (password confirm is blank)`);
|
logToConsole(LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to create an account (password confirm is blank)`);
|
||||||
@@ -874,7 +892,7 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getServerConfig().useGUI && doesPlayerHaveGUIEnabled(client)) {
|
if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
if(areParamsEmpty(emailAddress)) {
|
if(areParamsEmpty(emailAddress)) {
|
||||||
showPlayerRegistrationFailedGUI(client, getLocaleString(client, "RegistrationFailedNoEmail"));
|
showPlayerRegistrationFailedGUI(client, getLocaleString(client, "RegistrationFailedNoEmail"));
|
||||||
logToConsole(LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to create an account (email address is blank)`);
|
logToConsole(LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to create an account (email address is blank)`);
|
||||||
@@ -882,7 +900,7 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getServerConfig().useGUI && doesPlayerHaveGUIEnabled(client)) {
|
if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
if(password != confirmPassword) {
|
if(password != confirmPassword) {
|
||||||
showPlayerRegistrationFailedGUI(client, getLocaleString(client, "RegistrationFailedPasswordMismatch"));
|
showPlayerRegistrationFailedGUI(client, getLocaleString(client, "RegistrationFailedPasswordMismatch"));
|
||||||
logToConsole(LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to create an account (password and confirm don't match)`);
|
logToConsole(LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to create an account (password and confirm don't match)`);
|
||||||
@@ -891,7 +909,7 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!doesPasswordMeetRequirements(password)) {
|
if(!doesPasswordMeetRequirements(password)) {
|
||||||
if(getServerConfig().useGUI && doesPlayerHaveGUIEnabled(client)) {
|
if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
// Work on this later. Function should return true by default anyway for now.
|
// Work on this later. Function should return true by default anyway for now.
|
||||||
showPlayerRegistrationFailedGUI(client, getLocaleString(client, "RegistrationFailedNoPasswordWeak"));
|
showPlayerRegistrationFailedGUI(client, getLocaleString(client, "RegistrationFailedNoPasswordWeak"));
|
||||||
logToConsole(LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to create an account (password doesn't meet requirements)`);
|
logToConsole(LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to create an account (password doesn't meet requirements)`);
|
||||||
@@ -901,7 +919,7 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getServerConfig().useGUI && doesPlayerHaveGUIEnabled(client)) {
|
if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
if(!isValidEmailAddress(emailAddress)) {
|
if(!isValidEmailAddress(emailAddress)) {
|
||||||
showPlayerRegistrationFailedGUI(client, getLocaleString(client, "RegistrationFailedInvalidEmail"));
|
showPlayerRegistrationFailedGUI(client, getLocaleString(client, "RegistrationFailedInvalidEmail"));
|
||||||
return false
|
return false
|
||||||
@@ -910,7 +928,7 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress
|
|||||||
|
|
||||||
let accountData = createAccount(getPlayerName(client), password, emailAddress);
|
let accountData = createAccount(getPlayerName(client), password, emailAddress);
|
||||||
if(!accountData) {
|
if(!accountData) {
|
||||||
if(getServerConfig().useGUI && doesPlayerHaveGUIEnabled(client)) {
|
if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
showPlayerRegistrationFailedGUI(client, getLocaleString(client, "RegistrationFailedCreateError"));
|
showPlayerRegistrationFailedGUI(client, getLocaleString(client, "RegistrationFailedCreateError"));
|
||||||
} else {
|
} else {
|
||||||
messagePlayerAlert(client, getLocaleString(client, "RegistrationFailedCreateError"));
|
messagePlayerAlert(client, getLocaleString(client, "RegistrationFailedCreateError"));
|
||||||
@@ -926,22 +944,36 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress
|
|||||||
messagePlayerSuccess(client, getLocaleString(client, "RegistrationSuccess"));
|
messagePlayerSuccess(client, getLocaleString(client, "RegistrationSuccess"));
|
||||||
if(checkForSMTPModule() && getEmailConfig().enabled) {
|
if(checkForSMTPModule() && getEmailConfig().enabled) {
|
||||||
messagePlayerAlert(client, getLocaleString(client, "RegistrationEmailVerifyReminder"));
|
messagePlayerAlert(client, getLocaleString(client, "RegistrationEmailVerifyReminder"));
|
||||||
|
let emailVerificationCode = generateEmailVerificationCode();
|
||||||
|
setAccountEmailVerificationCode(getPlayerData(client).accountData, emailVerificationCode);
|
||||||
|
sendEmailVerificationEmail(client, emailVerificationCode);
|
||||||
|
logToConsole(LOG_WARN, `${getPlayerDisplayForConsole(client)} was sent a registration email verification code`);
|
||||||
}
|
}
|
||||||
messagePlayerAlert(client, getLocaleString(client, "RegistrationCreateCharReminder"));
|
|
||||||
|
|
||||||
if(getServerConfig().useGUI && doesPlayerHaveGUIEnabled(client)) {
|
if(doesServerHaveTesterOnlyEnabled() && !isPlayerATester(client)) {
|
||||||
showPlayerRegistrationSuccessGUI(client);
|
setTimeout(function() {
|
||||||
showPlayerPromptGUI(client, getLocaleString(client, "NoCharactersMessage"), getLocaleString(client, "NoCharactersWindowTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
client.disconnect();
|
||||||
getPlayerData(client).promptType = VRR_PROMPT_CREATEFIRSTCHAR;
|
}, 5000);
|
||||||
|
|
||||||
if(checkForSMTPModule() && getEmailConfig().enabled) {
|
if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
let emailVerificationCode = generateEmailVerificationCode();
|
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the error GUI (not a tester).`);
|
||||||
setAccountEmailVerificationCode(getPlayerData(client).accountData, emailVerificationCode);
|
showPlayerErrorGUI(client, getLocaleString(client, "NotATester"), getLocaleString(client, "AccessDenied"));
|
||||||
sendEmailVerificationEmail(client, emailVerificationCode);
|
return false;
|
||||||
logToConsole(LOG_WARN, `${getPlayerDisplayForConsole(client)} was sent a registration email verification code`);
|
} else {
|
||||||
|
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the "not a tester" error message (GUI disabled).`);
|
||||||
|
messagePlayerError(client, getLocaleString(client, "NotATester"));
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
messagePlayerAlert(client, getLocaleString(client, "NoCharactersChatMessage"));
|
messagePlayerAlert(client, getLocaleString(client, "RegistrationCreateCharReminder"));
|
||||||
|
|
||||||
|
if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
|
showPlayerRegistrationSuccessGUI(client);
|
||||||
|
showPlayerPromptGUI(client, getLocaleString(client, "NoCharactersMessage"), getLocaleString(client, "NoCharactersWindowTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
||||||
|
getPlayerData(client).promptType = VRR_PROMPT_CREATEFIRSTCHAR;
|
||||||
|
} else {
|
||||||
|
messagePlayerAlert(client, getLocaleString(client, "NoCharactersChatMessage"), `{ALTCOLOUR}/newchar{MAINCOLOUR}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1084,6 +1116,12 @@ function initClient(client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(client.getData("vrr.isInitialized") != null || client.getData("vrr.isInitialized") == true) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
client.setData("vrr.isInitialized", true, false);
|
||||||
|
|
||||||
sendPlayerGUIColours(client);
|
sendPlayerGUIColours(client);
|
||||||
sendPlayerGUIInit(client);
|
sendPlayerGUIInit(client);
|
||||||
updatePlayerSnowState(client);
|
updatePlayerSnowState(client);
|
||||||
@@ -1109,7 +1147,7 @@ function initClient(client) {
|
|||||||
messagePlayerAlert(client, getLocaleString(client, "AutoLoggedInIP"));
|
messagePlayerAlert(client, getLocaleString(client, "AutoLoggedInIP"));
|
||||||
loginSuccess(client);
|
loginSuccess(client);
|
||||||
} else {
|
} else {
|
||||||
if(getServerConfig().useGUI && doesPlayerHaveGUIEnabled(client)) {
|
if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI.`);
|
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI.`);
|
||||||
showPlayerLoginGUI(client);
|
showPlayerLoginGUI(client);
|
||||||
} else {
|
} else {
|
||||||
@@ -1119,7 +1157,7 @@ function initClient(client) {
|
|||||||
playRadioStreamForPlayer(client, getServerIntroMusicURL(), true, getPlayerStreamingRadioVolume(client));
|
playRadioStreamForPlayer(client, getServerIntroMusicURL(), true, getPlayerStreamingRadioVolume(client));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(getServerConfig().useGUI && doesPlayerHaveGUIEnabled(client)) {
|
if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the register GUI.`);
|
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the register GUI.`);
|
||||||
showPlayerRegistrationGUI(client);
|
showPlayerRegistrationGUI(client);
|
||||||
} else {
|
} else {
|
||||||
@@ -1454,3 +1492,9 @@ function checkPlayerTwoFactorAuthentication(client, authCode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function isPlayerATester(client) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -70,7 +70,7 @@ function stopPlayerAnimationCommand(command, params, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showAnimationListCommand(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);
|
let chunkedList = splitArrayIntoChunks(animList, 10);
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ function showAnimationListCommand(command, params, client) {
|
|||||||
* @return {Array} The animation's data (array)
|
* @return {Array} The animation's data (array)
|
||||||
*/
|
*/
|
||||||
function getAnimationData(animationSlot, gameId = getServerGame()) {
|
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) {
|
function getAnimationFromParams(params) {
|
||||||
if(isNaN(params)) {
|
if(isNaN(params)) {
|
||||||
for(let i in getGameData().animations[getServerGame()]) {
|
for(let i in getGameConfig().animations[getServerGame()]) {
|
||||||
if(toLowerCase(getGameData().animations[getServerGame()][i][0]).indexOf(toLowerCase(params)) != -1) {
|
if(toLowerCase(getGameConfig().animations[getServerGame()][i][0]).indexOf(toLowerCase(params)) != -1) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(typeof getGameData().animations[getServerGame()][params] != "undefined") {
|
if(typeof getGameConfig().animations[getServerGame()][params] != "undefined") {
|
||||||
return toInteger(params);
|
return toInteger(params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,8 @@ let serverBitFlagKeys = {
|
|||||||
"TwoFactorAuthVerified",
|
"TwoFactorAuthVerified",
|
||||||
"NonRoleplayCharacterName",
|
"NonRoleplayCharacterName",
|
||||||
"CanHearEverything",
|
"CanHearEverything",
|
||||||
"DontSyncClientElements"
|
"DontSyncClientElements",
|
||||||
|
"IsTester"
|
||||||
],
|
],
|
||||||
factionFlagKeys: [
|
factionFlagKeys: [
|
||||||
"None",
|
"None",
|
||||||
@@ -409,7 +410,7 @@ function getModerationFlagValue(flagName) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getServerSettingFlagValue(flagName) {
|
function getServerSettingsFlagValue(flagName) {
|
||||||
if(flagName == "All") {
|
if(flagName == "All") {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1336,6 +1336,10 @@ function createAllBusinessBlips() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function createBusinessEntrancePickup(businessId) {
|
function createBusinessEntrancePickup(businessId) {
|
||||||
|
if(!areServerElementsSupported()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if(!getServerConfig().createBusinessPickups) {
|
if(!getServerConfig().createBusinessPickups) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1349,17 +1353,23 @@ function createBusinessEntrancePickup(businessId) {
|
|||||||
|
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Job]: Creating entrance pickup for business ${getBusinessData(businessId).name} (model ${pickupModelId})`);
|
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);
|
if(areServerElementsSupported()) {
|
||||||
setElementOnAllDimensions(getBusinessData(businessId).entrancePickup, false);
|
getBusinessData(businessId).entrancePickup = createGamePickup(pickupModelId, getBusinessData(businessId).entrancePosition, getGameConfig().pickupTypes[getServerGame()].business);
|
||||||
setElementDimension(getBusinessData(businessId).entrancePickup, getBusinessData(businessId).entranceDimension);
|
setElementOnAllDimensions(getBusinessData(businessId).entrancePickup, false);
|
||||||
updateBusinessPickupLabelData(businessId);
|
setElementDimension(getBusinessData(businessId).entrancePickup, getBusinessData(businessId).entranceDimension);
|
||||||
addToWorld(getBusinessData(businessId).entrancePickup);
|
updateBusinessPickupLabelData(businessId);
|
||||||
|
addToWorld(getBusinessData(businessId).entrancePickup);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function createBusinessEntranceBlip(businessId) {
|
function createBusinessEntranceBlip(businessId) {
|
||||||
|
if(!areServerElementsSupported()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if(!getServerConfig().createBusinessBlips) {
|
if(!getServerConfig().createBusinessBlips) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1373,10 +1383,12 @@ function createBusinessEntranceBlip(businessId) {
|
|||||||
|
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Job]: Creating entrance blip for business ${getBusinessData(businessId).name} (model ${blipModelId})`);
|
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"));
|
if(areServerElementsSupported()) {
|
||||||
setElementOnAllDimensions(getBusinessData(businessId).entranceBlip, false);
|
getBusinessData(businessId).entranceBlip = createGameBlip(getBusinessData(businessId).entrancePosition, blipModelId, 1, getColourByName("businessBlue"));
|
||||||
setElementDimension(getBusinessData(businessId).entranceBlip, getBusinessData(businessId).entranceDimension);
|
setElementOnAllDimensions(getBusinessData(businessId).entranceBlip, false);
|
||||||
addToWorld(getBusinessData(businessId).entranceBlip);
|
setElementDimension(getBusinessData(businessId).entranceBlip, getBusinessData(businessId).entranceDimension);
|
||||||
|
addToWorld(getBusinessData(businessId).entranceBlip);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1397,11 +1409,13 @@ function createBusinessExitPickup(businessId) {
|
|||||||
|
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Job]: Creating exit pickup for business ${getBusinessData(businessId).name} (model ${pickupModelId})`);
|
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);
|
if(areServerElementsSupported()) {
|
||||||
setElementDimension(getBusinessData(businessId).exitPickup, getBusinessData(businessId).exitDimension);
|
getBusinessData(businessId).exitPickup = createGamePickup(pickupModelId, getBusinessData(businessId).exitPosition, getGameConfig().pickupTypes[getServerGame()].business);
|
||||||
setElementOnAllDimensions(getBusinessData(businessId).exitPickup, false);
|
setElementDimension(getBusinessData(businessId).exitPickup, getBusinessData(businessId).exitDimension);
|
||||||
updateBusinessPickupLabelData(businessId);
|
setElementOnAllDimensions(getBusinessData(businessId).exitPickup, false);
|
||||||
addToWorld(getBusinessData(businessId).exitPickup);
|
updateBusinessPickupLabelData(businessId);
|
||||||
|
addToWorld(getBusinessData(businessId).exitPickup);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1421,15 +1435,17 @@ function createBusinessExitBlip(businessId) {
|
|||||||
blipModelId = getBusinessData(businessId).exitBlipModel;
|
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"));
|
getBusinessData(businessId).exitBlip = createGameBlip(getBusinessData(businessId).exitPosition, blipModelId, 1, getColourByName("businessBlue"));
|
||||||
setElementDimension(getBusinessData(businessId).exitBlip, getBusinessData(businessId).entranceDimension);
|
setElementDimension(getBusinessData(businessId).exitBlip, getBusinessData(businessId).entranceDimension);
|
||||||
setElementOnAllDimensions(getBusinessData(businessId).exitBlip, false);
|
setElementOnAllDimensions(getBusinessData(businessId).exitBlip, false);
|
||||||
//getBusinessData(businessId).exitBlip.interior = getBusinessData(businessId).exitInterior;
|
//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.type", VRR_BLIP_BUSINESS_EXIT, false);
|
||||||
//setEntityData(getBusinessData(businessId).exitBlip, "vrr.owner.id", businessId, false);
|
//setEntityData(getBusinessData(businessId).exitBlip, "vrr.owner.id", businessId, false);
|
||||||
addToWorld(getBusinessData(businessId).exitBlip);
|
addToWorld(getBusinessData(businessId).exitBlip);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1907,6 +1923,10 @@ function getBusinessIdFromDatabaseId(databaseId) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function updateBusinessPickupLabelData(businessId) {
|
function updateBusinessPickupLabelData(businessId) {
|
||||||
|
if(!areServerElementsSupported()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if(getBusinessData(businessId).exitPickup != null) {
|
if(getBusinessData(businessId).exitPickup != null) {
|
||||||
setEntityData(getBusinessData(businessId).exitPickup, "vrr.owner.type", VRR_PICKUP_BUSINESS_EXIT, false);
|
setEntityData(getBusinessData(businessId).exitPickup, "vrr.owner.type", VRR_PICKUP_BUSINESS_EXIT, false);
|
||||||
setEntityData(getBusinessData(businessId).exitPickup, "vrr.owner.id", businessId, false);
|
setEntityData(getBusinessData(businessId).exitPickup, "vrr.owner.id", businessId, false);
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ function initClassScript() {
|
|||||||
class ServerData {
|
class ServerData {
|
||||||
constructor(dbAssoc = false) {
|
constructor(dbAssoc = false) {
|
||||||
this.databaseId = 0;
|
this.databaseId = 0;
|
||||||
this.name = "";
|
|
||||||
this.password = "";
|
|
||||||
this.needsSaved = false;
|
this.needsSaved = false;
|
||||||
|
|
||||||
this.newCharacter = {
|
this.newCharacter = {
|
||||||
@@ -59,6 +57,8 @@ class ServerData {
|
|||||||
this.guiTextColourSecondary = [0, 0, 0];
|
this.guiTextColourSecondary = [0, 0, 0];
|
||||||
this.showLogo = true;
|
this.showLogo = true;
|
||||||
this.inflationMultiplier = 1;
|
this.inflationMultiplier = 1;
|
||||||
|
this.testerOnly = false;
|
||||||
|
this.settings = 0;
|
||||||
|
|
||||||
this.antiCheat = {
|
this.antiCheat = {
|
||||||
enabled: false,
|
enabled: false,
|
||||||
@@ -104,52 +104,47 @@ class ServerData {
|
|||||||
bank: dbAssoc["svr_newchar_bank"],
|
bank: dbAssoc["svr_newchar_bank"],
|
||||||
skin: dbAssoc["svr_newchar_skin"],
|
skin: dbAssoc["svr_newchar_skin"],
|
||||||
},
|
},
|
||||||
|
this.settings = toInteger(dbAssoc["svr_settings"]);
|
||||||
|
|
||||||
this.connectCameraPosition = toVector3(dbAssoc["svr_connectcam_pos_x"], dbAssoc["svr_connectcam_pos_y"], dbAssoc["svr_connectcam_pos_z"]);
|
this.connectCameraPosition = toVector3(dbAssoc["svr_connectcam_pos_x"], dbAssoc["svr_connectcam_pos_y"], dbAssoc["svr_connectcam_pos_z"]);
|
||||||
this.connectCameraLookAt = toVector3(dbAssoc["svr_connectcam_lookat_x"], dbAssoc["svr_connectcam_lookat_y"], dbAssoc["svr_connectcam_lookat_z"]);
|
this.connectCameraLookAt = toVector3(dbAssoc["svr_connectcam_lookat_x"], dbAssoc["svr_connectcam_lookat_y"], dbAssoc["svr_connectcam_lookat_z"]);
|
||||||
|
|
||||||
//this.characterSelectCameraPosition = toVector3(dbAssoc["svr_charselect_cam_pos_x"], dbAssoc["svr_charselect_cam_pos_y"], dbAssoc["svr_charselect_cam_pos_z"]);
|
|
||||||
//this.characterSelectCameraLookAt = toVector3(dbAssoc["svr_charselect_cam_lookat_x"], dbAssoc["svr_charselect_cam_lookat_y"], dbAssoc["svr_charselect_cam_lookat_z"]);
|
|
||||||
|
|
||||||
//this.characterSelectPedPosition = toVector3(dbAssoc["svr_charselect_ped_pos_x"], dbAssoc["svr_charselect_ped_pos_y"], dbAssoc["svr_charselect_ped_pos_z"]);
|
|
||||||
//this.characterSelectPedHeading = toFloat(dbAssoc["svr_charselect_ped_rot_z"]);
|
|
||||||
//this.characterSelectInterior = toInteger(dbAssoc["svr_charselect_int"]);
|
|
||||||
//this.characterSelectDimension = toInteger(dbAssoc["svr_charselect_int"]);
|
|
||||||
|
|
||||||
this.hour = toInteger(dbAssoc["svr_start_time_hour"]);
|
this.hour = toInteger(dbAssoc["svr_start_time_hour"]);
|
||||||
this.minute = toInteger(dbAssoc["svr_start_time_min"]);
|
this.minute = toInteger(dbAssoc["svr_start_time_min"]);
|
||||||
this.minuteDuration = toInteger(dbAssoc["svr_time_min_duration"]);
|
this.minuteDuration = toInteger(dbAssoc["svr_time_min_duration"]);
|
||||||
this.weather = toInteger(dbAssoc["svr_start_weather"]);
|
this.weather = toInteger(dbAssoc["svr_start_weather"]);
|
||||||
this.fallingSnow = intToBool(dbAssoc["svr_start_snow_falling"]);
|
this.fallingSnow = hasBitFlag(this.settings, getServerSettingsFlagValue("FallingSnow"));
|
||||||
this.groundSnow = intToBool(dbAssoc["svr_start_snow_ground"]);
|
this.groundSnow = hasBitFlag(this.settings, getServerSettingsFlagValue("GroundSnow"));
|
||||||
this.useGUI = intToBool(dbAssoc["svr_gui"]);
|
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.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.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.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.guiTextColourSecondary = [toInteger(dbAssoc["svr_gui_textcol2_r"]), toInteger(dbAssoc["svr_gui_textcol2_g"]), toInteger(dbAssoc["svr_gui_textcol2_b"])];
|
||||||
this.showLogo = intToBool(dbAssoc["svr_logo"]);
|
this.showLogo = hasBitFlag(this.settings, getServerSettingsFlagValue("Logo"));
|
||||||
this.inflationMultiplier = toFloat(dbAssoc["svr_inflation_multiplier"]);
|
this.inflationMultiplier = toFloat(dbAssoc["svr_inflation_multiplier"]);
|
||||||
|
this.testerOnly = hasBitFlag(this.settings, getServerSettingsFlagValue("Testing"));
|
||||||
|
|
||||||
this.antiCheat = {
|
this.antiCheat = {
|
||||||
enabled: intToBool(dbAssoc["svr_ac_enabled"]),
|
enabled: hasBitFlag(this.settings, getServerSettingsFlagValue("Anticheat")),
|
||||||
checkGameScripts: intToBool(dbAssoc["svr_ac_check_scripts"]),
|
checkGameScripts: hasBitFlag(this.settings, getServerSettingsFlagValue("CheckGameScripts")),
|
||||||
gameScriptBlackListEnabled: intToBool(dbAssoc["svr_ac_script_bl"]),
|
gameScriptBlackListEnabled: hasBitFlag(this.settings, getServerSettingsFlagValue("GameScriptBlackList")),
|
||||||
gameScriptWhiteListEnabled: intToBool(dbAssoc["svr_ac_script_wl"]),
|
gameScriptWhiteListEnabled: hasBitFlag(this.settings, getServerSettingsFlagValue("GameScriptWhiteList")),
|
||||||
gameScriptWhiteList: [],
|
gameScriptWhiteList: [],
|
||||||
gameScriptBlackList: [],
|
gameScriptBlackList: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
this.discordBotToken = intToBool(dbAssoc["svr_discord_bot_token"]);
|
this.discordBotToken = intToBool(dbAssoc["svr_discord_bot_token"]);
|
||||||
this.discordEnabled = intToBool(dbAssoc["svr_discord_bot_enabled"]);
|
this.discordEnabled = hasBitFlag(this.settings, getServerSettingsFlagValue("DiscordBot"));
|
||||||
|
|
||||||
this.createJobPickups = intToBool(dbAssoc["svr_job_pickups"]);
|
this.createJobPickups = hasBitFlag(this.settings, getServerSettingsFlagValue("JobPickups"));
|
||||||
this.createBusinessPickups = intToBool(dbAssoc["svr_biz_pickups"]);
|
this.createBusinessPickups = hasBitFlag(this.settings, getServerSettingsFlagValue("BusinessPickups"));
|
||||||
this.createHousePickups = intToBool(dbAssoc["svr_house_pickups"]);
|
this.createHousePickups = hasBitFlag(this.settings, getServerSettingsFlagValue("HousePickups"));
|
||||||
this.createJobBlips = intToBool(dbAssoc["svr_job_blips"]);
|
this.createJobBlips = hasBitFlag(this.settings, getServerSettingsFlagValue("JobBlips"));
|
||||||
this.createBusinessBlips = intToBool(dbAssoc["svr_biz_blips"]);
|
this.createBusinessBlips = hasBitFlag(this.settings, getServerSettingsFlagValue("BusinessBlips"));
|
||||||
this.createHouseBlips = intToBool(dbAssoc["svr_house_blips"]);
|
this.createHouseBlips = hasBitFlag(this.settings, getServerSettingsFlagValue("HouseBlips"));
|
||||||
|
|
||||||
this.introMusicURL = dbAssoc["svr_intro_music"];
|
this.introMusicURL = dbAssoc["svr_intro_music"];
|
||||||
this.useRealTime = intToBool(dbAssoc["svr_time_realtime_enabled"]);
|
this.useRealTime = hasBitFlag(this.settings, getServerSettingsFlagValue("RealTime"));
|
||||||
this.realTimeZone = dbAssoc["svr_time_realtime_timezone"];
|
this.realTimeZone = dbAssoc["svr_time_realtime_timezone"];
|
||||||
|
|
||||||
this.discordConfig = {
|
this.discordConfig = {
|
||||||
|
|||||||
@@ -410,14 +410,14 @@ function showPlayerPromptGUI(client, promptMessage, promptTitle, yesButtonText,
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showPlayerInfoGUI(client, infoMessage, infoTitle) {
|
function showPlayerInfoGUI(client, infoMessage, infoTitle, buttonText = "OK") {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending show info GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${infoTitle}, Message: ${infoMessage})`);
|
logToConsole(LOG_DEBUG, `[VRR.Client] Sending show info GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${infoTitle}, Message: ${infoMessage})`);
|
||||||
sendNetworkEventToPlayer("vrr.showInfo", client, infoMessage, infoTitle, buttonText);
|
sendNetworkEventToPlayer("vrr.showInfo", client, infoMessage, infoTitle, buttonText);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showPlayerErrorGUI(client, errorMessage, errorTitle) {
|
function showPlayerErrorGUI(client, errorMessage, errorTitle, buttonText = "OK") {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending show error GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${errorTitle}, Message: ${errorMessage})`);
|
logToConsole(LOG_DEBUG, `[VRR.Client] Sending show error GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${errorTitle}, Message: ${errorMessage})`);
|
||||||
sendNetworkEventToPlayer("vrr.showInfo", client, errorMessage, errorTitle, buttonText);
|
sendNetworkEventToPlayer("vrr.showInfo", client, errorMessage, errorTitle, buttonText);
|
||||||
}
|
}
|
||||||
@@ -522,13 +522,6 @@ function sendPlayerFrozenState(client, state) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function givePlayerWeapon(client, weaponId, ammo, active = true) {
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to give weapon (Weapon: ${weaponId}, Ammo: ${ammo})`);
|
|
||||||
sendNetworkEventToPlayer("vrr.giveWeapon", client, weaponId, ammo, active);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function clearPlayerWeapons(client) {
|
function clearPlayerWeapons(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to clear weapons`);
|
logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to clear weapons`);
|
||||||
sendNetworkEventToPlayer("vrr.clearWeapons", client);
|
sendNetworkEventToPlayer("vrr.clearWeapons", client);
|
||||||
@@ -1142,3 +1135,15 @@ function setPlayerInfiniteRun(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);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==========================================================================
|
||||||
@@ -68,12 +68,12 @@ function loadCommands() {
|
|||||||
commandData("stopanim", stopPlayerAnimationCommand, "", getStaffFlagValue("None"), true, true, "Stops your current animation"),
|
commandData("stopanim", stopPlayerAnimationCommand, "", getStaffFlagValue("None"), true, true, "Stops your current animation"),
|
||||||
],
|
],
|
||||||
antiCheat: [
|
antiCheat: [
|
||||||
commandData("addacscriptwl", addAntiCheatWhiteListedScriptCommand, "<script name>", getStaffFlagValue("Developer"), true, true),
|
commandData("addacscriptwl", addAntiCheatWhiteListedScriptCommand, "<script name>", getStaffFlagValue("ManageAntiCheat"), true, true),
|
||||||
commandData("delacscriptwl", removeAntiCheatWhiteListedScriptCommand, "<script name>", getStaffFlagValue("Developer"), true, true),
|
commandData("delacscriptwl", removeAntiCheatWhiteListedScriptCommand, "<script name>", getStaffFlagValue("ManageAntiCheat"), true, true),
|
||||||
commandData("addacscriptbl", addAntiCheatBlackListedScriptCommand, "<script name>", getStaffFlagValue("Developer"), true, true),
|
commandData("addacscriptbl", addAntiCheatBlackListedScriptCommand, "<script name>", getStaffFlagValue("ManageAntiCheat"), true, true),
|
||||||
commandData("delacscriptbl", removeAntiCheatBlackListedScriptCommand, "<script name>", getStaffFlagValue("Developer"), true, true),
|
commandData("delacscriptbl", removeAntiCheatBlackListedScriptCommand, "<script name>", getStaffFlagValue("ManageAntiCheat"), true, true),
|
||||||
commandData("setacscriptbl", toggleAntiCheatScriptBlackListCommand, "<0/1 state>", getStaffFlagValue("Developer"), true, true),
|
commandData("setacscriptbl", toggleAntiCheatScriptBlackListCommand, "<0/1 state>", getStaffFlagValue("ManageAntiCheat"), true, true),
|
||||||
commandData("setacscriptwl", toggleAntiCheatScriptWhiteListCommand, "<0/1 state>", getStaffFlagValue("Developer"), true, true),
|
commandData("setacscriptwl", toggleAntiCheatScriptWhiteListCommand, "<0/1 state>", getStaffFlagValue("ManageAntiCheat"), true, true),
|
||||||
//commandData("setac", toggleGlobalAntiCheatCommand, "<0/1 state>", getStaffFlagValue("Developer"), true, true),
|
//commandData("setac", toggleGlobalAntiCheatCommand, "<0/1 state>", getStaffFlagValue("Developer"), true, true),
|
||||||
//commandData("ac", getGlobalAntiCheatStatusCommand, "<0/1 state>", getStaffFlagValue("Developer"), true, true),
|
//commandData("ac", getGlobalAntiCheatStatusCommand, "<0/1 state>", getStaffFlagValue("Developer"), true, true),
|
||||||
],
|
],
|
||||||
@@ -183,10 +183,10 @@ function loadCommands() {
|
|||||||
commandData("cmddisable", disableCommand, "<command>", getStaffFlagValue("Developer"), true, true, "Disables a specific command"),
|
commandData("cmddisable", disableCommand, "<command>", getStaffFlagValue("Developer"), true, true, "Disables a specific command"),
|
||||||
],
|
],
|
||||||
config: [
|
config: [
|
||||||
commandData("settime", setTimeCommand, "<hour> [minute]", getStaffFlagValue("ManageServer"), true, true, "Sets the time. Hours are required, minute is optional and will default to 0"),
|
commandData("settime", setTimeCommand, "<hour> [minute]", getStaffFlagValue("ManageWorld"), true, true, "Sets the time. Hours are required, minute is optional and will default to 0"),
|
||||||
commandData("setminuteduration", setMinuteDurationCommand, "<time in ms>", getStaffFlagValue("ManageServer"), true, true, "Sets how long a minute lasts in milliseconds. 60000 is real time."),
|
commandData("setminuteduration", setMinuteDurationCommand, "<time in ms>", getStaffFlagValue("ManageWorld"), true, true, "Sets how long a minute lasts in milliseconds. 60000 is real time."),
|
||||||
commandData("setweather", setWeatherCommand, "<weather id/name>", getStaffFlagValue("ManageServer"), true, true, "Change the weather to specified type."),
|
commandData("setweather", setWeatherCommand, "<weather id/name>", getStaffFlagValue("ManageWorld"), true, true, "Change the weather to specified type."),
|
||||||
commandData("setsnow", setSnowingCommand, "<falling snow> <ground snow>", getStaffFlagValue("ManageServer"), true, true, "Toggles winter/snow"),
|
commandData("setsnow", setSnowingCommand, "<falling snow> <ground snow>", getStaffFlagValue("ManageWorld"), true, true, "Toggles winter/snow"),
|
||||||
commandData("setlogo", toggleServerLogoCommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles the corner server logo display on/off"),
|
commandData("setlogo", toggleServerLogoCommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles the corner server logo display on/off"),
|
||||||
commandData("setgui", toggleServerGUICommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles server GUI on/off"),
|
commandData("setgui", toggleServerGUICommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles server GUI on/off"),
|
||||||
commandData("setguicolours", setServerGUIColoursCommand, "<red> <green> <blue>", getStaffFlagValue("ManageServer"), true, true),
|
commandData("setguicolours", setServerGUIColoursCommand, "<red> <green> <blue>", getStaffFlagValue("ManageServer"), true, true),
|
||||||
@@ -229,7 +229,7 @@ function loadCommands() {
|
|||||||
commandData("forceresetpass", forceAccountPasswordResetCommand, "<account name>", getStaffFlagValue("Developer"), true, true),
|
commandData("forceresetpass", forceAccountPasswordResetCommand, "<account name>", getStaffFlagValue("Developer"), true, true),
|
||||||
commandData("fixblips", fixAllServerBlipsCommand, "", getStaffFlagValue("Developer"), true, true),
|
commandData("fixblips", fixAllServerBlipsCommand, "", getStaffFlagValue("Developer"), true, true),
|
||||||
commandData("fixpickups", fixAllServerPickupsCommand, "", getStaffFlagValue("Developer"), true, true),
|
commandData("fixpickups", fixAllServerPickupsCommand, "", getStaffFlagValue("Developer"), true, true),
|
||||||
commandData("resetambience", resetAllServerAmbienceElementsCommand, "", getStaffFlagValue("Developer"), true, true),
|
commandData("resetambience", resetAllServerAmbienceElementsCommand, "", getStaffFlagValue("ManageWorld"), true, true),
|
||||||
],
|
],
|
||||||
discord: [],
|
discord: [],
|
||||||
economy: [
|
economy: [
|
||||||
@@ -335,7 +335,7 @@ function loadCommands() {
|
|||||||
commandData("drag", policeDragCommand, "", getStaffFlagValue("None"), true, false),
|
commandData("drag", policeDragCommand, "", getStaffFlagValue("None"), true, false),
|
||||||
commandData("search", policeSearchCommand, "", getStaffFlagValue("None"), true, false),
|
commandData("search", policeSearchCommand, "", getStaffFlagValue("None"), true, false),
|
||||||
|
|
||||||
// Bus/Garbage
|
// Routes
|
||||||
commandData("startroute", jobStartRouteCommand, "", getStaffFlagValue("None"), true, false),
|
commandData("startroute", jobStartRouteCommand, "", getStaffFlagValue("None"), true, false),
|
||||||
commandData("stoproute", jobStopRouteCommand, "", getStaffFlagValue("None"), true, false),
|
commandData("stoproute", jobStopRouteCommand, "", getStaffFlagValue("None"), true, false),
|
||||||
|
|
||||||
@@ -381,6 +381,9 @@ function loadCommands() {
|
|||||||
],
|
],
|
||||||
locale: [
|
locale: [
|
||||||
commandData("lang", setLocaleCommand, "<language name>", getStaffFlagValue("None"), true, false, "Sets your language"),
|
commandData("lang", setLocaleCommand, "<language name>", getStaffFlagValue("None"), true, false, "Sets your language"),
|
||||||
|
commandData("language", setLocaleCommand, "<language name>", getStaffFlagValue("None"), true, false, "Sets your language"),
|
||||||
|
commandData("locale", setLocaleCommand, "<language name>", getStaffFlagValue("None"), true, false, "Sets your language"),
|
||||||
|
commandData("setlang", setLocaleCommand, "<language name>", getStaffFlagValue("None"), true, false, "Sets your language"),
|
||||||
],
|
],
|
||||||
messaging: [],
|
messaging: [],
|
||||||
misc: [
|
misc: [
|
||||||
@@ -421,14 +424,14 @@ function loadCommands() {
|
|||||||
commandData("gotojob", gotoJobLocationCommand, "<job id/name> <location id>", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to a job location by name and location ID."),
|
commandData("gotojob", gotoJobLocationCommand, "<job id/name> <location id>", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to a job location by name and location ID."),
|
||||||
commandData("gotoloc", gotoGameLocationCommand, "<location name>", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to a game location by name."),
|
commandData("gotoloc", gotoGameLocationCommand, "<location name>", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to a game location by name."),
|
||||||
commandData("gotospawn", gotoNewPlayerSpawnCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to the new player spawn location"),
|
commandData("gotospawn", gotoNewPlayerSpawnCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to the new player spawn location"),
|
||||||
commandData("fr", teleportForwardCommand, "<distance in meters>", getStaffFlagValue("BasicModeration"), true, true, "Teleports you forward a certain distance in meters."),
|
commandData("fr", teleportForwardCommand, "[distance in meters]", getStaffFlagValue("BasicModeration"), true, true, "Teleports you forward a certain distance in meters."),
|
||||||
commandData("ba", teleportBackwardCommand, "<distance in meters>", getStaffFlagValue("BasicModeration"), true, true, "Teleports you backward a certain distance in meters."),
|
commandData("ba", teleportBackwardCommand, "[distance in meters]", getStaffFlagValue("BasicModeration"), true, true, "Teleports you backward a certain distance in meters."),
|
||||||
commandData("lt", teleportLeftCommand, "<distance in meters>", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to the left a certain distance in meters."),
|
commandData("lt", teleportLeftCommand, "[distance in meters]", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to the left a certain distance in meters."),
|
||||||
commandData("rt", teleportRightCommand, "<distance in meters>", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to the right a certain distance in meters."),
|
commandData("rt", teleportRightCommand, "[distance in meters]", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to the right a certain distance in meters."),
|
||||||
commandData("up", teleportUpCommand, "<distance in meters>", getStaffFlagValue("BasicModeration"), true, true, "Teleports you upward a certain distance in meters."),
|
commandData("up", teleportUpCommand, "[distance in meters]", getStaffFlagValue("BasicModeration"), true, true, "Teleports you upward a certain distance in meters."),
|
||||||
commandData("dn", teleportDownCommand, "<distance in meters>", getStaffFlagValue("BasicModeration"), true, true, "Teleports you downward a certain distance in meters."),
|
commandData("dn", teleportDownCommand, "[distance in meters]", getStaffFlagValue("BasicModeration"), true, true, "Teleports you downward a certain distance in meters."),
|
||||||
commandData("int", playerInteriorCommand, "<interior id>", getStaffFlagValue("BasicModeration"), true, true, "Gets or sets a player's game interior."),
|
commandData("int", playerInteriorCommand, "<player name/id> [interior id]", getStaffFlagValue("BasicModeration"), true, true, "Gets or sets a player's game interior."),
|
||||||
commandData("vw", playerVirtualWorldCommand, "<virtual world id>", getStaffFlagValue("BasicModeration"), true, true, "Gets or sets a player's virtual world/dimension."),
|
commandData("vw", playerVirtualWorldCommand, "<player name/id> [virtual world id]", getStaffFlagValue("BasicModeration"), true, true, "Gets or sets a player's virtual world/dimension."),
|
||||||
commandData("addstaffflag", addStaffFlagCommand, "<player name/id> <flag name>", getStaffFlagValue("ManageAdmins"), true, true, "Gives a player a staff flag by name (this server only)."),
|
commandData("addstaffflag", addStaffFlagCommand, "<player name/id> <flag name>", getStaffFlagValue("ManageAdmins"), true, true, "Gives a player a staff flag by name (this server only)."),
|
||||||
commandData("delstaffflag", takeStaffFlagCommand, "<player name/id> <flag name>", getStaffFlagValue("ManageAdmins"), true, true, "Takes a player's staff flag by name (this server only)."),
|
commandData("delstaffflag", takeStaffFlagCommand, "<player name/id> <flag name>", getStaffFlagValue("ManageAdmins"), true, true, "Takes a player's staff flag by name (this server only)."),
|
||||||
commandData("getstaffflags", getStaffFlagsCommand, "<player name/id>", getStaffFlagValue("ManageAdmins"), true, true, "Shows a list of all staff flags a player has (this server only)."),
|
commandData("getstaffflags", getStaffFlagsCommand, "<player name/id>", getStaffFlagValue("ManageAdmins"), true, true, "Shows a list of all staff flags a player has (this server only)."),
|
||||||
|
|||||||
@@ -7,10 +7,10 @@
|
|||||||
// TYPE: Server (JavaScript)
|
// TYPE: Server (JavaScript)
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
let serverConfig = {};
|
let serverConfig = false;
|
||||||
let databaseConfig = {};
|
let databaseConfig = false;
|
||||||
let emailConfig = {};
|
let emailConfig = false;
|
||||||
let gameConfig = {};
|
let gameConfig = false;
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
@@ -75,9 +75,22 @@ let globalConfig = {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadGameConfig() {
|
function initConfigScript() {
|
||||||
return gameData;
|
logToConsole(LOG_INFO, "[VRR.Config]: Initializing config script ...");
|
||||||
};
|
logToConsole(LOG_DEBUG, "[VRR.Config]: Loading global config ...");
|
||||||
|
loadGlobalConfig();
|
||||||
|
|
||||||
|
logToConsole(LOG_DEBUG, "[VRR.Config]: Loading server config ...");
|
||||||
|
serverConfig = loadServerConfigFromGameAndPort(server.game, server.port, getMultiplayerMod());
|
||||||
|
|
||||||
|
logToConsole(LOG_DEBUG, "[VRR.Config]: Applying server config ...");
|
||||||
|
applyConfigToServer(serverConfig);
|
||||||
|
|
||||||
|
logToConsole(LOG_DEBUG, "[VRR.Config]: All config loaded and applied successfully!");
|
||||||
|
|
||||||
|
logToConsole(LOG_INFO, "[VRR.Config]: Config script initialized!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
@@ -89,19 +102,6 @@ function loadGlobalConfig() {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initConfigScript() {
|
|
||||||
logToConsole(LOG_INFO, "[VRR.Config]: Initializing config script ...");
|
|
||||||
gameConfig = loadGameConfig();
|
|
||||||
serverConfig = loadServerConfigFromGameAndPort(server.game, server.port, getMultiplayerMod());
|
|
||||||
applyConfigToServer(serverConfig);
|
|
||||||
|
|
||||||
loadGlobalConfig();
|
|
||||||
|
|
||||||
logToConsole(LOG_INFO, "[VRR.Config]: Config script initialized!");
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function loadServerConfigFromGameAndPort(gameId, port, mpMod) {
|
function loadServerConfigFromGameAndPort(gameId, port, mpMod) {
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if(dbConnection) {
|
if(dbConnection) {
|
||||||
@@ -144,10 +144,12 @@ function loadServerConfigFromId(tempServerId) {
|
|||||||
|
|
||||||
function applyConfigToServer(tempServerConfig) {
|
function applyConfigToServer(tempServerConfig) {
|
||||||
if(isTimeSupported()) {
|
if(isTimeSupported()) {
|
||||||
setGameTime(tempServerConfig.hour, tempServerConfig.minute, tempServerConfig.minuteDuration)
|
logToConsole(LOG_DEBUG, `[VRR.Config]: Setting time to to ${tempServerConfig.hour}:${tempServerConfig.minute} with minute duration of ${tempServerConfig.minuteDuration}`);
|
||||||
|
setGameTime(tempServerConfig.hour, tempServerConfig.minute, tempServerConfig.minuteDuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isWeatherSupported()) {
|
if(isWeatherSupported()) {
|
||||||
|
logToConsole(LOG_DEBUG, `[VRR.Config]: Setting weather to ${tempServerConfig.weather}`);
|
||||||
game.forceWeather(tempServerConfig.weather);
|
game.forceWeather(tempServerConfig.weather);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,13 +164,10 @@ function saveServerConfigToDatabase() {
|
|||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if(dbConnection) {
|
if(dbConnection) {
|
||||||
let data = [
|
let data = [
|
||||||
["svr_logo", boolToInt(getServerConfig().showLogo)],
|
["svr_settings", toInteger(getServerConfig().settings)],
|
||||||
["svr_gui", boolToInt(getServerConfig().useGUI)],
|
|
||||||
["svr_start_time_hour", getServerConfig().hour],
|
["svr_start_time_hour", getServerConfig().hour],
|
||||||
["svr_start_time_min", getServerConfig().minute],
|
["svr_start_time_min", getServerConfig().minute],
|
||||||
["svr_start_weather", getServerConfig().weather],
|
["svr_start_weather", getServerConfig().weather],
|
||||||
["svr_start_snow_falling", boolToInt(getServerConfig().fallingSnow)],
|
|
||||||
["svr_start_snow_ground", boolToInt(getServerConfig().groundSnow)],
|
|
||||||
["svr_newchar_pos_x", getServerConfig().newCharacter.spawnPosition.x],
|
["svr_newchar_pos_x", getServerConfig().newCharacter.spawnPosition.x],
|
||||||
["svr_newchar_pos_y", getServerConfig().newCharacter.spawnPosition.y],
|
["svr_newchar_pos_y", getServerConfig().newCharacter.spawnPosition.y],
|
||||||
["svr_newchar_pos_z", getServerConfig().newCharacter.spawnPosition.z],
|
["svr_newchar_pos_z", getServerConfig().newCharacter.spawnPosition.z],
|
||||||
@@ -200,16 +199,6 @@ function saveServerConfigToDatabase() {
|
|||||||
["svr_charselect_int", getServerConfig().characterSelectInterior],
|
["svr_charselect_int", getServerConfig().characterSelectInterior],
|
||||||
["svr_charselect_vw", getServerConfig().characterSelectDimension],
|
["svr_charselect_vw", getServerConfig().characterSelectDimension],
|
||||||
["svr_inflation_multiplier", getServerConfig().inflationMultiplier],
|
["svr_inflation_multiplier", getServerConfig().inflationMultiplier],
|
||||||
["svr_ac_enabled", boolToInt(getServerConfig().antiCheat.enabled)],
|
|
||||||
["svr_ac_check_scripts", boolToInt(getServerConfig().antiCheat.checkGameScripts)],
|
|
||||||
["svr_ac_script_wl", boolToInt(getServerConfig().antiCheat.gameScriptWhiteListEnabled)],
|
|
||||||
["svr_ac_script_bl", boolToInt(getServerConfig().antiCheat.gameScriptBlackListEnabled)],
|
|
||||||
["svr_job_pickups", boolToInt(getServerConfig().createJobPickups)],
|
|
||||||
["svr_job_blips", boolToInt(getServerConfig().createJobBlips)],
|
|
||||||
["svr_biz_pickups", boolToInt(getServerConfig().createBusinessPickups)],
|
|
||||||
["svr_biz_blips", boolToInt(getServerConfig().createBusinessBlips)],
|
|
||||||
["svr_house_pickups", boolToInt(getServerConfig().createHousePickups)],
|
|
||||||
["svr_house_blips", boolToInt(getServerConfig().createHouseBlips)],
|
|
||||||
["svr_intro_music", getServerConfig().introMusicURL],
|
["svr_intro_music", getServerConfig().introMusicURL],
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -230,27 +219,29 @@ function saveServerConfigToDatabase() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return {ServerConfigData} - Server configuration data
|
* @return {ServerData} - Server configuration data
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function getServerConfig() {
|
function getServerConfig() {
|
||||||
|
//if(serverId != getServerId()) {
|
||||||
|
// return loadServerConfigFromId(serverId);
|
||||||
|
//}
|
||||||
return serverConfig;
|
return serverConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getGameConfig() {
|
|
||||||
return gameConfig;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function getGlobalConfig() {
|
function getGlobalConfig() {
|
||||||
return globalConfig;
|
return globalConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return {number} - This server's ID
|
||||||
|
*
|
||||||
|
*/
|
||||||
function getServerId() {
|
function getServerId() {
|
||||||
return getServerConfig().databaseId;
|
return getServerConfig().databaseId;
|
||||||
}
|
}
|
||||||
@@ -356,7 +347,7 @@ function setWeatherCommand(command, params, client) {
|
|||||||
|
|
||||||
getServerConfig().needsSaved = true;
|
getServerConfig().needsSaved = true;
|
||||||
|
|
||||||
messageAdminAction(`${getPlayerName(client)} set the weather to {ALTCOLOUR}${getGameData().weatherNames[getServerGame()][toInteger(weatherId)]}`);
|
messageAdminAction(`${getPlayerName(client)} set the weather to {ALTCOLOUR}${getGameConfig().weatherNames[getServerGame()][toInteger(weatherId)]}`);
|
||||||
updateServerRules();
|
updateServerRules();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -447,7 +438,7 @@ function toggleServerLogoCommand(command, params, client) {
|
|||||||
|
|
||||||
updatePlayerShowLogoState(null, getServerConfig().useLogo);
|
updatePlayerShowLogoState(null, getServerConfig().useLogo);
|
||||||
|
|
||||||
messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned the server logo image ${getBoolRedGreenInlineColour(getServerConfig().useLogo)}${toUpperCase(getOnOffFromBool(getServerConfig().useLogo))}`);
|
messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned the server logo image ${getBoolRedGreenInlineColour(doesServerHaveServerLogoEnabled())}${toUpperCase(getOnOffFromBool(getServerConfig().useLogo))}`);
|
||||||
updateServerRules();
|
updateServerRules();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -467,7 +458,7 @@ function toggleServerLogoCommand(command, params, client) {
|
|||||||
getServerConfig().createJobBlips = !getServerConfig().createJobBlips;
|
getServerConfig().createJobBlips = !getServerConfig().createJobBlips;
|
||||||
getServerConfig().needsSaved = true;
|
getServerConfig().needsSaved = true;
|
||||||
|
|
||||||
messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned ${getBoolRedGreenInlineColour(getServerConfig().createJobBlips)}${toUpperCase(getOnOffFromBool(getServerConfig().createJobBlips))} {MAINCOLOUR}all job blips`);
|
messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned ${getBoolRedGreenInlineColour(doesServerHaveJobBlipsEnabled())}${toUpperCase(getOnOffFromBool(getServerConfig().createJobBlips))} {MAINCOLOUR}all job blips`);
|
||||||
resetAllJobBlips();
|
resetAllJobBlips();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -487,7 +478,7 @@ function toggleServerLogoCommand(command, params, client) {
|
|||||||
getServerConfig().createJobPickups = !getServerConfig().createJobPickups;
|
getServerConfig().createJobPickups = !getServerConfig().createJobPickups;
|
||||||
getServerConfig().needsSaved = true;
|
getServerConfig().needsSaved = true;
|
||||||
|
|
||||||
messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned ${getBoolRedGreenInlineColour(getServerConfig().createJobPickups)}${toUpperCase(getOnOffFromBool(getServerConfig().createJobPickups))} {MAINCOLOUR}all job pickups`);
|
messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned ${getBoolRedGreenInlineColour(doesServerHaveJobPickupsEnabled())}${toUpperCase(getOnOffFromBool(getServerConfig().createJobPickups))} {MAINCOLOUR}all job pickups`);
|
||||||
resetAllJobPickups();
|
resetAllJobPickups();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -507,7 +498,7 @@ function toggleServerLogoCommand(command, params, client) {
|
|||||||
getServerConfig().createBusinessBlips = !getServerConfig().createBusinessBlips;
|
getServerConfig().createBusinessBlips = !getServerConfig().createBusinessBlips;
|
||||||
getServerConfig().needsSaved = true;
|
getServerConfig().needsSaved = true;
|
||||||
|
|
||||||
messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned ${getBoolRedGreenInlineColour(getServerConfig().createBusinessBlips)}${toUpperCase(getOnOffFromBool(getServerConfig().createBusinessBlips))} {MAINCOLOUR}all business blips`);
|
messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned ${getBoolRedGreenInlineColour(doesServerHaveBusinessBlipsEnabled())}${toUpperCase(getOnOffFromBool(getServerConfig().createBusinessBlips))} {MAINCOLOUR}all business blips`);
|
||||||
resetAllBusinessBlips();
|
resetAllBusinessBlips();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -527,7 +518,7 @@ function toggleServerLogoCommand(command, params, client) {
|
|||||||
getServerConfig().createBusinessPickups = !getServerConfig().createBusinessPickups;
|
getServerConfig().createBusinessPickups = !getServerConfig().createBusinessPickups;
|
||||||
getServerConfig().needsSaved = true;
|
getServerConfig().needsSaved = true;
|
||||||
|
|
||||||
messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned ${getBoolRedGreenInlineColour(getServerConfig().createBusinessPickups)}${toUpperCase(getOnOffFromBool(getServerConfig().createBusinessPickups))} {MAINCOLOUR}all business pickups`);
|
messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned ${getBoolRedGreenInlineColour(doesServerHaveBusinessPickupsEnabled())}${toUpperCase(getOnOffFromBool(getServerConfig().createBusinessPickups))} {MAINCOLOUR}all business pickups`);
|
||||||
resetAllBusinessPickups();
|
resetAllBusinessPickups();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -547,7 +538,7 @@ function toggleServerLogoCommand(command, params, client) {
|
|||||||
getServerConfig().createHouseBlips = !getServerConfig().createHouseBlips;
|
getServerConfig().createHouseBlips = !getServerConfig().createHouseBlips;
|
||||||
getServerConfig().needsSaved = true;
|
getServerConfig().needsSaved = true;
|
||||||
|
|
||||||
messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned ${getBoolRedGreenInlineColour(getServerConfig().createHouseBlips)}${toUpperCase(getOnOffFromBool(getServerConfig().createHouseBlips))} {MAINCOLOUR}all house blips`);
|
messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned ${getBoolRedGreenInlineColour(doesServerHaveHouseBlipsEnabled())}${toUpperCase(getOnOffFromBool(getServerConfig().createHouseBlips))} {MAINCOLOUR}all house blips`);
|
||||||
resetAllHouseBlips();
|
resetAllHouseBlips();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -567,7 +558,7 @@ function toggleServerLogoCommand(command, params, client) {
|
|||||||
getServerConfig().createHousePickups = !getServerConfig().createHousePickups;
|
getServerConfig().createHousePickups = !getServerConfig().createHousePickups;
|
||||||
getServerConfig().needsSaved = true;
|
getServerConfig().needsSaved = true;
|
||||||
|
|
||||||
messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned ${getBoolRedGreenInlineColour(getServerConfig().createHousePickups)}${toUpperCase(getOnOffFromBool(getServerConfig().createHousePickups))} {MAINCOLOUR}all house pickups`);
|
messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned ${getBoolRedGreenInlineColour(doesServerHaveHousePickupsEnabled())}${toUpperCase(getOnOffFromBool(getServerConfig().createHousePickups))} {MAINCOLOUR}all house pickups`);
|
||||||
resetAllHousePickups();
|
resetAllHousePickups();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -584,10 +575,11 @@ function toggleServerLogoCommand(command, params, client) {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function toggleServerGUICommand(command, params, client) {
|
function toggleServerGUICommand(command, params, client) {
|
||||||
getServerConfig().useGUI = !getServerConfig().useGUI;
|
getServerConfig().useGUI = !getServerConfig().useGUI;
|
||||||
|
|
||||||
getServerConfig().needsSaved = true;
|
getServerConfig().needsSaved = true;
|
||||||
|
|
||||||
messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned GUI ${toLowerCase(getOnOffFromBool(getServerConfig().useGUI))} for this server`);
|
messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned GUI ${toLowerCase(getOnOffFromBool(doesServerHaveGUIEnabled()))} for this server`);
|
||||||
updateServerRules();
|
updateServerRules();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -604,10 +596,11 @@ function toggleServerGUICommand(command, params, client) {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function toggleServerUseRealWorldTimeCommand(command, params, client) {
|
function toggleServerUseRealWorldTimeCommand(command, params, client) {
|
||||||
getServerConfig().useRealTime = !getServerConfig().useRealTime;
|
getServerConfig().useRealTime = !getServerConfig().useRealTime;
|
||||||
|
|
||||||
getServerConfig().needsSaved = true;
|
getServerConfig().needsSaved = true;
|
||||||
|
|
||||||
messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned real-world time ${toLowerCase(getOnOffFromBool(getServerConfig().useRealTime))} for this server (GMT ${addPositiveNegativeSymbol(getServerConfig().realTimeZone)})`);
|
messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned real-world time ${getServerConfig().useRealTime} for this server (GMT ${addPositiveNegativeSymbol(getServerConfig().realTimeZone)})`);
|
||||||
updateServerGameTime();
|
updateServerGameTime();
|
||||||
updateServerRules();
|
updateServerRules();
|
||||||
return true;
|
return true;
|
||||||
@@ -738,3 +731,69 @@ function loadAccentConfig() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function doesServerHaveGUIEnabled() {
|
||||||
|
return getServerConfig().useGUI;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function doesServerHaveTesterOnlyEnabled() {
|
||||||
|
return getServerConfig().testerOnly;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function doesServerHaveRealTimeEnabled() {
|
||||||
|
return getServerConfig().useRealTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function doesServerHaveBusinessPickupsEnabled() {
|
||||||
|
return getServerConfig().createBusinessPickups
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function doesServerHaveHousePickupsEnabled() {
|
||||||
|
return getServerConfig().createHousePickups;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function doesServerHaveJobPickupsEnabled() {
|
||||||
|
return getServerConfig().createJobPickups;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function doesServerHaveBusinesBlipsEnabled() {
|
||||||
|
return getServerConfig().createBusinessBlips;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function doesServerHaveHouseBlipsEnabled() {
|
||||||
|
return getServerConfig().createHouseBlips;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function doesServerHaveJobBlipsEnabled() {
|
||||||
|
return getServerConfig().createJobBlips;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function doesServerHaveFallingSnowEnabled() {
|
||||||
|
return getServerConfig().fallingSnow;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function doesServerHaveGroundSnowEnabled() {
|
||||||
|
return getServerConfig().groundSnow;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
let scriptVersion = "1.0";
|
let scriptVersion = "1.0";
|
||||||
let serverStartTime = 0;
|
let serverStartTime = 0;
|
||||||
let logLevel = LOG_ERROR|LOG_WARN|LOG_INFO;
|
let logLevel = LOG_DEBUG;
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
|||||||
@@ -341,7 +341,7 @@ function executeClientCodeCommand(command, params, client) {
|
|||||||
let targetCode = splitParams.slice(1).join(" ");
|
let targetCode = splitParams.slice(1).join(" ");
|
||||||
|
|
||||||
if(!targetClient) {
|
if(!targetClient) {
|
||||||
messagePlayerError(client, "That player was not found!");
|
messagePlayerError(client, getLocaleString(client, "InvalidPlayer"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -359,6 +359,33 @@ function executeClientCodeCommand(command, params, client) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setPlayerTesterStatusCommand(command, params, client) {
|
||||||
|
if(areParamsEmpty(params)) {
|
||||||
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
let targetClient = getPlayerFromParams(params);
|
||||||
|
|
||||||
|
if(!targetClient) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "InvalidPlayer"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!hasBitFlag(getPlayerData(targetClient).accountData.flags.moderation, getModerationFlagValue("IsTester"))) {
|
||||||
|
getPlayerData(targetClient).accountData.flags.moderation = addBitFlag(getPlayerData(targetClient).accountData.flags.moderation, getModerationFlagValue("IsTester"));
|
||||||
|
} else {
|
||||||
|
getPlayerData(targetClient).accountData.flags.moderation = removeBitFlag(getPlayerData(targetClient).accountData.flags.moderation, getModerationFlagValue("IsTester"));
|
||||||
|
}
|
||||||
|
|
||||||
|
let enabled = hasBitFlag(getPlayerData(targetClient).accountData.flags.moderation, getModerationFlagValue("IsTester"));
|
||||||
|
|
||||||
|
messageAdminAction(`{ALTCOLOUR}${client.name} ${getBoolRedGreenInlineColour(enabled)}${toUpperCase(getEnabledDisabledFromBool(enabled))} {ALTCOLOUR}${targetClient.name}'s {MAINCOLOUR}tester status`)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
function saveAllServerDataCommand(command, params, client) {
|
function saveAllServerDataCommand(command, params, client) {
|
||||||
messageAdmins(`{clanOrange}Vortrex has forced a manual save of all data. Initiating ...`);
|
messageAdmins(`{clanOrange}Vortrex has forced a manual save of all data. Initiating ...`);
|
||||||
saveAllServerDataToDatabase();
|
saveAllServerDataToDatabase();
|
||||||
|
|||||||
@@ -408,7 +408,7 @@ function onPlayerDeath(client, position) {
|
|||||||
client.despawnPlayer();
|
client.despawnPlayer();
|
||||||
getPlayerCurrentSubAccount(client).interior = closestJail.interior;
|
getPlayerCurrentSubAccount(client).interior = closestJail.interior;
|
||||||
getPlayerCurrentSubAccount(client).dimension = closestJail.dimension;
|
getPlayerCurrentSubAccount(client).dimension = closestJail.dimension;
|
||||||
spawnPlayer(client, closestJail.position, closestJail.heading, getGameData().skins[getGame()][getPlayerCurrentSubAccount(client).skin][0]);
|
spawnPlayer(client, closestJail.position, closestJail.heading, getGameConfig().skins[getGame()][getPlayerCurrentSubAccount(client).skin][0]);
|
||||||
|
|
||||||
if(isFadeCameraSupported()) {
|
if(isFadeCameraSupported()) {
|
||||||
fadeCamera(client, true, 1.0);
|
fadeCamera(client, true, 1.0);
|
||||||
@@ -421,7 +421,7 @@ function onPlayerDeath(client, position) {
|
|||||||
client.despawnPlayer();
|
client.despawnPlayer();
|
||||||
getPlayerCurrentSubAccount(client).interior = closestHospital.interior;
|
getPlayerCurrentSubAccount(client).interior = closestHospital.interior;
|
||||||
getPlayerCurrentSubAccount(client).dimension = closestHospital.dimension;
|
getPlayerCurrentSubAccount(client).dimension = closestHospital.dimension;
|
||||||
spawnPlayer(client, closestHospital.position, closestHospital.heading, getGameData().skins[getGame()][getPlayerCurrentSubAccount(client).skin][0]);
|
spawnPlayer(client, closestHospital.position, closestHospital.heading, getGameConfig().skins[getGame()][getPlayerCurrentSubAccount(client).skin][0]);
|
||||||
|
|
||||||
if(isFadeCameraSupported()) {
|
if(isFadeCameraSupported()) {
|
||||||
fadeCamera(client, true, 1.0);
|
fadeCamera(client, true, 1.0);
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ function playerPromptAnswerYes(client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function canPlayerUseGUI(client) {
|
function canPlayerUseGUI(client) {
|
||||||
return (getServerConfig().useGUI && doesPlayerHaveGUIEnabled(client));
|
return (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -873,11 +873,13 @@ function createHouseEntrancePickup(houseId) {
|
|||||||
pickupModelId = getHouseData(houseId).entrancePickupModel;
|
pickupModelId = getHouseData(houseId).entrancePickupModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
getHouseData(houseId).entrancePickup = createGamePickup(pickupModelId, getHouseData(houseId).entrancePosition, getGameConfig().pickupTypes[getServerGame()].house);
|
if(areServerElementsSupported()) {
|
||||||
setElementOnAllDimensions(getHouseData(houseId).entrancePickup, false);
|
getHouseData(houseId).entrancePickup = createGamePickup(pickupModelId, getHouseData(houseId).entrancePosition, getGameConfig().pickupTypes[getServerGame()].house);
|
||||||
setElementDimension(getHouseData(houseId).entrancePickup, getHouseData(houseId).entranceDimension);
|
setElementOnAllDimensions(getHouseData(houseId).entrancePickup, false);
|
||||||
|
setElementDimension(getHouseData(houseId).entrancePickup, getHouseData(houseId).entranceDimension);
|
||||||
addToWorld(getHouseData(houseId).entrancePickup);
|
addToWorld(getHouseData(houseId).entrancePickup);
|
||||||
|
}
|
||||||
|
updateHousePickupLabelData(houseId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -895,14 +897,16 @@ function createHouseEntranceBlip(houseId) {
|
|||||||
blipModelId = getHouseData(houseId).entranceBlipModel;
|
blipModelId = getHouseData(houseId).entranceBlipModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
getHouseData(houseId).entranceBlip = createGameBlip(getHouseData(houseId).entrancePosition, blipModelId, 1, getColourByName("houseGreen"));
|
if(areServerElementsSupported()) {
|
||||||
setElementDimension(getHouseData(houseId).entranceBlip, getHouseData(houseId).entranceDimension);
|
getHouseData(houseId).entranceBlip = createGameBlip(getHouseData(houseId).entrancePosition, blipModelId, 1, getColourByName("houseGreen"));
|
||||||
setElementOnAllDimensions(getHouseData(houseId).entranceBlip, false);
|
setElementDimension(getHouseData(houseId).entranceBlip, getHouseData(houseId).entranceDimension);
|
||||||
//getHouseData(houseId).entranceBlip.streamInDistance = 300;
|
setElementOnAllDimensions(getHouseData(houseId).entranceBlip, false);
|
||||||
//getHouseData(houseId).entranceBlip.streamOutDistance = 350;
|
//getHouseData(houseId).entranceBlip.streamInDistance = 300;
|
||||||
setEntityData(getHouseData(houseId).entranceBlip, "vrr.owner.type", VRR_BLIP_HOUSE_ENTRANCE, false);
|
//getHouseData(houseId).entranceBlip.streamOutDistance = 350;
|
||||||
setEntityData(getHouseData(houseId).entranceBlip, "vrr.owner.id", houseId, false);
|
setEntityData(getHouseData(houseId).entranceBlip, "vrr.owner.type", VRR_BLIP_HOUSE_ENTRANCE, false);
|
||||||
addToWorld(getHouseData(houseId).entranceBlip);
|
setEntityData(getHouseData(houseId).entranceBlip, "vrr.owner.id", houseId, false);
|
||||||
|
addToWorld(getHouseData(houseId).entranceBlip);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -921,11 +925,13 @@ function createHouseExitPickup(houseId) {
|
|||||||
pickupModelId = getHouseData(houseId).exitPickupModel;
|
pickupModelId = getHouseData(houseId).exitPickupModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
getHouseData(houseId).exitPickup = createGamePickup(pickupModelId, getHouseData(houseId).exitPosition, getGameConfig().pickupTypes[getServerGame()].house);
|
if(areServerElementsSupported()) {
|
||||||
setElementDimension(getHouseData(houseId).exitPickup, getHouseData(houseId).exitDimension);
|
getHouseData(houseId).exitPickup = createGamePickup(pickupModelId, getHouseData(houseId).exitPosition, getGameConfig().pickupTypes[getServerGame()].house);
|
||||||
setElementOnAllDimensions(getHouseData(houseId).exitPickup, false);
|
setElementDimension(getHouseData(houseId).exitPickup, getHouseData(houseId).exitDimension);
|
||||||
updateHousePickupLabelData(houseId);
|
setElementOnAllDimensions(getHouseData(houseId).exitPickup, false);
|
||||||
addToWorld(getHouseData(houseId).exitPickup);
|
addToWorld(getHouseData(houseId).exitPickup);
|
||||||
|
}
|
||||||
|
updateHousePickupLabelData(houseId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -945,12 +951,14 @@ function createHouseExitBlip(houseId) {
|
|||||||
blipModelId = getHouseData(houseId).exitBlipModel;
|
blipModelId = getHouseData(houseId).exitBlipModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
getHouseData(houseId).exitBlip = createGameBlip(blipModelId, getHouseData(houseId).exitPosition, 1, getColourByName("houseGreen"));
|
if(areServerElementsSupported()) {
|
||||||
setElementDimension(getHouseData(houseId).exitBlip, getHouseData(houseId).entranceDimension);
|
getHouseData(houseId).exitBlip = createGameBlip(blipModelId, getHouseData(houseId).exitPosition, 1, getColourByName("houseGreen"));
|
||||||
setElementOnAllDimensions(getHouseData(houseId).exitBlip, false);
|
setElementDimension(getHouseData(houseId).exitBlip, getHouseData(houseId).entranceDimension);
|
||||||
setEntityData(getHouseData(houseId).exitBlip, "vrr.owner.type", VRR_BLIP_HOUSE_EXIT, false);
|
setElementOnAllDimensions(getHouseData(houseId).exitBlip, false);
|
||||||
setEntityData(getHouseData(houseId).exitBlip, "vrr.owner.id", houseId, false);
|
setEntityData(getHouseData(houseId).exitBlip, "vrr.owner.type", VRR_BLIP_HOUSE_EXIT, false);
|
||||||
addToWorld(getHouseData(houseId).exitBlip);
|
setEntityData(getHouseData(houseId).exitBlip, "vrr.owner.id", houseId, false);
|
||||||
|
addToWorld(getHouseData(houseId).exitBlip);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1403,6 +1411,10 @@ function getHouseFromParams(params) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function updateHousePickupLabelData(houseId) {
|
function updateHousePickupLabelData(houseId) {
|
||||||
|
if(!areServerElementsSupported()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
let houseData = getHouseData(houseId);
|
let houseData = getHouseData(houseId);
|
||||||
|
|
||||||
if(houseData.entrancePickup != null) {
|
if(houseData.entrancePickup != null) {
|
||||||
|
|||||||
@@ -1264,9 +1264,9 @@ function deleteItem(itemId) {
|
|||||||
ownerTypeString = "Player";
|
ownerTypeString = "Player";
|
||||||
owner = getPlayerFromCharacterId(getItemData(itemId).ownerId);
|
owner = getPlayerFromCharacterId(getItemData(itemId).ownerId);
|
||||||
if(getPlayerData(owner) != false) {
|
if(getPlayerData(owner) != false) {
|
||||||
switchPlayerActiveHotBarSlot(getPlayerData(owner), -1);
|
switchPlayerActiveHotBarSlot(owner, -1);
|
||||||
getPlayerData(owner).hotBarItems[getPlayerData(owner).hotBarItems.indexOf(itemId)] = -1;
|
getPlayerData(owner).hotBarItems[getPlayerData(owner).hotBarItems.indexOf(itemId)] = -1;
|
||||||
updatePlayerHotBar(getPlayerData(owner));
|
updatePlayerHotBar(owner);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1732,7 +1732,7 @@ function getItemValueDisplay(itemType, value) {
|
|||||||
} else if(getItemTypeData(itemType).useType == VRR_ITEM_USETYPE_WALKIETALKIE) {
|
} else if(getItemTypeData(itemType).useType == VRR_ITEM_USETYPE_WALKIETALKIE) {
|
||||||
return toString(toString(value).slice(0,-2)+"."+toString(value).slice(-1)+"MHz");
|
return toString(toString(value).slice(0,-2)+"."+toString(value).slice(-1)+"MHz");
|
||||||
} else if(getItemTypeData(itemType).useType == VRR_ITEM_USETYPE_VEHCOLOUR) {
|
} else if(getItemTypeData(itemType).useType == VRR_ITEM_USETYPE_VEHCOLOUR) {
|
||||||
return `[${getGameData().vehicleColourHex[value]}]SAMPLE[#FFFFFF]`;
|
return `[${getGameConfig().vehicleColourHex[value]}]SAMPLE[#FFFFFF]`;
|
||||||
} else {
|
} else {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -962,8 +962,8 @@ function createJob(name) {
|
|||||||
tempJobData.name = name;
|
tempJobData.name = name;
|
||||||
tempJobData.enabled = true;
|
tempJobData.enabled = true;
|
||||||
tempJobData.needsSaved = true;
|
tempJobData.needsSaved = true;
|
||||||
tempJobData.blipModel = getGameData().blipSprites[getGame()].job;
|
tempJobData.blipModel = getGameConfig().blipSprites[getGame()].job;
|
||||||
tempJobData.pickupModel = getGameData().pickupModels[getGame()].job;
|
tempJobData.pickupModel = getGameConfig().pickupModels[getGame()].job;
|
||||||
|
|
||||||
getServerData().jobs.push(tempJobData);
|
getServerData().jobs.push(tempJobData);
|
||||||
saveJobToDatabase(tempJobData);
|
saveJobToDatabase(tempJobData);
|
||||||
|
|||||||
@@ -6,3 +6,159 @@
|
|||||||
// DESC: Provides police officer job functions and usage
|
// DESC: Provides police officer job functions and usage
|
||||||
// TYPE: Job (JavaScript)
|
// TYPE: Job (JavaScript)
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function policeTazerCommand(command, params, client) {
|
||||||
|
if(!canPlayerUseJobs(client)) {
|
||||||
|
messagePlayerError(client, "You are not allowed to use jobs.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!canPlayerUsePoliceJob(client)) {
|
||||||
|
messagePlayerError(client, "You are not allowed to use the police job.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!isPlayerWorking(client)) {
|
||||||
|
messagePlayerError(client, "You are not working! Use /startwork first.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) {
|
||||||
|
messagePlayerError(client, "You don't have a police job.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function policeCuffCommand(command, params, client) {
|
||||||
|
if(!canPlayerUseJobs(client)) {
|
||||||
|
messagePlayerError(client, "You are not allowed to use jobs.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!canPlayerUsePoliceJob(client)) {
|
||||||
|
messagePlayerError(client, "You are not allowed to use the police job.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!isPlayerWorking(client)) {
|
||||||
|
messagePlayerError(client, "You are not working! Use /startwork first.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) {
|
||||||
|
messagePlayerError(client, "You don't have a police job.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function policeArrestCommand(command, params, client) {
|
||||||
|
if(!canPlayerUseJobs(client)) {
|
||||||
|
messagePlayerError(client, "You are not allowed to use jobs.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!canPlayerUsePoliceJob(client)) {
|
||||||
|
messagePlayerError(client, "You are not allowed to use the police job.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!isPlayerWorking(client)) {
|
||||||
|
messagePlayerError(client, "You are not working! Use /startwork first.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) {
|
||||||
|
messagePlayerError(client, "You don't have a police job.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function policeSearchCommand(command, params, client) {
|
||||||
|
if(!canPlayerUseJobs(client)) {
|
||||||
|
messagePlayerError(client, "You are not allowed to use jobs.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!canPlayerUsePoliceJob(client)) {
|
||||||
|
messagePlayerError(client, "You are not allowed to use the police job.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!isPlayerWorking(client)) {
|
||||||
|
messagePlayerError(client, "You are not working! Use /startwork first.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) {
|
||||||
|
messagePlayerError(client, "You don't have a police job.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function policeDragCommand(command, params, client) {
|
||||||
|
if(!canPlayerUseJobs(client)) {
|
||||||
|
messagePlayerError(client, "You are not allowed to use jobs.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!canPlayerUsePoliceJob(client)) {
|
||||||
|
messagePlayerError(client, "You are not allowed to use the police job.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!isPlayerWorking(client)) {
|
||||||
|
messagePlayerError(client, "You are not working! Use /startwork first.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) {
|
||||||
|
messagePlayerError(client, "You don't have a police job.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function policeDetainCommand(command, params, client) {
|
||||||
|
if(!canPlayerUseJobs(client)) {
|
||||||
|
messagePlayerError(client, "You are not allowed to use jobs.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!canPlayerUsePoliceJob(client)) {
|
||||||
|
messagePlayerError(client, "You are not allowed to use the police job.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!isPlayerWorking(client)) {
|
||||||
|
messagePlayerError(client, "You are not working! Use /startwork first.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) {
|
||||||
|
messagePlayerError(client, "You don't have a police job.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -163,13 +163,13 @@ function messagePlayerWhisper(client, whisperingClient, messageText) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function messagePlayerShout(client, shoutingClient, messageText) {
|
function messagePlayerMegaPhone(client, shoutingClient, messageText) {
|
||||||
messagePlayerNormal(client, `📢 ${getPlayerAccentInlineOutput(shoutingClient)}${getClientSubAccountName(shoutingClient)} (megaphone): ${messageText}!`, getColourByType("yellow"));
|
messagePlayerNormal(client, `📢 ${getPlayerAccentInlineOutput(shoutingClient)}${getClientSubAccountName(shoutingClient)} (megaphone): ${messageText}!`, getColourByType("yellow"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function messagePlayerMegaPhone(client, shoutingClient, messageText) {
|
function messagePlayerShout(client, shoutingClient, messageText) {
|
||||||
messagePlayerNormal(client, `🗣️ ${getPlayerAccentInlineOutput(shoutingClient)}${getClientSubAccountName(shoutingClient)} shouts: ${messageText}!`, getColourByType("shoutMessage"));
|
messagePlayerNormal(client, `🗣️ ${getPlayerAccentInlineOutput(shoutingClient)}${getClientSubAccountName(shoutingClient)} shouts: ${messageText}!`, getColourByType("shoutMessage"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -120,40 +120,70 @@ function enterExitPropertyCommand(command, params, client) {
|
|||||||
let isEntrance = false;
|
let isEntrance = false;
|
||||||
let isBusiness = false;
|
let isBusiness = false;
|
||||||
|
|
||||||
if(!getPlayerData(client).currentPickup) {
|
if(areServerElementsSupported()) {
|
||||||
return false;
|
if(!getPlayerData(client).currentPickup) {
|
||||||
}
|
|
||||||
|
|
||||||
let ownerType = getEntityData(getPlayerData(client).currentPickup, "vrr.owner.type");
|
|
||||||
let ownerId = getEntityData(getPlayerData(client).currentPickup, "vrr.owner.id");
|
|
||||||
|
|
||||||
switch(ownerType) {
|
|
||||||
case VRR_PICKUP_BUSINESS_ENTRANCE:
|
|
||||||
isBusiness = true;
|
|
||||||
isEntrance = true;
|
|
||||||
closestProperty = getServerData().businesses[ownerId];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case VRR_PICKUP_BUSINESS_EXIT:
|
|
||||||
isBusiness = true;
|
|
||||||
isEntrance = false;
|
|
||||||
closestProperty = getServerData().businesses[ownerId];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case VRR_PICKUP_HOUSE_ENTRANCE:
|
|
||||||
isBusiness = false;
|
|
||||||
isEntrance = true;
|
|
||||||
closestProperty = getServerData().houses[ownerId];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case VRR_PICKUP_HOUSE_EXIT:
|
|
||||||
isBusiness = false;
|
|
||||||
isEntrance = false;
|
|
||||||
closestProperty = getServerData().houses[ownerId];
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
let ownerType = getEntityData(getPlayerData(client).currentPickup, "vrr.owner.type");
|
||||||
|
let ownerId = getEntityData(getPlayerData(client).currentPickup, "vrr.owner.id");
|
||||||
|
|
||||||
|
switch(ownerType) {
|
||||||
|
case VRR_PICKUP_BUSINESS_ENTRANCE:
|
||||||
|
isBusiness = true;
|
||||||
|
isEntrance = true;
|
||||||
|
closestProperty = getServerData().businesses[ownerId];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case VRR_PICKUP_BUSINESS_EXIT:
|
||||||
|
isBusiness = true;
|
||||||
|
isEntrance = false;
|
||||||
|
closestProperty = getServerData().businesses[ownerId];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case VRR_PICKUP_HOUSE_ENTRANCE:
|
||||||
|
isBusiness = false;
|
||||||
|
isEntrance = true;
|
||||||
|
closestProperty = getServerData().houses[ownerId];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case VRR_PICKUP_HOUSE_EXIT:
|
||||||
|
isBusiness = false;
|
||||||
|
isEntrance = false;
|
||||||
|
closestProperty = getServerData().houses[ownerId];
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for(let i in getServerData().businesses) {
|
||||||
|
if(getPlayerDimension(client) == getGameConfig().mainWorldDimension[getGame()] && getPlayerInterior(client) == getGameConfig().mainWorldInterior[getGame()]) {
|
||||||
|
let businessId = getClosestBusinessEntrance(getPlayerPosition(client), getPlayerDimension(client));
|
||||||
|
isBusiness = true;
|
||||||
|
isEntrance = true;
|
||||||
|
closestProperty = getServerData().businesses[businessId];
|
||||||
|
} else {
|
||||||
|
let businessId = getClosestBusinessExit(getPlayerPosition(client), getPlayerDimension(client));
|
||||||
|
isBusiness = true;
|
||||||
|
isEntrance = false;
|
||||||
|
closestProperty = getServerData().businesses[businessId];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(let j in getServerData().houses) {
|
||||||
|
if(getPlayerDimension(client) == getGameConfig().mainWorldDimension[getGame()] && getPlayerInterior(client) == getGameConfig().mainWorldInterior[getGame()]) {
|
||||||
|
let houseId = getClosestHouseEntrance(getPlayerPosition(client), getPlayerDimension(client));
|
||||||
|
isBusiness = false;
|
||||||
|
isEntrance = true;
|
||||||
|
closestProperty = getServerData().businesses[houseId];
|
||||||
|
} else {
|
||||||
|
let houseId = getClosestHouseExit(getPlayerPosition(client), getPlayerDimension(client));
|
||||||
|
isBusiness = false;
|
||||||
|
isEntrance = false;
|
||||||
|
closestProperty = getServerData().businesses[houseId];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(closestProperty == null) {
|
if(closestProperty == null) {
|
||||||
@@ -451,7 +481,7 @@ function gpsCommand(command, params, client) {
|
|||||||
} else {
|
} else {
|
||||||
let gameLocationId = getGameLocationFromParams(params);
|
let gameLocationId = getGameLocationFromParams(params);
|
||||||
if(gameLocationId != false) {
|
if(gameLocationId != false) {
|
||||||
position = getGameData().locations[getServerGame()][gameLocationId][1]
|
position = getGameConfig().locations[getServerGame()][gameLocationId][1]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -548,8 +578,8 @@ function stuckPlayerCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setPlayerDimension(client, 1);
|
setPlayerDimension(client, 1);
|
||||||
setPlayerDimension(client, getGameData().mainWorldDimension[getGame()]);
|
setPlayerDimension(client, getGameConfig().mainWorldDimension[getGame()]);
|
||||||
setPlayerInterior(client, getGameData().mainWorldInterior[getGame()]);
|
setPlayerInterior(client, getGameConfig().mainWorldInterior[getGame()]);
|
||||||
setPlayerPosition(client, getPosAbovePos(getPlayerPosition(client), 2.0));
|
setPlayerPosition(client, getPosAbovePos(getPlayerPosition(client), 2.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -195,8 +195,12 @@ function removePlayerFromVehicle(client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setPlayerSkin(client, skinIndex) {
|
function setPlayerSkin(client, skinIndex) {
|
||||||
logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s skin to ${getGameData().skins[getGame()][skinIndex][0]} (Index: ${skinIndex}, Name: ${getGameData().skins[getGame()][skinIndex][1]})`);
|
logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s skin to ${getGameConfig().skins[getGame()][skinIndex][0]} (Index: ${skinIndex}, Name: ${getGameConfig().skins[getGame()][skinIndex][1]})`);
|
||||||
client.player.modelIndex = getGameData().skins[getGame()][skinIndex][0];
|
if(getGame() == VRR_GAME_GTA_IV) {
|
||||||
|
triggerNetworkEvent("vrr.localPlayerSkin", client, getGameConfig().skins[getGame()][skinIndex][0]);
|
||||||
|
} else {
|
||||||
|
client.player.modelIndex = getGameConfig().skins[getGame()][skinIndex][0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -413,7 +417,7 @@ function createGameObject(modelIndex, position) {
|
|||||||
if(!isGameFeatureSupported("objects")) {
|
if(!isGameFeatureSupported("objects")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return game.createObject(getGameData().objects[getGame()][modelIndex][0], position);
|
return game.createObject(getGameConfig().objects[getGame()][modelIndex][0], position);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -435,7 +439,7 @@ function destroyGameElement(element) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function isMeleeWeapon(weaponId, gameId = getServerGame()) {
|
function isMeleeWeapon(weaponId, gameId = getServerGame()) {
|
||||||
return (getGameData().meleeWeapons[gameId].indexOf(weaponId) != -1);
|
return (getGameConfig().meleeWeapons[gameId].indexOf(weaponId) != -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -523,7 +527,7 @@ function setVehicleColours(vehicle, colour1, colour2, colour3 = -1, colour4 = -1
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function createGameVehicle(modelIndex, position, heading) {
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -574,7 +578,7 @@ function setPlayerFightStyle(client, fightStyleId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
setEntityData(getPlayerElement(client), "vrr.fightStyle", [getGameData().fightStyles[getServerGame()][fightStyleId][1][0], getGameData().fightStyles[getServerGame()][fightStyleId][1][1]]);
|
setEntityData(getPlayerElement(client), "vrr.fightStyle", [getGameConfig().fightStyles[getServerGame()][fightStyleId][1][0], getGameConfig().fightStyles[getServerGame()][fightStyleId][1][1]]);
|
||||||
forcePlayerToSyncElementProperties(null, getPlayerElement(client));
|
forcePlayerToSyncElementProperties(null, getPlayerElement(client));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1010,3 +1014,10 @@ function setVehicleHealth(vehicle, health) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function givePlayerWeapon(client, weaponId, ammo, active = true) {
|
||||||
|
logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to give weapon (Weapon: ${weaponId}, Ammo: ${ammo})`);
|
||||||
|
sendNetworkEventToPlayer("vrr.giveWeapon", client, weaponId, ammo, active);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -374,19 +374,19 @@ function gotoGameLocationCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setPlayerVelocity(client, toVector3(0.0, 0.0, 0.0));
|
setPlayerVelocity(client, toVector3(0.0, 0.0, 0.0));
|
||||||
setPlayerPosition(client, getGameData().locations[getServerGame()][gameLocationId][1]);
|
setPlayerPosition(client, getGameConfig().locations[getServerGame()][gameLocationId][1]);
|
||||||
setPlayerInterior(client, 0);
|
setPlayerInterior(client, 0);
|
||||||
setPlayerDimension(client, 0);
|
setPlayerDimension(client, 0);
|
||||||
updateInteriorLightsForPlayer(client, true);
|
updateInteriorLightsForPlayer(client, true);
|
||||||
|
|
||||||
//setTimeout(function() {
|
//setTimeout(function() {
|
||||||
// setPlayerPosition(client, getGameData().locations[getServerGame()][gameLocationId][1]);
|
// setPlayerPosition(client, getGameConfig().locations[getServerGame()][gameLocationId][1]);
|
||||||
// setPlayerInterior(client, 0);
|
// setPlayerInterior(client, 0);
|
||||||
// setPlayerDimension(client, 0);
|
// setPlayerDimension(client, 0);
|
||||||
// updateInteriorLightsForPlayer(client, true);
|
// updateInteriorLightsForPlayer(client, true);
|
||||||
//}, 500);
|
//}, 500);
|
||||||
|
|
||||||
messagePlayerSuccess(client, `You teleported to game location {ALTCOLOUR}${getGameData().locations[getServerGame()][gameLocationId][0]}`);
|
messagePlayerSuccess(client, `You teleported to game location {ALTCOLOUR}${getGameConfig().locations[getServerGame()][gameLocationId][0]}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1003,20 +1003,24 @@ function forcePlayerSkinCommand(command, params, client) {
|
|||||||
let targetClient = getPlayerFromParams(splitParams[0]);
|
let targetClient = getPlayerFromParams(splitParams[0]);
|
||||||
let skinIndex = getSkinModelIndexFromParams(splitParams.slice(1).join(" "), getGame());
|
let skinIndex = getSkinModelIndexFromParams(splitParams.slice(1).join(" "), getGame());
|
||||||
|
|
||||||
|
console.warn(targetClient.name);
|
||||||
|
console.warn(splitParams.slice(1).join(" "));
|
||||||
|
console.warn(skinIndex);
|
||||||
|
|
||||||
if(!targetClient) {
|
if(!targetClient) {
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidPlayer"));
|
messagePlayerError(client, getLocaleString(client, "InvalidPlayer"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!skinIndex) {
|
if(skinIndex == false) {
|
||||||
messagePlayerError(client, "That skin is invalid!");
|
messagePlayerError(client, getLocaleString(client, "InvalidSkin"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
getPlayerCurrentSubAccount(targetClient).skin = skinIndex;
|
getPlayerCurrentSubAccount(targetClient).skin = skinIndex;
|
||||||
setPlayerSkin(targetClient, skinIndex);
|
setPlayerSkin(targetClient, skinIndex);
|
||||||
|
|
||||||
messageAdmins(`${getPlayerName(client)} {MAINCOLOUR}set ${getPlayerName(targetClient)}'s{MAINCOLOUR} skin to {ALTCOLOUR}${getGameData().skins[getGame()][skinIndex][1]}`);
|
messageAdmins(`${getPlayerName(client)} {MAINCOLOUR}set ${getPlayerName(targetClient)}'s{MAINCOLOUR} skin to {ALTCOLOUR}${getGameConfig().skins[getGame()][skinIndex][1]}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1112,7 +1116,7 @@ function forcePlayerWantedLevelCommand(command, params, client) {
|
|||||||
|
|
||||||
forcePlayerWantedLevel(targetClient, wantedLevel);
|
forcePlayerWantedLevel(targetClient, wantedLevel);
|
||||||
|
|
||||||
//messageAdmins(`${getPlayerName(client)} {MAINCOLOUR}set ${getPlayerName(targetClient)}'s {MAINCOLOUR}skin to {ALTCOLOUR}${getGameData().skins[getGame()][skinIndex][1]}`);
|
//messageAdmins(`${getPlayerName(client)} {MAINCOLOUR}set ${getPlayerName(targetClient)}'s {MAINCOLOUR}skin to {ALTCOLOUR}${getGameConfig().skins[getGame()][skinIndex][1]}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -40,11 +40,12 @@ function initServerScripts() {
|
|||||||
initLocaleScript();
|
initLocaleScript();
|
||||||
|
|
||||||
initCommandScript();
|
initCommandScript();
|
||||||
initTimers();
|
|
||||||
|
|
||||||
serverStartTime = getCurrentUnixTimestamp();
|
serverStartTime = getCurrentUnixTimestamp();
|
||||||
|
|
||||||
initAllClients();
|
initAllClients();
|
||||||
|
|
||||||
|
initTimers();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -231,13 +231,13 @@ function showCharacterSelectToClient(client) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getServerConfig().useGUI && doesPlayerHaveGUIEnabled(client)) {
|
if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
getPlayerData(client).currentSubAccount = 0;
|
getPlayerData(client).currentSubAccount = 0;
|
||||||
logToConsole(LOG_DEBUG, `[VRR.SubAccount] Setting ${getPlayerDisplayForConsole(client)}'s character to ID ${getPlayerData(client).currentSubAccount}`);
|
logToConsole(LOG_DEBUG, `[VRR.SubAccount] Setting ${getPlayerDisplayForConsole(client)}'s character to ID ${getPlayerData(client).currentSubAccount}`);
|
||||||
let tempSubAccount = getPlayerData(client).subAccounts[0];
|
let tempSubAccount = getPlayerData(client).subAccounts[0];
|
||||||
let ClanName = (tempSubAccount.clan != 0) ? getClanData(getClanIdFromDatabaseId(tempSubAccount.clan)).name : "None";
|
let ClanName = (tempSubAccount.clan != 0) ? getClanData(getClanIdFromDatabaseId(tempSubAccount.clan)).name : "None";
|
||||||
let lastPlayedText = (tempSubAccount.lastLogin != 0) ? `${msToTime(getCurrentUnixTimestamp()-tempSubAccount.lastLogin)} ago` : "Never";
|
let lastPlayedText = (tempSubAccount.lastLogin != 0) ? `${msToTime(getCurrentUnixTimestamp()-tempSubAccount.lastLogin)} ago` : "Never";
|
||||||
showPlayerCharacterSelectGUI(client, tempSubAccount.firstName, tempSubAccount.lastName, tempSubAccount.cash, ClanName, lastPlayedText, getGameData().skins[getGame()][tempSubAccount.skin][0]);
|
showPlayerCharacterSelectGUI(client, tempSubAccount.firstName, tempSubAccount.lastName, tempSubAccount.cash, ClanName, lastPlayedText, getGameConfig().skins[getGame()][tempSubAccount.skin][0]);
|
||||||
|
|
||||||
//spawnPlayer(client, getServerConfig().characterSelectPedPosition, getServerConfig().characterSelectPedHeading, getPlayerCurrentSubAccount(client).skin, getServerConfig().characterSelectInterior, getServerConfig().characterSelectDimension);
|
//spawnPlayer(client, getServerConfig().characterSelectPedPosition, getServerConfig().characterSelectPedHeading, getPlayerCurrentSubAccount(client).skin, getServerConfig().characterSelectInterior, getServerConfig().characterSelectDimension);
|
||||||
//setTimeout(function() {
|
//setTimeout(function() {
|
||||||
@@ -290,10 +290,10 @@ function checkNewCharacter(client, firstName, lastName) {
|
|||||||
|
|
||||||
let subAccountData = createSubAccount(getPlayerData(client).accountData.databaseId, firstName, lastName);
|
let subAccountData = createSubAccount(getPlayerData(client).accountData.databaseId, firstName, lastName);
|
||||||
if(!subAccountData) {
|
if(!subAccountData) {
|
||||||
if(getServerConfig().useGUI && doesPlayerHaveGUIEnabled(client)) {
|
if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
showPlayerNewCharacterFailedGUI(client, "Your character could not be created!");
|
showPlayerNewCharacterFailedGUI(client, "Your character could not be created!");
|
||||||
} else {
|
} else {
|
||||||
messagePlayerAlert(client, "Your character could not be created!");
|
messagePlayerError(client, "Your character could not be created!");
|
||||||
}
|
}
|
||||||
messagePlayerAlert(client, `${getServerName()} staff have been notified of the problem and will fix it soon.`);
|
messagePlayerAlert(client, `${getServerName()} staff have been notified of the problem and will fix it soon.`);
|
||||||
return false;
|
return false;
|
||||||
@@ -321,7 +321,7 @@ function checkPreviousCharacter(client) {
|
|||||||
|
|
||||||
let clanName = (tempSubAccount.clan != 0) ? getClanData(getClanIdFromDatabaseId(tempSubAccount.clan)).name : "None";
|
let clanName = (tempSubAccount.clan != 0) ? getClanData(getClanIdFromDatabaseId(tempSubAccount.clan)).name : "None";
|
||||||
let lastPlayedText = (tempSubAccount.lastLogin != 0) ? `${msToTime(getCurrentUnixTimestamp()-tempSubAccount.lastLogin)} ago` : "Never";
|
let lastPlayedText = (tempSubAccount.lastLogin != 0) ? `${msToTime(getCurrentUnixTimestamp()-tempSubAccount.lastLogin)} ago` : "Never";
|
||||||
showPlayerCharacterSelectGUI(client, tempSubAccount.firstName, tempSubAccount.lastName, tempSubAccount.cash, clanName, lastPlayedText, getGameData().skins[getGame()][tempSubAccount.skin][0]);
|
showPlayerCharacterSelectGUI(client, tempSubAccount.firstName, tempSubAccount.lastName, tempSubAccount.cash, clanName, lastPlayedText, getGameConfig().skins[getGame()][tempSubAccount.skin][0]);
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.SubAccount] Setting ${getPlayerDisplayForConsole(client)}'s character to ID ${getPlayerData(client).currentSubAccount}`);
|
logToConsole(LOG_DEBUG, `[VRR.SubAccount] Setting ${getPlayerDisplayForConsole(client)}'s character to ID ${getPlayerData(client).currentSubAccount}`);
|
||||||
}
|
}
|
||||||
@@ -342,7 +342,7 @@ function checkNextCharacter(client) {
|
|||||||
|
|
||||||
let clanName = (tempSubAccount.clan != 0) ? getClanData(getClanIdFromDatabaseId(tempSubAccount.clan)).name : "None";
|
let clanName = (tempSubAccount.clan != 0) ? getClanData(getClanIdFromDatabaseId(tempSubAccount.clan)).name : "None";
|
||||||
let lastPlayedText = (tempSubAccount.lastLogin != 0) ? `${msToTime(getCurrentUnixTimestamp()-tempSubAccount.lastLogin)} ago` : "Never";
|
let lastPlayedText = (tempSubAccount.lastLogin != 0) ? `${msToTime(getCurrentUnixTimestamp()-tempSubAccount.lastLogin)} ago` : "Never";
|
||||||
showPlayerCharacterSelectGUI(client, tempSubAccount.firstName, tempSubAccount.lastName, tempSubAccount.cash, clanName, lastPlayedText, getGameData().skins[getGame()][tempSubAccount.skin][0]);
|
showPlayerCharacterSelectGUI(client, tempSubAccount.firstName, tempSubAccount.lastName, tempSubAccount.cash, clanName, lastPlayedText, getGameConfig().skins[getGame()][tempSubAccount.skin][0]);
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.SubAccount] Setting ${getPlayerDisplayForConsole(client)}'s character to ID ${getPlayerData(client).currentSubAccount}`);
|
logToConsole(LOG_DEBUG, `[VRR.SubAccount] Setting ${getPlayerDisplayForConsole(client)}'s character to ID ${getPlayerData(client).currentSubAccount}`);
|
||||||
}
|
}
|
||||||
@@ -371,10 +371,12 @@ function selectCharacter(client, characterId = -1) {
|
|||||||
//setPlayerCameraLookAt(client, getPosBehindPos(spawnPosition, spawnHeading, 5), spawnPosition);
|
//setPlayerCameraLookAt(client, getPosBehindPos(spawnPosition, spawnHeading, 5), spawnPosition);
|
||||||
getPlayerData(client).pedState = VRR_PEDSTATE_SPAWNING;
|
getPlayerData(client).pedState = VRR_PEDSTATE_SPAWNING;
|
||||||
|
|
||||||
if(getGame() < VRR_GAME_MAFIA_ONE) {
|
if(getGame() < VRR_GAME_GTA_IV) {
|
||||||
spawnPlayer(client, spawnPosition, spawnHeading, getGameData().skins[getGame()][skin][0], spawnInterior, spawnDimension);
|
spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0], spawnInterior, spawnDimension);
|
||||||
} else {
|
} else if(getGame() == VRR_GAME_GTA_IV) {
|
||||||
spawnPlayer(client, getGameData().skins[getGame()][skin][0], spawnPosition, spawnHeading);
|
spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0], spawnInterior, spawnDimension);
|
||||||
|
} else if(getGame() >= VRR_GAME_MAFIA_ONE) {
|
||||||
|
spawnPlayer(client, getGameConfig().skins[getGame()][skin][0], spawnPosition, spawnHeading);
|
||||||
}
|
}
|
||||||
|
|
||||||
removePlayerKeyBind(client, getKeyIdFromParams("insert"));
|
removePlayerKeyBind(client, getKeyIdFromParams("insert"));
|
||||||
@@ -515,7 +517,7 @@ function setFightStyleCommand(command, params, client) {
|
|||||||
|
|
||||||
if(!fightStyle) {
|
if(!fightStyle) {
|
||||||
messagePlayerError(client, `That fight style doesn't exist!`);
|
messagePlayerError(client, `That fight style doesn't exist!`);
|
||||||
messagePlayerError(client, `Fight styles: ${getGameData().fightStyles[getServerGame()].map(fs => fs[0]).join(", ")}`);
|
messagePlayerError(client, `Fight styles: ${getGameConfig().fightStyles[getServerGame()].map(fs => fs[0]).join(", ")}`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -527,7 +529,7 @@ function setFightStyleCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setPlayerFightStyle(client, fightStyleId);
|
setPlayerFightStyle(client, fightStyleId);
|
||||||
messagePlayerSuccess(client, `Your fight style has been set to ${getGameData().fightStyles[getServerGame()][fightStyleId][0]}`)
|
messagePlayerSuccess(client, `Your fight style has been set to ${getGameConfig().fightStyles[getServerGame()][fightStyleId][0]}`)
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -560,13 +562,13 @@ function forceFightStyleCommand(command, params, client) {
|
|||||||
|
|
||||||
if(!fightStyleId) {
|
if(!fightStyleId) {
|
||||||
messagePlayerError(client, `That fight style doesn't exist!`);
|
messagePlayerError(client, `That fight style doesn't exist!`);
|
||||||
messagePlayerError(client, `Fight styles: ${getGameData().fightStyles[getServerGame()].map(fs => fs[0]).join(", ")}`);
|
messagePlayerError(client, `Fight styles: ${getGameConfig().fightStyles[getServerGame()].map(fs => fs[0]).join(", ")}`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
getPlayerCurrentSubAccount(client).fightStyle = fightStyleId;
|
getPlayerCurrentSubAccount(client).fightStyle = fightStyleId;
|
||||||
setPlayerFightStyle(client, fightStyleId);
|
setPlayerFightStyle(client, fightStyleId);
|
||||||
messagePlayerSuccess(client, `You set ${getCharacterFullName(targetClient)}'s fight style to ${getGameData().fightStyles[getServerGame()][fightStyleId][0]}`)
|
messagePlayerSuccess(client, `You set ${getCharacterFullName(targetClient)}'s fight style to ${getGameConfig().fightStyles[getServerGame()][fightStyleId][0]}`)
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,14 +11,6 @@ let serverTimers = {};
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function updateTimeRule() {
|
|
||||||
if(isTimeSupported()) {
|
|
||||||
server.setRule("Time", makeReadableTime(game.time.hour, game.time.minute));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function saveAllServerDataToDatabase() {
|
function saveAllServerDataToDatabase() {
|
||||||
if(getServerConfig().pauseSavingToDatabase) {
|
if(getServerConfig().pauseSavingToDatabase) {
|
||||||
return false;
|
return false;
|
||||||
@@ -188,7 +180,7 @@ function updatePings() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function checkServerGameTime() {
|
function checkServerGameTime() {
|
||||||
if(!getServerConfig().useRealTime) {
|
//if(!getServerConfig().useRealTime) {
|
||||||
if(getServerConfig().minute >= 59) {
|
if(getServerConfig().minute >= 59) {
|
||||||
getServerConfig().minute = 0;
|
getServerConfig().minute = 0;
|
||||||
if(getServerConfig().hour >= 23) {
|
if(getServerConfig().hour >= 23) {
|
||||||
@@ -199,11 +191,11 @@ function checkServerGameTime() {
|
|||||||
} else {
|
} else {
|
||||||
getServerConfig().minute = getServerConfig().minute + 1;
|
getServerConfig().minute = getServerConfig().minute + 1;
|
||||||
}
|
}
|
||||||
} else {
|
//} else {
|
||||||
let dateTime = getCurrentTimeStampWithTimeZone(getServerConfig().realTimeZone);
|
// let dateTime = getCurrentTimeStampWithTimeZone(getServerConfig().realTimeZone);
|
||||||
getServerConfig().hour = dateTime.getHours();
|
// getServerConfig().hour = dateTime.getHours();
|
||||||
getServerConfig().minute = dateTime.getMinutes();
|
// getServerConfig().minute = dateTime.getMinutes();
|
||||||
}
|
//}
|
||||||
|
|
||||||
updateTimeRule();
|
updateTimeRule();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ function getAreaName(position) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getGameAreas(gameId) {
|
function getGameAreas(gameId) {
|
||||||
return getGameData().areas[gameId];
|
return getGameConfig().areas[gameId];
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -79,30 +79,46 @@ function initAllClients() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function updateServerRules() {
|
function updateServerRules() {
|
||||||
|
logToConsole(LOG_DEBUG, `[VRR.Utilities]: Updating all server rules ...`);
|
||||||
|
|
||||||
|
logToConsole(LOG_DEBUG, `[VRR.Utilities]: Time support: ${isTimeSupported()}`);
|
||||||
if(isTimeSupported()) {
|
if(isTimeSupported()) {
|
||||||
server.setRule("Time", makeReadableTime(getServerConfig().hour, getServerConfig().minute));
|
if(getServerConfig() != false) {
|
||||||
|
let value = makeReadableTime(getServerConfig().hour, getServerConfig().minute);
|
||||||
|
logToConsole(LOG_DEBUG, `[VRR.Utilities]: Setting server rule "Time" as ${value}`);
|
||||||
|
server.setRule("Time", value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isWeatherSupported()) {
|
if(isWeatherSupported()) {
|
||||||
server.setRule("Weather", getGameData().weatherNames[getServerGame()][getServerConfig().weather]);
|
if(getServerConfig() != false) {
|
||||||
|
let value = getGameConfig().weatherNames[getServerGame()][getServerConfig().weather];
|
||||||
|
logToConsole(LOG_DEBUG, `[VRR.Utilities]: Setting server rule "Weather" as ${value}`);
|
||||||
|
server.setRule("Weather", value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isSnowSupported()) {
|
if(isSnowSupported()) {
|
||||||
server.setRule("Snowing", getYesNoFromBool(getServerConfig().fallingSnow));
|
if(getServerConfig() != false) {
|
||||||
|
let value = getYesNoFromBool(getServerConfig().fallingSnow);
|
||||||
|
logToConsole(LOG_DEBUG, `[VRR.Utilities]: Setting server rule "Snowing" as ${value}`);
|
||||||
|
server.setRule("Snowing", value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
logToConsole(LOG_DEBUG, `[VRR.Utilities]: All server rules updated successfully!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getWeatherFromParams(params) {
|
function getWeatherFromParams(params) {
|
||||||
if(isNaN(params)) {
|
if(isNaN(params)) {
|
||||||
for(let i in getGameData().weatherNames[getServerGame()]) {
|
for(let i in getGameConfig().weatherNames[getServerGame()]) {
|
||||||
if(toLowerCase(getGameData().weatherNames[getServerGame()][i]).indexOf(toLowerCase(params)) != -1) {
|
if(toLowerCase(getGameConfig().weatherNames[getServerGame()][i]).indexOf(toLowerCase(params)) != -1) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(typeof getGameData().weatherNames[getServerGame()][params] != "undefined") {
|
if(typeof getGameConfig().weatherNames[getServerGame()][params] != "undefined") {
|
||||||
return toInteger(params);
|
return toInteger(params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -114,13 +130,13 @@ function getWeatherFromParams(params) {
|
|||||||
|
|
||||||
function getFightStyleFromParams(params) {
|
function getFightStyleFromParams(params) {
|
||||||
if(isNaN(params)) {
|
if(isNaN(params)) {
|
||||||
for(let i in getGameData().fightStyles[getServerGame()]) {
|
for(let i in getGameConfig().fightStyles[getServerGame()]) {
|
||||||
if(toLowerCase(getGameData().fightStyles[getServerGame()][i][0]).indexOf(toLowerCase(params)) != -1) {
|
if(toLowerCase(getGameConfig().fightStyles[getServerGame()][i][0]).indexOf(toLowerCase(params)) != -1) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(typeof getGameData().fightStyles[getServerGame()][params] != "undefined") {
|
if(typeof getGameConfig().fightStyles[getServerGame()][params] != "undefined") {
|
||||||
return toInteger(params);
|
return toInteger(params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -132,26 +148,26 @@ function getFightStyleFromParams(params) {
|
|||||||
|
|
||||||
function getClosestHospital(position) {
|
function getClosestHospital(position) {
|
||||||
let closest = 0;
|
let closest = 0;
|
||||||
for(let i in getGameData().hospitals[getServerGame()]) {
|
for(let i in getGameConfig().hospitals[getServerGame()]) {
|
||||||
if(getDistance(getGameData().hospitals[getServerGame()][i].position, position) < getDistance(getGameData().hospitals[getServerGame()][closest].position, position)) {
|
if(getDistance(getGameConfig().hospitals[getServerGame()][i].position, position) < getDistance(getGameConfig().hospitals[getServerGame()][closest].position, position)) {
|
||||||
closest = i;
|
closest = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return getGameData().hospitals[getServerGame()][closest];
|
return getGameConfig().hospitals[getServerGame()][closest];
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getClosestPoliceStation(position) {
|
function getClosestPoliceStation(position) {
|
||||||
let closest = 0;
|
let closest = 0;
|
||||||
for(let i in getGameData().policeStations[getServerGame()]) {
|
for(let i in getGameConfig().policeStations[getServerGame()]) {
|
||||||
if(getDistance(getGameData().policeStations[getServerGame()][i].position, position) < getDistance(getGameData().policeStations[getServerGame()][closest].position, position)) {
|
if(getDistance(getGameConfig().policeStations[getServerGame()][i].position, position) < getDistance(getGameConfig().policeStations[getServerGame()][closest].position, position)) {
|
||||||
closest = i;
|
closest = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return getGameData().policeStations[getServerGame()][closest];
|
return getGameConfig().policeStations[getServerGame()][closest];
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -190,8 +206,8 @@ function getPlayerIsland(client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function isAtPayAndSpray(position) {
|
function isAtPayAndSpray(position) {
|
||||||
for(let i in getGameData().payAndSprays[getServerGame()]) {
|
for(let i in getGameConfig().payAndSprays[getServerGame()]) {
|
||||||
if(getDistance(position, getGameData().payAndSprays[getServerGame()][i]) <= getGlobalConfig().payAndSprayDistance) {
|
if(getDistance(position, getGameConfig().payAndSprays[getServerGame()][i]) <= getGlobalConfig().payAndSprayDistance) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -432,3 +448,11 @@ function kickAllClients() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function updateTimeRule() {
|
||||||
|
if(isTimeSupported()) {
|
||||||
|
server.setRule("Time", makeReadableTime(game.time.hour, game.time.minute));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -33,7 +33,7 @@ const VRR_WEAPON_DAMAGE_EVENT_MACE = 4;
|
|||||||
const VRR_GAME_GTA_III = 1;
|
const VRR_GAME_GTA_III = 1;
|
||||||
const VRR_GAME_GTA_VC = 2;
|
const VRR_GAME_GTA_VC = 2;
|
||||||
const VRR_GAME_GTA_SA = 3;
|
const VRR_GAME_GTA_SA = 3;
|
||||||
const VRR_GAME_GTA_IV = 4;
|
const VRR_GAME_GTA_IV = 5;
|
||||||
const VRR_GAME_GTA_V = 50;
|
const VRR_GAME_GTA_V = 50;
|
||||||
const VRR_GAME_MAFIA_ONE = 10;
|
const VRR_GAME_MAFIA_ONE = 10;
|
||||||
const VRR_GAME_MAFIA_TWO = 11;
|
const VRR_GAME_MAFIA_TWO = 11;
|
||||||
|
|||||||
@@ -1255,15 +1255,15 @@ let gameData = {
|
|||||||
[-1084007777,"Triad Member 3," , true],
|
[-1084007777,"Triad Member 3," , true],
|
||||||
[-164935626 ,"Triad Member 4," , true],
|
[-164935626 ,"Triad Member 4," , true],
|
||||||
[-751071255 ,"Female Maid" , true],
|
[-751071255 ,"Female Maid" , true],
|
||||||
[-109247258 ,"Female Binco Worker" , true],
|
[-109247258 ,"Female Binco Worker" , false],
|
||||||
[ 1366257926,"Female Bank Teller" , true],
|
[ 1366257926,"Female Bank Teller" , true],
|
||||||
[ 346338575 ,"Female Doctor" , true],
|
[ 346338575 ,"Female Doctor" , true],
|
||||||
[ 1350216795,"Female Gym Worker" , true],
|
[ 1350216795,"Female Gym Worker" , true],
|
||||||
[ 924926104 ,"Female Burger Shot Worker" , true],
|
[ 924926104 ,"Female Burger Shot Worker" , false],
|
||||||
[-346378101 ,"Female Cluckin Bell Worker" , true],
|
[-346378101 ,"Female Cluckin Bell Worker" , false],
|
||||||
[-2104311883,"Female Rockstar Cafe Worker" , true],
|
[-2104311883,"Female Rockstar Cafe Worker" , false],
|
||||||
[ 212900845 ,"Female TW@ Cafe Worker" , true],
|
[ 212900845 ,"Female TW@ Cafe Worker" , false],
|
||||||
[-290070895 ,"Female Well Stacked Pizza Worker", true],
|
[-290070895 ,"Female Well Stacked Pizza Worker", false],
|
||||||
[ 552542187 ,"Hooker" , true],
|
[ 552542187 ,"Hooker" , true],
|
||||||
[ 996267216 ,"Hooker 2," , true],
|
[ 996267216 ,"Hooker 2," , true],
|
||||||
[-1193778389,"Nurse" , true],
|
[-1193778389,"Nurse" , true],
|
||||||
@@ -1271,8 +1271,8 @@ let gameData = {
|
|||||||
[ 1353709999,"Stripper 2," , true],
|
[ 1353709999,"Stripper 2," , true],
|
||||||
[ 24233425 ,"Waitress" , true],
|
[ 24233425 ,"Waitress" , true],
|
||||||
[-1761003415,"Alcoholic Man" , true],
|
[-1761003415,"Alcoholic Man" , true],
|
||||||
[ 1075583233,"Armoured Truck Driver" , true],
|
[ 1075583233,"Armoured Truck Driver" , false],
|
||||||
[ 134077503 ,"Bus Driver" , true],
|
[ 134077503 ,"Bus Driver" , false],
|
||||||
[ 757349871 ,"Generic Asian Man" , true],
|
[ 757349871 ,"Generic Asian Man" , true],
|
||||||
[-1827421800,"Black Crackhead" , true],
|
[-1827421800,"Black Crackhead" , true],
|
||||||
[ 219393781 ,"Doctor (Scrubs)" , true],
|
[ 219393781 ,"Doctor (Scrubs)" , true],
|
||||||
@@ -1281,10 +1281,10 @@ let gameData = {
|
|||||||
[ 2105015949,"Cook" , true],
|
[ 2105015949,"Cook" , true],
|
||||||
[-200234085 ,"Italian Mob Enforcer" , true],
|
[-200234085 ,"Italian Mob Enforcer" , true],
|
||||||
[ 800131009 ,"Factory Worker" , true],
|
[ 800131009 ,"Factory Worker" , true],
|
||||||
[-999506922 ,"FIB Agent" , true],
|
[-999506922 ,"FIB Agent" , false],
|
||||||
[-1993909080,"Fat Delivery Driver" , true],
|
[-1993909080,"Fat Delivery Driver" , true],
|
||||||
[ 610888851 ,"Fire Chief" , true],
|
[ 610888851 ,"Fire Chief" , false],
|
||||||
[ 486302863 ,"Mercenary Soldier" , true],
|
[ 486302863 ,"Mercenary Soldier" , false],
|
||||||
[-778316080 ,"Helicopter Pilot" , false],
|
[-778316080 ,"Helicopter Pilot" , false],
|
||||||
[ 624314380 ,"Hotel Doorman" , true],
|
[ 624314380 ,"Hotel Doorman" , true],
|
||||||
[-1784833142,"Korean Cook" , true],
|
[-1784833142,"Korean Cook" , true],
|
||||||
@@ -1295,7 +1295,7 @@ let gameData = {
|
|||||||
[ 807236245 ,"Generic Man" , true],
|
[ 807236245 ,"Generic Man" , true],
|
||||||
[-284362863 ,"Postal Worker" , true],
|
[-284362863 ,"Postal Worker" , true],
|
||||||
[-1188246269,"Saxophone Player" , true],
|
[-1188246269,"Saxophone Player" , true],
|
||||||
[-1870989171,"Security Guard" , true],
|
[-1870989171,"Security Guard" , false],
|
||||||
[ 420915580 ,"Stadium Food Vendor" , true],
|
[ 420915580 ,"Stadium Food Vendor" , true],
|
||||||
[ 1878085135,"Stadium Food Cook" , true],
|
[ 1878085135,"Stadium Food Cook" , true],
|
||||||
[ 142730876 ,"Street Food Vendor" , true],
|
[ 142730876 ,"Street Food Vendor" , true],
|
||||||
@@ -1309,7 +1309,7 @@ let gameData = {
|
|||||||
[-1284047560,"Janitor" , true],
|
[-1284047560,"Janitor" , true],
|
||||||
[ 22944263 ,"Hotel Doorman 2," , true],
|
[ 22944263 ,"Hotel Doorman 2," , true],
|
||||||
[ 1178487645,"Mob Boss" , true],
|
[ 1178487645,"Mob Boss" , true],
|
||||||
[-1464712858,"Airport Worker" , true],
|
[-1464712858,"Airport Worker" , false],
|
||||||
[-2139064254,"Bartender" , true],
|
[-2139064254,"Bartender" , true],
|
||||||
[-1780698891,"Biker Bouncer" , true],
|
[-1780698891,"Biker Bouncer" , true],
|
||||||
[-409283472 ,"High End Club Bouncer" , true],
|
[-409283472 ,"High End Club Bouncer" , true],
|
||||||
@@ -1343,9 +1343,9 @@ let gameData = {
|
|||||||
[ 501136335 ,"Generic Male 1," , true],
|
[ 501136335 ,"Generic Male 1," , true],
|
||||||
[ 186619473 ,"Generic Male 2," , true],
|
[ 186619473 ,"Generic Male 2," , true],
|
||||||
[-111611196 ,"Generic Male 3," , true],
|
[-111611196 ,"Generic Male 3," , true],
|
||||||
[-1175077216,"Paramedic" , true],
|
[-1175077216,"Paramedic" , false],
|
||||||
[-1676937780,"Prisoner" , true],
|
[-1676937780,"Prisoner" , false],
|
||||||
[ 215190023 ,"Prisoner 2," , true],
|
[ 215190023 ,"Prisoner 2," , false],
|
||||||
[ 1552970117,"Roman's Taxi Service Driver" , true],
|
[ 1552970117,"Roman's Taxi Service Driver" , true],
|
||||||
[-1481923910,"Male Runner" , true],
|
[-1481923910,"Male Runner" , true],
|
||||||
[ 357919731 ,"Male Shop Assistant 1," , true],
|
[ 357919731 ,"Male Shop Assistant 1," , true],
|
||||||
@@ -1493,7 +1493,7 @@ let gameData = {
|
|||||||
[-1927496394,"Street Punk 2," , true],
|
[-1927496394,"Street Punk 2," , true],
|
||||||
[ 1374242512,"Street Punk 3," , true],
|
[ 1374242512,"Street Punk 3," , true],
|
||||||
[-1139941790,"Tough Guy" , true],
|
[-1139941790,"Tough Guy" , true],
|
||||||
[ 809067472 ,"Male Tourist" ,false]
|
[ 809067472 ,"Male Tourist" , true]
|
||||||
],
|
],
|
||||||
[], // GTA IV EFLC
|
[], // GTA IV EFLC
|
||||||
[], // Unknown
|
[], // Unknown
|
||||||
@@ -2849,7 +2849,7 @@ let gameData = {
|
|||||||
["South Bohan Police Station", [435.40, 1592.29, 17.353], 3.087, null],
|
["South Bohan Police Station", [435.40, 1592.29, 17.353], 3.087, null],
|
||||||
["Northern Gardens Police Station", [974.93, 1870.45, 23.073], -1.621, null],
|
["Northern Gardens Police Station", [974.93, 1870.45, 23.073], -1.621, null],
|
||||||
["South Slopes Police Station", [1233.25, -89.13, 28.034], 1.568, null],
|
["South Slopes Police Station", [1233.25, -89.13, 28.034], 1.568, null],
|
||||||
["Middle Part East Police Station", [50.12, 679.88, 15.316], 1.569, null],
|
["Middle Park East Police Station", [50.12, 679.88, 15.316], 1.569, null],
|
||||||
["East Holland Police Station", [85.21, 1189.82, 14.755], 3.127, null],
|
["East Holland Police Station", [85.21, 1189.82, 14.755], 3.127, null],
|
||||||
["Francis International Airport Police Station", [2170.87, 448.87, 6.085], 1.501, null],
|
["Francis International Airport Police Station", [2170.87, 448.87, 6.085], 1.501, null],
|
||||||
["Chinatown Police Station", [213.12, -211.70, 10.752], 0.200, null],
|
["Chinatown Police Station", [213.12, -211.70, 10.752], 0.200, null],
|
||||||
@@ -3488,6 +3488,24 @@ let gameData = {
|
|||||||
{
|
{
|
||||||
// GTA Underground
|
// GTA Underground
|
||||||
},
|
},
|
||||||
|
{ // GTA IV
|
||||||
|
PoliceStation: -1,
|
||||||
|
FireStation: -1,
|
||||||
|
Hospital: -1,
|
||||||
|
Ammunation: -1,
|
||||||
|
PayAndSpray: -1,
|
||||||
|
VehicleDealership: -1,
|
||||||
|
Restaurant: -1,
|
||||||
|
FastFood: -1,
|
||||||
|
Bank: -1,
|
||||||
|
FuelStation: -1,
|
||||||
|
Business: -1,
|
||||||
|
House: -1,
|
||||||
|
Clothes: -1,
|
||||||
|
Misc: -1,
|
||||||
|
Exit: -1,
|
||||||
|
Job: -1,
|
||||||
|
}
|
||||||
],
|
],
|
||||||
pickupTypes: [
|
pickupTypes: [
|
||||||
{},
|
{},
|
||||||
@@ -3517,6 +3535,17 @@ let gameData = {
|
|||||||
clothes: 1,
|
clothes: 1,
|
||||||
info: 1,
|
info: 1,
|
||||||
job: 1,
|
job: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// GTA Underground
|
||||||
|
},
|
||||||
|
{ // GTA IV
|
||||||
|
business: -1,
|
||||||
|
house: -1,
|
||||||
|
bank: -1,
|
||||||
|
clothes: -1,
|
||||||
|
info: -1,
|
||||||
|
job: -1,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
@@ -3977,7 +4006,7 @@ let gameData = {
|
|||||||
},
|
},
|
||||||
{}, // GTA UG
|
{}, // GTA UG
|
||||||
{ // GTA IV
|
{ // GTA IV
|
||||||
clothingStore: [
|
ClothingStore: [
|
||||||
["Outfit", 500, 2]
|
["Outfit", 500, 2]
|
||||||
],
|
],
|
||||||
LegalGunStore: [
|
LegalGunStore: [
|
||||||
@@ -5380,6 +5409,22 @@ let gameData = {
|
|||||||
0, // Mafia 3
|
0, // Mafia 3
|
||||||
0, // Mafia Definitive Edition
|
0, // Mafia Definitive Edition
|
||||||
],
|
],
|
||||||
|
mainWorldInterior: [
|
||||||
|
0, // Invalid
|
||||||
|
0, // GTA 3
|
||||||
|
0, // GTA VC
|
||||||
|
0, // GTA SA
|
||||||
|
0, // GTA UG
|
||||||
|
0, // GTA IV
|
||||||
|
0, // GTA IV EFLC
|
||||||
|
0, // Invalid
|
||||||
|
0, // Invalid
|
||||||
|
0, // Invalid
|
||||||
|
0, // Mafia 1
|
||||||
|
0, // Mafia 2
|
||||||
|
0, // Mafia 3
|
||||||
|
0, // Mafia Definitive Edition
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1125,6 +1125,10 @@ let serverEmoji = [
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getGameConfig() {
|
||||||
|
return gameData;
|
||||||
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function makeLargeNumberReadable(num) {
|
function makeLargeNumberReadable(num) {
|
||||||
@@ -1537,13 +1541,7 @@ function isGameFeatureSupported(featureName) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getAllowedSkins(gameId = getGame()) {
|
function getAllowedSkins(gameId = getGame()) {
|
||||||
return getGameData().skins[gameId].filter(skin => skin[2] == true);
|
return getGameConfig().skins[gameId].filter(skin => skin[2] == true);
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function getGameData() {
|
|
||||||
return gameData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1561,7 +1559,7 @@ function getAllowedSkinIndexFromSkin(skin) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getSkinIndexFromModel(model, gameId = getGame()) {
|
function getSkinIndexFromModel(model, gameId = getGame()) {
|
||||||
let skins = getGameData().skins[gameId];
|
let skins = getGameConfig().skins[gameId];
|
||||||
for(let i in skins) {
|
for(let i in skins) {
|
||||||
if(toLowerCase(skins[i][0]).indexOf(toLowerCase(model)) != -1) {
|
if(toLowerCase(skins[i][0]).indexOf(toLowerCase(model)) != -1) {
|
||||||
return i;
|
return i;
|
||||||
@@ -1574,7 +1572,7 @@ function getSkinIndexFromModel(model, gameId = getGame()) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getSkinIndexFromName(name, gameId = getGame()) {
|
function getSkinIndexFromName(name, gameId = getGame()) {
|
||||||
let skins = getGameData().skins[gameId];
|
let skins = getGameConfig().skins[gameId];
|
||||||
for(let i in skins) {
|
for(let i in skins) {
|
||||||
if(toLowerCase(skins[i][1]).indexOf(toLowerCase(name)) != -1) {
|
if(toLowerCase(skins[i][1]).indexOf(toLowerCase(name)) != -1) {
|
||||||
return i;
|
return i;
|
||||||
@@ -1587,7 +1585,7 @@ function getSkinIndexFromName(name, gameId = getGame()) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getObjectModelIndexFromModel(model, gameId = getGame()) {
|
function getObjectModelIndexFromModel(model, gameId = getGame()) {
|
||||||
let objects = getGameData().objects[gameId];
|
let objects = getGameConfig().objects[gameId];
|
||||||
for(let i in objects) {
|
for(let i in objects) {
|
||||||
if(toLowerCase(objects[i][0]).indexOf(toLowerCase(model)) != -1) {
|
if(toLowerCase(objects[i][0]).indexOf(toLowerCase(model)) != -1) {
|
||||||
return i;
|
return i;
|
||||||
@@ -1600,7 +1598,7 @@ function getObjectModelIndexFromModel(model, gameId = getGame()) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getGameName(gameId = getGame()) {
|
function getGameName(gameId = getGame()) {
|
||||||
return getGameData().gameNames[gameId];
|
return getGameConfig().gameNames[gameId];
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1623,7 +1621,7 @@ function getVehicleModelIndexFromParams(params, gameId = getGame()) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getVehicleModelIndexFromName(name, gameId = getGame()) {
|
function getVehicleModelIndexFromName(name, gameId = getGame()) {
|
||||||
let vehicles = getGameData().vehicles[gameId];
|
let vehicles = getGameConfig().vehicles[gameId];
|
||||||
for(let i in vehicles) {
|
for(let i in vehicles) {
|
||||||
if(toLowerCase(vehicles[i][1]).indexOf(toLowerCase(name)) != -1) {
|
if(toLowerCase(vehicles[i][1]).indexOf(toLowerCase(name)) != -1) {
|
||||||
return i;
|
return i;
|
||||||
@@ -1636,7 +1634,7 @@ function getVehicleModelIndexFromName(name, gameId = getGame()) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getVehicleModelIndexFromModel(model, gameId = getGame()) {
|
function getVehicleModelIndexFromModel(model, gameId = getGame()) {
|
||||||
let vehicles = getGameData().vehicles[gameId];
|
let vehicles = getGameConfig().vehicles[gameId];
|
||||||
for(let i in vehicles) {
|
for(let i in vehicles) {
|
||||||
if(isNaN(model)) {
|
if(isNaN(model)) {
|
||||||
if(toLowerCase(vehicles[i][0]).indexOf(toLowerCase(model)) != -1) {
|
if(toLowerCase(vehicles[i][0]).indexOf(toLowerCase(model)) != -1) {
|
||||||
@@ -1655,7 +1653,7 @@ function getVehicleModelIndexFromModel(model, gameId = getGame()) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getVehicleModelFromName(name, gameId = getGame()) {
|
function getVehicleModelFromName(name, gameId = getGame()) {
|
||||||
let vehicles = getGameData().vehicles[gameId];
|
let vehicles = getGameConfig().vehicles[gameId];
|
||||||
for(let i in vehicles) {
|
for(let i in vehicles) {
|
||||||
if(toLowerCase(vehicles[i][1]).indexOf(toLowerCase(name)) != -1) {
|
if(toLowerCase(vehicles[i][1]).indexOf(toLowerCase(name)) != -1) {
|
||||||
return vehicles[i][0];
|
return vehicles[i][0];
|
||||||
@@ -1668,7 +1666,7 @@ function getVehicleModelFromName(name, gameId = getGame()) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getVehicleNameFromModel(model, gameId = getGame()) {
|
function getVehicleNameFromModel(model, gameId = getGame()) {
|
||||||
let vehicles = getGameData().vehicles[gameId];
|
let vehicles = getGameConfig().vehicles[gameId];
|
||||||
for(let i in vehicles) {
|
for(let i in vehicles) {
|
||||||
if(isNaN(model)) {
|
if(isNaN(model)) {
|
||||||
if(toLowerCase(vehicles[i][0]).indexOf(toLowerCase(model)) != -1) {
|
if(toLowerCase(vehicles[i][0]).indexOf(toLowerCase(model)) != -1) {
|
||||||
@@ -1686,7 +1684,7 @@ function getVehicleNameFromModel(model, gameId = getGame()) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getSkinModelIndexFromParams(params, gameId = getServerGame()) {
|
function getSkinModelIndexFromParams(params, gameId = getGame()) {
|
||||||
let fromName = getSkinIndexFromName(params, gameId);
|
let fromName = getSkinIndexFromName(params, gameId);
|
||||||
let fromModel = getSkinIndexFromModel(params, gameId);
|
let fromModel = getSkinIndexFromModel(params, gameId);
|
||||||
|
|
||||||
@@ -1703,8 +1701,8 @@ function getSkinModelIndexFromParams(params, gameId = getServerGame()) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getSkinNameFromModel(model, gameId = getServerGame()) {
|
function getSkinNameFromModel(model, gameId = getGame()) {
|
||||||
let skins = getGameData().skins[gameId];
|
let skins = getGameConfig().skins[gameId];
|
||||||
for(let i in skins) {
|
for(let i in skins) {
|
||||||
if(toLowerCase(skins[i][0]).indexOf(toLowerCase(model)) != -1) {
|
if(toLowerCase(skins[i][0]).indexOf(toLowerCase(model)) != -1) {
|
||||||
return skins[i][1];
|
return skins[i][1];
|
||||||
@@ -1716,8 +1714,8 @@ function getSkinNameFromModel(model, gameId = getServerGame()) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getSkinModelFromName(name, gameId = getServerGame()) {
|
function getSkinModelFromName(name, gameId = getGame()) {
|
||||||
let skins = getGameData().skins[gameId];
|
let skins = getGameConfig().skins[gameId];
|
||||||
for(let i in skins) {
|
for(let i in skins) {
|
||||||
if(toLowerCase(skins[i][1]).indexOf(toLowerCase(name)) != -1) {
|
if(toLowerCase(skins[i][1]).indexOf(toLowerCase(name)) != -1) {
|
||||||
return skins[i][0];
|
return skins[i][0];
|
||||||
@@ -1727,7 +1725,7 @@ function getSkinModelFromName(name, gameId = getServerGame()) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getObjectModelIndexFromParams(params, gameId = getServerGame()) {
|
function getObjectModelIndexFromParams(params, gameId = getGame()) {
|
||||||
let fromName = getObjectModelIndexFromName(params, gameId);
|
let fromName = getObjectModelIndexFromName(params, gameId);
|
||||||
let fromModel = getObjectModelIndexFromModel(params, gameId);
|
let fromModel = getObjectModelIndexFromModel(params, gameId);
|
||||||
|
|
||||||
@@ -1744,8 +1742,8 @@ function getObjectModelIndexFromParams(params, gameId = getServerGame()) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getObjectNameFromModel(model, gameId = getServerGame()) {
|
function getObjectNameFromModel(model, gameId = getGame()) {
|
||||||
let objects = getGameData().objects[gameId];
|
let objects = getGameConfig().objects[gameId];
|
||||||
for(let i in objects) {
|
for(let i in objects) {
|
||||||
if(toLowerCase(objects[i][0]).indexOf(toLowerCase(model)) != -1) {
|
if(toLowerCase(objects[i][0]).indexOf(toLowerCase(model)) != -1) {
|
||||||
return objects[i][1];
|
return objects[i][1];
|
||||||
@@ -1757,8 +1755,8 @@ function getObjectNameFromModel(model, gameId = getServerGame()) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getObjectModelFromName(name, gameId = getServerGame()) {
|
function getObjectModelFromName(name, gameId = getGame()) {
|
||||||
let objects = getGameData().objects[gameId];
|
let objects = getGameConfig().objects[gameId];
|
||||||
for(let i in objects) {
|
for(let i in objects) {
|
||||||
if(toLowerCase(objects[i][1]).indexOf(toLowerCase(name)) != -1) {
|
if(toLowerCase(objects[i][1]).indexOf(toLowerCase(name)) != -1) {
|
||||||
return objects[i][0];
|
return objects[i][0];
|
||||||
@@ -2074,14 +2072,14 @@ async function waitUntil(condition) {
|
|||||||
|
|
||||||
function getGameLocationFromParams(params) {
|
function getGameLocationFromParams(params) {
|
||||||
if(isNaN(params)) {
|
if(isNaN(params)) {
|
||||||
let locations = getGameData().locations[getGame()];
|
let locations = getGameConfig().locations[getGame()];
|
||||||
for(let i in locations) {
|
for(let i in locations) {
|
||||||
if(toLowerCase(locations[i][0]).indexOf(toLowerCase(params)) != -1) {
|
if(toLowerCase(locations[i][0]).indexOf(toLowerCase(params)) != -1) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(typeof getGameData().locations[getGame()][params] != "undefined") {
|
if(typeof getGameConfig().locations[getGame()][params] != "undefined") {
|
||||||
return toInteger(params);
|
return toInteger(params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user