diff --git a/.gitignore b/.gitignore
index 287764c4..101fbdbd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@
*.code-workspace
config/database.json
config/email.json
+config/discord.json
diff --git a/TODO.md b/TODO.md
index d07c17b1..cc3f6aa5 100644
--- a/TODO.md
+++ b/TODO.md
@@ -1,5 +1,10 @@
-* Finish auto-translate
-* Add /autotranslate to enable/disable automatic chat translations for all languages, or specific ones by short code (RU, ES, etc)
-* Finish working on the new job route system
+* Finish auto-translator
* Add ways to acquire drugs. Pot/coke plants, meth labs, etc
-* Finish setting up the persistent NPC system
\ No newline at end of file
+* Finish setting up the persistent NPC system
+* Add yes/no prompts for some important things like
+ * (Business owner) Setting item sell price below order price. Will result in losing money.
+ * Giving house, biz, or vehicle to clan. Clan leaders can revoke permissions and you may be screwed and not able to change it!
+ * Deleting character
+* Make game messages (big message, small message) into array of types
+ * Array of message types in shared
+ * Font, text, duration, etc arrays in client, indexed by type
\ No newline at end of file
diff --git a/config/database.json b/config/database.json
deleted file mode 100644
index dd077d6d..00000000
--- a/config/database.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "host": "localhost",
- "user": "",
- "pass": "",
- "name": "",
- "port": 3306,
- "usePersistentConnection": true
-}
\ No newline at end of file
diff --git a/config/discord.json b/config/discord.json
new file mode 100644
index 00000000..6afb8078
--- /dev/null
+++ b/config/discord.json
@@ -0,0 +1,10 @@
+{
+ "sendChat": "true",
+ "sendConnectEvents": "true",
+ "sendVehicleEvents": "true",
+ "sendDeathEvents": "true",
+ "webhook": {
+ "enabled": "true",
+ "webhookBaseURL": "https://example.com/something.php?message={0}&url={1}"
+ }
+}
\ No newline at end of file
diff --git a/config/email.json b/config/email.json
deleted file mode 100644
index 224bdb3d..00000000
--- a/config/email.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "enabled": "false",
- "smtp": {
- "host":"",
- "port":"",
- "username":"",
- "password":"",
- "from":"",
- "fromName":"",
- "useTLS":"true"
- },
- "bodyContent": {
- "confirmEmail": "Welcome to {SERVERNAME}!\nPlease confirm your email by using the command /verifyemail in-game.\n\nYour verification code is: {VERIFICATIONCODE}",
- "emailConfirmed": "Your email has been confirmed on {SERVERNAME}!\nYou may now use this email to reset your password, require two-factor authentication on login, receive offline notifications, and more!",
- "twoFactorAuthentication": "Please enter the following code to continue on {SERVERNAME} for {GAMENAME}: {2FACODE}",
- "accountAuthSuccessAlert": "You or someone else has successfully logged in to your account on {SERVERNAME} for {GAMENAME}.\n\nIP Address: {IPADDRESS}\nLocation: {LOCATION}\nTimestamp: {TIMESTAMP}\n\nIf you have two-factor authentication enabled (Using /2fa in-game), your account can't be accessed unless a correct 2FA code is entered.",
- "accountAuthFailAlert": "You or someone else has failed to login to your account on {SERVERNAME} for {GAMENAME}.\nIP Address: {IPADDRESS}\nLocation: {LOCATION}\nTimestamp: {TIMESTAMP}",
- "offlineMessageAlert": "You have received a private message on {SERVERNAME} for {GAMENAME}. \nYou are receiving this notification because you enabled email message notifications when you're not connected to the server.\nFrom: {FROMNAME}\nTimestamp: {TIMESTAMP}\nMessage: {MESSAGE}",
- "confirmPasswordReset": "You (or someone else) requested to reset your password on {SERVERNAME}!\nPlease confirm this request by entering the code below into the password reset window in-game.\n\nYour verification code is: {VERIFICATIONCODE}\n\n\nIf you did not request a password reset, then there's nothing to worry about since your password can only be reset with the code above.",
- "passwordChanged": "Your password on {SERVERNAME} has been changed successfully!"
- }
-}
\ No newline at end of file
diff --git a/config/locale.json b/config/locale.json
index 3eccf479..6fd555be 100644
--- a/config/locale.json
+++ b/config/locale.json
@@ -2,9 +2,70 @@
"apiEmail": "example@example.com",
"defaultLanguage": "en",
"locales": [
- ["English", "english", "en"],
- ["Russian", "russian", "ru"],
- ["Polish", "polish", "pl"],
- ["Spanish", "spanish", "es"]
- ]
+ {
+ "englishName": "English",
+ "stringsFile": "english.json",
+ "isoCode": "en",
+ "flagImageFile": "gb.png",
+ "countries": ["gb", "us", "au", "bz", "ca", "ie", "jm", "nz", "za", "tt"],
+ "requiresUnicode": false
+ },
+ {
+ "englishName": "Russian",
+ "stringsFile": "russian.json",
+ "isoCode": "ru",
+ "flagImageFile": "ru",
+ "countries": ["ru", "ua"],
+ "requiresUnicode": false
+ },
+ {
+ "englishName": "Polish",
+ "stringsFile": "polish.json",
+ "isoCode": "pl",
+ "flagImageFile": "pl",
+ "countries": ["pl"],
+ "requiresUnicode": false
+ },
+ {
+ "englishName": "Spanish",
+ "stringsFile": "spanish.json",
+ "isoCode": "es",
+ "flagImageFile": "es",
+ "countries": ["es", "ar", "bo", "cl", "co", "cr", "do", "ec", "sv", "gt", "hn", "mx", "ni", "pa", "py", "pe", "pr", "uy", "ve"],
+ "requiresUnicode": false
+ },
+ {
+ "englishName": "Chinese",
+ "stringsFile": "chinese.json",
+ "isoCode": "zh",
+ "flagImageFile": "cn",
+ "countries": ["cn", "hk", "sg", "tw"],
+ "requiresUnicode": true
+ },
+ {
+ "englishName": "Arabic",
+ "stringsFile": "arabic.json",
+ "isoCode": "ar",
+ "flagImageFile": "sa",
+ "countries": ["dz", "bh", "eg", "iq", "jo", "kw", "lb", "ly", "ma", "om", "qa", "sa", "sy", "tn", "ae", "ye"],
+ "requiresUnicode": true
+ }
+ ],
+ "sendStringsToClient": [
+ "PropertyEnterCommandLabel",
+ "PropertyEnterKeyPressLabel",
+ "BusinessBuyItemsLabel",
+ "PropertyForSaleLabel",
+ "PropertyForRentLabel",
+ "VehicleDealershipLabel",
+ "TakeJobLabel",
+ "StartWorkLabel",
+ "JobEquipAndUniformLabel",
+ "NotYourJobLabel",
+ "Locked",
+ "Unlocked",
+ "Closed",
+ "Open",
+ "JobLabel"
+ ]
}
\ No newline at end of file
diff --git a/documentation/gtac/client/gtaiv/Commands.xml b/documentation/gtac/client/gtaiv/Commands.xml
new file mode 100644
index 00000000..ca9a127e
--- /dev/null
+++ b/documentation/gtac/client/gtaiv/Commands.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/documentation/gtac/client/gtaiv/Defines.xml b/documentation/gtac/client/gtaiv/Defines.xml
new file mode 100644
index 00000000..24c48ded
--- /dev/null
+++ b/documentation/gtac/client/gtaiv/Defines.xml
@@ -0,0 +1,3542 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/documentation/gtac/client/gtaiv/Documentation.xml b/documentation/gtac/client/gtaiv/Documentation.xml
new file mode 100644
index 00000000..0cd15ac2
--- /dev/null
+++ b/documentation/gtac/client/gtaiv/Documentation.xml
@@ -0,0 +1,3159 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/documentation/gtac/client/gtaiv/EventTypes.xml b/documentation/gtac/client/gtaiv/EventTypes.xml
new file mode 100644
index 00000000..7f447490
--- /dev/null
+++ b/documentation/gtac/client/gtaiv/EventTypes.xml
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/documentation/gtac/server/Commands.xml b/documentation/gtac/server/Commands.xml
new file mode 100644
index 00000000..9d51e79b
--- /dev/null
+++ b/documentation/gtac/server/Commands.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/documentation/gtac/server/Defines.xml b/documentation/gtac/server/Defines.xml
new file mode 100644
index 00000000..f60fdcec
--- /dev/null
+++ b/documentation/gtac/server/Defines.xml
@@ -0,0 +1,1671 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/documentation/gtac/server/Documentation.xml b/documentation/gtac/server/Documentation.xml
new file mode 100644
index 00000000..7df381ed
--- /dev/null
+++ b/documentation/gtac/server/Documentation.xml
@@ -0,0 +1,439 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/documentation/gtac/server/EventTypes.xml b/documentation/gtac/server/EventTypes.xml
new file mode 100644
index 00000000..8de2c651
--- /dev/null
+++ b/documentation/gtac/server/EventTypes.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/documentation/mafiac/client/mafia1/Commands.xml b/documentation/mafiac/client/mafia1/Commands.xml
new file mode 100644
index 00000000..e255010a
--- /dev/null
+++ b/documentation/mafiac/client/mafia1/Commands.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/documentation/mafiac/client/mafia1/Defines.xml b/documentation/mafiac/client/mafia1/Defines.xml
new file mode 100644
index 00000000..4d559fa9
--- /dev/null
+++ b/documentation/mafiac/client/mafia1/Defines.xml
@@ -0,0 +1,577 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/documentation/mafiac/client/mafia1/Documentation.xml b/documentation/mafiac/client/mafia1/Documentation.xml
new file mode 100644
index 00000000..6a1303f5
--- /dev/null
+++ b/documentation/mafiac/client/mafia1/Documentation.xml
@@ -0,0 +1,459 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/documentation/mafiac/client/mafia1/EventTypes.xml b/documentation/mafiac/client/mafia1/EventTypes.xml
new file mode 100644
index 00000000..ea29b084
--- /dev/null
+++ b/documentation/mafiac/client/mafia1/EventTypes.xml
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/documentation/mafiac/server/Commands.xml b/documentation/mafiac/server/Commands.xml
new file mode 100644
index 00000000..a1be49df
--- /dev/null
+++ b/documentation/mafiac/server/Commands.xml
@@ -0,0 +1,399 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/documentation/mafiac/server/Defines.xml b/documentation/mafiac/server/Defines.xml
new file mode 100644
index 00000000..7ae0532e
--- /dev/null
+++ b/documentation/mafiac/server/Defines.xml
@@ -0,0 +1,545 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/documentation/mafiac/server/Documentation.xml b/documentation/mafiac/server/Documentation.xml
new file mode 100644
index 00000000..32fc0abb
--- /dev/null
+++ b/documentation/mafiac/server/Documentation.xml
@@ -0,0 +1,424 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/documentation/mafiac/server/EventTypes.xml b/documentation/mafiac/server/EventTypes.xml
new file mode 100644
index 00000000..17bcf503
--- /dev/null
+++ b/documentation/mafiac/server/EventTypes.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/locale/arabic.json b/locale/arabic.json
new file mode 100644
index 00000000..ab858570
--- /dev/null
+++ b/locale/arabic.json
@@ -0,0 +1,458 @@
+{
+ "TranslationProvidedBy": "Kasir",
+ "LocaleEnglishName": "Arabic",
+
+ "LocaleNativeName": "عربى",
+ "LocaleOffer": ".الخادم متاح باللغة الإنجليزية.استخدم {1} لاستخدامه",
+ "LocaleChanged1": "لغتك الآن على {1}",
+ "LocaleChanged2": "سيعرض الخادم الآن الرسائل في {1}",
+ "LocaleChangedNote": "هذا لا يغير الرسائل من اللاعبين الآخرين",
+ "AccentsListHeader": "لهجآت",
+ "HeaderHelpMainList": "فئة الدعم",
+ "AccentNotFound": "اللكنة الحالية غير متوفرة",
+ "AccentSet": "قمت بتعيين لهجتك على {1}",
+ "InvalidAnimation": "هذه الرسوم المتحركة غير متوفرة",
+ "AnimationCommandTip": "استخدم {1} لمشاهدة قائمة الرسوم المتحركة المتاحة",
+ "InvalidAnimationDistance": "يجب المسافة تكون بين 0 و 3",
+ "AnimationStopCommandTip": "استخدم {1} لإيقاف الرسوم المتحركة",
+ "CantBanClient": "لا يمكنك حظر هذا الإعب",
+ "PlayerAccountBanned": "تم حظر حساب {1}",
+ "ClanNotFound": "لم يتم العثور على المجموعة",
+ "ClanNameTaken": "توجد مجموعة بهذا الاسم بالفعل",
+ "PlayerNotFound": "الاعب غير موجود",
+ "ClanCantRemoveRanks": "لا يمكنك إزالة رتب المجموعة",
+ "ClanCantAddRanks": "لأ يمكنك إضافة رتب",
+ "ClanRankNotFound": "رتبة غير موجودهـ",
+ "ClanCantChangeMemberTag": "ليس لديك الصلاحيات لتعديل على علامات رتب الاعضاء",
+ "ClanPlayerNotInSameClan": "الاعب غير موجود بمجموعتك",
+ "ClanCantChangeRankLevel": "ليس لديك صلاحيات لتغيير مستوى رتبة المجموعة",
+ "ClanCantChangeRankTag": "لا يمكنك تغيير علامات رتب المجموعة",
+ "NameNotRegistered": "اسمك غير مسجل! استخدم {1} لإنشاء حساب.",
+ "AutomaticLoginIPToggle": "IP تم تفعيل {1} تسجيل الدخول التلقائي عن طربق",
+ "CouldNotRegisterAccount": "حدثت مشكلة في إنشاء حسابك, يرجى التواصل بـ إلاداره.",
+ "RandomTipsToggle": "النصائح العشوائية{1}",
+ "ActionTipsToggle": "نصائح العمل{1}",
+ "AutoSpawnLastCharToggle": "النشر التلقائي كأخر حرف تم استخدامه هو {1}",
+ "AccountGUISettingToggle": "واجهة المستخدم الرسومية هي الآن {1}",
+ "On": "تشغيل",
+ "Off": "إيقاف",
+ "Yes": "موافق",
+ "No": "لا",
+ "True": "صحيح",
+ "False": "خطأ",
+ "Locked": "مغلق",
+ "Unlocked": "مفتوح",
+ "PasswordNotGoodEnough": "كلمة المرور الجديدة يجب أن تفي بالمتطلبات!",
+ "PasswordNeedsBase": " {1} يجب أن تحتوي كلمات المرور على الأقل",
+ "PasswordNeedsCapitals": "{1}من الأحرف الكبيرة",
+ "PasswordNeedsNumbers": "{1} أرقام",
+ "PasswordNeedsSymbols": "{1} حروف او رموز",
+ "PasswordsDontMatch": "كلمة المرور الجديدة وتأكيد كلمة المرور الجديدة ليسا متطابقين!!",
+ "PasswordChanged": "تم بنجاح تغيير كلمة المرور!",
+ "AutoLoggedInIP": "IP تم تسجيل دخولك تلقائيًا بواسطة!",
+ "WelcomeBack": "مرحبًا بك مرة أخرى في {1} ، {2}! من فضلك {3} للمتابعة.",
+ "WelcomeNewPlayer": "مرحبًا بك في {1} ، {2}! من فضلك {3} للعب.",
+ "InvalidPlayer": "اللاعب غير موجود!",
+ "InvalidBusiness": "لم يتم العثور على الأعمال!",
+ "InvalidHouse": "البيت غير موجود!",
+ "InvalidVehicle": "لم يتم ايجاد السيارة!",
+ "InvalidClan": "لم يتم العثور على المجموعة!",
+ "InvalidClanRank": "رتبة غير موجوده!",
+ "InvalidJob": "لم يتم العثور على الوظيفة!",
+ "InvalidItem": "العنصر غير موجود!",
+ "InvalidItemType": "نوع العنصر غير موجود!",
+ "InvalidRadioStation": "لم يتم العثور على محطة راديو!",
+ "InvalidGate": "البوابة غير موجودة!",
+ "EntersProperty": "يفتح الباب ويدخل {1}",
+ "ExitsProperty": "يفتح الباب ويخرج من {1}",
+ "EnterExitPropertyDoorLocked": "يحاول فتح الباب {1} ولكنه يفشل لأنه مغلق",
+ "PropertyNoInterior": "هذا ليس له جزء داخلي {1}، ولكن لا يزال بإمكانك استخدام الأوامر على أيقونة الباب.",
+ "NoBusinessWithItemType": "لا يوجد عمل مع هذا الخيار متاح",
+ "HeaderKeyBinds": "مفتاح الروابط",
+ "HeaderAccountHelp": "مساعدة الحساب",
+ "HeaderVehicleHelp": "تعليمات السيارة",
+ "HeaderVehicleDealershipHelp": "مساعدة بيع سيارات",
+ "HeaderJobHelp": "تعليمات الوظيفة",
+ "HeaderChatHelp": "تعليمات الدردشة",
+ "HeaderServerRules": "قوانين سيرفر",
+ "HeaderWebsiteInfo": "الموقع الرسمي",
+ "HeaderDiscordInfo": "ديسكورد",
+ "HeaderAnimationsList": "قائمة الرسوم المتحركة",
+ "HeaderPayAndSprayHelp": "الدفع ,ورشٌ المساعده",
+ "HeaderAmmunationHelp": "مساعدة الذخيرة",
+ "HeaderVehicleTuneupHelp": "مساعدة تعديل السيارة",
+ "HeaderBindableKeysHelp": "مفاتيح قابلة للربط",
+ "HeaderSkinHelp": "مساعدة الملابس / الجلد",
+ "HeaderBusinessHelp": "تعليمات الأعمال",
+ "HeaderClanHelp": "تعليمات المجموعة",
+ "HeaderPlayerVehiclesList": "مركبات المشغل ({1})",
+ "HeaderPlayerBusinessesList": "أعمال اللاعب ({1})",
+ "HeaderClansList": "قائمة المجموعة",
+ "HeaderAdminsList": "قائمة الادمن",
+ "HeaderBadgeInfo": "معلومات الشاره",
+ "HeaderAccentsList": "قائمة اللغة",
+ "HeaderPlayerInfo": "معلومات الاعب",
+ "HeaderWealthandTaxHelp": "معلومات المال",
+ "HeaderCommandInfo": "معلومات الإوامر ({1})",
+ "HeaderRadioHelp": "تعليمات راديو",
+ "HeaderRadioStationsList": "محطات الردايو",
+ "HeaderKeyBindsList": "قائمة روابط المفاتيح",
+ "RadioVolumeChanged": "{1} لقد {2} غيرت مستوى صوت البث اللاسلكى إلى٪",
+ "VolumeLevelNotNumber": "يجب أن يكون مستوى الصوت رقمًا",
+ "RadioStationLocationInvalid": "يجب أن تكون في سيارة أو منزل أو عمل أو لديك جهاز شخصي لتغيير المحطة!",
+ "ActionBusinessRadioStationChange": "تغيير محطة راديو الأعمال إلى {1} ({2})",
+ "ActionHouseRadioStationChange": "تغيير محطة راديو المنزل إلى {1} ({2})",
+ "ActionVehicleRadioStationChange": "يغير محطة راديو السيارة إلى {1} ({2})",
+ "ActionItemRadioStationChange": "يغير محطة {1} إلى {2} ({3})",
+ "RandomVehicleCommandsDisabled": "هذه مركبة مرور عشوائية ولا يمكن استخدام الأوامر لها.",
+ "HouseDoorLock": "البيت {1} {2}!",
+ "BusinessDoorLock": "الأعمال {1} {2}!",
+ "ServerGameModeRestarting": "يتم إعادة تشغيل وضع لعبة الخادم!",
+ "HeaderSelfItemList": "المخزون الخاص بك",
+ "HeaderPlayerItemList": "مخزون الاعب ({1})",
+ "HeaderHouseItemList": "بيت الاعب",
+ "HeaderBusinessFloorItemList": "جرد الأعمال (للبيع)",
+ "HeaderBusinessStorageItemList": "جرد الأعمال (التخزين)",
+ "HeaderItemItemList": "مخزون {1}",
+ "ItemSlotNotNumber": "يجب أن تكون خانة العنصر رقمًا",
+ "ItemSlotMustBeBetween": "The item slot must be between {1} and {2}!",
+ "UseItemBugged": "العنصر الذي تحاول استخدامه به التنصت. تم إرسال تقرير خطأ إلى مطوري الخادم.",
+ "PickupItemBugged": "العنصر الذي تحاول استلامه به التنصت. تم إرسال تقرير خطأ إلى مطوري الخادم.",
+ "DropItemBugged": "تم التنصت على العنصر الذي تحاول إسقاطه. تم إرسال تقرير خطأ إلى مطوري الخادم.",
+ "HandsBusy": "يديك مشغولتان",
+ "CantUseItemInSkinChange": "لا يمكنك استخدام عنصر أثناء تخصيص مظهرك",
+ "CantDropItemInSkinChange": "لا يمكنك إسقاط عنصر أثناء تخصيص مظهرك",
+ "CantPickupItemInSkinChange": "لا يمكنك التقاط عنصر أثناء تخصيص مظهرك",
+ "CantSwitchItemInSkinChange": "لا يمكنك تبديل عنصر أثناء تخصيص مظهرك",
+ "CantGiveItemInSkinChange": "لا يمكنك إعطاء عنصر أثناء تخصيص مظهرك",
+ "CantTakeItemInSkinChange": "لا يمكنك أن تأخذ عنصرًا أثناء تخصيص مظهرك",
+ "ItemUnequippableNoAmmo": "لا تحتوي الفتحة {1} الموجودة في الفتحة {2} على ذخيرة ، ولا يمكن تجهيزها!",
+ "NoSpaceSelfInventory": "ليس لديك أي مساحة إضافية في مخزونك",
+ "Business": "الاعمال",
+ "House": "البيت",
+ "Clan": "المجموعة",
+ "Vehicle": "السيارة",
+ "Item": "الاغراض",
+ "ItemType": "نوع العنصر",
+ "Gate": "بوابة",
+ "Door": "باب",
+ "ClanRank": "رتبة المجموعة",
+ "JobRank": "رتبة الوظيفة",
+ "RadioStation": "المحطة الإذاعية",
+ "Months": [
+ "يناير",
+ "فبراير",
+ "مارس",
+ "أبريل",
+ "مايو",
+ "يونيو",
+ "يوليو",
+ "أغسطس",
+ "سبتمبر",
+ "أكتوبر",
+ "نوفمبر",
+ "ديسمبر"
+ ],
+ "WeekDays": [
+ "الأحد",
+ "الإثنين",
+ "الثلاثاء",
+ "الاربعاء",
+ "الخميس",
+ "الجمعه",
+ "السبت"
+ ],
+ "CardinalDirections": [
+ "شمال",
+ "الشمال الشرقي",
+ "شرق",
+ "الجنوب الشرقي",
+ "جنوب",
+ "جنوب غرب",
+ "غرب",
+ "الشمال الغربي"
+ ],
+ "NewPlayerReadyToPlay": [
+ "لقد حصلت على بعض من المال. استخدم {1} للبحث عن أماكن لشراء العناصر.",
+ "إذا كنت بحاجة إلى المال،الوظائف هي النقاط الصفراء على الخريطة.",
+ "للحصول على سيارة ، قم بزيارة وكالة السيارات. يمكنك أيضًا استخدام سيارة مستأجرة بالقرب من السباون أو ركوب القطار",
+ "تأكد من قراءة {1} واستخدم {2} للحصول على معلومات."
+ ],
+ "YourCurrentVehicleDeleted": "تم حذف السيارة التي كنت بداخلها.",
+ "Distance": "مسافة",
+ "Meters": "أمتار",
+ "Feet": "قدم",
+ "Kilometers": "كيلومترات",
+ "Miles": "اميال",
+ "MustBeVehicleDriver": "يجب أن تكون سائق السيارة!",
+ "PlayerJoinedServer": "انضم إلى اللعبة من {1}!",
+ "PlayerLeftServer": "غادر {1} اللعبة! ({1})",
+ "DisconnectReasons": [
+ "انقطع الإتصال",
+ "انقطع الاتصال",
+ "عميل غير مدعوم",
+ "تحذير للعبة",
+ "كلمة سر غير صحيحه",
+ "قابل للتنفيذ غير معتمد",
+ "انقطع الاتصال",
+ "حظر",
+ "فشل",
+ "اسم غير صالح",
+ "خطأ"
+ ],
+ "TakeItemFromHouse": "يأخذ {1} من المنزل",
+ "TakeItemFromBusinessStorage": "يأخذ {1} من تخزين الشركة",
+ "TakeItemFromBusiness": "يأخذ {1} من الأعمال",
+ "TakeItemFromItem": "يأخذ {1} من {2}",
+ "TakeItemFromVehicleTrunk": "يأخذ {1} من صندوق السيارة",
+ "TakeItemFromVehicleDash": "يأخذ {1} من صندوق القفازات",
+ "JobEquipmentInventoryKeyBindTip": "معدات العمل في مخزونك. اضغط على {1} لمشاهدتها.",
+ "JobEquipmentInventoryCommandTip": "معدات العمل في مخزونك. استخدم {1} لمشاهدتها.",
+ "AccountHelp": [
+ "لا تشارك كلمة مرورك مع أي شخص آخر. لن يطالبك فريق عمل {1} بكلمة المرور مطلقًا",
+ "استخدم {1} لتغيير كلمة المرور الخاصة بك ، و {2} إذا نسيتها",
+ "بعض الإعدادات التي يمكنك استخدامها: {1}"
+ ],
+ "VehicleHelp": [
+ "ستوفر مركباتك الشخصية أينما تتركها أنت أو أي شخص آخر!",
+ "قم بزيارة المعرض لشراء مركبات جديدة (استخدم {1} لمزيد من المعلومات)",
+ "Some commands: {1}",
+ "قم بزيارة مرآب ميكانيكي لإصلاح وتلوين وضبط سيارتك! {1} للحصول على معلومات"
+ ],
+ "VehicleDealershipHelp": [
+ "قم بزيارة تاجر سيارات لشراء مركبات جديدة. استخدم {1} للعثور على واحد.",
+ "عند التاجر ، أدخل السيارة التي تريد شراءها ، وسيظهر لك السعر",
+ "إذا كنت ترغب في شراء السيارة ، فاستخدم {1} وستحصل على مفاتيح لاختبار قيادتها حول ساحة الانتظار.",
+ "ابتعد عن الوكالة مع السيارة الجديدة لتأكيد الشراء."
+ ],
+ "JobHelp": [
+ "قم بزيارة مواقع العمل للحصول على وظيفة وكسب المال. ابحث عن علامات الصفراء على الخريطة",
+ "في موقع العمل ، استخدم {1} للحصول على الوظيفة. استخدم {2} لإنهاء عملك",
+ "استخدم {1} لبدء العمل. يمكنك أيضًا الحصول على وظيفة {2} و {3}",
+ "يتم تأمين معظم مركبات العمل. استخدم {1} بالقرب من واحد للدخول إليه.",
+ "عند دخول مركبة عمل ، ستظهر لك معلومات حول كيفية القيام بالمهمة."
+ ],
+ "ChatHelp": [
+ "(IC)والشخصية(OOC)هناك نوعان رئيسيان من الدردشة: خارج الطابع الشخصي",
+ "الخلط بين هذين النوعين ليس لعب الأدوار المناسب. راجع {1} للحصول على معلومات.",
+ "بعض أوامر الدردشة: {1}",
+ "يتوفر لبعضها أسماء أقصر ({1} للتحدث ، {2} للصراخ ، إلخ)"
+ ],
+ "ServerRulesHelp": [
+ ".غير مسموح بها.انت لست سوبر مان(powergaming)الإجراءات غير الواقعية",
+ "لا يسمح بأدوار إرهابية",
+ "اتبع دائمًا التعليمات التي قدمها المشرفون والاداره",
+ "لا تخلط الدردشات (metagaming). لا يمكنك استخدام المعلومات في IC التي تم استلامها OOC",
+ "حافظ على اللغة الإنجليزية في الدردشات الرئيسية. إذا لم تكن جيدًا في اللغة الإنجليزية ، فاستخدم {1}"
+ ],
+ "AnimationHelp": [
+ "تتيح لك الرسوم المتحركة تحسين لعب الأدوار من خلال الإجراءات المرئية",
+ "استخدم {1} أو {2} مع اسم لاستخدام الرسم المتحرك.",
+ "لمشاهدة قائمة الرسوم المتحركة ، استخدم {1}"
+ ],
+ "WeaponHelp": [
+ "قم بزيارة متجر أسلحة لشراء أسلحة. استخدم {1} للعثور على واحد.",
+ "شراء سلاح يتطلب رخصة سلاح.",
+ "يتم إدارة تراخيص الأسلحة من قبل قسم الشرطة. قدم طلبًا للحصول على واحدة ",
+ "يمكن أيضًا شراء الأسلحة بشكل غير قانوني من بعض الشركات وتجار الأسلحة والعصابات."
+ ],
+ "SkinHelp": [
+ "في متجر الملابس ، استخدم {1} لشراء الملابس",
+ "عندما يكون لديك عنصر من الملابس ، قم بتجهيزه واستخدامه مثل أي عنصر آخر لإظهار اختيار الجلد (حدد {1} لمعرفة كيفية استخدام العناصر)",
+ "Some skins are restricted to jobs, clans, or for other reasons."
+ ],
+ "KeyBindHelp": [
+ "يمكنك تعيين روابط المفاتيح الخاصة بك. استخدم {1} لرؤية المفاتيح التي تم ربطها.",
+ "استخدم {1} لإضافة رابط مفتاح جديد و {2} لإزالة واحد.",
+ "المفاتيح الافتراضية هي: {1} لمحرك السيارة و {2} للأضواء و {3} للقفل / فتح القفل",
+ "اضغط على {1} لمشاهدة عناصرك و {2} لتجهيز عنصر أو {3} لإلغاء تجهيز الكل.",
+ "اضغط على {1} لاستخدام العنصر الذي تمسكه ، أو اضغط على {2} لإسقاطه ، أو اضغط على {3} لالتقاط عنصر من الأرض."
+ ],
+ "BusinessHelp": [
+ "استخدم {1} لشراء العناصر أو {2} لمشاهدة قائمة بما هو معروض للبيع في أي شركة",
+ "تظهر الشركات بأسماء زرقاء فوق الرمز عند مدخلها.",
+ "أوامر صاحب العمل: {1}",
+ "ستظهر سيارة جديدة معروضة للبيع عندما تبتعد عن الوكيل."
+ ],
+ "ClanHelp": [
+ "اطلب من الإدارة إنشاء تيم(القبيلة) (على غرار الفصائل / المجموعات / العائلات)",
+ "يتمتع مالكو التيم(القبيلة) بالسيطرة الكاملة على افراد المجموعة بمجرد إنشائها",
+ "أوامر القبيلة: {1}",
+ "أوامر القبيلة: {1}"
+ ],
+ "RadioStationHelp": [
+ "استخدم {1} لتعيين المحطة لمركبتك أو منزلك أو عملك",
+ "استخدم {2} لمشاهدة قائمة المحطات",
+ "يمكنك تغيير حجم تدفق الراديو باستخدام {1} مع 0-100 كنسبة مئوية"
+ ],
+ "WealthAndTaxHelp": [
+ "ضرائبك في يوم الدفع هي {1} بالمائة من ثروتك المحسوبة.",
+ "ثروتك المحسوبة هي مجموع إجمالي يعتمد على عدد المركبات والمنازل والشركات التي لديك.",
+ "كل سيارة {1} ، كل منزل {2} ، وكل عمل {3}",
+ "استخدم {1} لمعرفة ثروتك الحالية ، و {2} لمعرفة المبلغ الذي ستدفعه كضريبة في كل يوم دفع"
+ ],
+ "MustBeInAVehicle": "يجب أن تكون في مركبة!",
+ "MustBeInOrNearVehicle": "أنت بحاجة إلى أن تكون في السيارة أو بالقرب منها!",
+ "MustBeInVehicleFrontSeat": "يجب أن تكون في المقاعد الأمامية للسيارة!",
+ "MustBeInVehicleDriverSeat": "يجب أن تكون السائق!",
+ "DontHaveVehicleKey": "ليس لديك مفتاح لهذه السيارة!",
+ "NoGateAccess": "لا يمكنك الوصول إلى هذه البوابة!",
+ "GateBroken": "هذه البوابة مكسورة!",
+ "GateHacked": "البوابة لا تستجيب!",
+ "RadioJammed": "تسمع صوتًا ثابتًا فقط من الراديو.",
+ "VehicleNotForSale": "هذه السيارة ليست للبيع!",
+ "VehicleNotForRent": "هذه السيارة ليست للإيجار!",
+ "BusinessNotForSale": "هذا العمل ليس للبيع!",
+ "BusinessNotForRent": "هذا العمل ليس للإيجار!",
+ "HouseNotForSale": "هذا المنزل ليس للبيع!",
+ "HouseNotForRent": "هذا المنزل ليس للإيجار!",
+ "DealershipPurchaseTestDrive": "قم بقيادة السيارة بعيدًا عن الوكالة لشرائها ، أو اخرج للإلغاء.",
+ "DealershipPurchaseExitedVehicle": "لقد ألغيت شراء السيارة بالخروج من السيارة!",
+ "VehiclePurchaseComplete": "هذه السيارة الآن لك!",
+ "VehiclePurchaseNotEnoughMoney": "ليس لديك ما يكفي من المال لشراء هذه السيارة!",
+ "HousePurchaseNotEnoughMoney": "ليس لديك ما يكفي من المال لشراء هذا المنزل!",
+ "BusinessPurchaseNotEnoughMoney": "ليس لديك ما يكفي من المال لشراء هذا العمل!",
+ "Locales": {
+ "English": "انجلزي",
+ "Russian": "روسي",
+ "Spanish": "الإسبانية",
+ "German": "الإلمانية",
+ "Dutch": "الهولندية",
+ "Polish": "البولندية"
+ },
+
+ "ADDED-21JAN2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations.",
+ "HeaderPlayerHousesList": "بيوت اللاعبين ({1})",
+ "HeaderPlayerStaffFlagsList": "أعلام طاقم العمل ({1})",
+ "HeaderStaffFlagsList": "أعلام الموظفين",
+ "NonRPName": "اسم غير RP! اختر واحدة جديدة:",
+ "InvalidStaffFlag": "لم يتم العثور على علم الموظفين!",
+ "InvalidClanFlag": "علم القبيلة غير موجود!",
+ "InvalidLocale": "اللغة غير موجودة!",
+ "HeaderJobUniformList": "زي العمل ({1})",
+ "HeaderJobEquipmentList": "معدات العمل ({1})",
+ "InvalidJobUniform": "زي العمل غير موجود!",
+ "InvalidJobEquipment": "لم يتم العثور على معدات العمل!",
+ "HeaderVehiclesInRangeList": "مركبات داخل {1}",
+ "NoVehiclesWithInRange": "لا توجد مركبات داخل {1}",
+ "AmountNotNumber": "المبلغ يجب أن يكون رقما!",
+ "NeedToBeWorking": "يجب أن تعمل! استخدم {1} في موقع العمل أو بالقرب من سيارات العمل.",
+ "NeedToBeOnJobRoute": "عليك أن تفعل طريق عمل! استخدم {1} في مركبة عمل",
+ "CurrentJobRouteDeleted": "تم حذف مسار العمل الذي كنت تعمل فيه بواسطة الإدمن",
+ "CurrentJobRouteVehicleColoursChanged": "تم تغيير ألوان السيارة لمسار وظيفتك بواسطة الإدمن",
+ "NotYourJob": "هذه ليست وظيفتك!",
+ "JobPoints": "يمكنك الحصول على وظيفة من خلال الذهاب إلى النقاط الصفراء على الخريطة.",
+ "QuitJobToTakeAnother": "إذا كنت تريد هذه الوظيفة ، فاستخدم {1} لإنهاء وظيفتك الحالية.",
+ "NotAJobVehicle": "هذه ليست وسيلة عمل!",
+ "NotYourJobVehicle": "هذه ليست مركبة عملك!",
+ "JobRouteDisabled": "تم تعطيل مسار العمل الذي كنت تسلكه بواسطة أحد الإداريين",
+ "HeaderPickupTypes": "أنواع الالتقاط",
+ "HeaderBlipTypes": "أنواع أيقونات الخريطة",
+ "InvalidGPSLocation": "لا توجد مواقع بهذا الاسم أو النوع",
+ "HeaderBusinessList": "الأعمال",
+ "VehicleForSale": "يمكن شراء {1} مقابل {2}! استخدم {3} إذا كنت ترغب في شرائه",
+ "VehicleForRent": "هذا {1} قابل للتأجير لـ {2}! استخدم {3} إذا كنت تريد استئجاره",
+
+ "ADDED-31JAN2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations.",
+ "LoginFailedInvalidPassword": "رمز مرور خاطئ! عدد المحاولات المتبقية: {1}",
+ "LoginFailedNoPassword": "يجب عليك إدخال كلمة المرور! ! عدد المحاولات المتبقية: {1}",
+ "RegistrationFailedNoPassword": "يجب عليك إدخال كلمة المرور!",
+ "RegistrationFailedNoPasswordConfirm": "يجب عليك تأكيد كلمة المرور!",
+ "RegistrationFailedNoEmail": "يجب إدخال البريد الإلكتروني!",
+ "AccountNameAlreadyRegistered": "تم تسجيل اسمك بالفعل!",
+ "AlreadyLoggedIn": "انت بالفعل بداخل!",
+ "RegistrationFailedInvalidEmail": "هذا البريد الإلكتروني غير صالح!",
+ "RegistrationFailedPasswordMismatch": "كلمات المرور غير متطابقة!",
+ "RegistrationFailedCreateError": "تعذر إنشاء حسابك!",
+ "RegistrationSuccess": "لقد تم إنشاء حسابك!",
+ "RegistrationEmailVerifyReminder": "لا تنس التحقق من بريدك الإلكتروني! تم إرسال رمز التحقق لك.",
+ "RegistrationCreateCharReminder": "للعب على الخادم ، ستحتاج إلى تكوين شخصية.",
+ "NoCharactersGUIMessage": "ليس لديك أحرف. هل ترغب في صنع واحدة؟",
+ "NoCharactersGUIWindowTitle": "لا أحرف",
+ "NoCharactersChatMessage": "ليس لديك أحرف. استخدم {1} لإنشاء واحدة.",
+ "NeedEmailFor2FA": "تحتاج إلى إضافة بريدك الإلكتروني إلى حسابك لاستخدام المصادقة ذات العاملين.",
+ "NeedEmailVerifiedFor2FA": "تحتاج إلى التحقق من بريدك الإلكتروني لاستخدام المصادقة ذات العاملين.",
+ "SetEmailHelpTip": "استخدم {1} لتعيين بريدك الإلكتروني.",
+ "VerifyEmailHelpTip": "استخدم {1} للتحقق من بريدك الإلكتروني.",
+
+ "ADDED-13FEB2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations.",
+ "NearbyRadio": "راديو قريب",
+ "FromRadio": "من الراديو",
+ "ToRadio": "في الراديو",
+ "NeedToEnterPropertyCommand": "تحتاج إلى إدخال {1} أولاً! استخدم {2} للدخول والخروج",
+ "NeedToEnterPropertyKeyPress": "تحتاج إلى إدخال {1} أولاً! اضغط على {2} للدخول والخروج",
+ "InventoryFullCantCarry": "ليس لديك أي مساحة لحمل هذا (جرد كامل)!",
+ "NotEnoughCashNeedAmountMore": "ليس لديك ما يكفي من المال! أنت بحاجة إلى {1} أكثر!",
+ "AmountMustBeMoreThan": "يجب أن يكون المبلغ أكثر من {1}!",
+ "WeaponBanned": "لا يسمح لك بشراء أو استخدام الأسلحة!",
+ "TimeNotNumber": "يجب أن يكون الوقت رقمًا",
+ "HeaderDefaultBusinessItemTypes": "قوالب عناصر الأعمال",
+ "FixingStuck": "إصلاح موقعك والعالم الافتراضي ...",
+ "CantUseCommandYet": "يجب أن تنتظر قبل أن تتمكن من استخدام هذا الأمر مرة أخرى!",
+ "NotATester": "أنت لست مختبرا!",
+ "AccessDenied": "تم الرفض",
+ "InvalidSkin": "هذا الجلد غير صالح!",
+ "HeaderInteriorTypes": "قائمة التصميمات الداخلية",
+ "ViewInventoryKeyPressTip": "اضغط على {1} لرؤية العناصر الخاصة بك",
+ "ViewInventoryCommandTip": "استخدم {1} لمشاهدة عناصرك",
+ "GUIAccountSettingToggle": "لقد قمت بتحويل {1} GUI",
+
+ "ADDED-23MAR2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations",
+ "CarCommandHelp": "You can buy a car by visiting a vehicle dealership. Use {1} for more information.",
+ "SkinCommandHelp": "You can change your skin by visiting a clothes store. Use {1} for more info.",
+ "BusinessVehiclesRespawned": "All business vehicles have been respawned by an admin!",
+ "JobVehiclesRespawned": "All job vehicles have been respawned by an admin!",
+ "PlayerVehiclesRespawned": "All player vehicles have been respawned by an admin!",
+ "ClanVehiclesRespawned": "All clan vehicles have been respawned by an admin!",
+ "PublicVehiclesRespawned": "All public have been respawned by an admin!",
+ "EmptyVehiclesRespawned": "All empty vehicles have been respawned by an admin!",
+ "AllVehiclesRespawned": "All vehicles have been respawned by an admin!",
+ "AllVehiclesReloaded": "All vehicles have been reloaded by an admin!",
+ "YourVehicleRespawned": "Your vehicle has been respawned",
+ "PlayerIPBanned": "{1} has been IP banned!",
+ "PlayerCharacterBanned": "{1} has been character banned!",
+ "PlayerSubNetBanned": "{1} has been subnet banned!",
+ "CantModifyBusiness": "You can't manage or modify this business",
+ "CantModifyHouse": "You can't manage or modify this house",
+ "ServerTimeSet": "{1} set the time to {2}",
+ "ServerWeatherSet": "{1} set the weather to {2}",
+ "ServerSnowSet": "{1} turned falling snow {2} and ground snow {3}",
+ "AllJobsReloaded": "All server jobs have been reloaded by an admin",
+ "ServerLogoSet": "{1} turned the server logo image {2}",
+ "ServerGUISet": "{1} turned GUI for this server {2}",
+ "ServerBusinessBlipsSet": "{1} turned all business blips {2}",
+ "ServerHouseBlipsSet": "{1} turned all house blips {2}",
+ "ServerJobBlipsSet": "{1} turned all job blips {2}",
+ "ServerBusinessPickupsSet": "{1} turned all business pickups {2}",
+ "ServerHousePickupsSet": "{1} turned all house pickups {2}",
+ "ServerJobPickupsSet": "{1} turned on all job pickups {2}",
+ "BusinessBuyItemsLabel": "Use {1} to purchase items",
+ "PropertyEnterCommandLabel": "Use {1} to enter",
+ "PropertyEnterKeyPressLabel": "Press {1} to enter",
+ "PropertyForSaleLabel": "For sale: ${1}",
+ "PropertyForRentLabel": "For rent: ${1} every payday",
+ "RemainingTaxPaidInMoney": "You covered the remaining taxes with ${1} in cash.",
+ "LostMoneyFromTaxes": "You lost money since your taxes are more than your paycheck!",
+ "NextPaycheckRepossessionWarning": "If you don't have enough cash to cover taxes on next paycheck, you will lose stuff!",
+ "NotEnoughMoneyForTax": "You don't have enough money to cover your taxes!",
+ "AssetsRepossessedForTax": "You lost {1} vehicles, {2} houses, and {3} businesses because you couldn't pay taxes!",
+ "Closed": "Closed",
+ "Open": "Open",
+ "VehicleDealershipLabel": "Enter a vehicle as driver to buy it",
+ "TakeJobLabel": "Use {1} to work here",
+ "StartWorkLabel": "Use {1} to start working",
+ "JobEquipAndUniformLabel": "Use {1} and {2} for job stuff, or {3} to stop working",
+ "NotYourJobLabel": "You already have a different job. Use {1} if you want this one",
+ "JobLabel": "{1} Job",
+ "PaydayBonusSet": "{1} set the payday bonus to ${2}",
+ "AllHousesReloaded": "All houses have been reloaded by an admin",
+ "AllRadioStationsReloaded": "All radio stations have been reloaded by an admin!",
+ "PlayerKicked": "{1} has been kicked from the server",
+ "AllBusinessesReloaded": "All businesses have been reloaded by an admin!",
+ "UnableToDoThat": "You aren't able to do that",
+ "SetVehicleClanConfirmMessage": "Are you sure you want to give this vehicle to your clan?",
+ "SetVehicleClanConfirmTitle": "Warning!",
+ "SetItemPriceBelowOrderPriceMessage": "Are you sure you want to set the item price below it's order price? You will lose ${1} every purchase!",
+ "SetItemPriceBelowOrderPriceTitle": "Warning!",
+ "MustOwnVehicle": "You don't own this vehicle!"
+}
diff --git a/locale/chinese.json b/locale/chinese.json
index 5286e7db..16a6dff3 100644
--- a/locale/chinese.json
+++ b/locale/chinese.json
@@ -1,397 +1,458 @@
{
- "TranslationProvidedBy": "Renzuka Ctone",
- "LocaleEnglishName": "Chinese",
- "LocaleNativeName": "Chinese",
- "LocaleOffer": "This server is available in English. Use {1} to use it.",
- "LocaleChanged1": "Your language is now set to {1}",
- "LocaleChanged2": "The server will now display messages in {1}",
- "LocaleChangedNote": "This does not change messages from other players",
- "AccentsListHeader": "Accents",
- "HeaderHelpMainList": "Help Categories",
- "AccentNotFound": "Accent not found",
- "AccentSet": "You set your accent to {1}",
- "AnimationNotFound": "That animation doesn't exist",
- "AnimationCommandTip": "Use {1} to see a list of valid animations",
- "AnimationInvalidDistance": "The distance must be between 0 and 3",
- "AnimationStopCommandTip": "Use {1} to stop your animation",
- "CantBanClient": "You cannot ban this person",
- "PlayerAccountBanned": "{1} has been account banned",
- "ClanNotFound": "Clan not found",
- "ClanNameTaken": "A clan with that name already exists",
- "PlayerNotFound": "Player not found",
- "ClanCantRemoveRanks": "You can't remove clan ranks",
- "ClanCantAddRanks": "You can't add clan ranks",
- "ClanRankNotFound": "Clan rank not found",
- "ClanCantChangeMemberTag": "You can not change clan member's tags",
- "ClanPlayerNotInSameClan": "That player is not in your clan",
- "ClanCantChangeRankLevel": "You can not change clan rank's level",
- "ClanCantChangeRankTag": "You can not change clan rank's tags",
- "NameNotRegistered": "Your name is not registered! Use {1} to make an account.",
- "AutomaticLoginIPToggle": "Automatic login by IP is now {1}",
- "CouldNotRegisterAccount": "There was a problem creating your account. Please contact an admin.",
- "RandomTipsToggle": "Random tips are now {1}",
- "ActionTipsToggle": "Action tips are now {1}",
- "AutoSpawnLastCharToggle": "Automatic spawn as last used character is {1}",
- "AccountGUISettingToggle": "GUI is now {1}",
- "On": "On",
- "Off": "Off",
- "Yes": "Yes",
- "No": "No",
- "True": "True",
- "False": "False",
- "Locked": "Locked",
- "Unlocked": "Unlocked",
- "PasswordNotGoodEnough": "The new password must meet the requirements!",
- "PasswordNeedsBase": "Passwords must have at least {1}",
- "PasswordNeedsCapitals": "{1} capital letters",
- "PasswordNeedsNumbers": "{1} numbers",
- "PasswordNeedsSymbols": "{1} symbols",
- "PasswordsDontMatch": "The new password and confirm new password aren't the same!",
- "PasswordChanged": "Your password has been changed!",
- "AutoLoggedInIP": "You have been automatically logged in by IP!",
- "WelcomeBack": "Welcome back to {1}, {2}! Please {3} to continue.",
- "WelcomeNewPlayer": "Welcome to {1}, {2}! Please {3} to play.",
- "InvalidPlayer": "Player not found!",
- "InvalidBusiness": "Business not found!",
- "InvalidHouse": "House not found!",
- "InvalidVehicle": "Vehicle not found!",
- "InvalidClan": "Clan not found!",
- "InvalidClanRank": "Clan rank not found!",
- "InvalidJob": "Job not found!",
- "InvalidItem": "Item not found!",
- "InvalidItemType": "Item type not found!",
- "InvalidRadioStation": "Radio station not found!",
- "InvalidGate": "Gate not found!",
- "EntersProperty": "opens the door and enters the {1}",
- "ExitsProperty": "opens the door and exits the {1}",
- "EnterExitPropertyDoorLocked": "tries to open the {1} door but fails because it's locked",
- "PropertyNoInterior": "This {1} does not have an interior, but you can still use commands at the door icon.",
- "NoBusinessWithItemType": "There is no business with that item available",
- "HeaderKeyBinds": "Key Binds",
- "HeaderAccountHelp": "Account Help",
- "HeaderVehicleHelp": "Vehicle Help",
- "HeaderVehicleDealershipHelp": "Vehicle Dealership Help",
- "HeaderJobHelp": "Job Help",
- "HeaderChatHelp": "Chat Help",
- "HeaderServerRules": "Server Rules",
- "HeaderWebsiteInfo": "Website",
+ "TranslationProvidedBy": "Renzuka_Ctone",
+ "LocaleEnglishName": "Simplified Chinese",
+ "LocaleNativeName": "简体中文",
+ "LocaleOffer": "本服务器有可用的中文翻译版本,使用 {1} 以启用。",
+ "LocaleChanged1": "语言已设定为 {1}",
+ "LocaleChanged2": "服务器现在将以 {1} 显示消息。",
+ "LocaleChangedNote": "这将不会影响到来自其他玩家的消息",
+ "AccentsListHeader": "口音",
+ "HeaderHelpMainList": "帮助类别",
+ "AccentNotFound": "口音不存在",
+ "AccentSet": " 口音已设置为 {1}",
+ "InvalidAnimation": "该动作不存在",
+ "AnimationCommandTip": "使用 {1} 以查看可用动作列表",
+ "InvalidAnimationDistance": "范围必须在 0 到 3 之间",
+ "AnimationStopCommandTip": "使用 {1} 以停止当前动作",
+ "CantBanClient": "你无法封禁该玩家",
+ "PlayerAccountBanned": "{1} 的账号已被封禁",
+ "ClanNotFound": "帮派不存在",
+ "ClanNameTaken": "该帮派名称已被占用",
+ "PlayerNotFound": "玩家不存在",
+ "ClanCantRemoveRanks": "无法清除帮派等级",
+ "ClanCantAddRanks": "无法增加帮派等级",
+ "ClanRankNotFound": "帮派等级不存在",
+ "ClanCantChangeMemberTag": "你无法更改帮派成员的标签",
+ "ClanPlayerNotInSameClan": "该玩家并不属于你的帮派",
+ "ClanCantChangeRankLevel": "你无法改变帮派等级",
+ "ClanCantChangeRankTag": "你无法改变帮派标签",
+ "NameNotRegistered": "你的游戏名尚未注册!使用 {1} 以创建一个新账户。",
+ "AutomaticLoginIPToggle": "通过 IP 自动登录功能 现已 {1}",
+ "CouldNotRegisterAccount": "在创建你的账户时遇到一些问题,请与管理员联系。",
+ "RandomTipsToggle": "随机提示信息现已 {1}",
+ "ActionTipsToggle": "操作帮助现已 {1}",
+ "AutoSpawnLastCharToggle": "上次使用的角色 {1} 已自动复活。",
+ "AccountGUISettingToggle": "GUI 现已 {1}",
+ "On": "开启",
+ "Off": "关闭",
+ "Yes": "是",
+ "No": "否",
+ "True": "真",
+ "False": "假",
+ "Locked": "锁定",
+ "Unlocked": "未锁定",
+ "PasswordNotGoodEnough": "新密码必须符合要求!",
+ "PasswordNeedsBase": "密码至少需要 {1}",
+ "PasswordNeedsCapitals": "{1} 大写字母",
+ "PasswordNeedsNumbers": "{1} 数字",
+ "PasswordNeedsSymbols": "{1} 符号",
+ "PasswordsDontMatch": "新密码和确认密码不一致!",
+ "PasswordChanged": "已成功更改你的密码!",
+ "AutoLoggedInIP": "已通过 IP 自动登录!",
+ "WelcomeBack": "欢迎回到 {1}, {2}! 请 {3} 以继续。",
+ "WelcomeNewPlayer": "欢迎来到 {1}, {2}! 请 {3} 以开始游戏。",
+ "InvalidPlayer": "玩家不存在!",
+ "InvalidBusiness": "企业不存在!",
+ "InvalidHouse": "住宅不存在!",
+ "InvalidVehicle": "载具不存在!",
+ "InvalidClan": "帮派不存在!",
+ "InvalidClanRank": "帮派等级不存在!",
+ "InvalidJob": "职业不存在",
+ "InvalidItem": "物品不存在!",
+ "InvalidItemType": "物品种类不存在!",
+ "InvalidRadioStation": "电台不存在!",
+ "InvalidGate": "大门不存在!",
+ "EntersProperty": "开门并进入 {1}",
+ "ExitsProperty": "开门并退出 {1}",
+ "EnterExitPropertyDoorLocked": "试图打开 {1} 之门,却发现已上锁。",
+ "PropertyNoInterior": "{1} 暂无内部场景,但你仍可以在大门图标上使用相关指令。",
+ "NoBusinessWithItemType": "暂无可用项目的企业",
+ "HeaderKeyBinds": "快捷键设置",
+ "HeaderAccountHelp": "账户帮助",
+ "HeaderVehicleHelp": "载具帮助",
+ "HeaderVehicleDealershipHelp": "汽车经销商帮助 ",
+ "HeaderJobHelp": "职业帮助",
+ "HeaderChatHelp": "聊天帮助",
+ "HeaderServerRules": "服务器规则",
+ "HeaderWebsiteInfo": "官网",
"HeaderDiscordInfo": "Discord",
- "HeaderAnimationsList": "Animation List",
- "HeaderPayAndSprayHelp": "Pay and Spray Help",
- "HeaderAmmunationHelp": "Ammunation Help",
- "HeaderVehicleTuneupHelp": "Vehicle Tune Help",
- "HeaderBindableKeysHelp": "Bindable Keys",
- "HeaderSkinHelp": "Clothes/Skin Help",
- "HeaderBusinessHelp": "Business Help",
- "HeaderClanHelp": "Clan Help",
- "HeaderPlayerVehiclesList": "Player Vehicles ({1})",
- "HeaderPlayerBusinessesList": "Player Businesses ({1})",
- "HeaderClansList": "Clan List",
- "HeaderAdminsList": "Admin List",
- "HeaderBadgeInfo": "Badge Information",
- "HeaderAccentsList": "Accent List",
- "HeaderPlayerInfo": "Player Information ({1})",
- "HeaderWealthandTaxHelp": "Wealth and Tax Information",
- "HeaderCommandInfo": "Command Information ({1})",
- "HeaderRadioHelp": "Radio Help",
- "HeaderRadioStationsList": "Radio Stations",
- "HeaderKeyBindsList": "Key Binds List",
- "RadioVolumeChanged": "{1} You changed your streaming radio volume to {2}%",
- "VolumeLevelNotNumber": "The volume level must be a number",
- "RadioStationLocationInvalid": "You must be in a vehicle, house, or business or have a personal device to change the station!",
- "ActionBusinessRadioStationChange": "changes the business radio station to {1} ({2})",
- "ActionHouseRadioStationChange": "changes the house radio station to {1} ({2})",
- "ActionVehicleRadioStationChange": "changes the vehicle radio station to {1} ({2})",
- "ActionItemRadioStationChange": "changes the {1}'s station to {2} ({3})",
- "RandomVehicleCommandsDisabled": "This is a random traffic vehicle and commands can't be used for it.",
- "HouseDoorLock": "House {1} {2}!",
- "BusinessDoorLock": "Business {1} {2}!",
- "ServerGameModeRestarting": "The server game mode is restarting!",
- "HeaderSelfItemList": "Your Inventory",
- "HeaderPlayerItemList": "Player Inventory ({1})",
- "HeaderHouseItemList": "House Inventory",
- "HeaderBusinessFloorItemList": "Business Inventory (For Sale)",
- "HeaderBusinessStorageItemList": "Business Inventory (Storage)",
- "HeaderItemItemList": "{1}'s Inventory",
- "ItemSlotNotNumber": "The item slot must be a number",
- "ItemSlotMustBeBetween": "The item slot must be between {1} and {2}!",
- "UseItemBugged": "The item you're trying to use is bugged. A bug report has been sent to the server developers.",
- "PickupItemBugged": "The item you're trying to pickup is bugged. A bug report has been sent to the server developers.",
- "DropItemBugged": "The item you're trying to drop is bugged. A bug report has been sent to the server developers.",
- "HandsBusy": "Your hands are busy",
- "CantUseItemInSkinChange": "You can't use an item while customizing your appearance",
- "CantDropItemInSkinChange": "You can't drop an item while customizing your appearance",
- "CantPickupItemInSkinChange": "You can't pickup an item while customizing your appearance",
- "CantSwitchItemInSkinChange": "You can't switch an item while customizing your appearance",
- "CantGiveItemInSkinChange": "You can't give an item while customizing your appearance",
- "CantTakeItemInSkinChange": "You can't take an item while customizing your appearance",
- "ItemUnequippableNoAmmo": "The {1} in slot {2} has no ammo, and can't be equipped!",
- "NoSpaceSelfInventory": "You don't have any more space in your inventory",
- "Business": "business",
- "House": "house",
- "Clan": "clan",
- "Vehicle": "vehicle",
- "Item": "item",
- "ItemType": "item type",
- "Gate": "gate",
- "Door": "door",
- "ClanRank": "clan rank",
- "JobRank": "job rank",
- "RadioStation": "radio station",
+ "HeaderAnimationsList": "动作列表",
+ "HeaderPayAndSprayHelp": "有偿喷漆帮助",
+ "HeaderAmmunationHelp": "弹药帮助",
+ "HeaderVehicleTuneupHelp": "载具改装帮助",
+ "HeaderBindableKeysHelp": "可绑定的按键",
+ "HeaderSkinHelp": "服装/皮肤帮助",
+ "HeaderBusinessHelp": "企业帮助",
+ "HeaderClanHelp": "帮派帮助",
+ "HeaderPlayerVehiclesList": "玩家载具 ({1})",
+ "HeaderPlayerBusinessesList": "玩家企业 ({1})",
+ "HeaderClansList": "帮派列表",
+ "HeaderAdminsList": "管理员列表",
+ "HeaderBadgeInfo": "荣誉信息",
+ "HeaderAccentsList": "口音列表",
+ "HeaderPlayerInfo": "玩家信息 ({1})",
+ "HeaderWealthandTaxHelp": "资产与税收帮助",
+ "HeaderCommandInfo": "指令帮助 ({1})",
+ "HeaderRadioHelp": "电台帮助",
+ "HeaderRadioStationsList": "电台",
+ "HeaderKeyBindsList": "按键绑定列表",
+ "RadioVolumeChanged": "{1} 已将电台音量调整为 {2}%",
+ "VolumeLevelNotNumber": "确保输入的音量大小为有效数值",
+ "RadioStationLocationInvalid": "你必须在车辆、住宅或企业中,或拥有个人设备才能更改电台!",
+ "ActionBusinessRadioStationChange": "企业电台已设置为 {1} ({2})",
+ "ActionHouseRadioStationChange": "住宅电台已设置为 {1} ({2})",
+ "ActionVehicleRadioStationChange": "载具电台已设置为 {1} ({2})",
+ "ActionItemRadioStationChange": "{1} 的电台已设置为 {2} ({3})",
+ "RandomVehicleCommandsDisabled": "这是一辆随机刷出的街车,无法对其使用指令。",
+ "HouseDoorLock": "住宅 {1} {2}!",
+ "BusinessDoorLock": "企业 {1} {2}!",
+ "ServerGameModeRestarting": "游戏模式正在重启!",
+ "HeaderSelfItemList": "你的库存",
+ "HeaderPlayerItemList": "玩家库存 ({1})",
+ "HeaderHouseItemList": "住宅库存",
+ "HeaderBusinessFloorItemList": "企业库存 (供售)",
+ "HeaderBusinessStorageItemList": "企业库存 (暂存)",
+ "HeaderItemItemList": "{1} 的库存",
+ "ItemSlotNotNumber": "物体槽位必须为整数",
+ "ItemSlotMustBeBetween": "物体槽位应在 {1} 与 {2} 之间!",
+ "UseItemBugged": "尝试操作的物品出现错误!错误报告已发送给服务器开发人员。",
+ "PickupItemBugged": "尝试拾取的物品出现错误!错误报告已发送给服务器开发人员。",
+ "DropItemBugged": "尝试丢弃的物品出现错误!错误报告已发送给服务器开发人员。",
+ "HandsBusy": "操作繁忙",
+ "CantUseItemInSkinChange": "自定义外观时无法使用该物品",
+ "CantDropItemInSkinChange": "自定义外观时无法丢弃该物品",
+ "CantPickupItemInSkinChange": "自定义外观时无法拾取物品",
+ "CantSwitchItemInSkinChange": "自定义外观时无法切换物品",
+ "CantGiveItemInSkinChange": "自定义外观时无法赠送物品",
+ "CantTakeItemInSkinChange": "自定义外观时无法取出物品",
+ "ItemUnequippableNoAmmo": "槽位 {2} 中 {1} 弹药耗尽,无法装备!",
+ "NoSpaceSelfInventory": "库存已无更多空间",
+ "Business": "企业",
+ "House": "住宅",
+ "Clan": "帮派",
+ "Vehicle": "载具",
+ "Item": "物品",
+ "ItemType": "物品种类",
+ "Gate": "大门",
+ "Door": "门",
+ "ClanRank": "帮派等级",
+ "JobRank": "职业等级",
+ "RadioStation": "电台",
"Months": [
- "January",
- "February",
- "March",
- "April",
- "May",
- "June",
- "July",
- "August",
- "September",
- "October",
- "November",
- "December"
+ "一月",
+ "二月",
+ "三月",
+ "四月",
+ "五月",
+ "六月",
+ "七月",
+ "八月",
+ "九月",
+ "十月",
+ "十一月",
+ "十二月"
],
"WeekDays": [
- "Sunday",
- "Monday",
- "Tuesday",
- "Wednesday",
- "Thursday",
- "Friday",
- "Saturday"
+ "周日",
+ "周一",
+ "周二",
+ "周三",
+ "周四",
+ "周五",
+ "周六"
],
"CardinalDirections": [
- "North",
- "Northeast",
- "East",
- "Southeast",
- "South",
- "Southwest",
- "West",
- "Northwest"
+ "北",
+ "东北",
+ "东",
+ "东南",
+ "南",
+ "西南",
+ "西",
+ "西北"
],
"NewPlayerReadyToPlay": [
- "You have been given some cash. Use {1} to find places to buy items.",
- "If you need money, jobs are the yellow dots on the radar.",
- "For a car, visit the car dealership. You can also use a rental vehicle near spawn or take the train",
- "Be sure to read the {1} and use {2} for info."
+ "你得到了一些现金,使用 {1} 以找到买东西的地方。",
+ "赚钱靠劳动,求职请前往雷达上的小黄点。",
+ "买车可以到汽车经销店,你也可以在出生点附近租车或者直接乘火车。",
+ "确保已阅读 {1},使用 {2} 以获取相关信息。"
],
- "YourCurrentVehicleDeleted": "The vehicle you were in was deleted.",
- "Distance": "Distance",
- "Meters": "Meters",
- "Feet": "Feet",
- "Kilometers": "Kilometers",
- "Miles": "Miles",
- "MustBeVehicleDriver": "You must be the driver of the vehicle!",
- "PlayerJoinedServer": "{1} has joined the game from {1}!",
- "PlayerLeftServer": "{1} has left the game! ({1})",
+ "YourCurrentVehicleDeleted": "你当前乘坐的车辆已被删除。",
+ "Distance": "距离",
+ "Meters": "米",
+ "Feet": "英尺",
+ "Kilometers": "公里",
+ "Miles": "英里",
+ "MustBeVehicleDriver": "你并不是主驾驶!",
+ "PlayerJoinedServer": "{1} 加入游戏。来自:{1}",
+ "PlayerLeftServer": "{1} 退出游戏! ({1})",
"DisconnectReasons": [
- "Lost Connection",
- "Disconnected",
- "Unsupported Client",
- "Wrong Game",
- "Incorrect Password",
- "Unsupported Executable",
- "Disconnected",
- "Banned",
- "Failed",
- "Invalid Name",
- "Crashed"
+ "失去连接",
+ "断开连接",
+ "不支持的客户端",
+ "游戏错误",
+ "密码错误",
+ "不支持的游戏主程序",
+ "断开连接",
+ "已被封禁",
+ "连接失败",
+ "无效的游戏名",
+ "客户端崩溃"
],
- "TakeItemFromHouse": "takes a {1} from the house",
- "TakeItemFromBusinessStorage": "takes a {1} from the business storage",
- "TakeItemFromBusiness": "takes a {1} from the business",
- "TakeItemFromItem": "takes a {1} from the {2}",
- "TakeItemFromVehicleTrunk": "takes a {1} from the trunk",
- "TakeItemFromVehicleDash": "takes a {1} from the glove compartment",
- "JobEquipmentInventoryKeyBindTip": "The job equipment is in your inventory. Press {1} to see them.",
- "JobEquipmentInventoryCommandTip": "The job equipment is in your inventory. Use {1} to see them.",
+ "TakeItemFromHouse": "从住宅处拿到 {1}",
+ "TakeItemFromBusinessStorage": "从企业仓库拿到 {1}",
+ "TakeItemFromBusiness": "从企业处拿到 {1}",
+ "TakeItemFromItem": "从 {2} 处拿到 {1}",
+ "TakeItemFromVehicleTrunk": "从后备箱中取出 {1}",
+ "TakeItemFromVehicleDash": "从杂物箱中取出 {1}",
+ "JobEquipmentInventoryKeyBindTip": "工作设备在你的仓库里,按下 {1} 以查看。",
+ "JobEquipmentInventoryCommandTip": "工作设备在你的仓库里,使用 {1} 以查看。",
"AccountHelp": [
- "Do NOT share your password with anybody else. {1} staff will never ask you for your password",
- "Use {1} to change your password, and {2} if you forgot it",
- "Some settings you can use: {1}"
+ "请不要将密码分享给任何人,且{1} 工作人员不会询问你的密码。",
+ "使用 {1} 以更改密码,若遗忘密码请使用 {2} 。",
+ "可用设定:{1}"
],
"VehicleHelp": [
- "Your personal vehicles will save wherever you or somebody else leaves them!",
- "Visit dealerships to buy new vehicles (Use {1} for more information)",
- "Some commands: {1}",
- "Visit a mechanic garage to repair, colour, and tune up your car! {1} for info"
+ "你的私人车辆将会在离开车辆时自动保存!",
+ "前往汽车经销商购买新车 (使用 {1} 获取更多信息)",
+ "相关指令:{1}",
+ "去修理厂修理、喷漆和改装你的汽车! 使用 {1} 获取相关信息。"
],
"VehicleDealershipHelp": [
- "Visit a vehicle dealer to buy new vehicles. Use {1} to find one.",
- "At the dealer, enter a car you want to buy, and the price will be shown to you",
- "If you want to buy the vehicle, use {1} and you will be given keys to test drive it around the parking lot.",
- "Drive away from the dealership with the new vehicle to confirm the purchase."
+ "前往汽车经销商购买新车,使用 {1} 可以找一家。",
+ "在经销商处进入你希望购买的车辆,对应价格将会自动显示。",
+ "确定车辆后使用 {1},即可开始试驾。",
+ "驾驶车辆离开经销商以确认购买。"
],
"JobHelp": [
- "Visit job locations to get a job and earn money. Look for yellow spots on the map",
- "At a job location, use {1} to get the job. Use {2} to quit your job",
- "Use {1} to begin working. You can also get a job {2} and {3}",
- "Most job vehicles are locked. Use {1} near one to enter it.",
- "When entering a job vehicle, information on how to do the job will be shown to you."
+ "地图上的黄点为求职处,你可以在那里找工作挣大钱。",
+ "在求职处使用 {1} 以获得工作,不想干了就使用 {2} 跑路。",
+ "使用 {1} 即开始工作,你也可以在 {2} 与 {3} 中获得工作。",
+ "工作专用车一般都是锁着的,在其旁边使用 {1} 即可进入。",
+ "进入专用车时,将向您显示有关如何执行工作的信息。"
],
"ChatHelp": [
- "There are two main types of chat: out-of-character (OOC) and in-character (IC)",
- "Mixing these two types is not proper roleplay. See {1} for info.",
- "Some chat commands: {1}",
- "Some have shorter names available ({1} to talk, {2} to shout, etc)"
+ "聊天方式主要有两种:本我意识 (OOC 即 out-of-character) 和 角色意识 (IC 即 in-character)",
+ "在玩角色扮演的时候最好不要混用两种聊天方式,查看 {1} 以获取更多信息。",
+ "聊天指令:{1}",
+ "某些玩家有可用的更简短的名称 ({1} 用以正常交流, {2} 用以喊话等)"
],
"ServerRulesHelp": [
- "Unrealistic actions (powergaming) are not allowed. You aren't superman.",
- "No terrorist or terrorism roleplay is allowed.",
- "Always follow instructions given by moderators and admins.",
- "Do not mix the chats (metagaming). You can't use info in IC that was received OOC",
- "Keep English in main chats. If you aren't good at English, use {1}"
+ "不允许不切实际的行为 (powergaming),你拯救不了世界。",
+ "不允许恐怖分子或恐怖主义式角色扮演。",
+ "请始终遵循版主和管理员的指示。",
+ "不建议混合式聊天 (metagaming), 你不能在IC中使用收到OOC的信息。",
+ "请使用英语与其他玩家进行交流,不大擅长英语的话可以试试 {1}"
],
"AnimationHelp": [
- "Animations allow you to enhance roleplay with visual actions",
- "Use {1} or {2} with a name to use an animation.",
- "To see a list of animations, use {1}"
+ "做出虚拟动作可以提升你角色扮演的游戏体验。",
+ "使用 {1} 或 {2} + 动作名称 以做出一个动作。",
+ "要查看动作列表,使用 {1}"
],
"WeaponHelp": [
- "Visit an gun store to buy weapons. Use {1} to find one.",
- "Buying a weapon requires a weapon license.",
- "Weapon licenses are managed by the police department. Apply there to get one.",
- "Weapons can also be purchased illegally from some businesses, weapon dealers, and clans."
+ "前往枪店购买武器,使用 {1} 可以找一家。",
+ "购买武器是需要武器许可证的。",
+ "而武器许可证由警察局管理,在那里申请就可以办到一张。",
+ "武器也可以从一些企业、武器经销商和帮派那里非法购买。"
],
"SkinHelp": [
- "At a clothing store, use {1} to purchase clothes",
- "When you have a clothing item, equip and use it like any other item to show the skin selection (check {1} to learn how to use items)",
- "Some skins are restricted to jobs, clans, or for other reasons."
+ "在服装店里使用 {1} 即可买到衣服",
+ "当你拥有可穿戴式物品时,像其它物品一样直接装备即可。(查看 {1} 以了解如何使用物品)",
+ "某些服装将因工作、帮派或其它原因而受到限制。"
],
"KeyBindHelp": [
- "You can set your own key binds. Use {1} to see your binded keys.",
- "Use {1} to add a new keybind and {2} to remove one.",
- "Default keys are: {1} for vehicle engine, {1} for lights, and {3} for lock/unlock",
- "Press {1} to see your items and {2} to equip an item or {3} to unequip all.",
- "Press {1} to use the item you're holding, press {2} to drop it, or press {3} to pickup an item from the ground."
+ "你可以自定义快捷键,使用 {1} 以查看已绑定的按键。",
+ "使用 {1} 以新增快捷键,{2} 以移除。",
+ "默认按键如下: {1} 发动引擎,{2} 车灯开关,{3} 锁车/解锁",
+ "按下 {1} 查看你的物品,{2} 装备选定物品,{3} 卸下所有物品",
+ "按下 {1} 使用当前物品,{2} 丢弃当前物品,{3} 拾取地面物品"
],
"BusinessHelp": [
- "Use {1} to purchase items or {2} to see a list of what's for sale at any business",
- "Businesses are shown with blue names above the icon at their entrance.",
- "Business owner commands: {1}",
- "A new car for sale will appear when you drive away from the dealer."
+ "使用 {1} 以购买物品,或者使用 {2} 以查看任意企业的待售物品列表。",
+ "企业名称以蓝色字体显示在图标上方。",
+ "企业主可用的指令:{1}",
+ "一辆待售的新车会在你开车离开经销商(即确认购买)后出现。"
],
"ClanHelp": [
- "Ask an administrator to create a clan (Similar to factions/groups/families)",
- "Clan owners have full control over their clan once it's created",
- "Clan commands: {1}",
- "More clan commands: {1}"
+ "请求管理员以创建一个属于你自己的帮派 (类似于派系/团体/家庭)",
+ "帮派创建成功后,帮主将拥有其所有控制权。",
+ "帮派指令:{1}",
+ "更多帮派指令:{1}"
],
"RadioStationHelp": [
- "Use {1} to set the station for your vehicle, house, or business",
- "Use {2} to see a list of stations",
- "You can change your radio streaming volume using {1} with 0-100 as the percent"
+ "使用 {1} 为你的车辆/住宅/企业设置电台",
+ "使用 {2} 以查看电台列表",
+ "你可以使用 {1} 来改变电台音量大小。(0-100%)"
],
"WealthAndTaxHelp": [
- "Your taxes on payday are {1} percent of your calculated wealth.",
- "Your calculated wealth is a total sum based on how many vehicles, houses, and businesses you have.",
- "Each vehicle is {1}, each house is {2}, and each business is {3}",
- "Use {1} to see your current wealth, and {2} to see how much you'll pay in tax each payday"
+ "发薪日那天需要缴税,而税款是你计算财富的 {1}%.",
+ "计算财富是基于你所拥有的车辆、住宅和企业的总和。",
+ "{1} 每辆车,{2} 每栋房,{3} 每个企业。",
+ "使用 {1} 以查看你的当前财富,{2} 以查看发薪日当天你应当缴纳的税款。"
],
- "MustBeInAVehicle": "You need to be in a vehicle!",
- "MustBeInOrNearVehicle": "You need to be in or near a vehicle!",
- "MustBeInVehicleFrontSeat": "You need to be in the vehicle front seats!",
- "MustBeInVehicleDriverSeat": "You need to be the driver!",
- "DontHaveVehicleKey": "You don't have a key for this vehicle!",
- "NoGateAccess": "You don't have access to this gate!",
- "GateBroken": "This gate is broken!",
- "GateHacked": "The gate does not respond!",
- "RadioJammed": "You hear only static from the radio.",
- "VehicleNotForSale": "This vehicle is not for sale!",
- "VehicleNotForRent": "This vehicle is not for rent!",
- "BusinessNotForSale": "This business is not for sale!",
- "BusinessNotForRent": "This business is not for rent!",
- "HouseNotForSale": "This house is not for sale!",
- "HouseNotForRent": "This house is not for rent!",
- "DealershipPurchaseTestDrive": "Drive the vehicle away from the dealership to buy it, or get out to cancel.",
- "DealershipPurchaseExitedVehicle": "You canceled the vehicle purchase by exiting the vehicle!",
- "VehiclePurchaseComplete": "This vehicle is now yours! It will save wherever you leave it.",
- "VehiclePurchaseNotEnoughMoney": "You don't have enough money to buy this vehicle!",
- "HousePurchaseNotEnoughMoney": "You don't have enough money to buy this house!",
- "BusinessPurchaseNotEnoughMoney": "You don't have enough money to buy this business!",
+ "MustBeInAVehicle": "你必须先坐在一辆车上!",
+ "MustBeInOrNearVehicle": "必须要有辆车在你旁边,或者你坐上那辆车!",
+ "MustBeInVehicleFrontSeat": "你必须坐在车辆前排座椅上!",
+ "MustBeInVehicleDriverSeat": "你必须是车辆主驾驶!",
+ "DontHaveVehicleKey": "你并没有这车的钥匙!",
+ "NoGateAccess": "你无法进入这个大门。",
+ "GateBroken": "这门已是破烂不堪。",
+ "GateHacked": "大门没什么反应。",
+ "RadioJammed": "电台似是被干扰了。",
+ "VehicleNotForSale": "本车不出售!",
+ "VehicleNotForRent": "本车不出租!",
+ "BusinessNotForSale": "本企业不出售!",
+ "BusinessNotForRent": "本企业不出租!",
+ "HouseNotForSale": "这房子不给卖!",
+ "HouseNotForRent": "这房子不给租!",
+ "DealershipPurchaseTestDrive": "将车辆驶离经销商处以确认购买,下车取消。",
+ "DealershipPurchaseExitedVehicle": "已取消车辆购买。",
+ "VehiclePurchaseComplete": "这辆车现在是你的了!不管它在哪里都会自动保存。",
+ "VehiclePurchaseNotEnoughMoney": "你没有足够的钱买这辆车!",
+ "HousePurchaseNotEnoughMoney": "你没有足够的钱买这所房子!",
+ "BusinessPurchaseNotEnoughMoney": "你没有足够的钱来买这家企业!",
"Locales": {
- "English": "English",
- "Russian": "Russian",
- "Spanish": "Spanish",
- "German": "German",
- "Dutch": "Dutch",
- "Polish": "Polish"
+ "English": "英文",
+ "Russian": "俄文",
+ "Spanish": "西班牙文",
+ "German": "德文",
+ "Dutch": "荷兰文",
+ "Polish": "波兰文",
+ "Chinese": "中文"
},
"ADDED-21JAN2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations.",
- "HeaderPlayerHousesList": "Player Houses ({1})",
- "HeaderPlayerStaffFlagsList": "Player Staff Flags ({1})",
- "HeaderStaffFlagsList": "Staff Flags",
- "NonRPName": "Non-RP name! Choose a new one:",
- "InvalidStaffFlag": "Staff flag not found!",
- "InvalidClanFlag": "Clan flag not found!",
- "InvalidLocale": "Language not found!",
- "HeaderJobUniformList": "Job Uniforms ({1})",
- "HeaderJobEquipmentList": "Job Equipment ({1})",
- "InvalidJobUniform": "Job uniform not found!",
- "InvalidJobEquipment": "Job equipment not found!",
- "HeaderVehiclesInRangeList": "Vehicles within {1}",
- "NoVehiclesWithInRange": "There are no vehicles within {1}",
- "AmountNotNumber": "The amount must be a number!",
- "NeedToBeWorking": "You need to be working! Use {1} at a job location or near a job vehicle.",
- "NeedToBeOnJobRoute": "You need to be doing a job route! Use {1} in a job vehicle",
- "CurrentJobRouteDeleted": "The job route you were on has been deleted by an admin",
- "CurrentJobRouteVehicleColoursChanged": "Your job route's vehicle colours were changed by an admin",
- "NotYourJob": "This is not your job!",
- "JobPoints": "You can get a job by going the yellow points on the map.",
- "QuitJobToTakeAnother": "If you want this job, use {1} to quit your current job.",
- "NotAJobVehicle": "This is not a job vehicle!",
- "NotYourJobVehicle": "This is not your job's vehicle!",
- "JobRouteDisabled": "The job route you were on has been disabled by an admin",
- "HeaderPickupTypes": "Pickup Types",
- "HeaderBlipTypes": "Map Icon Types",
- "InvalidGPSLocation": "There are no locations with that name or type",
- "HeaderBusinessList": "Businesses",
- "VehicleForSale": "This {1} is buyable for {2}! Use {3} if you want to buy it",
- "VehicleForRent": "This {1} is rentable for {2}! Use {3} if you want to rent it",
+ "HeaderPlayerHousesList": "玩家住宅 ({1})",
+ "HeaderPlayerStaffFlagsList": "玩家信号旗 ({1})",
+ "HeaderStaffFlagsList": "信号旗",
+ "NonRPName": "非角色扮演名称!请选择新的名称:",
+ "InvalidStaffFlag": "信号旗帜不存在!",
+ "InvalidClanFlag": "帮派旗帜不存在!",
+ "InvalidLocale": "语言不存在!",
+ "HeaderJobUniformList": "工作制服 ({1})",
+ "HeaderJobEquipmentList": "工作设备 ({1})",
+ "InvalidJobUniform": "工作制服不存在!",
+ "InvalidJobEquipment": "工作设备不存在!",
+ "HeaderVehiclesInRangeList": "{1} 内的车辆",
+ "NoVehiclesWithInRange": "{1} 内无任何车辆。",
+ "AmountNotNumber": "请输入有效数字!",
+ "NeedToBeWorking": "你得去工作!在求职处或工作专用车旁使用 {1} 。",
+ "NeedToBeOnJobRoute": "你需要进行一个工作路线!请在工作专用车内使用 {1} 。",
+ "CurrentJobRouteDeleted": "管理员已删除你所在的工作路线",
+ "CurrentJobRouteVehicleColoursChanged": "管理员已更改你的工作路线的车辆颜色",
+ "NotYourJob": "这不是你的工作!",
+ "JobPoints": "前往地图上的黄点找到工作。",
+ "QuitJobToTakeAnother": "要是想干这行,先使用 {1} 离开当前工作。",
+ "NotAJobVehicle": "这并不是辆工作专用车!",
+ "NotYourJobVehicle": "这不是你工作用的车!",
+ "JobRouteDisabled": "管理员已禁用你的工作路线",
+ "HeaderPickupTypes": "拾取物类型",
+ "HeaderBlipTypes": "地图图标类型",
+ "InvalidGPSLocation": "没有具有该名称或类型的位置",
+ "HeaderBusinessList": "企业",
+ "VehicleForSale": "此 {1} 可被 {2} 购买到!购买请使用 {3}",
+ "VehicleForRent": "此 {1} 可被 {2} 租用!租用请使用 {3}",
"ADDED-31JAN2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations.",
- "LoginFailedInvalidPassword": "Invalid password! {1} attempts remaining",
- "LoginFailedNoPassword": "You must enter a password! ! {1} attempts remaining",
- "RegistrationFailedNoPassword": "You must enter a password!",
- "RegistrationFailedNoPasswordConfirm": "You must confirm the password!",
- "RegistrationFailedNoEmail": "You must enter an email!",
- "AccountNameAlreadyRegistered": "Your name is already registered!",
- "AlreadyLoggedIn": "You are already logged in!",
- "RegistrationFailedInvalidEmail": "That email is invalid!",
- "RegistrationFailedPasswordMismatch": "The passwords don't match!",
- "RegistrationFailedCreateError": "Your account couldn't be created!",
- "RegistrationSuccess": "Your account has been created!",
- "RegistrationEmailVerifyReminder": "Don't forget to verify your email! A verification code has been sent to you.",
- "RegistrationCreateCharReminder": "To play on the server, you will need to make a character.",
- "NoCharactersGUIMessage": "You have no characters. Would you like to make one?",
- "NoCharactersGUIWindowTitle": "No characters",
- "NoCharactersChatMessage": "You have no characters. Use {1} to make one.",
- "NeedEmailFor2FA": "You need to add your email to your account to use two-factor authentication.",
- "NeedEmailVerifiedFor2FA": "You need to verify your email to use two-factor authentication.",
- "SetEmailHelpTip": "Use {1} to set your email.",
- "VerifyEmailHelpTip": "Use {1} to verify your email.",
+ "LoginFailedInvalidPassword": "密码错误!还有 {1} 次尝试机会。",
+ "LoginFailedNoPassword": "密码不能为空!还有 {1} 次尝试机会。",
+ "RegistrationFailedNoPassword": "密码不能为空!",
+ "RegistrationFailedNoPasswordConfirm": "确认密码不能为空!",
+ "RegistrationFailedNoEmail": "电子邮件不能为空!",
+ "AccountNameAlreadyRegistered": "该游戏名已被注册。",
+ "AlreadyLoggedIn": "您已登录过账号!",
+ "RegistrationFailedInvalidEmail": "该电子邮件无效!",
+ "RegistrationFailedPasswordMismatch": "密码不匹配!",
+ "RegistrationFailedCreateError": "无法创建您的帐户!",
+ "RegistrationSuccess": "账号创建成功!",
+ "RegistrationEmailVerifyReminder": "验证码已发送至您的电子邮件,请前往进行验证。",
+ "RegistrationCreateCharReminder": "在正式游玩之前,您需要创建一个角色。",
+ "NoCharactersGUIMessage": "暂无角色。要创建一个吗?",
+ "NoCharactersGUIWindowTitle": "无角色",
+ "NoCharactersChatMessage": "暂无角色。使用 {1} 新建一个角色。",
+ "NeedEmailFor2FA": "开启双重验证前,请先添加您的电子邮件。",
+ "NeedEmailVerifiedFor2FA": "开启双重验证前,请先验证您的电子邮件。",
+ "SetEmailHelpTip": "使用 {1} 以设置您的电子邮件。",
+ "VerifyEmailHelpTip": "使用 {1} 以验证您的电子邮件。",
"ADDED-13FEB2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations.",
- "NearbyRadio": "Nearby radio",
- "FromRadio": "From radio",
- "ToRadio": "To radio",
- "NeedToEnterPropertyCommand": "You need to enter the {1} first! Use {2} to enter and exit",
- "NeedToEnterPropertyKeyPress": "You need to enter the {1} first! Press {2} to enter and exit",
- "InventoryFullCantCarry": "You don't have any space to carry this (full inventory)!",
- "NotEnoughCashNeedAmountMore": "You don't have enough money! You need {1} more!",
- "AmountMustBeMoreThan": "The amount must be more than {1}!",
- "WeaponBanned": "You are not allowed to buy or use weapons!",
- "TimeNotNumber": "The time must be a number",
- "HeaderDefaultBusinessItemTypes": "Business Item Templates",
- "FixingStuck": "Fixing your position and virtual world ...",
- "CantUseCommandYet": "You must wait before you can use this command again!",
- "NotATester": "You are not a tester!",
- "AccessDenied": "AccessDenied",
- "InvalidSkin": "That skin is invalid!",
- "HeaderInteriorTypes": "Interiors List",
- "ViewInventoryKeyPressTip": "Press {1} to see your items",
- "ViewInventoryCommandTip": "Use {1} to see your items"
-}
+ "NearbyRadio": "附近电台",
+ "FromRadio": "起始电台",
+ "ToRadio": "终止电台",
+ "NeedToEnterPropertyCommand": "你得先进入 {1} !使用 {2} 以进入或退出。",
+ "NeedToEnterPropertyKeyPress": "你得先进入 {1} !使用 {2} 以进入或退出。",
+ "InventoryFullCantCarry": "库存已满!",
+ "NotEnoughCashNeedAmountMore": "没有足够现金!你需要多加 {1} !",
+ "AmountMustBeMoreThan": "数额必须大于 {1}!",
+ "WeaponBanned": "你已被禁止购买及使用武器!",
+ "TimeNotNumber": "设定的时间非有效数值",
+ "HeaderDefaultBusinessItemTypes": "企业项目模板",
+ "FixingStuck": "修复你当前的位置和虚拟世界 ...",
+ "CantUseCommandYet": "稍后才能再次使用该指令!",
+ "NotATester": "非测试者",
+ "AccessDenied": "拒绝访问",
+ "InvalidSkin": "该皮肤无效!",
+ "HeaderInteriorTypes": "内部场景列表",
+ "ViewInventoryKeyPressTip": "按下 {1} 以查看你的全部物品",
+ "ViewInventoryCommandTip": "使用 {1} 以查看你的全部物品",
+ "GUIAccountSettingToggle": "已切换至 {1} GUI",
+
+ "ADDED-23MAR2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations",
+ "CarCommandHelp": "前往汽车经销商购买新车,使用 {1} 以获取更多信息。",
+ "SkinCommandHelp": "前往服装店购买新衣服,使用 {1} 以获取更多信息。",
+ "BusinessVehiclesRespawned": "管理员已重置所有企业车辆!",
+ "JobVehiclesRespawned": "管理员已重置所有工作车辆!",
+ "PlayerVehiclesRespawned": "管理员已重置所有玩家车辆!",
+ "ClanVehiclesRespawned": "管理员已重置所有帮派车辆!",
+ "PublicVehiclesRespawned": "管理员已重置所有公众!",
+ "EmptyVehiclesRespawned": "管理员已重置所有空闲车辆!",
+ "AllVehiclesRespawned": "管理员已重置所有车辆!",
+ "AllVehiclesReloaded": "管理员已重载所有车辆!",
+ "YourVehicleRespawned": "你的车辆已重生!",
+ "PlayerIPBanned": "{1} 被封禁 IP!",
+ "PlayerCharacterBanned": "{1} 被封禁角色!",
+ "PlayerSubNetBanned": "{1} 被封禁网段!",
+ "CantModifyBusiness": "你无法操作或修改这个企业!",
+ "CantModifyHouse": "你无法操作或修改此住宅!",
+ "ServerTimeSet": "{1} 已将时间设定为 {2}",
+ "ServerWeatherSet": "{1} 已将天气设定为 {2}",
+ "ServerSnowSet": "{1} 已调整:落雪-{2},积雪-{3}",
+ "AllJobsReloaded": "管理员已重置所有职业!",
+ "ServerLogoSet": "{1} 已设定:服务器 LOGO 状态-{2}",
+ "ServerGUISet": "{1} 已设定:服务器 GUI 状态-{2}",
+ "ServerBusinessBlipsSet": "{1} 已设定:服务器企业图例显示状态-{2}",
+ "ServerHouseBlipsSet": "{1} 已设定:服务器住宅图例显示状态-{2}",
+ "ServerJobBlipsSet": "{1} 已设定:服务器职业图例显示状态-{2}",
+ "ServerBusinessPickupsSet": "{1} 已设定:服务器企业拾取物状态-{2}",
+ "ServerHousePickupsSet": "{1} 已设定:服务器住宅拾取物状态-{2}",
+ "ServerJobPickupsSet": "{1} 已设定:服务器职业拾取物状态-{2}",
+ "BusinessBuyItemsLabel": "使用 {1} 以购买物品",
+ "PropertyEnterCommandLabel": "使用 {1} 以进入",
+ "PropertyEnterKeyPressLabel": "按下 {1} 以进入",
+ "PropertyForSaleLabel": "售价:${1}",
+ "PropertyForRentLabel": "租价:每个发薪日需 ${1}",
+ "RemainingTaxPaidInMoney": "你以 ${1} 现金支付了剩下的税款",
+ "LostMoneyFromTaxes": "你应缴纳的税款超过了你的薪水!",
+ "NextPaycheckRepossessionWarning": "若无足够的现金来支付下一份薪水的税款,你将失去一些资产!",
+ "NotEnoughMoneyForTax": "没有足够的现金来支付税款",
+ "AssetsRepossessedForTax": "因未缴纳税款,你已失去 {1} 辆车,{2} 处住宅,{3} 处企业!",
+ "Closed": "Closed",
+ "Open": "Open",
+ "VehicleDealershipLabel": "Enter a vehicle as driver to buy it",
+ "TakeJobLabel": "Use {1} to work here",
+ "StartWorkLabel": "Use {1} to start working",
+ "JobEquipAndUniformLabel": "Use {1} and {2} for job stuff, or {3} to stop working",
+ "NotYourJobLabel": "You already have a different job. Use {1} if you want this one",
+ "JobLabel": "{1} Job",
+ "PaydayBonusSet": "{1} set the payday bonus to ${2}",
+ "AllHousesReloaded": "All houses have been reloaded by an admin",
+ "AllRadioStationsReloaded": "All radio stations have been reloaded by an admin!",
+ "PlayerKicked": "{1} has been kicked from the server",
+ "AllBusinessesReloaded": "All businesses have been reloaded by an admin!",
+ "UnableToDoThat": "You aren't able to do that",
+ "SetVehicleClanConfirmMessage": "Are you sure you want to give this vehicle to your clan?",
+ "SetVehicleClanConfirmTitle": "Warning!",
+ "SetItemPriceBelowOrderPriceMessage": "Are you sure you want to set the item price below it's order price? You will lose ${1} every purchase!",
+ "SetItemPriceBelowOrderPriceTitle": "Warning!",
+ "MustOwnVehicle": "You don't own this vehicle!"
+}
\ No newline at end of file
diff --git a/locale/english.json b/locale/english.json
index 5f68c88e..d6509979 100644
--- a/locale/english.json
+++ b/locale/english.json
@@ -1,6 +1,7 @@
{
"TranslationProvidedBy": "Vortrex",
"LocaleEnglishName": "English",
+
"LocaleNativeName": "English",
"LocaleOffer": "This server is available in English. Use {1} to use it.",
"LocaleChanged1": "Your language is now set to {1}",
@@ -10,9 +11,9 @@
"HeaderHelpMainList": "Help Categories",
"AccentNotFound": "Accent not found",
"AccentSet": "You set your accent to {1}",
- "AnimationNotFound": "That animation doesn't exist",
+ "InvalidAnimation": "That animation doesn't exist",
"AnimationCommandTip": "Use {1} to see a list of valid animations",
- "AnimationInvalidDistance": "The distance must be between 0 and 3",
+ "InvalidAnimationDistance": "The distance must be between 0 and 3",
"AnimationStopCommandTip": "Use {1} to stop your animation",
"CantBanClient": "You cannot ban this person",
"PlayerAccountBanned": "{1} has been account banned",
@@ -263,7 +264,7 @@
"KeyBindHelp": [
"You can set your own key binds. Use {1} to see your binded keys.",
"Use {1} to add a new keybind and {2} to remove one.",
- "Default keys are: {1} for vehicle engine, {1} for lights, and {3} for lock/unlock",
+ "Default keys are: {1} for vehicle engine, {2} for lights, and {3} for lock/unlock",
"Press {1} to see your items and {2} to equip an item or {3} to unequip all.",
"Press {1} to use the item you're holding, press {2} to drop it, or press {3} to pickup an item from the ground."
],
@@ -393,5 +394,65 @@
"InvalidSkin": "That skin is invalid!",
"HeaderInteriorTypes": "Interiors List",
"ViewInventoryKeyPressTip": "Press {1} to see your items",
- "ViewInventoryCommandTip": "Use {1} to see your items"
-}
+ "ViewInventoryCommandTip": "Use {1} to see your items",
+ "GUIAccountSettingToggle": "You have turned {1} GUI",
+
+ "ADDED-23MAR2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations",
+ "CarCommandHelp": "You can buy a car by visiting a vehicle dealership. Use {1} for more information.",
+ "SkinCommandHelp": "You can change your skin by visiting a clothes store. Use {1} for more info.",
+ "BusinessVehiclesRespawned": "🚗 All business vehicles have been respawned by an admin!",
+ "JobVehiclesRespawned": "🚗 All job vehicles have been respawned by an admin!",
+ "PlayerVehiclesRespawned": "🚗 All player vehicles have been respawned by an admin!",
+ "ClanVehiclesRespawned": "🚗 All clan vehicles have been respawned by an admin!",
+ "PublicVehiclesRespawned": "🚗 All public have been respawned by an admin!",
+ "EmptyVehiclesRespawned": "🚗 All empty vehicles have been respawned by an admin!",
+ "AllVehiclesRespawned": "🚗 All vehicles have been respawned by an admin!",
+ "AllVehiclesReloaded": "🚗 All vehicles have been reloaded by an admin!",
+ "YourVehicleRespawned": "🚗 Your vehicle has been respawned!",
+ "PlayerIPBanned": "💀 {1} has been IP banned!",
+ "PlayerCharacterBanned": "💀 {1} has been character banned!",
+ "PlayerSubNetBanned": "💀 {1} has been subnet banned!",
+ "CantModifyBusiness": "You can't manage or modify this business!",
+ "CantModifyHouse": "You can't manage or modify this house!",
+ "ServerTimeSet": "⏰ {1} set the time to {2}",
+ "ServerWeatherSet": "☁️ {1} set the weather to {2}",
+ "ServerSnowSet": "❄️ {1} turned falling snow {2} and ground snow {3}",
+ "AllJobsReloaded": "💼 All server jobs have been reloaded by an admin",
+ "ServerLogoSet": "{1} turned the server logo image {2}",
+ "ServerGUISet": "🗔 {1} turned GUI for this server {2}",
+ "ServerBusinessBlipsSet": "🏢 {1} turned all business blips {2}",
+ "ServerHouseBlipsSet": "🏘️ {1} turned all house blips {2}",
+ "ServerJobBlipsSet": "💼 {1} turned all job blips {2}",
+ "ServerBusinessPickupsSet": "🏢 {1} turned all business pickups {2}",
+ "ServerHousePickupsSet": "🏘️ {1} turned all house pickups {2}",
+ "ServerJobPickupsSet": "💼 {1} turned on all job pickups {2}",
+ "BusinessBuyItemsLabel": "Use {1} to purchase items",
+ "PropertyEnterCommandLabel": "Use {1} to enter",
+ "PropertyEnterKeyPressLabel": "Press {1} to enter",
+ "PropertyForSaleLabel": "For sale: ${1}",
+ "PropertyForRentLabel": "For rent: ${1} every payday",
+ "RemainingTaxPaidInMoney": "You covered the remaining taxes with ${1} in cash.",
+ "LostMoneyFromTaxes": "You lost money since your taxes are more than your paycheck!",
+ "NextPaycheckRepossessionWarning": "If you don't have enough cash to cover taxes on next paycheck, you will lose stuff!",
+ "NotEnoughMoneyForTax": "You don't have enough money to cover your taxes!",
+ "AssetsRepossessedForTax": "You lost {1} vehicles, {2} houses, and {3} businesses because you couldn't pay taxes!",
+ "Closed": "Closed",
+ "Open": "Open",
+ "VehicleDealershipLabel": "Enter a vehicle as driver to buy it",
+ "TakeJobLabel": "Use {1} to work here",
+ "StartWorkLabel": "Use {1} to start working",
+ "JobEquipAndUniformLabel": "Use {1} and {2} for job stuff, or {3} to stop working",
+ "NotYourJobLabel": "You already have a different job. Use {1} if you want this one",
+ "JobLabel": "{1} Job",
+ "PaydayBonusSet": "🤑 {1} set the payday bonus to ${2}",
+ "AllHousesReloaded": "🏘️ All houses have been reloaded by an admin",
+ "AllRadioStationsReloaded": "📻 All radio stations have been reloaded by an admin!",
+ "PlayerKicked": "🦶 {1} has been kicked from the server",
+ "AllBusinessesReloaded": "🏢 All businesses have been reloaded by an admin!",
+ "UnableToDoThat": "You aren't able to do that",
+ "SetVehicleClanConfirmMessage": "Are you sure you want to give this vehicle to your clan?",
+ "SetVehicleClanConfirmTitle": "Warning!",
+ "SetItemPriceBelowOrderPriceMessage": "Are you sure you want to set the item price below it's order price? You will lose ${1} every purchase!",
+ "SetItemPriceBelowOrderPriceTitle": "Warning!",
+ "MustOwnVehicle": "You don't own this vehicle!"
+}
\ No newline at end of file
diff --git a/locale/polish.json b/locale/polish.json
index e38d5e1f..08eb8985 100644
--- a/locale/polish.json
+++ b/locale/polish.json
@@ -1,6 +1,7 @@
{
"TranslationProvidedBy": "Suprise444",
"LocaleEnglishName": "Polish",
+
"LocaleNativeName": "Polski",
"LocaleOffer": "Ten serwer jest dostępny w języku Polskim. Użyj {1} aby go użyć.",
"LocaleChanged1": "Twój język jest ustawiony na {1}",
@@ -10,9 +11,9 @@
"HeaderHelpMainList": "Pomoc - Kategorie",
"AccentNotFound": "Akcent nie znaleziony",
"AccentSet": "Ustawiłeś swój akcent na {1}",
- "AnimationNotFound": "Ta animcja nie istnieje",
+ "InvalidAnimation": "Ta animcja nie istnieje",
"AnimationCommandTip": "Użyj {1} aby zobaczyć listę działających animacji",
- "AnimationInvalidDistance": "Dystans musi być między 0 i 3",
+ "InvalidAnimationDistance": "Dystans musi być między 0 i 3",
"AnimationStopCommandTip": "Użyj {1} aby zatrzymać swoją animacje",
"CantBanClient": "Nie możesz zbanować tej osoby",
"PlayerAccountBanned": "{1} został zbanowany",
@@ -263,7 +264,7 @@
"KeyBindHelp": [
"Możesz zmienić przypisania klawiszy. Użyj {1} aby zobaczyć twoje przypisane klawisze.",
"Użyj {1} aby dodać nowe przypisanie i {2} aby je usunąć.",
- "Domyślnymi przyciskami są: {1} aby uruchomić pojazd, {1} aby użyć świateł, and {3} aby otworzyć/zamknąć pojazd",
+ "Domyślnymi przyciskami są: {1} aby uruchomić pojazd, {2} aby użyć świateł, and {3} aby otworzyć/zamknąć pojazd",
"Naciśnij {1} aby zobaczyć swoje itemy i {2} aby wyposażyć się w jakiś przedmiot lub {3} aby go schować.",
"Naciśnij {1} aby użyć przedmiot, który trzymasz, naciśnij {2} aby go upuścić lub naciśnij {3} aby podnieść jakiś przedmiot z ziemi."
],
@@ -393,5 +394,65 @@
"InvalidSkin": "That skin is invalid!",
"HeaderInteriorTypes": "Interiors List",
"ViewInventoryKeyPressTip": "Press {1} to see your items",
- "ViewInventoryCommandTip": "Use {1} to see your items"
+ "ViewInventoryCommandTip": "Use {1} to see your items",
+ "GUIAccountSettingToggle": "You have turned {1} GUI",
+
+ "ADDED-23MAR2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations",
+ "CarCommandHelp": "You can buy a car by visiting a vehicle dealership. Use {1} for more information.",
+ "SkinCommandHelp": "You can change your skin by visiting a clothes store. Use {1} for more info.",
+ "BusinessVehiclesRespawned": "All business vehicles have been respawned by an admin!",
+ "JobVehiclesRespawned": "All job vehicles have been respawned by an admin!",
+ "PlayerVehiclesRespawned": "All player vehicles have been respawned by an admin!",
+ "ClanVehiclesRespawned": "All clan vehicles have been respawned by an admin!",
+ "PublicVehiclesRespawned": "All public have been respawned by an admin!",
+ "EmptyVehiclesRespawned": "All empty vehicles have been respawned by an admin!",
+ "AllVehiclesRespawned": "All vehicles have been respawned by an admin!",
+ "AllVehiclesReloaded": "All vehicles have been reloaded by an admin!",
+ "YourVehicleRespawned": "Your vehicle has been respawned",
+ "PlayerIPBanned": "{1} has been IP banned!",
+ "PlayerCharacterBanned": "{1} has been character banned!",
+ "PlayerSubNetBanned": "{1} has been subnet banned!",
+ "CantModifyBusiness": "You can't manage or modify this business",
+ "CantModifyHouse": "You can't manage or modify this house",
+ "ServerTimeSet": "{1} set the time to {2}",
+ "ServerWeatherSet": "{1} set the weather to {2}",
+ "ServerSnowSet": "{1} turned falling snow {2} and ground snow {3}",
+ "AllJobsReloaded": "All server jobs have been reloaded by an admin",
+ "ServerLogoSet": "{1} turned the server logo image {2}",
+ "ServerGUISet": "{1} turned GUI for this server {2}",
+ "ServerBusinessBlipsSet": "{1} turned all business blips {2}",
+ "ServerHouseBlipsSet": "{1} turned all house blips {2}",
+ "ServerJobBlipsSet": "{1} turned all job blips {2}",
+ "ServerBusinessPickupsSet": "{1} turned all business pickups {2}",
+ "ServerHousePickupsSet": "{1} turned all house pickups {2}",
+ "ServerJobPickupsSet": "{1} turned on all job pickups {2}",
+ "BusinessBuyItemsLabel": "Use {1} to purchase items",
+ "PropertyEnterCommandLabel": "Use {1} to enter",
+ "PropertyEnterKeyPressLabel": "Press {1} to enter",
+ "PropertyForSaleLabel": "For sale: ${1}",
+ "PropertyForRentLabel": "For rent: ${1} every payday",
+ "RemainingTaxPaidInMoney": "You covered the remaining taxes with ${1} in cash.",
+ "LostMoneyFromTaxes": "You lost money since your taxes are more than your paycheck!",
+ "NextPaycheckRepossessionWarning": "If you don't have enough cash to cover taxes on next paycheck, you will lose stuff!",
+ "NotEnoughMoneyForTax": "You don't have enough money to cover your taxes!",
+ "AssetsRepossessedForTax": "You lost {1} vehicles, {2} houses, and {3} businesses because you couldn't pay taxes!",
+ "Closed": "Closed",
+ "Open": "Open",
+ "VehicleDealershipLabel": "Enter a vehicle as driver to buy it",
+ "TakeJobLabel": "Use /takejob to work here",
+ "StartWorkLabel": "Use /startwork to start working",
+ "JobEquipAndUniformLabel": "Use /uniform and /equip for job stuff, or /stopwork to stop working",
+ "NotYourJobLabel": "You already have a different job. Use /quitjob if you want this one",
+ "JobLabel": "{1} Job",
+ "PaydayBonusSet": "{1} set the payday bonus to ${2}",
+ "AllHousesReloaded": "All houses have been reloaded by an admin",
+ "AllRadioStationsReloaded": "All radio stations have been reloaded by an admin!",
+ "PlayerKicked": "{1} has been kicked from the server",
+ "AllBusinessesReloaded": "All businesses have been reloaded by an admin!",
+ "UnableToDoThat": "You aren't able to do that",
+ "SetVehicleClanConfirmMessage": "Are you sure you want to give this vehicle to your clan?",
+ "SetVehicleClanConfirmTitle": "Warning!",
+ "SetItemPriceBelowOrderPriceMessage": "Are you sure you want to set the item price below it's order price? You will lose ${1} every purchase!",
+ "SetItemPriceBelowOrderPriceTitle": "Warning!",
+ "MustOwnVehicle": "You don't own this vehicle!"
}
diff --git a/locale/russian.json b/locale/russian.json
index 82a535d2..2792287a 100644
--- a/locale/russian.json
+++ b/locale/russian.json
@@ -1,6 +1,7 @@
{
"TranslationProvidedBy": "VNDTTS",
"LocaleEnglishName": "Russian",
+
"LocaleNativeName": "Русский",
"LocaleOffer": "Этот сервер доступен на русском. Используйте {1} чтобы его использовать.",
"LocaleChanged1": "Ваш язык был установлен на {1}",
@@ -10,9 +11,9 @@
"HeaderHelpMainList": "Помощь Категории",
"AccentNotFound": "Не удалось найти акцент",
"AccentSet": "Вы установили свой акцент на {1}",
- "AnimationNotFound": "Такой анимации не существует",
+ "InvalidAnimation": "Такой анимации не существует",
"AnimationCommandTip": "Используйте {1} чтобы просмотреть список доступных анимаций",
- "AnimationInvalidDistance": "Дистанция должна быть между 0 и 3",
+ "InvalidAnimationDistance": "Дистанция должна быть между 0 и 3",
"AnimationStopCommandTip": "Используйте {1} чтобы остановить анимацию",
"CantBanClient": "Вы не можете забанить этого игрока",
"PlayerAccountBanned": "Аккаунт {1} был заблокирован ",
@@ -263,7 +264,7 @@
"KeyBindHelp": [
"Вы можете сами создавать ваши привязки на кнопки. Используйте {1} чтобы просмотреть ваши привязки.",
"Используйте {1} чтобы добавить новую приязку или {2} чтобы убрать ее.",
- "Стандартные привязки: {1} для мотора, {1} для фар, и {3} для открытия/закрытия",
+ "Стандартные привязки: {1} для мотора, {2} для фар, и {3} для открытия/закрытия",
"Используйте {1} чтобы просмотреть ваши предметы {2} чтобы экипировать предмет или {3} чтобы убрать.",
"Используйте {1} чтобы использвать предмет который вы держите в руках, используйте {2} чтобы его выбростить, или используйте {3} чтобы подобрать предмет."
],
@@ -392,5 +393,65 @@
"InvalidSkin": "That skin is invalid!",
"HeaderInteriorTypes": "Interiors List",
"ViewInventoryKeyPressTip": "Press {1} to see your items",
- "ViewInventoryCommandTip": "Use {1} to see your items"
+ "ViewInventoryCommandTip": "Use {1} to see your items",
+ "GUIAccountSettingToggle": "You have turned {1} GUI",
+
+ "ADDED-23MAR2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations",
+ "CarCommandHelp": "You can buy a car by visiting a vehicle dealership. Use {1} for more information.",
+ "SkinCommandHelp": "You can change your skin by visiting a clothes store. Use {1} for more info.",
+ "BusinessVehiclesRespawned": "All business vehicles have been respawned by an admin!",
+ "JobVehiclesRespawned": "All job vehicles have been respawned by an admin!",
+ "PlayerVehiclesRespawned": "All player vehicles have been respawned by an admin!",
+ "ClanVehiclesRespawned": "All clan vehicles have been respawned by an admin!",
+ "PublicVehiclesRespawned": "All public have been respawned by an admin!",
+ "EmptyVehiclesRespawned": "All empty vehicles have been respawned by an admin!",
+ "AllVehiclesRespawned": "All vehicles have been respawned by an admin!",
+ "AllVehiclesReloaded": "All vehicles have been reloaded by an admin!",
+ "YourVehicleRespawned": "Your vehicle has been respawned",
+ "PlayerIPBanned": "{1} has been IP banned!",
+ "PlayerCharacterBanned": "{1} has been character banned!",
+ "PlayerSubNetBanned": "{1} has been subnet banned!",
+ "CantModifyBusiness": "You can't manage or modify this business",
+ "CantModifyHouse": "You can't manage or modify this house",
+ "ServerTimeSet": "{1} set the time to {2}",
+ "ServerWeatherSet": "{1} set the weather to {2}",
+ "ServerSnowSet": "{1} turned falling snow {2} and ground snow {3}",
+ "AllJobsReloaded": "All server jobs have been reloaded by an admin",
+ "ServerLogoSet": "{1} turned the server logo image {2}",
+ "ServerGUISet": "{1} turned GUI for this server {2}",
+ "ServerBusinessBlipsSet": "{1} turned all business blips {2}",
+ "ServerHouseBlipsSet": "{1} turned all house blips {2}",
+ "ServerJobBlipsSet": "{1} turned all job blips {2}",
+ "ServerBusinessPickupsSet": "{1} turned all business pickups {2}",
+ "ServerHousePickupsSet": "{1} turned all house pickups {2}",
+ "ServerJobPickupsSet": "{1} turned on all job pickups {2}",
+ "BusinessBuyItemsLabel": "Use {1} to purchase items",
+ "PropertyEnterCommandLabel": "Use {1} to enter",
+ "PropertyEnterKeyPressLabel": "Press {1} to enter",
+ "PropertyForSaleLabel": "For sale: ${1}",
+ "PropertyForRentLabel": "For rent: ${1} every payday",
+ "RemainingTaxPaidInMoney": "You covered the remaining taxes with ${1} in cash.",
+ "LostMoneyFromTaxes": "You lost money since your taxes are more than your paycheck!",
+ "NextPaycheckRepossessionWarning": "If you don't have enough cash to cover taxes on next paycheck, you will lose stuff!",
+ "NotEnoughMoneyForTax": "You don't have enough money to cover your taxes!",
+ "AssetsRepossessedForTax": "You lost {1} vehicles, {2} houses, and {3} businesses because you couldn't pay taxes!",
+ "Closed": "Closed",
+ "Open": "Open",
+ "VehicleDealershipLabel": "Enter a vehicle as driver to buy it",
+ "TakeJobLabel": "Use {1} to work here",
+ "StartWorkLabel": "Use {1} to start working",
+ "JobEquipAndUniformLabel": "Use {1} and {2} for job stuff, or {3} to stop working",
+ "NotYourJobLabel": "You already have a different job. Use {1} if you want this one",
+ "JobLabel": "{1} Job",
+ "PaydayBonusSet": "{1} set the payday bonus to ${2}",
+ "AllHousesReloaded": "All houses have been reloaded by an admin",
+ "AllRadioStationsReloaded": "All radio stations have been reloaded by an admin!",
+ "PlayerKicked": "{1} has been kicked from the server",
+ "AllBusinessesReloaded": "All businesses have been reloaded by an admin!",
+ "UnableToDoThat": "You aren't able to do that",
+ "SetVehicleClanConfirmMessage": "Are you sure you want to give this vehicle to your clan?",
+ "SetVehicleClanConfirmTitle": "Warning!",
+ "SetItemPriceBelowOrderPriceMessage": "Are you sure you want to set the item price below it's order price? You will lose ${1} every purchase!",
+ "SetItemPriceBelowOrderPriceTitle": "Warning!",
+ "MustOwnVehicle": "You don't own this vehicle!"
}
diff --git a/locale/slovak.json b/locale/slovak.json
new file mode 100644
index 00000000..fc3621ad
--- /dev/null
+++ b/locale/slovak.json
@@ -0,0 +1,458 @@
+{
+ "TranslationProvidedBy": "ZaKlaus",
+ "LocaleEnglishName": "Slovak",
+
+ "LocaleNativeName": "Slovak",
+ "LocaleOffer": "This server is available in Slovak. Use {1} to use it.",
+ "LocaleChanged1": "Your language is now set to {1}",
+ "LocaleChanged2": "The server will now display messages in {1}",
+ "LocaleChangedNote": "This does not change messages from other players",
+ "AccentsListHeader": "Accents",
+ "HeaderHelpMainList": "Help Categories",
+ "AccentNotFound": "Accent not found",
+ "AccentSet": "You set your accent to {1}",
+ "InvalidAnimation": "That animation doesn't exist",
+ "AnimationCommandTip": "Use {1} to see a list of valid animations",
+ "InvalidAnimationDistance": "The distance must be between 0 and 3",
+ "AnimationStopCommandTip": "Use {1} to stop your animation",
+ "CantBanClient": "You cannot ban this person",
+ "PlayerAccountBanned": "{1} has been account banned",
+ "ClanNotFound": "Clan not found",
+ "ClanNameTaken": "A clan with that name already exists",
+ "PlayerNotFound": "Player not found",
+ "ClanCantRemoveRanks": "You can't remove clan ranks",
+ "ClanCantAddRanks": "You can't add clan ranks",
+ "ClanRankNotFound": "Clan rank not found",
+ "ClanCantChangeMemberTag": "You can not change clan member's tags",
+ "ClanPlayerNotInSameClan": "That player is not in your clan",
+ "ClanCantChangeRankLevel": "You can not change clan rank's level",
+ "ClanCantChangeRankTag": "You can not change clan rank's tags",
+ "NameNotRegistered": "Your name is not registered! Use {1} to make an account.",
+ "AutomaticLoginIPToggle": "Automatic login by IP is now {1}",
+ "CouldNotRegisterAccount": "There was a problem creating your account. Please contact an admin.",
+ "RandomTipsToggle": "Random tips are now {1}",
+ "ActionTipsToggle": "Action tips are now {1}",
+ "AutoSpawnLastCharToggle": "Automatic spawn as last used character is {1}",
+ "AccountGUISettingToggle": "GUI is now {1}",
+ "On": "On",
+ "Off": "Off",
+ "Yes": "Yes",
+ "No": "No",
+ "True": "True",
+ "False": "False",
+ "Locked": "Locked",
+ "Unlocked": "Unlocked",
+ "PasswordNotGoodEnough": "The new password must meet the requirements!",
+ "PasswordNeedsBase": "Passwords must have at least {1}",
+ "PasswordNeedsCapitals": "{1} capital letters",
+ "PasswordNeedsNumbers": "{1} numbers",
+ "PasswordNeedsSymbols": "{1} symbols",
+ "PasswordsDontMatch": "The new password and confirm new password aren't the same!",
+ "PasswordChanged": "Your password has been changed!",
+ "AutoLoggedInIP": "You have been automatically logged in by IP!",
+ "WelcomeBack": "Welcome back to {1}, {2}! Please {3} to continue.",
+ "WelcomeNewPlayer": "Welcome to {1}, {2}! Please {3} to play.",
+ "InvalidPlayer": "Player not found!",
+ "InvalidBusiness": "Business not found!",
+ "InvalidHouse": "House not found!",
+ "InvalidVehicle": "Vehicle not found!",
+ "InvalidClan": "Clan not found!",
+ "InvalidClanRank": "Clan rank not found!",
+ "InvalidJob": "Job not found!",
+ "InvalidItem": "Item not found!",
+ "InvalidItemType": "Item type not found!",
+ "InvalidRadioStation": "Radio station not found!",
+ "InvalidGate": "Gate not found!",
+ "EntersProperty": "opens the door and enters the {1}",
+ "ExitsProperty": "opens the door and exits the {1}",
+ "EnterExitPropertyDoorLocked": "tries to open the {1} door but fails because it's locked",
+ "PropertyNoInterior": "This {1} does not have an interior, but you can still use commands at the door icon.",
+ "NoBusinessWithItemType": "There is no business with that item available",
+ "HeaderKeyBinds": "Key Binds",
+ "HeaderAccountHelp": "Account Help",
+ "HeaderVehicleHelp": "Vehicle Help",
+ "HeaderVehicleDealershipHelp": "Vehicle Dealership Help",
+ "HeaderJobHelp": "Job Help",
+ "HeaderChatHelp": "Chat Help",
+ "HeaderServerRules": "Server Rules",
+ "HeaderWebsiteInfo": "Website",
+ "HeaderDiscordInfo": "Discord",
+ "HeaderAnimationsList": "Animation List",
+ "HeaderPayAndSprayHelp": "Pay and Spray Help",
+ "HeaderAmmunationHelp": "Ammunation Help",
+ "HeaderVehicleTuneupHelp": "Vehicle Tune Help",
+ "HeaderBindableKeysHelp": "Bindable Keys",
+ "HeaderSkinHelp": "Clothes/Skin Help",
+ "HeaderBusinessHelp": "Business Help",
+ "HeaderClanHelp": "Clan Help",
+ "HeaderPlayerVehiclesList": "Player Vehicles ({1})",
+ "HeaderPlayerBusinessesList": "Player Businesses ({1})",
+ "HeaderClansList": "Clan List",
+ "HeaderAdminsList": "Admin List",
+ "HeaderBadgeInfo": "Badge Information",
+ "HeaderAccentsList": "Accent List",
+ "HeaderPlayerInfo": "Player Information ({1})",
+ "HeaderWealthandTaxHelp": "Wealth and Tax Information",
+ "HeaderCommandInfo": "Command Information ({1})",
+ "HeaderRadioHelp": "Radio Help",
+ "HeaderRadioStationsList": "Radio Stations",
+ "HeaderKeyBindsList": "Key Binds List",
+ "RadioVolumeChanged": "{1} You changed your streaming radio volume to {2}%",
+ "VolumeLevelNotNumber": "The volume level must be a number",
+ "RadioStationLocationInvalid": "You must be in a vehicle, house, or business or have a personal device to change the station!",
+ "ActionBusinessRadioStationChange": "changes the business radio station to {1} ({2})",
+ "ActionHouseRadioStationChange": "changes the house radio station to {1} ({2})",
+ "ActionVehicleRadioStationChange": "changes the vehicle radio station to {1} ({2})",
+ "ActionItemRadioStationChange": "changes the {1}'s station to {2} ({3})",
+ "RandomVehicleCommandsDisabled": "This is a random traffic vehicle and commands can't be used for it.",
+ "HouseDoorLock": "House {1} {2}!",
+ "BusinessDoorLock": "Business {1} {2}!",
+ "ServerGameModeRestarting": "The server game mode is restarting!",
+ "HeaderSelfItemList": "Your Inventory",
+ "HeaderPlayerItemList": "Player Inventory ({1})",
+ "HeaderHouseItemList": "House Inventory",
+ "HeaderBusinessFloorItemList": "Business Inventory (For Sale)",
+ "HeaderBusinessStorageItemList": "Business Inventory (Storage)",
+ "HeaderItemItemList": "{1}'s Inventory",
+ "ItemSlotNotNumber": "The item slot must be a number",
+ "ItemSlotMustBeBetween": "The item slot must be between {1} and {2}!",
+ "UseItemBugged": "The item you're trying to use is bugged. A bug report has been sent to the server developers.",
+ "PickupItemBugged": "The item you're trying to pickup is bugged. A bug report has been sent to the server developers.",
+ "DropItemBugged": "The item you're trying to drop is bugged. A bug report has been sent to the server developers.",
+ "HandsBusy": "Your hands are busy",
+ "CantUseItemInSkinChange": "You can't use an item while customizing your appearance",
+ "CantDropItemInSkinChange": "You can't drop an item while customizing your appearance",
+ "CantPickupItemInSkinChange": "You can't pickup an item while customizing your appearance",
+ "CantSwitchItemInSkinChange": "You can't switch an item while customizing your appearance",
+ "CantGiveItemInSkinChange": "You can't give an item while customizing your appearance",
+ "CantTakeItemInSkinChange": "You can't take an item while customizing your appearance",
+ "ItemUnequippableNoAmmo": "The {1} in slot {2} has no ammo, and can't be equipped!",
+ "NoSpaceSelfInventory": "You don't have any more space in your inventory",
+ "Business": "business",
+ "House": "house",
+ "Clan": "clan",
+ "Vehicle": "vehicle",
+ "Item": "item",
+ "ItemType": "item type",
+ "Gate": "gate",
+ "Door": "door",
+ "ClanRank": "clan rank",
+ "JobRank": "job rank",
+ "RadioStation": "radio station",
+ "Months": [
+ "January",
+ "February",
+ "March",
+ "April",
+ "May",
+ "June",
+ "July",
+ "August",
+ "September",
+ "October",
+ "November",
+ "December"
+ ],
+ "WeekDays": [
+ "Sunday",
+ "Monday",
+ "Tuesday",
+ "Wednesday",
+ "Thursday",
+ "Friday",
+ "Saturday"
+ ],
+ "CardinalDirections": [
+ "North",
+ "Northeast",
+ "East",
+ "Southeast",
+ "South",
+ "Southwest",
+ "West",
+ "Northwest"
+ ],
+ "NewPlayerReadyToPlay": [
+ "You have been given some cash. Use {1} to find places to buy items.",
+ "If you need money, jobs are the yellow dots on the radar.",
+ "For a car, visit the car dealership. You can also use a rental vehicle near spawn or take the train",
+ "Be sure to read the {1} and use {2} for info."
+ ],
+ "YourCurrentVehicleDeleted": "The vehicle you were in was deleted.",
+ "Distance": "Distance",
+ "Meters": "Meters",
+ "Feet": "Feet",
+ "Kilometers": "Kilometers",
+ "Miles": "Miles",
+ "MustBeVehicleDriver": "You must be the driver of the vehicle!",
+ "PlayerJoinedServer": "{1} has joined the game from {1}!",
+ "PlayerLeftServer": "{1} has left the game! ({1})",
+ "DisconnectReasons": [
+ "Lost Connection",
+ "Disconnected",
+ "Unsupported Client",
+ "Wrong Game",
+ "Incorrect Password",
+ "Unsupported Executable",
+ "Disconnected",
+ "Banned",
+ "Failed",
+ "Invalid Name",
+ "Crashed"
+ ],
+ "TakeItemFromHouse": "takes a {1} from the house",
+ "TakeItemFromBusinessStorage": "takes a {1} from the business storage",
+ "TakeItemFromBusiness": "takes a {1} from the business",
+ "TakeItemFromItem": "takes a {1} from the {2}",
+ "TakeItemFromVehicleTrunk": "takes a {1} from the trunk",
+ "TakeItemFromVehicleDash": "takes a {1} from the glove compartment",
+ "JobEquipmentInventoryKeyBindTip": "The job equipment is in your inventory. Press {1} to see them.",
+ "JobEquipmentInventoryCommandTip": "The job equipment is in your inventory. Use {1} to see them.",
+ "AccountHelp": [
+ "Do NOT share your password with anybody else. {1} staff will never ask you for your password",
+ "Use {1} to change your password, and {2} if you forgot it",
+ "Some settings you can use: {1}"
+ ],
+ "VehicleHelp": [
+ "Your personal vehicles will save wherever you or somebody else leaves them!",
+ "Visit dealerships to buy new vehicles (Use {1} for more information)",
+ "Some commands: {1}",
+ "Visit a mechanic garage to repair, colour, and tune up your car! {1} for info"
+ ],
+ "VehicleDealershipHelp": [
+ "Visit a vehicle dealer to buy new vehicles. Use {1} to find one.",
+ "At the dealer, enter a car you want to buy, and the price will be shown to you",
+ "If you want to buy the vehicle, use {1} and you will be given keys to test drive it around the parking lot.",
+ "Drive away from the dealership with the new vehicle to confirm the purchase."
+ ],
+ "JobHelp": [
+ "Visit job locations to get a job and earn money. Look for yellow spots on the map",
+ "At a job location, use {1} to get the job. Use {2} to quit your job",
+ "Use {1} to begin working. You can also get a job {2} and {3}",
+ "Most job vehicles are locked. Use {1} near one to enter it.",
+ "When entering a job vehicle, information on how to do the job will be shown to you."
+ ],
+ "ChatHelp": [
+ "There are two main types of chat: out-of-character (OOC) and in-character (IC)",
+ "Mixing these two types is not proper roleplay. See {1} for info.",
+ "Some chat commands: {1}",
+ "Some have shorter names available ({1} to talk, {2} to shout, etc)"
+ ],
+ "ServerRulesHelp": [
+ "Unrealistic actions (powergaming) are not allowed. You aren't superman.",
+ "No terrorist or terrorism roleplay is allowed.",
+ "Always follow instructions given by moderators and admins.",
+ "Do not mix the chats (metagaming). You can't use info in IC that was received OOC",
+ "Keep English in main chats. If you aren't good at English, use {1}"
+ ],
+ "AnimationHelp": [
+ "Animations allow you to enhance roleplay with visual actions",
+ "Use {1} or {2} with a name to use an animation.",
+ "To see a list of animations, use {1}"
+ ],
+ "WeaponHelp": [
+ "Visit an gun store to buy weapons. Use {1} to find one.",
+ "Buying a weapon requires a weapon license.",
+ "Weapon licenses are managed by the police department. Apply there to get one.",
+ "Weapons can also be purchased illegally from some businesses, weapon dealers, and clans."
+ ],
+ "SkinHelp": [
+ "At a clothing store, use {1} to purchase clothes",
+ "When you have a clothing item, equip and use it like any other item to show the skin selection (check {1} to learn how to use items)",
+ "Some skins are restricted to jobs, clans, or for other reasons."
+ ],
+ "KeyBindHelp": [
+ "You can set your own key binds. Use {1} to see your binded keys.",
+ "Use {1} to add a new keybind and {2} to remove one.",
+ "Default keys are: {1} for vehicle engine, {2} for lights, and {3} for lock/unlock",
+ "Press {1} to see your items and {2} to equip an item or {3} to unequip all.",
+ "Press {1} to use the item you're holding, press {2} to drop it, or press {3} to pickup an item from the ground."
+ ],
+ "BusinessHelp": [
+ "Use {1} to purchase items or {2} to see a list of what's for sale at any business",
+ "Businesses are shown with blue names above the icon at their entrance.",
+ "Business owner commands: {1}",
+ "A new car for sale will appear when you drive away from the dealer."
+ ],
+ "ClanHelp": [
+ "Ask an administrator to create a clan (Similar to factions/groups/families)",
+ "Clan owners have full control over their clan once it's created",
+ "Clan commands: {1}",
+ "More clan commands: {1}"
+ ],
+ "RadioStationHelp": [
+ "Use {1} to set the station for your vehicle, house, or business",
+ "Use {2} to see a list of stations",
+ "You can change your radio streaming volume using {1} with 0-100 as the percent"
+ ],
+ "WealthAndTaxHelp": [
+ "Your taxes on payday are {1} percent of your calculated wealth.",
+ "Your calculated wealth is a total sum based on how many vehicles, houses, and businesses you have.",
+ "Each vehicle is {1}, each house is {2}, and each business is {3}",
+ "Use {1} to see your current wealth, and {2} to see how much you'll pay in tax each payday"
+ ],
+ "MustBeInAVehicle": "You need to be in a vehicle!",
+ "MustBeInOrNearVehicle": "You need to be in or near a vehicle!",
+ "MustBeInVehicleFrontSeat": "You need to be in the vehicle front seats!",
+ "MustBeInVehicleDriverSeat": "You need to be the driver!",
+ "DontHaveVehicleKey": "You don't have a key for this vehicle!",
+ "NoGateAccess": "You don't have access to this gate!",
+ "GateBroken": "This gate is broken!",
+ "GateHacked": "The gate does not respond!",
+ "RadioJammed": "You hear only static from the radio.",
+ "VehicleNotForSale": "This vehicle is not for sale!",
+ "VehicleNotForRent": "This vehicle is not for rent!",
+ "BusinessNotForSale": "This business is not for sale!",
+ "BusinessNotForRent": "This business is not for rent!",
+ "HouseNotForSale": "This house is not for sale!",
+ "HouseNotForRent": "This house is not for rent!",
+ "DealershipPurchaseTestDrive": "Drive the vehicle away from the dealership to buy it, or get out to cancel.",
+ "DealershipPurchaseExitedVehicle": "You canceled the vehicle purchase by exiting the vehicle!",
+ "VehiclePurchaseComplete": "This vehicle is now yours! It will save wherever you leave it.",
+ "VehiclePurchaseNotEnoughMoney": "You don't have enough money to buy this vehicle!",
+ "HousePurchaseNotEnoughMoney": "You don't have enough money to buy this house!",
+ "BusinessPurchaseNotEnoughMoney": "You don't have enough money to buy this business!",
+ "Locales": {
+ "English": "English",
+ "Russian": "Russian",
+ "Spanish": "Spanish",
+ "German": "German",
+ "Dutch": "Dutch",
+ "Polish": "Polish"
+ },
+
+ "ADDED-21JAN2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations.",
+ "HeaderPlayerHousesList": "Player Houses ({1})",
+ "HeaderPlayerStaffFlagsList": "Player Staff Flags ({1})",
+ "HeaderStaffFlagsList": "Staff Flags",
+ "NonRPName": "Non-RP name! Choose a new one:",
+ "InvalidStaffFlag": "Staff flag not found!",
+ "InvalidClanFlag": "Clan flag not found!",
+ "InvalidLocale": "Language not found!",
+ "HeaderJobUniformList": "Job Uniforms ({1})",
+ "HeaderJobEquipmentList": "Job Equipment ({1})",
+ "InvalidJobUniform": "Job uniform not found!",
+ "InvalidJobEquipment": "Job equipment not found!",
+ "HeaderVehiclesInRangeList": "Vehicles within {1}",
+ "NoVehiclesWithInRange": "There are no vehicles within {1}",
+ "AmountNotNumber": "The amount must be a number!",
+ "NeedToBeWorking": "You need to be working! Use {1} at a job location or near a job vehicle.",
+ "NeedToBeOnJobRoute": "You need to be doing a job route! Use {1} in a job vehicle",
+ "CurrentJobRouteDeleted": "The job route you were on has been deleted by an admin",
+ "CurrentJobRouteVehicleColoursChanged": "Your job route's vehicle colours were changed by an admin",
+ "NotYourJob": "This is not your job!",
+ "JobPoints": "You can get a job by going the yellow points on the map.",
+ "QuitJobToTakeAnother": "If you want this job, use {1} to quit your current job.",
+ "NotAJobVehicle": "This is not a job vehicle!",
+ "NotYourJobVehicle": "This is not your job's vehicle!",
+ "JobRouteDisabled": "The job route you were on has been disabled by an admin",
+ "HeaderPickupTypes": "Pickup Types",
+ "HeaderBlipTypes": "Map Icon Types",
+ "InvalidGPSLocation": "There are no locations with that name or type",
+ "HeaderBusinessList": "Businesses",
+ "VehicleForSale": "This {1} is buyable for {2}! Use {3} if you want to buy it",
+ "VehicleForRent": "This {1} is rentable for {2}! Use {3} if you want to rent it",
+
+ "ADDED-31JAN2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations.",
+ "LoginFailedInvalidPassword": "Invalid password! {1} attempts remaining",
+ "LoginFailedNoPassword": "You must enter a password! ! {1} attempts remaining",
+ "RegistrationFailedNoPassword": "You must enter a password!",
+ "RegistrationFailedNoPasswordConfirm": "You must confirm the password!",
+ "RegistrationFailedNoEmail": "You must enter an email!",
+ "AccountNameAlreadyRegistered": "Your name is already registered!",
+ "AlreadyLoggedIn": "You are already logged in!",
+ "RegistrationFailedInvalidEmail": "That email is invalid!",
+ "RegistrationFailedPasswordMismatch": "The passwords don't match!",
+ "RegistrationFailedCreateError": "Your account couldn't be created!",
+ "RegistrationSuccess": "Your account has been created!",
+ "RegistrationEmailVerifyReminder": "Don't forget to verify your email! A verification code has been sent to you.",
+ "RegistrationCreateCharReminder": "To play on the server, you will need to make a character.",
+ "NoCharactersGUIMessage": "You have no characters. Would you like to make one?",
+ "NoCharactersGUIWindowTitle": "No characters",
+ "NoCharactersChatMessage": "You have no characters. Use {1} to make one.",
+ "NeedEmailFor2FA": "You need to add your email to your account to use two-factor authentication.",
+ "NeedEmailVerifiedFor2FA": "You need to verify your email to use two-factor authentication.",
+ "SetEmailHelpTip": "Use {1} to set your email.",
+ "VerifyEmailHelpTip": "Use {1} to verify your email.",
+
+ "ADDED-13FEB2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations.",
+ "NearbyRadio": "Nearby radio",
+ "FromRadio": "From radio",
+ "ToRadio": "To radio",
+ "NeedToEnterPropertyCommand": "You need to enter the {1} first! Use {2} to enter and exit",
+ "NeedToEnterPropertyKeyPress": "You need to enter the {1} first! Press {2} to enter and exit",
+ "InventoryFullCantCarry": "You don't have any space to carry this (full inventory)!",
+ "NotEnoughCashNeedAmountMore": "You don't have enough money! You need {1} more!",
+ "AmountMustBeMoreThan": "The amount must be more than {1}!",
+ "WeaponBanned": "You are not allowed to buy or use weapons!",
+ "TimeNotNumber": "The time must be a number",
+ "HeaderDefaultBusinessItemTypes": "Business Item Templates",
+ "FixingStuck": "Fixing your position and virtual world ...",
+ "CantUseCommandYet": "You must wait before you can use this command again!",
+ "NotATester": "You are not a tester!",
+ "AccessDenied": "AccessDenied",
+ "InvalidSkin": "That skin is invalid!",
+ "HeaderInteriorTypes": "Interiors List",
+ "ViewInventoryKeyPressTip": "Press {1} to see your items",
+ "ViewInventoryCommandTip": "Use {1} to see your items",
+ "GUIAccountSettingToggle": "You have turned {1} GUI",
+
+ "ADDED-23MAR2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations",
+ "CarCommandHelp": "You can buy a car by visiting a vehicle dealership. Use {1} for more information.",
+ "SkinCommandHelp": "You can change your skin by visiting a clothes store. Use {1} for more info.",
+ "BusinessVehiclesRespawned": "All business vehicles have been respawned by an admin!",
+ "JobVehiclesRespawned": "All job vehicles have been respawned by an admin!",
+ "PlayerVehiclesRespawned": "All player vehicles have been respawned by an admin!",
+ "ClanVehiclesRespawned": "All clan vehicles have been respawned by an admin!",
+ "PublicVehiclesRespawned": "All public have been respawned by an admin!",
+ "EmptyVehiclesRespawned": "All empty vehicles have been respawned by an admin!",
+ "AllVehiclesRespawned": "All vehicles have been respawned by an admin!",
+ "AllVehiclesReloaded": "All vehicles have been reloaded by an admin!",
+ "YourVehicleRespawned": "Your vehicle has been respawned!",
+ "PlayerIPBanned": "{1} has been IP banned!",
+ "PlayerCharacterBanned": "{1} has been character banned!",
+ "PlayerSubNetBanned": "{1} has been subnet banned!",
+ "CantModifyBusiness": "You can't manage or modify this business!",
+ "CantModifyHouse": "You can't manage or modify this house!",
+ "ServerTimeSet": "{1} set the time to {2}",
+ "ServerWeatherSet": "{1} set the weather to {2}",
+ "ServerSnowSet": "{1} turned falling snow {2} and ground snow {3}",
+ "AllJobsReloaded": "All server jobs have been reloaded by an admin",
+ "ServerLogoSet": "{1} turned the server logo image {2}",
+ "ServerGUISet": "{1} turned GUI for this server {2}",
+ "ServerBusinessBlipsSet": "{1} turned all business blips {2}",
+ "ServerHouseBlipsSet": "{1} turned all house blips {2}",
+ "ServerJobBlipsSet": "{1} turned all job blips {2}",
+ "ServerBusinessPickupsSet": "{1} turned all business pickups {2}",
+ "ServerHousePickupsSet": "{1} turned all house pickups {2}",
+ "ServerJobPickupsSet": "{1} turned on all job pickups {2}",
+ "BusinessBuyItemsLabel": "Use {1} to purchase items",
+ "PropertyEnterCommandLabel": "Use {1} to enter",
+ "PropertyEnterKeyPressLabel": "Press {1} to enter",
+ "PropertyForSaleLabel": "For sale: ${1}",
+ "PropertyForRentLabel": "For rent: ${1} every payday",
+ "RemainingTaxPaidInMoney": "You covered the remaining taxes with ${1} in cash.",
+ "LostMoneyFromTaxes": "You lost money since your taxes are more than your paycheck!",
+ "NextPaycheckRepossessionWarning": "If you don't have enough cash to cover taxes on next paycheck, you will lose stuff!",
+ "NotEnoughMoneyForTax": "You don't have enough money to cover your taxes!",
+ "AssetsRepossessedForTax": "You lost {1} vehicles, {2} houses, and {3} businesses because you couldn't pay taxes!",
+ "Closed": "Closed",
+ "Open": "Open",
+ "VehicleDealershipLabel": "Enter a vehicle as driver to buy it",
+ "TakeJobLabel": "Use {1} to work here",
+ "StartWorkLabel": "Use {1} to start working",
+ "JobEquipAndUniformLabel": "Use {1} and {2} for job stuff, or {3} to stop working",
+ "NotYourJobLabel": "You already have a different job. Use {1} if you want this one",
+ "JobLabel": "{1} Job",
+ "PaydayBonusSet": "{1} set the payday bonus to ${2}",
+ "AllHousesReloaded": "All houses have been reloaded by an admin",
+ "AllRadioStationsReloaded": "All radio stations have been reloaded by an admin!",
+ "PlayerKicked": "{1} has been kicked from the server",
+ "AllBusinessesReloaded": "All businesses have been reloaded by an admin!",
+ "UnableToDoThat": "You aren't able to do that",
+ "SetVehicleClanConfirmMessage": "Are you sure you want to give this vehicle to your clan?",
+ "SetVehicleClanConfirmTitle": "Warning!",
+ "SetItemPriceBelowOrderPriceMessage": "Are you sure you want to set the item price below it's order price? You will lose ${1} every purchase!",
+ "SetItemPriceBelowOrderPriceTitle": "Warning!",
+ "MustOwnVehicle": "You don't own this vehicle!"
+}
\ No newline at end of file
diff --git a/locale/spanish.json b/locale/spanish.json
index 7562b925..71aee871 100644
--- a/locale/spanish.json
+++ b/locale/spanish.json
@@ -1,7 +1,8 @@
{
"TranslationProvidedBy": "PerikiyoXD",
- "LocaleEnglishName": "Español",
- "LocaleNativeName": "Inglés",
+ "LocaleEnglishName": "Spanish",
+
+ "LocaleNativeName": "Español",
"LocaleOffer": "Este servidor se encuentra disponible en Español. Utilice {1} para usarlo",
"LocaleChanged1": "El idioma se ha configurado a {1}",
"LocaleChanged2": "El servidor mostrará los mensajes en {1}",
@@ -16,9 +17,9 @@
"HelpAnimationHeader": "Ayuda de animaciones",
"AccentNotFound": "Acento no encontrado",
"AccentSet": "Acento establecido como {1}",
- "AnimationNotFound": "Esa animación no existe",
+ "InvalidAnimation": "Esa animación no existe",
"AnimationCommandTip": "Usa {1} para ver la lista de animaciones",
- "AnimationInvalidDistance": "La distancia debe ser un numero entre el 0 y el 3",
+ "InvalidAnimationDistance": "La distancia debe ser un numero entre el 0 y el 3",
"AnimationStopCommandTip": "Usa {1} para detener la animación actual",
"CantBanClient": "No se puede vetar a esta persona",
"PlayerAccountBanned": "La cuenta de {1} ha sido vetada",
@@ -269,7 +270,7 @@
"KeyBindHelp": [
"Puedes establecer tus propias combinaciones de teclas. Utilice {1} para ver sus teclas vinculadas",
"Utilice {1} para añadir una nueva combinación de teclas y {2} para eliminar una",
- "Las teclas por defecto son: {1} para el motor del vehículo, {1} para las luces y {3} para el bloqueo/desbloqueo",
+ "Las teclas por defecto son: {1} para el motor del vehículo, {2} para las luces y {3} para el bloqueo/desbloqueo",
"Pulsa {1} para ver tus objetos y {2} para equipar un objeto o {3} para desequipar todos",
"Pulsa {1} para usar el objeto que tienes en la mano, pulsa {2} para dejarlo caer o pulsa {3} para recoger un objeto del suelo"
],
@@ -397,5 +398,65 @@
"InvalidSkin": "That skin is invalid!",
"HeaderInteriorTypes": "Interiors List",
"ViewInventoryKeyPressTip": "Press {1} to see your items",
- "ViewInventoryCommandTip": "Use {1} to see your items"
+ "ViewInventoryCommandTip": "Use {1} to see your items",
+ "GUIAccountSettingToggle": "You have turned {1} GUI",
+
+ "ADDED-23MAR2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations",
+ "CarCommandHelp": "You can buy a car by visiting a vehicle dealership. Use {1} for more information.",
+ "SkinCommandHelp": "You can change your skin by visiting a clothes store. Use {1} for more info.",
+ "BusinessVehiclesRespawned": "All business vehicles have been respawned by an admin!",
+ "JobVehiclesRespawned": "All job vehicles have been respawned by an admin!",
+ "PlayerVehiclesRespawned": "All player vehicles have been respawned by an admin!",
+ "ClanVehiclesRespawned": "All clan vehicles have been respawned by an admin!",
+ "PublicVehiclesRespawned": "All public have been respawned by an admin!",
+ "EmptyVehiclesRespawned": "All empty vehicles have been respawned by an admin!",
+ "AllVehiclesRespawned": "All vehicles have been respawned by an admin!",
+ "AllVehiclesReloaded": "All vehicles have been reloaded by an admin!",
+ "YourVehicleRespawned": "Your vehicle has been respawned",
+ "PlayerIPBanned": "{1} has been IP banned!",
+ "PlayerCharacterBanned": "{1} has been character banned!",
+ "PlayerSubNetBanned": "{1} has been subnet banned!",
+ "CantModifyBusiness": "You can't manage or modify this business",
+ "CantModifyHouse": "You can't manage or modify this house",
+ "ServerTimeSet": "{1} set the time to {2}",
+ "ServerWeatherSet": "{1} set the weather to {2}",
+ "ServerSnowSet": "{1} turned falling snow {2} and ground snow {3}",
+ "AllJobsReloaded": "All server jobs have been reloaded by an admin",
+ "ServerLogoSet": "{1} turned the server logo image {2}",
+ "ServerGUISet": "{1} turned GUI for this server {2}",
+ "ServerBusinessBlipsSet": "{1} turned all business blips {2}",
+ "ServerHouseBlipsSet": "{1} turned all house blips {2}",
+ "ServerJobBlipsSet": "{1} turned all job blips {2}",
+ "ServerBusinessPickupsSet": "{1} turned all business pickups {2}",
+ "ServerHousePickupsSet": "{1} turned all house pickups {2}",
+ "ServerJobPickupsSet": "{1} turned on all job pickups {2}",
+ "BusinessBuyItemsLabel": "Use {1} to purchase items",
+ "PropertyEnterCommandLabel": "Use {1} to enter",
+ "PropertyEnterKeyPressLabel": "Press {1} to enter",
+ "PropertyForSaleLabel": "For sale: ${1}",
+ "PropertyForRentLabel": "For rent: ${1} every payday",
+ "RemainingTaxPaidInMoney": "You covered the remaining taxes with ${1} in cash.",
+ "LostMoneyFromTaxes": "You lost money since your taxes are more than your paycheck!",
+ "NextPaycheckRepossessionWarning": "If you don't have enough cash to cover taxes on next paycheck, you will lose stuff!",
+ "NotEnoughMoneyForTax": "You don't have enough money to cover your taxes!",
+ "AssetsRepossessedForTax": "You lost {1} vehicles, {2} houses, and {3} businesses because you couldn't pay taxes!",
+ "Closed": "Closed",
+ "Open": "Open",
+ "VehicleDealershipLabel": "Enter a vehicle as driver to buy it",
+ "TakeJobLabel": "Use {1} to work here",
+ "StartWorkLabel": "Use {1} to start working",
+ "JobEquipAndUniformLabel": "Use {1} and {2} for job stuff, or {3} to stop working",
+ "NotYourJobLabel": "You already have a different job. Use {1} if you want this one",
+ "JobLabel": "{1} Job",
+ "PaydayBonusSet": "{1} set the payday bonus to ${2}",
+ "AllHousesReloaded": "All houses have been reloaded by an admin",
+ "AllRadioStationsReloaded": "All radio stations have been reloaded by an admin!",
+ "PlayerKicked": "{1} has been kicked from the server",
+ "AllBusinessesReloaded": "All businesses have been reloaded by an admin!",
+ "UnableToDoThat": "You aren't able to do that",
+ "SetVehicleClanConfirmMessage": "Are you sure you want to give this vehicle to your clan?",
+ "SetVehicleClanConfirmTitle": "Warning!",
+ "SetItemPriceBelowOrderPriceMessage": "Are you sure you want to set the item price below it's order price? You will lose ${1} every purchase!",
+ "SetItemPriceBelowOrderPriceTitle": "Warning!",
+ "MustOwnVehicle": "You don't own this vehicle!"
}
diff --git a/meta.xml b/meta.xml
index 79e7de37..19f4a33d 100644
--- a/meta.xml
+++ b/meta.xml
@@ -56,19 +56,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -124,6 +111,7 @@
+
@@ -135,7 +123,8 @@
-
+
+
diff --git a/scripts/client/afk.js b/scripts/client/afk.js
index 95cbd995..b0ca14e5 100644
--- a/scripts/client/afk.js
+++ b/scripts/client/afk.js
@@ -7,6 +7,7 @@
// TYPE: Client (JavaScript)
// ===========================================================================
+// Init AFK script
function initAFKScript() {
logToConsole(LOG_DEBUG, "[VRR.AFK]: Initializing AFK script ...");
logToConsole(LOG_DEBUG, "[VRR.AFK]: AFK script initialized!");
@@ -14,14 +15,16 @@ function initAFKScript() {
// ===========================================================================
+// Process stuff when game loses focus
function processLostFocusAFK(event) {
sendServerNewAFKStatus(true);
}
// ===========================================================================
+// Process stuff when game gains focus
function processFocusAFK(event) {
- sendServerNewAFKStatus(false);
+ sendServerNewAFKStatus(false);
}
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/animation.js b/scripts/client/animation.js
index 2d5760e5..abc1b713 100644
--- a/scripts/client/animation.js
+++ b/scripts/client/animation.js
@@ -7,69 +7,115 @@
// TYPE: Client (JavaScript)
// ===========================================================================
-function makePedPlayAnimation(pedId, animGroup, animId, animType, animSpeed, loop, loopNoControl, freezeLastFrame, returnToOriginalPosition, freezePlayer) {
- logToConsole(LOG_DEBUG, `[VRR.Animation] Playing animation ${animGroup}/${animId} for ped ${pedId}`);
- if(getGame() < VRR_GAME_GTA_IV) {
- if(animType == VRR_ANIMTYPE_NORMAL || animType == VRR_ANIMTYPE_SURRENDER) {
- if(getGame() == VRR_GAME_GTA_VC || getGame() == VRR_GAME_GTA_SA) {
- getElementFromId(pedId).clearAnimations();
- } else {
- getElementFromId(pedId).clearObjective();
- }
- getElementFromId(pedId).addAnimation(animGroup, animId);
+function makePedPlayAnimation(pedId, animationSlot, positionOffset) {
+ let animationData = getAnimationData(animationSlot);
+ logToConsole(LOG_DEBUG, `[VRR.Animation] Playing animation ${animationData[0]} for ped ${pedId}`);
- if(getElementFromId(pedId) == localPlayer && freezePlayer == true) {
- inAnimation = true;
- setLocalPlayerControlState(false, false);
- localPlayer.collisionsEnabled = false;
- }
- } else if(animType == VRR_ANIMTYPE_BLEND) {
- getElementFromId(pedId).position = getElementFromId(pedId).position;
- getElementFromId(pedId).blendAnimation(animGroup, animId, animSpeed);
- }
- } else {
- natives.requestAnims(animGroup);
- natives.taskPlayAnimNonInterruptable(getElementFromId(pedId), animId, animGroup, animSpeed, loop, loopNoControl, freezeLastFrame, returnToOriginalPosition, -1);
- }
+ let freezePlayer = false;
+ switch(animationData.moveType) {
+ case VRR_ANIMMOVE_FORWARD:
+ setElementCollisionsEnabled(ped, false);
+ setElementPosition(ped, getPosInFrontOfPos(getElementPosition(ped), fixAngle(getElementHeading(ped)), positionOffset));
+ freezePlayer = true;
+ break;
+
+ case VRR_ANIMMOVE_BACK:
+ setElementCollisionsEnabled(ped, false);
+ setElementPosition(ped, getPosBehindPos(getElementPosition(ped), fixAngle(getElementHeading(ped)), positionOffset));
+ freezePlayer = true;
+ break;
+
+ case VRR_ANIMMOVE_LEFT:
+ setElementCollisionsEnabled(ped, false);
+ setElementPosition(ped, getPosToLeftOfPos(getElementPosition(ped), fixAngle(getElementHeading(ped)), positionOffset));
+ freezePlayer = true;
+ break;
+
+ case VRR_ANIMMOVE_RIGHT:
+ setElementCollisionsEnabled(ped, false);
+ setElementPosition(ped, getPosToRightOfPos(getElementPosition(ped), fixAngle(getElementHeading(ped)), positionOffset));
+ freezePlayer = true;
+ break;
+
+ default:
+ break;
+ }
+
+ if(getGame() < VRR_GAME_GTA_IV) {
+ if(animationData.animType == VRR_ANIMTYPE_NORMAL || animationData.animType == VRR_ANIMTYPE_SURRENDER) {
+ if(getGame() == VRR_GAME_GTA_VC || getGame() == VRR_GAME_GTA_SA) {
+ getElementFromId(pedId).clearAnimations();
+ } else {
+ getElementFromId(pedId).clearObjective();
+ }
+ getElementFromId(pedId).addAnimation(animationData.groupId, animationData.animId);
+
+ if(getElementFromId(pedId) == localPlayer && freezePlayer == true) {
+ inAnimation = true;
+ setLocalPlayerControlState(false, false);
+ localPlayer.collisionsEnabled = false;
+ }
+ } else if(animationData.animType == VRR_ANIMTYPE_BLEND) {
+ getElementFromId(pedId).position = getElementFromId(pedId).position;
+ getElementFromId(pedId).blendAnimation(animationData.groupId, animationData.animId, animationData.animSpeed);
+ }
+ } else {
+ natives.requestAnims(animationData.groupId);
+ natives.taskPlayAnimNonInterruptable(getElementFromId(pedId), animationData.groupId, animationData.animId, animationData.animSpeed, boolToInt(animationData.infiniteLoop), boolToInt(animationData.infiniteLoopNoMovement), boolToInt(animationData.dontReturnToStartCoords), boolToInt(animationData.freezeLastFrame), -1);
+ }
}
// ===========================================================================
-function forcePedAnimation(pedId, animGroup, animId, animType, animSpeed, loop, loopNoControl, freezeLastFrame, returnToOriginalPosition) {
- if(getGame() < VRR_GAME_GTA_IV) {
- forcedAnimation = [animGroup, animId];
- getElementFromId(pedId).position = getElementFromId(pedId).position;
- getElementFromId(pedId).addAnimation(animGroup, animId);
+function forcePedAnimation(pedId, animSlot) {
+ let animationData = getAnimationData(animSlot);
- if(getElementFromId(pedId) == localPlayer) {
- inAnimation = true;
- setLocalPlayerControlState(false, false);
- localPlayer.collisionsEnabled = false;
- }
- }
+ if(getGame() < VRR_GAME_GTA_IV) {
+ getElementFromId(pedId).position = getElementFromId(pedId).position;
+ getElementFromId(pedId).addAnimation(animationData.groupId, animationData.animId);
+
+ if(getElementFromId(pedId) == localPlayer) {
+ inAnimation = true;
+ setLocalPlayerControlState(false, false);
+ localPlayer.collisionsEnabled = false;
+ }
+ } else {
+ natives.requestAnims(animationData.groupId);
+ natives.taskPlayAnimNonInterruptable(getElementFromId(pedId), animationData.groupId, animationData.animId, animationData.animSpeed, boolToInt(animationData.infiniteLoop), boolToInt(animationData.infiniteLoopNoMovement), boolToInt(animationData.dontReturnToStartCoords), boolToInt(animationData.freezeLastFrame), -1);
+ }
}
// ===========================================================================
function makePedStopAnimation(pedId) {
- if(getElementFromId(pedId) == null) {
- return false;
- }
+ if(getElementFromId(pedId) == null) {
+ return false;
+ }
- if(getGame() != VRR_GAME_GTA_IV) {
- if(getGame() == VRR_GAME_GTA_VC || getGame() == VRR_GAME_GTA_SA) {
- getElementFromId(pedId).clearAnimations();
- } else {
- getElementFromId(pedId).clearObjective();
- }
- }
+ if(getGame() != VRR_GAME_GTA_IV) {
+ if(getGame() == VRR_GAME_GTA_VC || getGame() == VRR_GAME_GTA_SA) {
+ getElementFromId(pedId).clearAnimations();
+ } else {
+ getElementFromId(pedId).clearObjective();
+ }
+ }
- if(getElementFromId(pedId) == localPlayer) {
- if(getGame() != VRR_GAME_GTA_IV) {
- localPlayer.collisionsEnabled = true;
- }
- setLocalPlayerControlState(true, false);
- }
+ if(getElementFromId(pedId) == localPlayer) {
+ if(getGame() != VRR_GAME_GTA_IV) {
+ localPlayer.collisionsEnabled = true;
+ }
+ setLocalPlayerControlState(true, false);
+ }
+}
+
+// ===========================================================================
+
+/**
+ * @param {number} animationSlot - The slot index of the animation
+ * @return {Array} The animation's data (array)
+ */
+ function getAnimationData(animationSlot, gameId = getGame()) {
+ return getGameConfig().animations[gameId][animationSlot];
}
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/business.js b/scripts/client/business.js
index 69a73600..bbcd3cc8 100644
--- a/scripts/client/business.js
+++ b/scripts/client/business.js
@@ -8,85 +8,84 @@
// ===========================================================================
class BusinessData {
- constructor(businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems) {
- this.index = -1;
- this.businessId = businessId;
- this.name = name;
- this.entrancePosition = entrancePosition;
- this.blipModel = blipModel;
- this.pickupModel = pickupModel;
- this.hasInterior = hasInterior;
- this.hasItems = hasItems;
- this.blipId = -1;
- }
+ constructor(businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems) {
+ this.index = -1;
+ this.businessId = businessId;
+ this.name = name;
+ this.entrancePosition = entrancePosition;
+ this.blipModel = blipModel;
+ this.pickupModel = pickupModel;
+ this.hasInterior = hasInterior;
+ this.hasItems = hasItems;
+ this.blipId = -1;
+ this.labelInfoType = 0;
+ }
}
// ===========================================================================
function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems) {
- logToConsole(LOG_DEBUG, `[VRR.Business] Received business ${businessId} (${name}) from server`);
-
- if(getGame() == VRR_GAME_GTA_IV) {
- if(getBusinessData(businessId) != false) {
- let businessData = getBusinessData(businessId);
- businessData.name = name;
- businessData.entrancePosition = entrancePosition;
- businessData.blipModel = blipModel;
- businessData.pickupModel = pickupModel;
- businessData.hasInterior = hasInterior;
- businessData.hasItems = hasItems;
+ logToConsole(LOG_DEBUG, `[VRR.Business] Received business ${businessId} (${name}) from server`);
- logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId} already exists. Checking blip ...`);
- if(blipModel == -1) {
- if(businessData.blipId != -1) {
- logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been removed by the server`);
- natives.removeBlipAndClearIndex(getBusinessData(businessId).blipId);
- businessData.blipId = -1;
- //businesses.splice(businessData.index, 1);
- //setAllBusinessDataIndexes();
- } else {
- logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip is unchanged`);
- }
- } else {
- if(businessData.blipId != -1) {
- logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been changed by the server`);
- natives.setBlipCoordinates(businessData.blipId, businessData.entrancePosition);
- natives.changeBlipSprite(businessData.blipId, businessData.blipModel);
- natives.setBlipMarkerLongDistance(businessData.blipId, false);
- natives.setBlipAsShortRange(tempBusinessData.blipId, true);
- natives.changeBlipNameFromAscii(businessData.blipId, `${businessData.name.substr(0, 24)}${(businessData.name.length > 24) ? " ...": ""}`);
- } else {
- let blipId = natives.addBlipForCoord(entrancePosition);
- if(blipId) {
- businessData.blipId = blipId;
- natives.changeBlipSprite(businessData.blipId, businessData.blipModel);
- natives.setBlipMarkerLongDistance(businessData.blipId, false);
- natives.setBlipAsShortRange(tempBusinessData.blipId, true);
- natives.changeBlipNameFromAscii(businessData.blipId, `${businessData.name.substr(0, 24)}${(businessData.name.length > 24) ? " ...": ""}`);
- }
- logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
- }
- }
- } else {
- logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId} doesn't exist. Adding ...`);
- let tempBusinessData = new BusinessData(businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems);
- if(blipModel != -1) {
- let blipId = natives.addBlipForCoord(entrancePosition);
- if(blipId) {
- tempBusinessData.blipId = blipId;
- natives.changeBlipSprite(tempBusinessData.blipId, blipModel);
- natives.setBlipMarkerLongDistance(tempBusinessData.blipId, false);
- natives.setBlipAsShortRange(tempBusinessData.blipId, true);
- natives.changeBlipNameFromAscii(tempBusinessData.blipId, `${name.substr(0, 24)}${(name.length > 24) ? " ...": ""}`);
- }
- logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
- } else {
- logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId} has no blip.`);
- }
- businesses.push(tempBusinessData);
- setAllBusinessDataIndexes();
- }
- }
+ if(getGame() == VRR_GAME_GTA_IV) {
+ if(getBusinessData(businessId) != false) {
+ let businessData = getBusinessData(businessId);
+ businessData.name = name;
+ businessData.entrancePosition = entrancePosition;
+ businessData.blipModel = blipModel;
+ businessData.pickupModel = pickupModel;
+ businessData.hasInterior = hasInterior;
+ businessData.hasItems = hasItems;
+
+ logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId} already exists. Checking blip ...`);
+ if(blipModel == -1) {
+ if(businessData.blipId != -1) {
+ logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been removed by the server`);
+ if(getGame() == VRR_GAME_GTA_IV) {
+ natives.removeBlipAndClearIndex(getBusinessData(businessId).blipId);
+ } else {
+ destroyElement(getElementFromId(blipId));
+ }
+ businessData.blipId = -1;
+ //businesses.splice(businessData.index, 1);
+ //setAllBusinessDataIndexes();
+ } else {
+ logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip is unchanged`);
+ }
+ } else {
+ if(businessData.blipId != -1) {
+ logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been changed by the server`);
+ if(getGame() == VRR_GAME_GTA_IV) {
+ natives.setBlipCoordinates(businessData.blipId, businessData.entrancePosition);
+ natives.changeBlipSprite(businessData.blipId, businessData.blipModel);
+ natives.setBlipMarkerLongDistance(businessData.blipId, false);
+ natives.setBlipAsShortRange(tempBusinessData.blipId, true);
+ natives.changeBlipNameFromAscii(businessData.blipId, `${businessData.name.substr(0, 24)}${(businessData.name.length > 24) ? " ...": ""}`);
+ }
+ } else {
+ let blipId = createGameBlip(tempBusinessData.blipModel, tempBusinessData.entrancePosition, tempBusinessData.name);
+ if(blipId != -1) {
+ tempBusinessData.blipId = blipId;
+ }
+ logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
+ }
+ }
+ } else {
+ logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId} doesn't exist. Adding ...`);
+ let tempBusinessData = new BusinessData(businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems);
+ if(blipModel != -1) {
+ let blipId = createGameBlip(tempBusinessData.blipModel, tempBusinessData.entrancePosition, tempBusinessData.name);
+ if(blipId != -1) {
+ tempBusinessData.blipId = blipId;
+ }
+ logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
+ } else {
+ logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId} has no blip.`);
+ }
+ getServerData().businesses.push(tempBusinessData);
+ setAllBusinessDataIndexes();
+ }
+ }
}
// ===========================================================================
@@ -96,23 +95,26 @@ function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel
* @return {BusinessData} The business's data (class instance)
*/
function getBusinessData(businessId) {
- //let tempBusinessData = businesses.find((b) => b.businessId == businessId);
- //return (typeof tempBusinessData != "undefined") ? tempBusinessData[0] : false;
- for(let i in businesses) {
- if(businesses[i].businessId == businessId) {
- return businesses[i];
- }
- }
+ //let tempBusinessData = businesses.find((b) => b.businessId == businessId);
+ //return (typeof tempBusinessData != "undefined") ? tempBusinessData[0] : false;
- return false;
+ let businesses = getServerData().businesses;
+
+ for(let i in businesses) {
+ if(businesses[i].businessId == businessId) {
+ return businesses[i];
+ }
+ }
+
+ return false;
}
// ===========================================================================
function setAllBusinessDataIndexes() {
- for(let i in businesses) {
- businesses[i].index = i;
- }
+ for(let i in getServerData().businesses) {
+ getServerData().businesses[i].index = i;
+ }
}
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/chatbox.js b/scripts/client/chatbox.js
index 64e454f6..bc71ebf7 100644
--- a/scripts/client/chatbox.js
+++ b/scripts/client/chatbox.js
@@ -16,95 +16,156 @@ let maxChatBoxHistory = 500;
let scrollAmount = 1;
let maxChatBoxLines = 6;
+let chatAutoHideDelay = 0;
+let chatLastUse = 0;
+
let scrollUpKey = false;
let scrollDownKey = false;
// ===========================================================================
function initChatBoxScript() {
- logToConsole(LOG_DEBUG, "[VRR.ChatBox]: Initializing chatbox script ...");
- scrollUpKey = getKeyIdFromParams("pageup");
- scrollDownKey = getKeyIdFromParams("pagedown");
- bindChatBoxKeys();
- logToConsole(LOG_DEBUG, "[VRR.ChatBox]: Chatbox script initialized!");
+ logToConsole(LOG_DEBUG, "[VRR.ChatBox]: Initializing chatbox script ...");
+ scrollUpKey = getKeyIdFromParams("pageup");
+ scrollDownKey = getKeyIdFromParams("pagedown");
+ bindChatBoxKeys();
+ logToConsole(LOG_DEBUG, "[VRR.ChatBox]: Chatbox script initialized!");
}
// ===========================================================================
function bindChatBoxKeys() {
- bindKey(toInteger(scrollUpKey), KEYSTATE_DOWN, chatBoxScrollUp);
- bindKey(toInteger(scrollDownKey), KEYSTATE_DOWN, chatBoxScrollDown);
+ bindKey(toInteger(scrollUpKey), KEYSTATE_DOWN, chatBoxScrollUp);
+ bindKey(toInteger(scrollDownKey), KEYSTATE_DOWN, chatBoxScrollDown);
}
// ===========================================================================
function unBindChatBoxKeys() {
- unbindKey(toInteger(scrollUpKey));
- unbindKey(toInteger(scrollDownKey));
+ unbindKey(toInteger(scrollUpKey));
+ unbindKey(toInteger(scrollDownKey));
}
// ===========================================================================
function receiveChatBoxMessageFromServer(messageString, colour) {
- logToConsole(LOG_DEBUG, `[VRR.ChatBox]: Received chatbox message from server: ${messageString}`);
- let colouredString = replaceColoursInMessage(messageString);
+ logToConsole(LOG_DEBUG, `[VRR.ChatBox]: Received chatbox message from server: ${messageString}`);
- if(bottomMessageIndex >= chatBoxHistory.length-1) {
- message(colouredString, colour);
- bottomMessageIndex = chatBoxHistory.length-1;
- }
- addToChatBoxHistory(colouredString, colour);
+ // Just in case it's hidden by auto hide
+ //setChatWindowEnabled(true);
+
+ let colouredString = replaceColoursInMessage(messageString);
+
+ logToConsole(LOG_DEBUG, `[VRR.ChatBox]: Changed colours in string: ${colouredString}`);
+
+ addToChatBoxHistory(colouredString, colour);
+ //if(bottomMessageIndex >= chatBoxHistory.length-1) {
+ message(colouredString, colour);
+ bottomMessageIndex = chatBoxHistory.length-1;
+ //}
+
+ chatLastUse = getCurrentUnixTimestamp();
}
// ===========================================================================
function setChatScrollLines(amount) {
- scrollAmount = amount;
+ scrollAmount = amount;
+}
+
+// ===========================================================================
+
+function setChatAutoHideDelay(delay) {
+ chatAutoHideDelay = delay*1000;
}
// ===========================================================================
function addToChatBoxHistory(messageString, colour) {
- chatBoxHistory.push([messageString, colour]);
+ chatBoxHistory.push([messageString, colour]);
}
// ===========================================================================
function chatBoxScrollUp() {
- if(bottomMessageIndex > maxChatBoxLines) {
- bottomMessageIndex = bottomMessageIndex-scrollAmount;
- updateChatBox();
- }
+ if(bottomMessageIndex > maxChatBoxLines) {
+ bottomMessageIndex = bottomMessageIndex-scrollAmount;
+ updateChatBox();
+ }
}
// ===========================================================================
function chatBoxScrollDown() {
- if(bottomMessageIndex < chatBoxHistory.length-1) {
- bottomMessageIndex = bottomMessageIndex+scrollAmount;
- updateChatBox();
- }
+ if(bottomMessageIndex < chatBoxHistory.length-1) {
+ bottomMessageIndex = bottomMessageIndex+scrollAmount;
+ updateChatBox();
+ }
}
// ===========================================================================
function clearChatBox() {
- for(let i = 0 ; i <= maxChatBoxLines ; i++) {
- message("", COLOUR_WHITE);
- }
+ for(let i = 0 ; i <= maxChatBoxLines ; i++) {
+ message("", COLOUR_WHITE);
+ }
}
// ===========================================================================
function updateChatBox() {
- clearChatBox();
- for(let i = bottomMessageIndex-maxChatBoxLines ; i <= bottomMessageIndex ; i++) {
- if(typeof chatBoxHistory[i] != "undefined") {
- message(chatBoxHistory[i][0], chatBoxHistory[i][1]);
- } else {
- message("", COLOUR_WHITE);
- }
- }
+ clearChatBox();
+ for(let i = bottomMessageIndex-maxChatBoxLines ; i <= bottomMessageIndex ; i++) {
+ if(typeof chatBoxHistory[i] != "undefined") {
+ message(chatBoxHistory[i][0], chatBoxHistory[i][1]);
+ } else {
+ message("", COLOUR_WHITE);
+ }
+ }
+ chatLastUse = getCurrentUnixTimestamp();
+}
+
+// ===========================================================================
+
+function processMouseWheelForChatBox(mouseId, deltaCoordinates, flipped) {
+ // There isn't a way to detect whether chat input is active, but mouse cursor is forced shown when typing so ¯\_(ツ)_/¯
+ if(!gui.cursorEnabled) {
+ return false;
+ }
+
+ if(!flipped) {
+ if(deltaCoordinates.y > 0) {
+ chatBoxScrollUp();
+ } else {
+ chatBoxScrollDown();
+ }
+ } else {
+ if(deltaCoordinates.y > 0) {
+ chatBoxScrollDown();
+ } else {
+ chatBoxScrollUp();
+ }
+ }
+}
+
+// ===========================================================================
+
+function checkChatAutoHide() {
+ return false;
+
+ // Make sure chat input isn't active
+ if(gui.cursorEnabled) {
+ return false;
+ }
+
+ // Don't process auto-hide if it's disabled
+ if(chatAutoHideDelay == 0) {
+ return false;
+ }
+
+ if(getCurrentUnixTimestamp()-chatLastUse >= chatAutoHideDelay) {
+ setChatWindowEnabled(false);
+ }
}
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/content.js b/scripts/client/content.js
index 214655ea..bcae54d0 100644
--- a/scripts/client/content.js
+++ b/scripts/client/content.js
@@ -8,58 +8,58 @@
// ===========================================================================
function getCustomImage(imageName) {
- let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
- if(contentResource != null) {
- if(contentResource.isStarted) {
- let image = contentResource.exports.getCustomImage(imageName);
- if(image != null) {
- return image;
- }
- }
- }
- return false;
+ let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
+ if(contentResource != null) {
+ if(contentResource.isStarted) {
+ let image = contentResource.exports.getCustomImage(imageName);
+ if(image != null) {
+ return image;
+ }
+ }
+ }
+ return false;
}
// ===========================================================================
function getCustomFont(fontName) {
- let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
- if(contentResource != null) {
- if(contentResource.isStarted) {
- let font = contentResource.exports.getCustomFont(fontName);
- if(font != null) {
- return font;
- }
- }
- }
- return false;
+ let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
+ if(contentResource != null) {
+ if(contentResource.isStarted) {
+ let font = contentResource.exports.getCustomFont(fontName);
+ if(font != null) {
+ return font;
+ }
+ }
+ }
+ return false;
}
// ===========================================================================
function getCustomAudio(audioName) {
- let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
- if(contentResource != null) {
- if(contentResource.isStarted) {
- let audioFile = contentResource.exports.getCustomAudio(audioName);
- if(audioFile != null) {
- return audioFile;
- }
- }
- }
- return false;
+ let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
+ if(contentResource != null) {
+ if(contentResource.isStarted) {
+ let audioFile = contentResource.exports.getCustomAudio(audioName);
+ if(audioFile != null) {
+ return audioFile;
+ }
+ }
+ }
+ return false;
}
// ===========================================================================
function playCustomAudio(audioName, volume = 0.5, loop = false) {
- let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
- if(contentResource != null) {
- if(contentResource.isStarted) {
- contentResource.exports.playCustomAudio(audioName, volume, loop);
- }
- }
- return false;
+ let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
+ if(contentResource != null) {
+ if(contentResource.isStarted) {
+ contentResource.exports.playCustomAudio(audioName, volume, loop);
+ }
+ }
+ return false;
}
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/event.js b/scripts/client/event.js
index 2bc8a09d..851028a7 100644
--- a/scripts/client/event.js
+++ b/scripts/client/event.js
@@ -8,227 +8,231 @@
// ===========================================================================
function initEventScript() {
- logToConsole(LOG_DEBUG, "[VRR.Event]: Initializing event script ...");
- addCustomEvents();
- addAllEventHandlers();
- logToConsole(LOG_DEBUG, "[VRR.Event]: Event script initialized!");
+ logToConsole(LOG_DEBUG, "[VRR.Event]: Initializing event script ...");
+ addCustomEvents();
+ addAllEventHandlers();
+ logToConsole(LOG_DEBUG, "[VRR.Event]: Event script initialized!");
}
// ===========================================================================
function addCustomEvents() {
- addEvent("OnLocalPlayerEnterSphere", 1);
- addEvent("OnLocalPlayerExitSphere", 1);
- addEvent("OnLocalPlayerEnteredVehicle", 1);
- addEvent("OnLocalPlayerExitedVehicle", 1);
- addEvent("OnLocalPlayerSwitchWeapon", 2);
+ addEvent("OnLocalPlayerEnterSphere", 1);
+ addEvent("OnLocalPlayerExitSphere", 1);
+ addEvent("OnLocalPlayerEnteredVehicle", 1);
+ addEvent("OnLocalPlayerExitedVehicle", 1);
+ addEvent("OnLocalPlayerSwitchWeapon", 2);
}
// ===========================================================================
function addAllEventHandlers() {
- bindEventHandler("OnResourceStart", thisResource, onResourceStart);
- bindEventHandler("OnResourceReady", thisResource, onResourceReady);
- bindEventHandler("OnResourceStop", thisResource, onResourceStop);
+ bindEventHandler("OnResourceStart", thisResource, onResourceStart);
+ bindEventHandler("OnResourceReady", thisResource, onResourceReady);
+ bindEventHandler("OnResourceStop", thisResource, onResourceStop);
- addEventHandler("OnProcess", onProcess);
- addEventHandler("OnKeyUp", onKeyUp);
- addEventHandler("OnDrawnHUD", onDrawnHUD);
+ addEventHandler("OnProcess", onProcess);
+ addEventHandler("OnKeyUp", onKeyUp);
+ addEventHandler("OnDrawnHUD", onDrawnHUD);
- addEventHandler("OnPedWasted", onPedWasted);
+ addEventHandler("OnPedWasted", onPedWasted);
- addEventHandler("OnElementStreamIn", onElementStreamIn);
+ addEventHandler("OnElementStreamIn", onElementStreamIn);
- addEventHandler("OnLocalPlayerEnteredVehicle", onLocalPlayerEnteredVehicle);
- addEventHandler("OnLocalPlayerExitedVehicle", onLocalPlayerExitedVehicle);
- addEventHandler("OnLocalPlayerEnterSphere", onLocalPlayerEnterSphere);
- addEventHandler("OnLocalPlayerExitSphere", onLocalPlayerExitSphere);
- addEventHandler("OnLocalPlayerSwitchWeapon", onLocalPlayerSwitchWeapon);
+ addEventHandler("OnLocalPlayerEnteredVehicle", onLocalPlayerEnteredVehicle);
+ addEventHandler("OnLocalPlayerExitedVehicle", onLocalPlayerExitedVehicle);
+ addEventHandler("OnLocalPlayerEnterSphere", onLocalPlayerEnterSphere);
+ addEventHandler("OnLocalPlayerExitSphere", onLocalPlayerExitSphere);
+ addEventHandler("OnLocalPlayerSwitchWeapon", onLocalPlayerSwitchWeapon);
- addEventHandler("OnPedInflictDamage", onPedInflictDamage);
+ addEventHandler("OnPedInflictDamage", onPedInflictDamage);
- addEventHandler("OnLostFocus", onLostFocus);
- addEventHandler("OnFocus", onFocus);
+ addEventHandler("OnLostFocus", onLostFocus);
+ addEventHandler("OnFocus", onFocus);
- addEventHandler("OnCameraProcess", onCameraProcess);
+ addEventHandler("OnCameraProcess", onCameraProcess);
+
+ addEventHandler("OnMouseWheel", onMouseWheel);
}
// ===========================================================================
function onResourceStart(event, resource) {
- sendResourceStartedSignalToServer();
- setUpInitialGame();
- garbageCollectorInterval = setInterval(collectAllGarbage, 1000*60);
+ sendResourceStartedSignalToServer();
+ setUpInitialGame();
+ garbageCollectorInterval = setInterval(collectAllGarbage, 1000*60);
}
// ===========================================================================
function onResourceStop(event, resource) {
- sendResourceStoppedSignalToServer();
+ sendResourceStoppedSignalToServer();
}
// ===========================================================================
function onResourceReady(event, resource) {
- sendResourceReadySignalToServer();
+ sendResourceReadySignalToServer();
}
// ===========================================================================
function onProcess(event, deltaTime) {
- if(localPlayer == null) {
- return false;
- }
+ if(localPlayer == null) {
+ return false;
+ }
- if(!isSpawned) {
- return false;
- }
+ if(!isSpawned) {
+ return false;
+ }
- processSync();
- processLocalPlayerControlState();
- processLocalPlayerVehicleControlState();
- processLocalPlayerSphereEntryExitHandling();
- processLocalPlayerVehicleEntryExitHandling();
- processJobRouteSphere();
- forceLocalPlayerEquippedWeaponItem();
- processWantedLevelReset();
- processGameSpecifics();
- processNearbyPickups();
- processVehiclePurchasing();
- //processVehicleFires();
+ processSync();
+ processLocalPlayerControlState();
+ processLocalPlayerVehicleControlState();
+ processLocalPlayerSphereEntryExitHandling();
+ processLocalPlayerVehicleEntryExitHandling();
+ processJobRouteSphere();
+ forceLocalPlayerEquippedWeaponItem();
+ processWantedLevelReset();
+ processGameSpecifics();
+ processNearbyPickups();
+ processVehiclePurchasing();
+ //checkChatBoxAutoHide(); // Will be uncommented on 1.4.0 GTAC update
+ //processVehicleFires();
}
// ===========================================================================
function onKeyUp(event, keyCode, scanCode, keyModifiers) {
- processSkinSelectKeyPress(keyCode);
- //processKeyDuringAnimation();
- processGUIKeyPress(keyCode);
- processToggleGUIKeyPress(keyCode);
+ processSkinSelectKeyPress(keyCode);
+ //processKeyDuringAnimation();
+ processGUIKeyPress(keyCode);
+ processToggleGUIKeyPress(keyCode);
}
// ===========================================================================
function onDrawnHUD(event) {
- if(!renderHUD) {
- return false;
- }
+ if(!renderHUD) {
+ return false;
+ }
- if(localPlayer == null) {
- return false;
- }
+ if(localPlayer == null) {
+ return false;
+ }
- processSmallGameMessageRendering();
- processScoreBoardRendering();
- processLabelRendering();
- processLogoRendering();
- processItemActionRendering();
- processSkinSelectRendering();
- processNameTagRendering();
- processInteriorLightsRendering();
+ processSmallGameMessageRendering();
+ processScoreBoardRendering();
+ processLabelRendering();
+ processLogoRendering();
+ processItemActionRendering();
+ processSkinSelectRendering();
+ processNameTagRendering();
+ processInteriorLightsRendering();
}
// ===========================================================================
function onPedWasted(event, wastedPed, killerPed, weapon, pedPiece) {
- logToConsole(LOG_DEBUG, `[VRR.Event] Ped ${wastedPed.name} died`);
- wastedPed.clearWeapons();
+ logToConsole(LOG_DEBUG, `[VRR.Event] Ped ${wastedPed.name} died`);
+ wastedPed.clearWeapons();
}
// ===========================================================================
function onElementStreamIn(event, element) {
- syncElementProperties(element);
+ syncElementProperties(element);
}
// ===========================================================================
function onLocalPlayerExitedVehicle(event, vehicle, seat) {
- logToConsole(LOG_DEBUG, `[VRR.Event] Local player exited vehicle`);
- sendNetworkEventToServer("vrr.onPlayerExitVehicle", getVehicleForNetworkEvent(vehicle), seat);
+ logToConsole(LOG_DEBUG, `[VRR.Event] Local player exited vehicle`);
+ sendNetworkEventToServer("vrr.onPlayerExitVehicle", getVehicleForNetworkEvent(vehicle), seat);
- if(inVehicleSeat) {
- parkedVehiclePosition = false;
- parkedVehicleHeading = false;
- }
+ if(inVehicleSeat) {
+ parkedVehiclePosition = false;
+ parkedVehicleHeading = false;
+ }
}
// ===========================================================================
function onLocalPlayerEnteredVehicle(event, vehicle, seat) {
- logToConsole(LOG_DEBUG, `[VRR.Event] Local player entered vehicle`);
+ logToConsole(LOG_DEBUG, `[VRR.Event] Local player entered vehicle`);
- sendNetworkEventToServer("vrr.onPlayerEnterVehicle", getVehicleForNetworkEvent(vehicle), seat);
+ sendNetworkEventToServer("vrr.onPlayerEnterVehicle", getVehicleForNetworkEvent(vehicle), seat);
- if(inVehicleSeat == 0) {
- inVehicle.engine = false;
- if(!inVehicle.engine) {
- parkedVehiclePosition = inVehicle.position;
- parkedVehicleHeading = inVehicle.heading;
- }
- }
+ if(inVehicleSeat == 0) {
+ inVehicle.engine = false;
+ if(!inVehicle.engine) {
+ parkedVehiclePosition = inVehicle.position;
+ parkedVehicleHeading = inVehicle.heading;
+ }
+ }
}
// ===========================================================================
function onPedInflictDamage(event, damagedEntity, damagerEntity, weaponId, healthLoss, pedPiece) {
- //let damagerEntityString = (!isNull(damagedEntity)) ? `${damagerEntity.name} (${damagerEntity.name}, ${damagerEntity.type} - ${typeof damagerEntity})` : `Unknown ped`;
- //let damagedEntityString = (!isNull(damagedEntity)) ? `${damagedEntity.name} (${damagedEntity.name}, ${damagedEntity.type} - ${typeof damagedEntity})` : `Unknown ped`;
- //logToConsole(LOG_DEBUG, `[VRR.Event] ${damagerEntityString} damaged ${damagedEntityString}'s '${pedPiece} with weapon ${weaponId}`);
- if(!isNull(damagedEntity) && !isNull(damagerEntity)) {
- if(damagedEntity.isType(ELEMENT_PLAYER)) {
- if(damagedEntity == localPlayer) {
- //if(!weaponDamageEnabled[damagerEntity.name]) {
- event.preventDefault();
- sendNetworkEventToServer("vrr.weaponDamage", damagerEntity.name, weaponId, pedPiece, healthLoss);
- //}
- }
- }
- }
+ //let damagerEntityString = (!isNull(damagedEntity)) ? `${damagerEntity.name} (${damagerEntity.name}, ${damagerEntity.type} - ${typeof damagerEntity})` : `Unknown ped`;
+ //let damagedEntityString = (!isNull(damagedEntity)) ? `${damagedEntity.name} (${damagedEntity.name}, ${damagedEntity.type} - ${typeof damagedEntity})` : `Unknown ped`;
+ //logToConsole(LOG_DEBUG, `[VRR.Event] ${damagerEntityString} damaged ${damagedEntityString}'s '${pedPiece} with weapon ${weaponId}`);
+ if(!isNull(damagedEntity) && !isNull(damagerEntity)) {
+ if(damagedEntity.isType(ELEMENT_PLAYER)) {
+ if(damagedEntity == localPlayer) {
+ //if(!weaponDamageEnabled[damagerEntity.name]) {
+ event.preventDefault();
+ sendNetworkEventToServer("vrr.weaponDamage", damagerEntity.name, weaponId, pedPiece, healthLoss);
+ //}
+ }
+ }
+ }
}
// ===========================================================================
function onLocalPlayerEnterSphere(event, sphere) {
- logToConsole(LOG_DEBUG, `[VRR.Event] Local player entered sphere`);
- if(sphere == jobRouteLocationSphere) {
- enteredJobRouteSphere();
- }
+ logToConsole(LOG_DEBUG, `[VRR.Event] Local player entered sphere`);
+ if(sphere == jobRouteLocationSphere) {
+ enteredJobRouteSphere();
+ }
}
// ===========================================================================
function onLocalPlayerExitSphere(event, sphere) {
- logToConsole(LOG_DEBUG, `[VRR.Event] Local player exited sphere`);
+ logToConsole(LOG_DEBUG, `[VRR.Event] Local player exited sphere`);
}
// ===========================================================================
function onLostFocus(event) {
- processLostFocusAFK();
+ processLostFocusAFK();
}
// ===========================================================================
function onFocus(event) {
- processFocusAFK();
+ processFocusAFK();
}
// ===========================================================================
function onLocalPlayerSwitchWeapon(oldWeapon, newWeapon) {
+
}
// ===========================================================================
function onCameraProcess(event) {
+
}
// ===========================================================================
-function onChatOutput(event, messageText, colour) {
- //event.preventDefault();
- //receiveChatBoxMessageFromServer(messageText, colour);
+function onMouseWheel(event, mouseId, deltaCoordinates, flipped) {
+ processMouseWheelForChatBox(mouseId, deltaCoordinates, flipped);
}
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/gui.js b/scripts/client/gui.js
index 86bd4cf3..a780f47f 100644
--- a/scripts/client/gui.js
+++ b/scripts/client/gui.js
@@ -29,27 +29,6 @@ let textInputAlpha = 180;
let guiReady = false;
-let guiSubmitKey = false;
-let guiLeftKey = false;
-let guiRightKey = false;
-let guiUpKey = false;
-let guiDownKey = false;
-
-// ===========================================================================
-
-let placesOfOrigin = [
- "Liberty City",
- "Vice City",
- "Los Santos",
- "San Fierro",
- "Las Venturas",
- "San Andreas",
- "Blaine County",
- "Red County",
- "Bone County",
- "Other",
-];
-
// ===========================================================================
let characterData = [];
@@ -104,7 +83,7 @@ function closeAllWindows() {
listDialog.window.shown = false;
resetPassword.window.shown = false;
passwordChange.window.shown = false;
-
+
mexui.setInput(false);
mexui.focusedControl = false;
@@ -185,23 +164,23 @@ addNetworkEventHandler("vrr.switchCharacterSelect", function(firstName, lastName
// ===========================================================================
-addNetworkEventHandler("vrr.showError", function(errorMessage, errorTitle) {
+addNetworkEventHandler("vrr.showError", function(errorMessage, errorTitle, buttonText) {
logToConsole(LOG_DEBUG, `[VRR.GUI] Received request from server to show error window`);
- showError(errorMessage, errorTitle);
+ showError(errorMessage, errorTitle, buttonText);
});
// ===========================================================================
-addNetworkEventHandler("vrr.showPrompt", function(promptMessage, promptTitle) {
+addNetworkEventHandler("vrr.showPrompt", function(promptMessage, promptTitle, yesButtonText, noButtonText) {
logToConsole(LOG_DEBUG, `[VRR.GUI] Received request from server to show prompt window`);
- showYesNoPromptGUI(promptMessage, promptTitle);
+ showYesNoPromptGUI(promptMessage, promptTitle, yesButtonText, noButtonText);
});
// ===========================================================================
-addNetworkEventHandler("vrr.showInfo", function(infoMessage) {
+addNetworkEventHandler("vrr.showInfo", function(infoMessage, buttonText) {
logToConsole(LOG_DEBUG, `[VRR.GUI] Received request from server to show info dialog`);
- showInfo(infoMessage);
+ showInfo(infoMessage, buttonText);
});
// ===========================================================================
@@ -284,37 +263,50 @@ addNetworkEventHandler("vrr.guiInit", function() {
// ===========================================================================
function hideAllGUI() {
- closeAllWindows();
- setChatWindowEnabled(true);
+ closeAllWindows();
+ setChatWindowEnabled(true);
guiSubmitKey = false;
}
// ===========================================================================
function processGUIKeyPress(keyCode) {
+ logToConsole(LOG_DEBUG, `[VRR.GUI] Processing key press: ${keyCode}`);
+
if(!isAnyGUIActive()) {
+ logToConsole(LOG_DEBUG, `[VRR.GUI] GUI is not active. Cancelling keypress processing.`);
return false;
}
if(keyCode == SDLK_RETURN || keyCode == SDLK_RETURN2) {
+ logToConsole(LOG_DEBUG, `[VRR.GUI] Key press is submit (${guiSubmitKey})`);
if(guiSubmitKey != false) {
- guiSubmitKey();
+ logToConsole(LOG_DEBUG, `[VRR.GUI] Calling submit key function`);
+ guiSubmitKey.call();
}
} else if(keyCode == getKeyIdFromParams("left") || keyCode == getKeyIdFromParams("a")) {
+ logToConsole(LOG_DEBUG, `[VRR.GUI] Key press is left (${guiLeftKey})`);
if(guiLeftKey != false) {
- guiLeftKey();
+ logToConsole(LOG_DEBUG, `[VRR.GUI] Calling left key function`);
+ guiLeftKey.call();
}
} else if(keyCode == getKeyIdFromParams("right") || keyCode == getKeyIdFromParams("d")) {
+ logToConsole(LOG_DEBUG, `[VRR.GUI] Key press is right (${guiRightKey})`);
if(guiRightKey != false) {
- guiRightKey();
+ logToConsole(LOG_DEBUG, `[VRR.GUI] Calling right key function`);
+ guiRightKey.call();
}
} else if(keyCode == getKeyIdFromParams("down") || keyCode == getKeyIdFromParams("s")) {
+ logToConsole(LOG_DEBUG, `[VRR.GUI] Key press is down (${guiDownKey})`);
if(guiDownKey != false) {
- guiDownKey();
+ logToConsole(LOG_DEBUG, `[VRR.GUI] Calling down key function`);
+ guiDownKey.call();
}
} else if(keyCode == getKeyIdFromParams("up") || keyCode == getKeyIdFromParams("w")) {
+ logToConsole(LOG_DEBUG, `[VRR.GUI] Key press is up (${guiUpKey})`);
if(guiUpKey != false) {
- guiUpKey();
+ logToConsole(LOG_DEBUG, `[VRR.GUI] Calling up key function`);
+ guiUpKey.call();
}
}
}
diff --git a/scripts/client/gui/charselect.js b/scripts/client/gui/charselect.js
index fb9b25fb..ecd1f191 100644
--- a/scripts/client/gui/charselect.js
+++ b/scripts/client/gui/charselect.js
@@ -163,6 +163,10 @@ function showCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, ski
characterSelect.lastPlayedText.text = `Last Played: ${lastPlayed}`;
characterSelect.skinImage = characterSelect.window.image(310, 32, 100, 90, "files/images/skins/none.png");
characterSelect.window.shown = true;
+
+ guiSubmitKey = selectThisCharacter;
+ guiLeftKey = selectPreviousCharacter;
+ guiRightKey = selectNextCharacter;
}
// ===========================================================================
@@ -211,6 +215,7 @@ function switchCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, s
characterSelect.skinImage = (getGame() == VRR_GAME_GTA_III) ? characterSelect.window.image(310, 32, 100, 90, `files/images/skins/gta3/${getSkinImage(skinId)}.png`) : characterSelect.window.image(310, 32, 100, 90, "files/images/skins/none.png");
characterSelect.window.shown = true;
+
guiSubmitKey = selectThisCharacter;
guiLeftKey = selectPreviousCharacter;
guiRightKey = selectNextCharacter;
diff --git a/scripts/client/gui/error.js b/scripts/client/gui/error.js
index 25315568..3516f00b 100644
--- a/scripts/client/gui/error.js
+++ b/scripts/client/gui/error.js
@@ -63,12 +63,14 @@ function initErrorDialogGUI() {
// ===========================================================================
-function showErrorGUI(errorMessage, errorTitle) {
+function showErrorGUI(errorMessage, errorTitle, buttonText) {
closeAllWindows();
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing error window. Error: ${errorTitle} - ${errorMessage}`);
setChatWindowEnabled(false);
mexui.setInput(true);
errorDialog.messageLabel.text = errorMessage;
+ errorDialog.okayButton.text = buttonText;
+ errprDialog.window.title = errorTitle;
errorDialog.window.shown = true;
}
diff --git a/scripts/client/gui/info.js b/scripts/client/gui/info.js
index 7ecff81b..f2f4582b 100644
--- a/scripts/client/gui/info.js
+++ b/scripts/client/gui/info.js
@@ -70,11 +70,13 @@ function closeInfoDialog() {
// ===========================================================================
-function showInfo(infoMessage, infoTitle) {
+function showInfo(infoMessage, infoTitle, buttonText) {
closeAllWindows();
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing info dialog window. Info: ${infoTitle} - ${infoMessage}`);
mexui.setInput(true);
infoDialog.messageLabel.text = infoMessage;
+ infoDialog.okayButton.text = buttonText;
+ infoDialog.window.title = infoTitle;
infoDialog.window.shown = true;
}
diff --git a/scripts/client/gui/login.js b/scripts/client/gui/login.js
index 51b5fa03..39c443c7 100644
--- a/scripts/client/gui/login.js
+++ b/scripts/client/gui/login.js
@@ -20,6 +20,28 @@ let login = {
// ===========================================================================
+let loginHTML =
+`
+
+ Connected RP: Login
+
+
+
+
+`;
+
+// ===========================================================================
+
function initLoginGUI() {
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating login GUI ...`);
login.window = mexui.window(game.width/2-150, game.height/2-135, 300, 275, 'LOGIN', {
@@ -164,9 +186,10 @@ function loginSuccess() {
// ===========================================================================
function switchToPasswordResetGUI() {
- closeAllWindows();
- logToConsole(LOG_DEBUG, `[VRR.GUI] Showing password reset dialog window`);
- showResetPasswordGUI();
+ //closeAllWindows();
+ //logToConsole(LOG_DEBUG, `[VRR.GUI] Showing password reset dialog window`);
+ //showResetPasswordGUI();
+ sendNetworkEventToServer("vrr.checkResetPassword", "");
return false;
}
diff --git a/scripts/client/gui/register.js b/scripts/client/gui/register.js
index 1d1e0378..47aee279 100644
--- a/scripts/client/gui/register.js
+++ b/scripts/client/gui/register.js
@@ -40,7 +40,7 @@ function initRegisterGUI() {
register.window.titleBarIconSize = toVector2(0,0);
register.window.titleBarHeight = 0;
- register.window.image(5, 20, 290, 80, mainLogoPath, {
+ register.window.image(5, 20, 290, 100, mainLogoPath, {
focused: {
borderColour: toColour(0, 0, 0, 0),
},
diff --git a/scripts/client/gui/yesno.js b/scripts/client/gui/yesno.js
index a7ee4f32..26fb2770 100644
--- a/scripts/client/gui/yesno.js
+++ b/scripts/client/gui/yesno.js
@@ -48,7 +48,7 @@ function initYesNoDialogGUI() {
},
});
- yesNoDialog.yesButton = yesNoDialog.window.button(5, 100, 197, 25, 'YES', {
+ yesNoDialog.yesButton = yesNoDialog.window.button(5, 105, 193, 30, 'YES', {
main: {
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], 255),
@@ -61,7 +61,7 @@ function initYesNoDialogGUI() {
},
}, yesNoDialogAnswerYes);
- yesNoDialog.noButton = yesNoDialog.window.button(202, 105, 197, 25, 'NO', {
+ yesNoDialog.noButton = yesNoDialog.window.button(203, 105, 192, 30, 'NO', {
main: {
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], 255),
@@ -78,11 +78,14 @@ function initYesNoDialogGUI() {
// ===========================================================================
-function showYesNoPromptGUI(promptMessage, promptTitle) {
+function showYesNoPromptGUI(promptMessage, promptTitle, yesButtonText, noButtonText) {
closeAllWindows();
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing prompt window. Prompt: ${promptTitle} - ${promptMessage}`);
mexui.setInput(true);
yesNoDialog.messageLabel.text = promptMessage;
+ yesNoDialog.yesButton.text = yesButtonText;
+ yesNoDialog.noButton.text = noButtonText;
+ yesNoDialog.window.title = promptTitle;
yesNoDialog.window.shown = true;
}
diff --git a/scripts/client/house.js b/scripts/client/house.js
index 19631aad..ecdc5d9a 100644
--- a/scripts/client/house.js
+++ b/scripts/client/house.js
@@ -8,56 +8,77 @@
// ===========================================================================
class HouseData {
- constructor(houseId, entrancePosition, blipModel, pickupModel, hasInterior) {
- this.index = -1;
- this.houseId = houseId;
- this.entrancePosition = entrancePosition;
- this.blipModel = blipModel;
- this.pickupModel = pickupModel;
- this.hasInterior = hasInterior;
- this.blipId = -1;
- }
+ constructor(houseId, entrancePosition, blipModel, pickupModel, hasInterior) {
+ this.index = -1;
+ this.houseId = houseId;
+ this.entrancePosition = entrancePosition;
+ this.blipModel = blipModel;
+ this.pickupModel = pickupModel;
+ this.hasInterior = hasInterior;
+ this.blipId = -1;
+ }
}
// ===========================================================================
function receiveHouseFromServer(houseId, entrancePosition, blipModel, pickupModel, hasInterior) {
- if(getGame() == VRR_GAME_GTA_IV) {
- if(getHouseData(houseId) != false) {
- if(blipModel == -1) {
- natives.removeBlipAndClearIndex(getHouseData(houseId).blipId);
- getHouseData(houseId).blipId = -1;
- //houses.splice(getHouseData(houseId).index, 1);
- //setAllHouseDataIndexes();
- } else {
- if(getHouseData(houseId).blipId != -1) {
- natives.setBlipCoordinates(getHouseData(houseId).blipId, getHouseData(houseId).entrancePosition);
- natives.changeBlipSprite(getHouseData(houseId).blipId, getHouseData(houseId).blipModel);
- //natives.changeBlipNameFromAscii(getHouseData(houseId).blipId, `${name.substr(0, 24)}${(name.length > 24) ? " ...": ""}`);
- } else {
- let blipId = natives.addBlipForCoord(entrancePosition);
- if(blipId) {
- getHouseData(houseId).blipId = blipId;
- natives.changeBlipSprite(blipId, blipModel);
- natives.setBlipMarkerLongDistance(blipId, false);
- }
- }
- }
- } else {
- let tempHouseData = new HouseData(houseId, entrancePosition, blipModel, pickupModel, hasInterior, hasItems);
- if(blipModel != -1) {
- let blipId = natives.addBlipForCoord(entrancePosition);
- if(blipId) {
- tempHouseData.blipId = blipId;
- natives.changeBlipSprite(blipId, blipModel);
- natives.setBlipMarkerLongDistance(blipId, false);
- //natives.changeBlipNameFromAscii(blipId, `${name.substr(0, 24)}${(name.length > 24) ? " ...": ""}`);
- }
- }
- houses.push(tempHouseData);
- setAllHouseDataIndexes();
- }
- }
+ logToConsole(LOG_DEBUG, `[VRR.House] Received house ${houseId} (${name}) from server`);
+
+ if(getGame() == VRR_GAME_GTA_IV) {
+ if(getHouseData(houseId) != false) {
+ let houseData = getHouseData(houseId);
+ houseData.entrancePosition = entrancePosition;
+ houseData.blipModel = blipModel;
+ houseData.pickupModel = pickupModel;
+ houseData.hasInterior = hasInterior;
+
+ logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId} already exists. Checking blip ...`);
+ if(blipModel == -1) {
+ if(houseData.blipId != -1) {
+ logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been removed by the server`);
+ if(getGame() == VRR_GAME_GTA_IV) {
+ natives.removeBlipAndClearIndex(getHouseData(houseId).blipId);
+ } else {
+ destroyElement(getElementFromId(blipId));
+ }
+ houseData.blipId = -1;
+ } else {
+ logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip is unchanged`);
+ }
+ } else {
+ if(houseData.blipId != -1) {
+ logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been changed by the server`);
+ if(getGame() == VRR_GAME_GTA_IV) {
+ natives.setBlipCoordinates(houseData.blipId, houseData.entrancePosition);
+ natives.changeBlipSprite(houseData.blipId, houseData.blipModel);
+ natives.setBlipMarkerLongDistance(houseData.blipId, false);
+ natives.setBlipAsShortRange(houseData.blipId, true);
+ natives.changeBlipNameFromAscii(houseData.blipId, `${houseData.name.substr(0, 24)}${(houseData.name.length > 24) ? " ...": ""}`);
+ }
+ } else {
+ let blipId = createGameBlip(houseData.blipModel, houseData.entrancePosition, houseData.name);
+ if(blipId != -1) {
+ houseData.blipId = blipId;
+ }
+ logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
+ }
+ }
+ } else {
+ logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId} doesn't exist. Adding ...`);
+ let tempHouseData = new HouseData(houseId, entrancePosition, blipModel, pickupModel, hasInterior);
+ if(blipModel != -1) {
+ let blipId = createGameBlip(tempHouseData.blipModel, tempHouseData.entrancePosition, "House");
+ if(blipId != -1) {
+ tempHouseData.blipId = blipId;
+ }
+ logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
+ } else {
+ logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId} has no blip.`);
+ }
+ getServerData().houses.push(tempHouseData);
+ setAllHouseDataIndexes();
+ }
+ }
}
// ===========================================================================
@@ -66,17 +87,23 @@ function receiveHouseFromServer(houseId, entrancePosition, blipModel, pickupMode
* @param {number} houseId - The ID of the house (initially provided by server)
* @return {HouseData} The house's data (class instance)
*/
-function getHouseData(houseId) {
- let tempHouseData = houses.find((h) => h.houseId == houseId);
- return (typeof tempHouseData != "undefined") ? tempHouseData : false;
+ function getHouseData(houseId) {
+ let houses = getServerData().houses;
+ for(let i in houses) {
+ if(houses[i].houseId == houseId) {
+ return houses[i];
+ }
+ }
+
+ return false;
}
// ===========================================================================
function setAllHouseDataIndexes() {
- for(let i in houses) {
- houses[i].index = i;
- }
+ for(let i in getServerData().houses) {
+ getServerData().houses[i].index = i;
+ }
}
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/item.js b/scripts/client/item.js
index a1735ae0..783426eb 100644
--- a/scripts/client/item.js
+++ b/scripts/client/item.js
@@ -23,40 +23,40 @@ function initItemScript() {
// ===========================================================================
function processItemActionRendering() {
- if(renderItemActionDelay) {
- if(itemActionDelayEnabled) {
- let finishTime = itemActionDelayStart+itemActionDelayDuration;
- if(sdl.ticks >= finishTime) {
- itemActionDelayEnabled = false;
- itemActionDelayDuration = 0;
- itemActionDelayStart = 0;
- tellServerItemActionDelayComplete();
- } else {
- let currentTick = sdl.ticks-itemActionDelayStart;
- let progressPercent = Math.ceil(currentTick*100/itemActionDelayDuration);
- let width = Math.ceil(getPercentage(itemActionDelaySize.x, progressPercent));
+ if(renderItemActionDelay) {
+ if(itemActionDelayEnabled) {
+ let finishTime = itemActionDelayStart+itemActionDelayDuration;
+ if(sdl.ticks >= finishTime) {
+ itemActionDelayEnabled = false;
+ itemActionDelayDuration = 0;
+ itemActionDelayStart = 0;
+ tellServerItemActionDelayComplete();
+ } else {
+ let currentTick = sdl.ticks-itemActionDelayStart;
+ let progressPercent = Math.ceil(currentTick*100/itemActionDelayDuration);
+ let width = Math.ceil(getPercentage(itemActionDelaySize.x, progressPercent));
- let backgroundColour = toColour(0, 0, 0, 255);
- graphics.drawRectangle(null, [itemActionDelayPosition.x-(itemActionDelaySize.x/2)-1, itemActionDelayPosition.y-(itemActionDelaySize.y/2)-1], [itemActionDelaySize.x+2, itemActionDelaySize.y+2], backgroundColour, backgroundColour, backgroundColour, backgroundColour);
- graphics.drawRectangle(null, [itemActionDelayPosition.x-(itemActionDelaySize.x/2), itemActionDelayPosition.y-(itemActionDelaySize.y/2)-2], [width, itemActionDelaySize.y], COLOUR_LIME, COLOUR_LIME, COLOUR_LIME, COLOUR_LIME);
- }
- }
- }
+ let backgroundColour = toColour(0, 0, 0, 255);
+ graphics.drawRectangle(null, [itemActionDelayPosition.x-(itemActionDelaySize.x/2)-1, itemActionDelayPosition.y-(itemActionDelaySize.y/2)-1], [itemActionDelaySize.x+2, itemActionDelaySize.y+2], backgroundColour, backgroundColour, backgroundColour, backgroundColour);
+ graphics.drawRectangle(null, [itemActionDelayPosition.x-(itemActionDelaySize.x/2), itemActionDelayPosition.y-(itemActionDelaySize.y/2)-2], [width, itemActionDelaySize.y], COLOUR_LIME, COLOUR_LIME, COLOUR_LIME, COLOUR_LIME);
+ }
+ }
+ }
}
// ===========================================================================
function updatePlayerHotBar(activeSlot, itemsArray) {
- logToConsole(LOG_DEBUG, `[VRR.Main] Updating hotbar`);
+ logToConsole(LOG_DEBUG, `[VRR.Main] Updating hotbar`);
}
// ===========================================================================
function showItemActionDelay(duration) {
- itemActionDelayDuration = duration;
- itemActionDelayStart = sdl.ticks;
- itemActionDelayEnabled = true;
- logToConsole(LOG_DEBUG, `Item action delay started. Duration: ${itemActionDelayDuration}, Start: ${itemActionDelayStart}, Rendering Enabled: ${renderItemActionDelay}`);
+ itemActionDelayDuration = duration;
+ itemActionDelayStart = sdl.ticks;
+ itemActionDelayEnabled = true;
+ logToConsole(LOG_DEBUG, `Item action delay started. Duration: ${itemActionDelayDuration}, Start: ${itemActionDelayStart}, Rendering Enabled: ${renderItemActionDelay}`);
}
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/job.js b/scripts/client/job.js
index c993aa16..f9b057ca 100644
--- a/scripts/client/job.js
+++ b/scripts/client/job.js
@@ -14,6 +14,20 @@ let jobRouteLocationSphere = null;
// ===========================================================================
+class JobData {
+ constructor(jobId, name, position, blipModel, pickupModel) {
+ this.index = -1;
+ this.jobId = jobId;
+ this.name = name;
+ this.position = position;
+ this.blipModel = blipModel;
+ this.pickupModel = pickupModel;
+ this.blipId = -1;
+ }
+}
+
+// ===========================================================================
+
function initJobScript() {
logToConsole(LOG_DEBUG, "[VRR.Job]: Initializing job script ...");
logToConsole(LOG_DEBUG, "[VRR.Job]: Job script initialized!");
@@ -22,74 +36,161 @@ function initJobScript() {
// ===========================================================================
function setLocalPlayerJobType(tempJobType) {
- logToConsole(LOG_DEBUG, `[VRR.Main] Set local player job type to ${tempJobType}`);
- localPlayerJobType = tempJobType;
+ logToConsole(LOG_DEBUG, `[VRR.Job] Set local player job type to ${tempJobType}`);
+ localPlayerJobType = tempJobType;
}
// ===========================================================================
function setLocalPlayerWorkingState(tempWorking) {
- logToConsole(LOG_DEBUG, `[VRR.Main] Setting working state to ${tempWorking}`);
- localPlayerWorking = tempWorking;
+ logToConsole(LOG_DEBUG, `[VRR.Job] Setting working state to ${tempWorking}`);
+ localPlayerWorking = tempWorking;
}
// ===========================================================================
function showJobRouteLocation(position, colour) {
- logToConsole(LOG_DEBUG, `[VRR.Job] Showing job route location`);
- if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
- if(game.game == VRR_GAME_GTA_SA) {
- jobRouteLocationSphere = game.createPickup(1318, position, 1);
- } else {
- jobRouteLocationSphere = game.createSphere(position, 3);
- jobRouteLocationSphere.colour = colour;
- }
+ logToConsole(LOG_DEBUG, `[VRR.Job] Showing job route location`);
+ if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
+ if(game.game == VRR_GAME_GTA_SA) {
+ // Server-side spheres don't show in GTA SA for some reason.
+ jobRouteLocationSphere = game.createPickup(1318, position, 1);
+ } else {
+ jobRouteLocationSphere = game.createSphere(position, 3);
+ jobRouteLocationSphere.colour = colour;
+ }
- if(jobRouteLocationBlip != null) {
- destroyElement(jobRouteLocationBlip);
- }
+ if(jobRouteLocationBlip != null) {
+ destroyElement(jobRouteLocationBlip);
+ }
- blinkJobRouteLocationBlip(10, position, colour);
- }
+ blinkJobRouteLocationBlip(10, position, colour);
+ }
}
// ===========================================================================
function enteredJobRouteSphere() {
- logToConsole(LOG_DEBUG, `[VRR.Job] Entered job route sphere`);
- tellServerPlayerArrivedAtJobRouteLocation();
- destroyElement(jobRouteLocationSphere);
- destroyElement(jobRouteLocationBlip);
- jobRouteLocationSphere = null;
- jobRouteLocationBlip = null;
+ logToConsole(LOG_DEBUG, `[VRR.Job] Entered job route sphere`);
+ tellServerPlayerArrivedAtJobRouteLocation();
+ destroyElement(jobRouteLocationSphere);
+ destroyElement(jobRouteLocationBlip);
+ jobRouteLocationSphere = null;
+ jobRouteLocationBlip = null;
}
// ===========================================================================
function blinkJobRouteLocationBlip(times, position, colour) {
- for(let i = 1 ; i <= times ; i++) {
- setTimeout(function() {
- if(jobRouteLocationBlip != null) {
- destroyElement(jobRouteLocationBlip);
- jobRouteLocationBlip = null;
- } else {
- jobRouteLocationBlip = game.createBlip(position, 0, 2, colour);
- }
- }, 500*i);
- }
+ for(let i = 1 ; i <= times ; i++) {
+ setTimeout(function() {
+ if(jobRouteLocationBlip != null) {
+ destroyElement(jobRouteLocationBlip);
+ jobRouteLocationBlip = null;
+ } else {
+ jobRouteLocationBlip = game.createBlip(position, 0, 2, colour);
+ }
+ }, 500*i);
+ }
- setTimeout(function() {
- jobRouteLocationBlip = game.createBlip(position, 0, 2, colour);
- }, 500*times+1);
+ setTimeout(function() {
+ jobRouteLocationBlip = game.createBlip(position, 0, 2, colour);
+ }, 500*times+1);
}
// ===========================================================================
function hideJobRouteLocation() {
- destroyElement(jobRouteLocationSphere);
- destroyElement(jobRouteLocationBlip);
- jobRouteLocationSphere = null;
- jobRouteLocationBlip = null;
+ destroyElement(jobRouteLocationSphere);
+ destroyElement(jobRouteLocationBlip);
+ jobRouteLocationSphere = null;
+ jobRouteLocationBlip = null;
+}
+
+// ===========================================================================
+
+function receiveJobFromServer(jobId, name, position, blipModel, pickupModel) {
+ logToConsole(LOG_DEBUG, `[VRR.Job] Received job ${jobId} (${name}) from server`);
+
+ if(getGame() == VRR_GAME_GTA_IV) {
+ if(getJobData(jobId) != false) {
+ let jobData = getJobData(jobId);
+ jobData.name = name;
+ jobData.position = position;
+ jobData.blipModel = blipModel;
+ jobData.pickupModel = pickupModel;
+
+ logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId} already exists. Checking blip ...`);
+ if(blipModel == -1) {
+ if(jobData.blipId != -1) {
+ logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been removed by the server`);
+ if(getGame() == VRR_GAME_GTA_IV) {
+ natives.removeBlipAndClearIndex(getJobData(jobId).blipId);
+ } else {
+ destroyElement(getElementFromId(blipId));
+ }
+ jobData.blipId = -1;
+ } else {
+ logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip is unchanged`);
+ }
+ } else {
+ if(jobData.blipId != -1) {
+ logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been changed by the server`);
+ if(getGame() == VRR_GAME_GTA_IV) {
+ natives.setBlipCoordinates(jobData.blipId, jobData.position);
+ natives.changeBlipSprite(jobData.blipId, jobData.blipModel);
+ natives.setBlipMarkerLongDistance(jobData.blipId, false);
+ natives.setBlipAsShortRange(jobData.blipId, true);
+ natives.changeBlipNameFromAscii(jobData.blipId, `${jobData.name.substr(0, 24)}${(jobData.name.length > 24) ? " ...": ""}`);
+ }
+ } else {
+ let blipId = createGameBlip(jobData.blipModel, jobData.position, jobData.name);
+ if(blipId != -1) {
+ jobData.blipId = blipId;
+ }
+ logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
+ }
+ }
+ } else {
+ logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId} doesn't exist. Adding ...`);
+ let tempJobData = new JobData(jobId, name, position, blipModel, pickupModel);
+ if(blipModel != -1) {
+ let blipId = createGameBlip(tempJobData.blipModel, tempJobData.position, tempJobData.name);
+ if(blipId != -1) {
+ tempJobData.blipId = blipId;
+ }
+ logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
+ } else {
+ logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId} has no blip.`);
+ }
+ jobs.push(tempJobData);
+ setAllJobDataIndexes();
+ }
+ }
+}
+
+// ===========================================================================
+
+/**
+ * @param {number} job - The ID of the job (initially provided by server)
+ * @return {JobData} The job's data (class instance)
+ */
+ function getJobData(jobId) {
+ for(let i in jobs) {
+ if(jobs[i].jobId == jobId) {
+ return jobs[i];
+ }
+ }
+
+ return false;
+}
+
+// ===========================================================================
+
+function setAllJobDataIndexes() {
+ for(let i in jobs) {
+ jobs[i].index = i;
+ }
}
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/jsconfig.json b/scripts/client/jsconfig.json
index a5e369f2..f8c14e94 100644
--- a/scripts/client/jsconfig.json
+++ b/scripts/client/jsconfig.json
@@ -1,14 +1,14 @@
{
"compilerOptions": {
- "module": "commonjs",
- "target": "es6",
- "moduleResolution": "classic"
+ "module": "commonjs",
+ "target": "es6",
+ "moduleResolution": "classic"
},
"include": [
- "*.js",
- "gui/*.js",
- "native/*.js",
- "../shared/*.js",
- "../third-party/mexui/*"
+ "*.js",
+ "gui/*.js",
+ "native/*.js",
+ "../shared/*.js",
+ "../third-party/mexui/*"
]
}
\ No newline at end of file
diff --git a/scripts/client/keybind.js b/scripts/client/keybind.js
index 4c8c2d9c..ecc4bcb8 100644
--- a/scripts/client/keybind.js
+++ b/scripts/client/keybind.js
@@ -23,71 +23,71 @@ function initKeyBindScript() {
// ===========================================================================
function bindAccountKey(key, keyState) {
- logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Binded key ${toUpperCase(getKeyNameFromId(key))} (${key})`);
- keyBinds.push(toInteger(key));
- bindKey(toInteger(key), keyState, function(event) {
- if(isAnyGUIActive()) {
- return false;
- }
+ logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Binded key ${toUpperCase(getKeyNameFromId(key))} (${key})`);
+ keyBinds.push(toInteger(key));
+ bindKey(toInteger(key), keyState, function(event) {
+ if(isAnyGUIActive()) {
+ return false;
+ }
- if(hasKeyBindDelayElapsed()) {
- if(canLocalPlayerUseKeyBinds()) {
- logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Using keybind for key ${toUpperCase(getKeyNameFromId(key))} (${key})`);
- lastKeyBindUse = sdl.ticks;
- tellServerPlayerUsedKeyBind(key);
- } else {
- logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Failed to use keybind for key ${toUpperCase(getKeyNameFromId(key))} (${key}) - Not allowed to use keybinds!`);
- }
- } else {
- logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Failed to use keybind for key ${toUpperCase(getKeyNameFromId(key))} (${key}) - Not enough time has passed since last keybind use!`);
- }
- });
+ if(hasKeyBindDelayElapsed()) {
+ if(canLocalPlayerUseKeyBinds()) {
+ logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Using keybind for key ${toUpperCase(getKeyNameFromId(key))} (${key})`);
+ lastKeyBindUse = sdl.ticks;
+ tellServerPlayerUsedKeyBind(key);
+ } else {
+ logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Failed to use keybind for key ${toUpperCase(getKeyNameFromId(key))} (${key}) - Not allowed to use keybinds!`);
+ }
+ } else {
+ logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Failed to use keybind for key ${toUpperCase(getKeyNameFromId(key))} (${key}) - Not enough time has passed since last keybind use!`);
+ }
+ });
}
// ===========================================================================
function unBindAccountKey(key) {
- logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Unbinded key ${toUpperCase(getKeyNameFromId(key))} (${key})`);
- unbindKey(key);
- keyBinds.splice(keyBinds.indexOf(key), 1);
- return true;
+ logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Unbinded key ${toUpperCase(getKeyNameFromId(key))} (${key})`);
+ unbindKey(key);
+ keyBinds.splice(keyBinds.indexOf(key), 1);
+ return true;
}
// ===========================================================================
function hasKeyBindDelayElapsed() {
- if(sdl.ticks-lastKeyBindUse >= keyBindDelayTime) {
- return true;
- }
+ if(sdl.ticks-lastKeyBindUse >= keyBindDelayTime) {
+ return true;
+ }
- return false;
+ return false;
}
// ===========================================================================
function canLocalPlayerUseKeyBinds() {
- if(isAnyGUIActive()) {
- return false;
- }
+ if(isAnyGUIActive()) {
+ return false;
+ }
- if(!isSpawned) {
- return false;
- }
+ if(!isSpawned) {
+ return false;
+ }
- if(itemActionDelayEnabled) {
- return false;
- }
+ if(itemActionDelayEnabled) {
+ return false;
+ }
- return true;
+ return true;
}
// ===========================================================================
function clearKeyBinds() {
- for(let i in keyBinds) {
- unbindKey(keyBinds[i]);
- }
- keyBinds = [];
+ for(let i in keyBinds) {
+ unbindKey(keyBinds[i]);
+ }
+ keyBinds = [];
}
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/label.js b/scripts/client/label.js
index 4f20d67a..3afa875d 100644
--- a/scripts/client/label.js
+++ b/scripts/client/label.js
@@ -42,268 +42,334 @@ function initLabelScript() {
// ===========================================================================
function initLabelPropertyNameFont() {
- return lucasFont.createDefaultFont(16.0, "Roboto", "Regular");
+ return lucasFont.createDefaultFont(16.0, "Roboto", "Regular");
}
// ===========================================================================
function initLabelPropertyLockedFont() {
- return lucasFont.createDefaultFont(12.0, "Roboto", "Light");
+ return lucasFont.createDefaultFont(12.0, "Roboto", "Light");
}
// ===========================================================================
function initLabelJobNameFont() {
- return lucasFont.createDefaultFont(16.0, "Roboto", "Regular");
+ return lucasFont.createDefaultFont(16.0, "Roboto", "Regular");
}
// ===========================================================================
function initLabelJobHelpFont() {
- return lucasFont.createDefaultFont(10.0, "Roboto", "Light");
+ return lucasFont.createDefaultFont(10.0, "Roboto", "Light");
}
// ===========================================================================
function renderPropertyEntranceLabel(name, position, locked, isBusiness, price, rentPrice, labelInfoType) {
- if(localPlayer == null) {
- return false;
- }
+ if(localPlayer == null) {
+ return false;
+ }
if(propertyLabelNameFont == null) {
return false;
- }
+ }
if(propertyLabelLockedFont == null) {
return false;
- }
+ }
- let tempPosition = position;
- tempPosition.z = tempPosition.z + propertyLabelHeight;
- let screenPosition = getScreenFromWorldPosition(tempPosition);
+ if(getGame() == VRR_GAME_GTA_IV) {
+ if(!natives.doesViewportExist(natives.getGameViewportId())) {
+ logToConsole(LOG_INFO, "[VRR.Label]: Game viewport does not exist!");
+ return false;
+ }
- if(screenPosition.x < 0 || screenPosition.x > game.width) {
- return false;
- }
+ if(!natives.isViewportActive(natives.getGameViewportId())) {
+ logToConsole(LOG_INFO, "[VRR.Label]: Game viewport is not active!");
+ return false;
+ }
+ }
- let text = "";
- if(price > "0") {
- text = `For sale: $${price}`;
- let size = propertyLabelLockedFont.measure(text, game.width, 0.0, 0.0, propertyLabelLockedFont.size, true, true);
- propertyLabelLockedFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelLockedFont.size, toColour(200, 200, 200, 255), false, true, false, true);
+ let tempPosition = position;
+ tempPosition.z = tempPosition.z + propertyLabelHeight;
+ let screenPosition = new Vec3(0.0, 0.0, 0.0);
+ if(getGame() == VRR_GAME_GTA_IV) {
+ screenPosition = natives.getViewportPositionOfCoord(tempPosition, natives.getGameViewportId());
+ } else {
+ screenPosition = getScreenFromWorldPosition(tempPosition);
+ }
- screenPosition.y -= propertyLabelPriceOffset;
- }
+ if(screenPosition.x < 0 || screenPosition.x > game.width) {
+ return false;
+ }
- text = "";
- if(rentPrice != "0") {
- text = `For rent: $${rentPrice} every payday`;
- let size = propertyLabelLockedFont.measure(text, game.width, 0.0, 0.0, propertyLabelLockedFont.size, true, true);
- propertyLabelLockedFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelLockedFont.size, toColour(200, 200, 200, 255), false, true, false, true);
+ let text = "";
+ if(price > "0") {
+ text = getLocaleString("PropertyForSaleLabel", price);
+ let size = propertyLabelLockedFont.measure(text, game.width, 0.0, 0.0, propertyLabelLockedFont.size, true, true);
+ propertyLabelLockedFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelLockedFont.size, toColour(200, 200, 200, 255), false, true, false, true);
- screenPosition.y -= propertyLabelPriceOffset;
- }
+ screenPosition.y -= propertyLabelPriceOffset;
+ }
+
+ text = "";
+ if(rentPrice != "0") {
+ text = getLocaleString("PropertyForRentLabel", rentPrice);
+ let size = propertyLabelLockedFont.measure(text, game.width, 0.0, 0.0, propertyLabelLockedFont.size, true, true);
+ propertyLabelLockedFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelLockedFont.size, toColour(200, 200, 200, 255), false, true, false, true);
+
+ screenPosition.y -= propertyLabelPriceOffset;
+ }
- if(isBusiness) {
- text = (locked) ? "CLOSED" : "OPEN";
- } else {
- text = (locked) ? "LOCKED" : "UNLOCKED";
- }
+ if(isBusiness) {
+ text = (locked) ? toUpperCase(getLocaleString("Closed")) : toUpperCase(getLocaleString("Open"));
+ } else {
+ text = (locked) ? toUpperCase(getLocaleString("Locked")) : toUpperCase(getLocaleString("Unlocked"));
+ }
- if(!locked && labelInfoType != VRR_PROPLABEL_INFO_NONE) {
- let infoText = "";
- switch(labelInfoType) {
- case VRR_PROPLABEL_INFO_ENTER:
- if(enterPropertyKey) {
- infoText = `Press ${toUpperCase(getKeyNameFromId(enterPropertyKey))} to enter`;
- } else {
- infoText = `Use /enter to enter`;
- }
- break;
+ if(!locked && labelInfoType != VRR_PROPLABEL_INFO_NONE) {
+ let infoText = "";
+ switch(labelInfoType) {
+ case VRR_PROPLABEL_INFO_ENTER:
+ if(enterPropertyKey) {
+ infoText = getLocaleString("PropertyEnterCommandLabel", "/enter");
+ } else {
+ infoText = getLocaleString("PropertyEnterKeyPressLabel", getKeyNameFromId(enterPropertyKey));
+ }
+ break;
- case VRR_PROPLABEL_INFO_BUY:
- infoText = `Use /buy to purchase items`;
- break;
+ case VRR_PROPLABEL_INFO_BUY:
+ infoText = getLocaleString("BusinessBuyItemsLabel", "/buy");
+ break;
- case VRR_PROPLABEL_INFO_BUYBIZ:
- infoText = `Use /buy to purchase items`;
- break;
+ case VRR_PROPLABEL_INFO_BUYBIZ:
+ infoText = getLocaleString("PropertyForSaleLabel", price);
+ break;
- //case VRR_PROPLABEL_INFO_RENTBIZ:
- // infoText = `Use /bizrent to buy this business`;
- // break;
+ //case VRR_PROPLABEL_INFO_RENTBIZ:
+ // infoText = `Use /bizrent to buy this business`;
+ // break;
- case VRR_PROPLABEL_INFO_BUYHOUSE:
- infoText = `Use /housebuy to buy this house`;
- break;
+ case VRR_PROPLABEL_INFO_BUYHOUSE:
+ infoText = getLocaleString("PropertyForSaleLabel", price);
+ break;
- case VRR_PROPLABEL_INFO_RENTHOUSE:
- infoText = `Use /houserent to rent this house`;
- break;
+ case VRR_PROPLABEL_INFO_RENTHOUSE:
+ infoText = getLocaleString("PropertyForRentLabel", rentPrice);
+ break;
- case VRR_PROPLABEL_INFO_ENTERVEH:
- infoText = "Enter a vehicle in the parking lot to buy it";
- break;
+ case VRR_PROPLABEL_INFO_ENTERVEH:
+ infoText = getLocaleString("VehicleDealershipLabel");
+ break;
- case VRR_PROPLABEL_INFO_NONE:
- default:
- infoText = "";
- break;
- }
- if(getDistance(localPlayer.position, position) <= renderLabelDistance-2) {
- let size = propertyLabelLockedFont.measure(infoText, game.width, 0.0, 0.0, propertyLabelLockedFont.size, true, true);
- propertyLabelLockedFont.render(infoText, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelLockedFont.size, toColour(234, 198, 126, 255), false, true, false, true);
- screenPosition.y -= propertyLabelLockedOffset;
- }
- }
+ case VRR_PROPLABEL_INFO_NONE:
+ default:
+ infoText = "";
+ break;
+ }
+ if(getDistance(localPlayer.position, position) <= renderLabelDistance-2) {
+ let size = propertyLabelLockedFont.measure(infoText, game.width, 0.0, 0.0, propertyLabelLockedFont.size, true, true);
+ propertyLabelLockedFont.render(infoText, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelLockedFont.size, toColour(234, 198, 126, 255), false, true, false, true);
+ screenPosition.y -= propertyLabelLockedOffset;
+ }
+ }
- let size = propertyLabelLockedFont.measure(text, game.width, 0.0, 0.0, propertyLabelLockedFont.size, true, true);
- propertyLabelLockedFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelLockedFont.size, (locked) ? lockedColour : unlockedColour, false, true, false, true);
+ let size = propertyLabelLockedFont.measure(text, game.width, 0.0, 0.0, propertyLabelLockedFont.size, true, true);
+ propertyLabelLockedFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelLockedFont.size, (locked) ? lockedColour : unlockedColour, false, true, false, true);
- screenPosition.y -= propertyLabelNameOffset;
+ screenPosition.y -= propertyLabelNameOffset;
- text = name || " ";
- size = propertyLabelNameFont.measure(text, game.width, 0.0, 0.0, propertyLabelNameFont.size, true, true);
- propertyLabelNameFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelNameFont.size, (isBusiness) ? toColour(0, 153, 255, 255) : toColour(17, 204, 17, 255), false, true, false, true);
+ text = name || " ";
+ size = propertyLabelNameFont.measure(text, game.width, 0.0, 0.0, propertyLabelNameFont.size, true, true);
+ propertyLabelNameFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelNameFont.size, (isBusiness) ? toColour(0, 153, 255, 255) : toColour(17, 204, 17, 255), false, true, false, true);
}
// -------------------------------------------------------------------------
function renderPropertyExitLabel(position) {
- if(localPlayer == null) {
- return false;
- }
+ if(localPlayer == null) {
+ return false;
+ }
if(propertyLabelNameFont == null) {
return false;
- }
+ }
if(propertyLabelLockedFont == null) {
return false;
}
- let tempPosition = position;
- tempPosition.z = tempPosition.z + propertyLabelHeight;
- let screenPosition = getScreenFromWorldPosition(tempPosition);
+ if(getGame() == VRR_GAME_GTA_IV) {
+ if(!natives.doesViewportExist(natives.getGameViewportId())) {
+ logToConsole(LOG_INFO, "[VRR.Label]: Game viewport does not exist!");
+ return false;
+ }
- if(screenPosition.x < 0 || screenPosition.x > game.width) {
- return false;
- }
+ if(!natives.isViewportActive(natives.getGameViewportId())) {
+ logToConsole(LOG_INFO, "[VRR.Label]: Game viewport is not active!");
+ return false;
+ }
+ }
- let text = "EXIT";
- let size = propertyLabelNameFont.measure(text, game.width, 0.0, 0.0, propertyLabelNameFont.size, true, true);
- propertyLabelNameFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelNameFont.size, COLOUR_WHITE, false, true, false, true);
+ let tempPosition = position;
+ tempPosition.z = tempPosition.z + propertyLabelHeight;
+ let screenPosition = new Vec3(0.0, 0.0, 0.0);
+ if(getGame() == VRR_GAME_GTA_IV) {
+ screenPosition = natives.getViewportPositionOfCoord(tempPosition, natives.getGameViewportId());
+ } else {
+ screenPosition = getScreenFromWorldPosition(tempPosition);
+ }
+
+ if(screenPosition.x < 0 || screenPosition.x > game.width) {
+ return false;
+ }
+
+ let text = "EXIT";
+ let size = propertyLabelNameFont.measure(text, game.width, 0.0, 0.0, propertyLabelNameFont.size, true, true);
+ propertyLabelNameFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelNameFont.size, COLOUR_WHITE, false, true, false, true);
}
// -------------------------------------------------------------------------
function renderJobLabel(name, position, jobType) {
- if(localPlayer == null) {
- return false;
- }
+ if(localPlayer == null) {
+ return false;
+ }
if(jobNameLabelFont == null) {
return false;
- }
+ }
if(jobHelpLabelFont == null) {
return false;
}
- let tempPosition = position;
- tempPosition.z = tempPosition.z + propertyLabelHeight;
- let screenPosition = getScreenFromWorldPosition(tempPosition);
+ if(getGame() == VRR_GAME_GTA_IV) {
+ if(!natives.doesViewportExist(natives.getGameViewportId())) {
+ logToConsole(LOG_INFO, "[VRR.Label]: Game viewport does not exist!");
+ return false;
+ }
- if(screenPosition.x < 0 || screenPosition.x > game.width) {
- return false;
- }
+ if(!natives.isViewportActive(natives.getGameViewportId())) {
+ logToConsole(LOG_INFO, "[VRR.Label]: Game viewport is not active!");
+ return false;
+ }
+ }
- let text = "";
- if(jobType == localPlayerJobType) {
- if(localPlayerWorking) {
- text = "Use /uniform and /equip for job stuff, or /stopwork to go off duty";
- } else {
- text = "Use /startwork to go on duty";
- }
- } else {
- if(localPlayerJobType == 0) {
- text = "Use /takejob to work here";
- } else {
- text = "You already have a job. Use /quitjob if you want this one";
- }
- }
+ let tempPosition = position;
+ tempPosition.z = tempPosition.z + propertyLabelHeight;
+ let screenPosition = new Vec3(0.0, 0.0, 0.0);
+ if(getGame() == VRR_GAME_GTA_IV) {
+ screenPosition = natives.getViewportPositionOfCoord(tempPosition, natives.getGameViewportId());
+ } else {
+ screenPosition = getScreenFromWorldPosition(tempPosition);
+ }
- let size = jobHelpLabelFont.measure(text, game.width, 0.0, 0.0, jobHelpLabelFont.size, true, true);
- jobHelpLabelFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, jobHelpLabelFont.size, COLOUR_YELLOW, false, true, false, true);
+ if(screenPosition.x < 0 || screenPosition.x > game.width) {
+ return false;
+ }
- screenPosition.y -= 18;
+ let text = "";
+ if(jobType == localPlayerJobType) {
+ if(localPlayerWorking) {
+ text = getLocaleString("JobEquipAndUniformLabel", "/equip", "/uniform", "/stopwork");
+ } else {
+ text = getLocaleString("StartWorkLabel", "/startwork");
+ }
+ } else {
+ if(localPlayerJobType == 0) {
+ text = getLocaleString("TakeJobLabel", "/takejob");
+ } else {
+ text = getLocaleString("NotYourJobLabel", "/quitjob");
+ }
+ }
- text = name + " Job";
- size = jobNameLabelFont.measure(text, game.width, 0.0, 0.0, jobNameLabelFont.size, true, true);
- jobNameLabelFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, jobNameLabelFont.size, COLOUR_WHITE, false, true, false, true);
+ let size = jobHelpLabelFont.measure(text, game.width, 0.0, 0.0, jobHelpLabelFont.size, true, true);
+ jobHelpLabelFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, jobHelpLabelFont.size, COLOUR_YELLOW, false, true, false, true);
+
+ screenPosition.y -= 18;
+
+ text = getLocaleString("JobLabel", name);
+ size = jobNameLabelFont.measure(text, game.width, 0.0, 0.0, jobNameLabelFont.size, true, true);
+ jobNameLabelFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, jobNameLabelFont.size, COLOUR_WHITE, false, true, false, true);
}
// -------------------------------------------------------------------------
function processLabelRendering() {
- if(renderLabels) {
- if(!areServerElementsSupported()) {
- if(localPlayer != null) {
- for(let i in businesses) {
- if(getDistance(localPlayer.position, businesses[i].entrancePosition) <= 75.0) {
- natives.drawColouredCylinder(getPosBelowPos(businesses[i].entrancePosition, 1.0), 0.0, 0.0, 0, 153, 255, 255);
- }
- }
- }
- }
-
- if(areWorldLabelsSupported()) {
- if(localPlayer != null) {
- let pickups = getElementsByType(ELEMENT_PICKUP);
- for(let i in pickups) {
- if(pickups[i].getData("vrr.label.type") != null) {
- if(getDistance(localPlayer.position, pickups[i].position) <= renderLabelDistance) {
- if(!pickups[i].isOnScreen) {
- let price = "0";
- let rentPrice = "0";
- let labelInfoType = VRR_PROPLABEL_INFO_NONE;
- if(pickups[i].getData("vrr.label.price") != null) {
- price = makeLargeNumberReadable(pickups[i].getData("vrr.label.price"));
- }
-
- if(pickups[i].getData("vrr.label.rentprice") != null) {
- rentPrice = makeLargeNumberReadable(pickups[i].getData("vrr.label.rentprice"));
- }
-
- if(pickups[i].getData("vrr.label.help") != null) {
- labelInfoType = pickups[i].getData("vrr.label.help");
- }
-
- switch(pickups[i].getData("vrr.label.type")) {
- case VRR_LABEL_BUSINESS:
- renderPropertyEntranceLabel(pickups[i].getData("vrr.label.name"), pickups[i].position, pickups[i].getData("vrr.label.locked"), true, price, rentPrice, labelInfoType);
- break;
-
- case VRR_LABEL_HOUSE:
- renderPropertyEntranceLabel("House", pickups[i].position, pickups[i].getData("vrr.label.locked"), false, price, rentPrice, labelInfoType);
- break;
-
- case VRR_LABEL_JOB:
- renderJobLabel(pickups[i].getData("vrr.label.name"), pickups[i].position, pickups[i].getData("vrr.label.jobType"));
- break;
-
- case VRR_LABEL_EXIT:
- renderPropertyExitLabel(pickups[i].position);
- break;
- }
- }
- }
- }
- }
- }
- }
- }
+ if(renderLabels) {
+ if(!areServerElementsSupported()) {
+ if(localPlayer != null) {
+ getServerData().businesses.forEach((business) => {
+ if(getDistance(localPlayer.position, business.entrancePosition) <= 75.0) {
+ natives.drawColouredCylinder(getPosBelowPos(business.entrancePosition, 1.0), 0.0, 0.0, 0, 153, 255, 255);
+ //renderPropertyEntranceLabel(business.name, business.entrancePosition, business.locked, true, makeLargeNumberReadable(business.price), makeLargeNumberReadable(business.rentPrice), business.labelInfoType);
+ }
+ });
+
+ getServerData().houses.forEach((house) => {
+ if(getDistance(localPlayer.position, house.entrancePosition) <= 75.0) {
+ natives.drawColouredCylinder(getPosBelowPos(house.entrancePosition, 1.0), 0.0, 0.0, 0, 200, 0, 255);
+ //renderPropertyEntranceLabel("House", house.entrancePosition, house.locked, true, makeLargeNumberReadable(house.price), makeLargeNumberReadable(house.rentPrice), 0);
+ }
+ });
+
+ getServerData().jobs.forEach((job) => {
+ if(getDistance(localPlayer.position, job.position) <= 75.0) {
+ natives.drawColouredCylinder(getPosBelowPos(job.position, 1.0), 0.0, 0.0, 255, 255, 0, 255);
+ //renderJobLabel(job.name, job.position, job.jobType);
+ }
+ });
+ }
+ }
+
+ if(areWorldLabelsSupported()) {
+ if(localPlayer != null) {
+ let pickups = getElementsByType(ELEMENT_PICKUP);
+ for(let i in pickups) {
+ if(pickups[i].getData("vrr.label.type") != null) {
+ if(getDistance(localPlayer.position, pickups[i].position) <= renderLabelDistance) {
+ if(!pickups[i].isOnScreen) {
+ let price = "0";
+ let rentPrice = "0";
+ let labelInfoType = VRR_PROPLABEL_INFO_NONE;
+ if(pickups[i].getData("vrr.label.price") != null) {
+ price = makeLargeNumberReadable(pickups[i].getData("vrr.label.price"));
+ }
+
+ if(pickups[i].getData("vrr.label.rentprice") != null) {
+ rentPrice = makeLargeNumberReadable(pickups[i].getData("vrr.label.rentprice"));
+ }
+
+ if(pickups[i].getData("vrr.label.help") != null) {
+ labelInfoType = pickups[i].getData("vrr.label.help");
+ }
+
+ switch(pickups[i].getData("vrr.label.type")) {
+ case VRR_LABEL_BUSINESS:
+ renderPropertyEntranceLabel(pickups[i].getData("vrr.label.name"), pickups[i].position, pickups[i].getData("vrr.label.locked"), true, price, rentPrice, labelInfoType);
+ break;
+
+ case VRR_LABEL_HOUSE:
+ renderPropertyEntranceLabel("House", pickups[i].position, pickups[i].getData("vrr.label.locked"), false, price, rentPrice, labelInfoType);
+ break;
+
+ case VRR_LABEL_JOB:
+ renderJobLabel(pickups[i].getData("vrr.label.name"), pickups[i].position, pickups[i].getData("vrr.label.jobType"));
+ break;
+
+ case VRR_LABEL_EXIT:
+ renderPropertyExitLabel(pickups[i].position);
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
}
// -------------------------------------------------------------------------
\ No newline at end of file
diff --git a/scripts/client/locale.js b/scripts/client/locale.js
new file mode 100644
index 00000000..53eb182a
--- /dev/null
+++ b/scripts/client/locale.js
@@ -0,0 +1,31 @@
+// ===========================================================================
+// Vortrex's Roleplay Resource
+// https://github.com/VortrexFTW/gtac_roleplay
+// ===========================================================================
+// FILE: locale.js
+// DESC: Provides locale functions and usage
+// TYPE: Client (JavaScript)
+// ===========================================================================
+
+function getLocaleString(stringName, ...args) {
+ if(typeof getServerData().localeStrings[stringName] == undefined) {
+ return "";
+ }
+
+ let tempString = getServerData().localeStrings[stringName];
+
+ for(let i = 1; i <= args.length; i++) {
+ tempString = tempString.replace(`{${i}}`, args[i-1]);
+ }
+
+ return tempString;
+}
+
+// ===========================================================================
+
+function receiveLocaleStringFromServer(stringName, stringValue) {
+ logToConsole(LOG_INFO, `[VRR.Locale]: Received locale string "${stringName}" from server (${stringValue})`);
+ getServerData().localeStrings[stringName] = stringValue;
+}
+
+// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/logo.js b/scripts/client/logo.js
index 286e38e1..9a23f20b 100644
--- a/scripts/client/logo.js
+++ b/scripts/client/logo.js
@@ -15,38 +15,38 @@ let logoSize = toVector2(128, 128);
function initLogoScript() {
logToConsole(LOG_DEBUG, "[VRR.Logo]: Initializing logo script ...");
- //logoImage = loadLogoImage();
+ //logoImage = loadLogoImage();
logToConsole(LOG_DEBUG, "[VRR.Logo]: Logo script initialized!");
}
// ===========================================================================
function loadLogoImage() {
- let logoStream = openFile(mainLogoPath);
- let tempLogoImage = null;
- if(logoStream != null) {
- tempLogoImage = graphics.loadPNG(logoStream);
- logoStream.close();
- }
+ let logoStream = openFile(mainLogoPath);
+ let tempLogoImage = null;
+ if(logoStream != null) {
+ tempLogoImage = graphics.loadPNG(logoStream);
+ logoStream.close();
+ }
- return tempLogoImage;
+ return tempLogoImage;
}
// ===========================================================================
function processLogoRendering() {
- if(renderLogo) {
- if(logoImage != null) {
- graphics.drawRectangle(logoImage, logoPos, logoSize);
- }
- }
+ if(renderLogo) {
+ if(logoImage != null) {
+ graphics.drawRectangle(logoImage, logoPos, logoSize);
+ }
+ }
}
// ===========================================================================
function setServerLogoRenderState(state) {
- logToConsole(LOG_DEBUG, `[VRR.Main] Server logo ${(state) ? "enabled" : "disabled"}`);
- renderLogo = state;
+ logToConsole(LOG_DEBUG, `[VRR.Main] Server logo ${(state) ? "enabled" : "disabled"}`);
+ renderLogo = state;
}
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/main.js b/scripts/client/main.js
index e28117a2..bb8157eb 100644
--- a/scripts/client/main.js
+++ b/scripts/client/main.js
@@ -27,7 +27,7 @@ let renderHotBar = true;
let renderItemActionDelay = true;
let renderInteriorLights = true;
-let logLevel = LOG_ERROR|LOG_WARN|LOG_INFO;
+let logLevel = LOG_INFO|LOG_DEBUG|LOG_VERBOSE|LOG_WARN|LOG_ERROR;
let weaponDamageEnabled = {};
let weaponDamageEvent = {};
@@ -66,12 +66,21 @@ let vehiclePurchasePosition = null;
let forceWantedLevel = 0;
+let guiSubmitKey = false;
+let guiLeftKey = false;
+let guiRightKey = false;
+let guiUpKey = false;
+let guiDownKey = false;
+
// Pre-cache all allowed skins
let allowedSkins = getAllowedSkins(getGame());
-let businesses = [];
-let houses = [];
-let jobs = [];
-let vehicles = [];
+let serverData = {
+ houses: [],
+ businesses: [],
+ localeStrings: [],
+ vehicles: [],
+ jobs: [],
+};
-// ===========================================================================
\ No newline at end of file
+// ===========================================================================
diff --git a/scripts/client/messaging.js b/scripts/client/messaging.js
index a2c97cfd..1bd288c3 100644
--- a/scripts/client/messaging.js
+++ b/scripts/client/messaging.js
@@ -7,7 +7,14 @@
// TYPE: Client (JavaScript)
// ===========================================================================
-let smallGameMessageFont = null;
+let bigGameMessageFonts = {};
+let bigGameMessageFontName = "";
+let bigGameMessageText = "";
+let bigGameMessageColour = COLOUR_WHITE;
+let bigGameMessageTimer = null;
+
+let smallGameMessageFonts = {};
+let smallGameMessageFontName = "";
let smallGameMessageText = "";
let smallGameMessageColour = COLOUR_WHITE;
let smallGameMessageTimer = null;
@@ -16,64 +23,73 @@ let smallGameMessageTimer = null;
function initMessagingScript() {
logToConsole(LOG_DEBUG, "[VRR.Messaging]: Initializing messaging script ...");
- smallGameMessageFont = loadSmallGameMessageFont();
+ smallGameMessageFonts = loadSmallGameMessageFonts();
+ bigGameMessageFonts = loadSmallGameMessageFonts();
logToConsole(LOG_DEBUG, "[VRR.Messaging]: Messaging script initialized!");
}
// ===========================================================================
-function loadSmallGameMessageFont() {
- let tempSmallGameMessageFont = null;
- let fontStream = openFile("files/fonts/pricedown.ttf");
- if(fontStream != null) {
- tempSmallGameMessageFont = lucasFont.createFont(fontStream, 20.0);
- fontStream.close();
- }
+function loadSmallGameMessageFonts() {
+ let tempSmallGameMessageFonts = {};
+ let fontStream = openFile("files/fonts/pricedown.ttf");
+ if(fontStream != null) {
+ tempSmallGameMessageFonts["Pricedown"] = lucasFont.createFont(fontStream, 20.0);
+ fontStream.close();
+ }
- return tempSmallGameMessageFont;
+ tempSmallGameMessageFonts["Roboto"] = lucasFont.createDefaultFont(20.0, "Roboto");
+ tempSmallGameMessageFonts["RobotoLight"] = lucasFont.createDefaultFont(20.0, "Roboto", "Light");
+
+ return tempSmallGameMessageFonts;
}
// ===========================================================================
function loadBigGameMessageFont() {
- let tempBigGameMessageFont = null;
- let fontStream = openFile("files/fonts/pricedown.ttf");
- if(fontStream != null) {
- tempBigGameMessageFont = lucasFont.createFont(fontStream, 28.0);
- fontStream.close();
- }
+ let tempBigGameMessageFonts = {};
+ let fontStream = openFile("files/fonts/pricedown.ttf");
+ if(fontStream != null) {
+ tempBigGameMessageFonts["Pricedown"] = lucasFont.createFont(fontStream, 28.0);
+ fontStream.close();
+ }
- return tempBigGameMessageFont;
+ tempBigGameMessageFonts["Roboto"] = lucasFont.createDefaultFont(28.0, "Roboto");
+ tempBigGameMessageFonts["RobotoLight"] = lucasFont.createDefaultFont(28.0, "Roboto", "Light");
+
+ return tempBigGameMessageFonts;
}
// ===========================================================================
function processSmallGameMessageRendering() {
- if(renderSmallGameMessage) {
- if(smallGameMessageFont != null) {
- if(smallGameMessageFont != "") {
- smallGameMessageFont.render(smallGameMessageText, [0, game.height-90], game.width, 0.5, 0.0, smallGameMessageFont.size, smallGameMessageColour, true, true, false, true);
- }
- }
- }
+ if(renderSmallGameMessage) {
+ if(smallGameMessageText != "") {
+ if(smallGameMessageFonts[smallGameMessageFontName] != null) {
+ smallGameMessageFonts[smallGameMessageFontName].render(smallGameMessageText, [0, game.height-90], game.width, 0.5, 0.0, smallGameMessageFonts[smallGameMessageFontName].size, smallGameMessageColour, true, true, false, true);
+ }
+ }
+ }
}
// ===========================================================================
-function showSmallGameMessage(text, colour, duration) {
- logToConsole(LOG_DEBUG, `[VRR.Messaging] Showing small game message '${text}' for ${duration}ms`);
- if(smallGameMessageText != "") {
- clearTimeout(smallGameMessageTimer);
- }
+function showSmallGameMessage(text, colour, duration, fontName) {
+ logToConsole(LOG_DEBUG, `[VRR.Messaging] Showing small game message '${text}' using font ${fontName} for ${duration}ms`);
+ if(smallGameMessageText != "") {
+ clearTimeout(smallGameMessageTimer);
+ }
- smallGameMessageColour = colour;
- smallGameMessageText = text;
+ smallGameMessageFontName = fontName;
+ smallGameMessageColour = colour;
+ smallGameMessageText = text;
- smallGameMessageTimer = setTimeout(function() {
- smallGameMessageText = "";
- smallGameMessageColour = COLOUR_WHITE;
- smallGameMessageTimer = null;
- }, duration);
+ smallGameMessageTimer = setTimeout(function() {
+ smallGameMessageText = "";
+ smallGameMessageColour = COLOUR_WHITE;
+ smallGameMessageTimer = null;
+ smallGameMessageFontName = "";
+ }, duration);
}
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/mousecam.js b/scripts/client/mousecam.js
index cd4bfd7b..edb85550 100644
--- a/scripts/client/mousecam.js
+++ b/scripts/client/mousecam.js
@@ -632,10 +632,10 @@ function update()
addEventHandler("OnCameraProcess", (event) =>
{
- if(mouseCameraEnabled) {
- update();
- event.preventDefault();
- }
+ if(mouseCameraEnabled) {
+ update();
+ event.preventDefault();
+ }
});
function toggleMouseCamera() {
diff --git a/scripts/client/nametag.js b/scripts/client/nametag.js
index 7009f884..ccc8347c 100644
--- a/scripts/client/nametag.js
+++ b/scripts/client/nametag.js
@@ -51,8 +51,8 @@ function updatePlayerNameTag(clientName, characterName, colour, paused, ping) {
if(game.game == VRR_GAME_GTA_IV) {
let client = getPlayerFromParams(clientName);
if(client != false) {
- if(client.player != null) {
- client.player.setNametag(characterName, colour);
+ if(getPlayerPed(client) != null) {
+ getPlayerPed(client).setNametag(characterName, colour);
}
}
}
@@ -74,11 +74,11 @@ function drawNametag(x, y, health, armour, text, ping, alpha, distance, colour,
alpha *= 0.75;
let width = nametagWidth;
health = Math.max(0.0, Math.min(1.0, health));
- armour = Math.max(0.0, Math.min(1.0, armour));
+ armour = Math.max(0.0, Math.min(1.0, armour));
- // Starts at bottom and works it's way up
- // -------------------------------------------
- // Health Bar
+ // Starts at bottom and works it's way up
+ // -------------------------------------------
+ // Health Bar
if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
if(game.game == VRR_GAME_GTA_III) {
@@ -104,7 +104,7 @@ function drawNametag(x, y, health, armour, text, ping, alpha, distance, colour,
graphics.drawRectangle(null, [hx+2, hy+2], [(width-4)*health, 10-6], colour, colour, colour, colour);
}
- // Armour Bar
+ // Armour Bar
if (armour > 0.0)
{
// Go up 10 pixels to draw the next part
@@ -119,16 +119,16 @@ function drawNametag(x, y, health, armour, text, ping, alpha, distance, colour,
y -= 20;
- // Nametag
+ // Nametag
if(nametagFont != null) {
let size = nametagFont.measure(text, game.width, 0.0, 0.0, nametagFont.size, false, false);
nametagFont.render(text, [x-size[0]/2, y-size[1]/2], game.width, 0.0, 0.0, nametagFont.size, colour, false, false, false, true);
}
- // Go up another 10 pixels for the next part
- y -= 20;
+ // Go up another 10 pixels for the next part
+ y -= 20;
- // AFK Status
+ // AFK Status
if(afkStatusFont != null) {
if(afk) {
let size = afkStatusFont.measure("PAUSED", game.width, 0.0, 0.0, afkStatusFont.size, false, false);
@@ -147,7 +147,7 @@ function updateNametags(element) {
if(localPlayer != null) {
let playerPos = localPlayer.position;
let elementPos = element.position;
- let client = getClientFromPlayerElement(element);
+ let client = getClientFromPlayerElement(element);
elementPos[2] += 0.9;
@@ -173,26 +173,26 @@ function updateNametags(element) {
}
if(element.type == ELEMENT_PLAYER) {
- let name = element.name;
- let colour = COLOUR_WHITE;
+ let name = element.name;
+ let colour = COLOUR_WHITE;
let paused = false;
let ping = -1;
- if(typeof playerNames[element.name] != "undefined") {
- name = playerNames[element.name];
- }
-
- if(typeof playerPaused[element.name] != "undefined") {
- paused = playerPaused[element.name];
- }
-
- if(typeof playerColours[element.name] != "undefined") {
- colour = playerColours[element.name];
+ if(typeof playerNames[element.name] != "undefined") {
+ name = playerNames[element.name];
}
- if(typeof playerPing[element.name] != "undefined") {
- ping = playerPing[element.name];
- }
+ if(typeof playerPaused[element.name] != "undefined") {
+ paused = playerPaused[element.name];
+ }
+
+ if(typeof playerColours[element.name] != "undefined") {
+ colour = playerColours[element.name];
+ }
+
+ if(typeof playerPing[element.name] != "undefined") {
+ ping = playerPing[element.name];
+ }
drawNametag(screenPos[0], screenPos[1], health, armour, name, ping, 1.0-distance/nametagDistance, distance, colour, paused, element.skin);
}
@@ -205,7 +205,7 @@ function updateNametags(element) {
function getClientFromPlayer(player) {
getClients().forEach(function(client) {
- if(client.player == player) {
+ if(getPlayerPed(client) == player) {
return client;
}
});
diff --git a/scripts/client/native/connected.js b/scripts/client/native/connected.js
index f62b24bc..ba5c4ebc 100644
--- a/scripts/client/native/connected.js
+++ b/scripts/client/native/connected.js
@@ -8,57 +8,61 @@
// ===========================================================================
function sendNetworkEventToPlayer(networkEvent, client, ...args) {
- triggerNetworkEvent.apply(null, networkEvent, client, args);
+ triggerNetworkEvent.apply(null, networkEvent, client, args);
}
// ===========================================================================
function getPlayerPosition() {
- return localPlayer.position;
+ return localPlayer.position;
}
// ===========================================================================
function setPlayerPosition(position) {
- localPlayer.position = position;
+ if(getGame() == VRR_GAME_GTA_IV) {
+ natives.setCharCoordinates(localPlayer, position);
+ } else {
+ localPlayer.position = position;
+ }
}
// ===========================================================================
function getElementPosition(element) {
- return element.position;
+ return element.position;
}
// ===========================================================================
function setElementPosition(element, position) {
- if(!element.isSyncer) {
- return false;
- }
+ if(!element.isSyncer) {
+ return false;
+ }
- element.position = position;
+ element.position = position;
}
// ===========================================================================
function deleteGameElement(element, position) {
- if(!element.isOwner) {
- return false;
- }
+ if(!element.isOwner) {
+ return false;
+ }
- destroyGameElement(element);
+ destroyGameElement(element);
}
// ===========================================================================
function createGameVehicle(modelIndex, position, heading) {
- return game.createVehicle(getGameConfig().vehicles[getGame()][modelIndex][0], position, heading);
+ return game.createVehicle(getGameConfig().vehicles[getGame()][modelIndex][0], position, heading);
}
// ===========================================================================
function addNetworkEventHandler(eventName, handlerFunction) {
- addNetworkHandler(eventName, handlerFunction);
+ addNetworkHandler(eventName, handlerFunction);
}
// ===========================================================================
@@ -141,4 +145,47 @@ function getVehiclesInRange(position, range) {
return inRangeVehicles;
}
+// ===========================================================================
+
+function createGameBlip(blipModel, position, name = "") {
+ if(getGame() == VRR_GAME_GTA_IV) {
+ let blipId = natives.addBlipForCoord(position);
+ if(blipId) {
+ natives.changeBlipSprite(blipId, blipModel);
+ natives.setBlipMarkerLongDistance(blipId, false);
+ natives.setBlipAsShortRange(blipId, true);
+ natives.changeBlipNameFromAscii(blipId, `${name.substr(0, 24)}${(name.length > 24) ? " ...": ""}`);
+ return blipId;
+ }
+ }
+
+ return -1;
+}
+
+// ===========================================================================
+
+function setEntityData(entity, dataName, dataValue, syncToClients = true) {
+ if(entity != null) {
+ return entity.setData(dataName, dataValue);
+ }
+}
+
+// ===========================================================================
+
+function removeEntityData(entity, dataName) {
+ if(entity != null) {
+ return entity.removeData(dataName);
+ }
+ return null;
+}
+
+// ===========================================================================
+
+function doesEntityDataExist(entity, dataName) {
+ if(entity != null) {
+ return (entity.getData(dataName) != null);
+ }
+ return null;
+}
+
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/radio.js b/scripts/client/radio.js
index 2608e834..7cb04ae5 100644
--- a/scripts/client/radio.js
+++ b/scripts/client/radio.js
@@ -8,39 +8,39 @@
// ===========================================================================
function playStreamingRadio(url, loop, volume, element = false) {
- if(streamingRadio != null) {
- streamingRadio.stop();
- }
+ if(streamingRadio != null) {
+ streamingRadio.stop();
+ }
- streamingRadioVolume = volume;
+ streamingRadioVolume = volume;
- streamingRadio = audio.createSoundFromURL(url, loop);
- streamingRadio.volume = volume/100;
- streamingRadio.play();
+ streamingRadio = audio.createSoundFromURL(url, loop);
+ streamingRadio.volume = volume/100;
+ streamingRadio.play();
}
// ===========================================================================
function stopStreamingRadio() {
- if(streamingRadio != null) {
- streamingRadio.stop();
- }
- streamingRadio = null;
+ if(streamingRadio != null) {
+ streamingRadio.stop();
+ }
+ streamingRadio = null;
}
// ===========================================================================
function setStreamingRadioVolume(volume) {
- if(streamingRadio != null) {
- streamingRadioVolume = volume;
- streamingRadio.volume = volume/100;
- }
+ if(streamingRadio != null) {
+ streamingRadioVolume = volume;
+ streamingRadio.volume = volume/100;
+ }
}
// ===========================================================================
function playAudioFile(audioName, loop, volume) {
- playCustomAudio(audioName, volume/100, loop);
+ findResourceByName("connectedrp-extra").exports.playCustomAudio(audioName, volume/100, loop);
}
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/scoreboard.js b/scripts/client/scoreboard.js
index 5007d78b..04dd9630 100644
--- a/scripts/client/scoreboard.js
+++ b/scripts/client/scoreboard.js
@@ -43,7 +43,7 @@ function processScoreBoardRendering() {
}
if(renderScoreBoard) {
- if(isKeyDown(SDLK_TAB)) {
+ if(isKeyDown(SDLK_TAB)) {
if(scoreBoardListFont != null && scoreBoardTitleFont != null) {
let scoreboardStart = (game.height/2)-(Math.floor(getClients().length/2)*20);
let titleSize = scoreBoardTitleFont.measure("PLAYERS", game.width, 0.0, 1.0, 10, false, false);
diff --git a/scripts/client/server.js b/scripts/client/server.js
index 5410a2fb..e36f3b0c 100644
--- a/scripts/client/server.js
+++ b/scripts/client/server.js
@@ -8,197 +8,216 @@
// ===========================================================================
function initServerScript() {
- logToConsole(LOG_DEBUG, "[VRR.Server]: Initializing server script ...");
- addAllNetworkHandlers();
- logToConsole(LOG_DEBUG, "[VRR.Server]: Server script initialized!");
+ logToConsole(LOG_DEBUG, "[VRR.Server]: Initializing server script ...");
+ addAllNetworkHandlers();
+ logToConsole(LOG_DEBUG, "[VRR.Server]: Server script initialized!");
}
// ===========================================================================
function addAllNetworkHandlers() {
- logToConsole(LOG_DEBUG, "[VRR.Server]: Adding network handlers ...");
+ logToConsole(LOG_DEBUG, "[VRR.Server]: Adding network handlers ...");
- addNetworkEventHandler("vrr.smallGameMessage", showSmallGameMessage);
- addNetworkEventHandler("vrr.working", setLocalPlayerWorkingState);
- addNetworkEventHandler("vrr.jobType", setLocalPlayerJobType);
- addNetworkEventHandler("vrr.passenger", enterVehicleAsPassenger);
+ // Chat history
+ addNetworkEventHandler("m", receiveChatBoxMessageFromServer); // Not prefixed with VRR to make it as small as possible
+ addNetworkEventHandler("vrr.chatScrollLines", setChatScrollLines);
+ addNetworkEventHandler("vrr.chatAutoHideDelay", setChatAutoHideDelay);
- addNetworkEventHandler("vrr.freeze", setLocalPlayerFrozenState);
- addNetworkEventHandler("vrr.control", setLocalPlayerControlState);
- addNetworkEventHandler("vrr.fadeCamera", fadeLocalCamera);
- addNetworkEventHandler("vrr.removeFromVehicle", removeLocalPlayerFromVehicle);
- addNetworkEventHandler("vrr.clearPeds", clearLocalPlayerOwnedPeds);
- addNetworkEventHandler("vrr.restoreCamera", restoreLocalCamera);
- addNetworkEventHandler("vrr.cameraLookAt", setLocalCameraLookAt);
- addNetworkEventHandler("vrr.logo", setServerLogoRenderState);
- addNetworkEventHandler("vrr.ambience", setCityAmbienceState);
- addNetworkEventHandler("vrr.runCode", runClientCode);
- addNetworkEventHandler("vrr.clearWeapons", clearLocalPlayerWeapons);
- addNetworkEventHandler("vrr.giveWeapon", giveLocalPlayerWeapon);
- addNetworkEventHandler("vrr.position", setLocalPlayerPosition);
- addNetworkEventHandler("vrr.heading", setLocalPlayerHeading);
- addNetworkEventHandler("vrr.interior", setLocalPlayerInterior);
- addNetworkEventHandler("vrr.minuteDuration", setMinuteDuration);
- addNetworkEventHandler("vrr.showJobRouteLocation", showJobRouteLocation);
- addNetworkEventHandler("vrr.hideJobRouteLocation", hideJobRouteLocation);
- addNetworkEventHandler("vrr.snow", setSnowState);
- addNetworkEventHandler("vrr.health", setLocalPlayerHealth);
- addNetworkEventHandler("vrr.enterPropertyKey", setEnterPropertyKey);
- addNetworkEventHandler("vrr.skinSelect", toggleSkinSelect);
- addNetworkEventHandler("vrr.hotbar", updatePlayerHotBar);
- addNetworkEventHandler("vrr.pedSpeech", playPedSpeech);
- addNetworkEventHandler("vrr.clearPedState", clearLocalPedState);
- addNetworkEventHandler("vrr.drunkEffect", setLocalPlayerDrunkEffect);
- addNetworkEventHandler("vrr.showItemActionDelay", showItemActionDelay);
- addNetworkEventHandler("vrr.set2DRendering", setPlayer2DRendering);
- addNetworkEventHandler("vrr.mouseCursor", toggleMouseCursor);
- addNetworkEventHandler("vrr.mouseCamera", toggleMouseCamera);
- addNetworkEventHandler("vrr.mouseCameraForce", setMouseCameraState);
- addNetworkEventHandler("vrr.weaponDamageEnabled", setPlayerWeaponDamageEnabled);
- addNetworkEventHandler("vrr.weaponDamageEvent", setPlayerWeaponDamageEvent);
- addNetworkEventHandler("vrr.spawned", onServerSpawnedPlayer);
- addNetworkEventHandler("vrr.money", setLocalPlayerCash);
- addNetworkEventHandler("vrr.armour", setLocalPlayerArmour);
- addNetworkEventHandler("vrr.wantedLevel", forceLocalPlayerWantedLevel);
+ // Messaging (like textdraws and stuff)
+ addNetworkEventHandler("vrr.smallGameMessage", showSmallGameMessage);
- addNetworkEventHandler("vrr.delKeyBind", unBindAccountKey);
- addNetworkEventHandler("vrr.addKeyBind", bindAccountKey);
- addNetworkEventHandler("vrr.clearKeyBinds", clearKeyBinds);
+ // Job
+ addNetworkEventHandler("vrr.job", receiveJobFromServer);
+ addNetworkEventHandler("vrr.working", setLocalPlayerWorkingState);
+ addNetworkEventHandler("vrr.jobType", setLocalPlayerJobType);
+ addNetworkEventHandler("vrr.showJobRouteLocation", showJobRouteLocation);
+ addNetworkEventHandler("vrr.hideJobRouteLocation", hideJobRouteLocation);
- addNetworkEventHandler("vrr.nametag", updatePlayerNameTag);
- addNetworkEventHandler("vrr.ping", updatePlayerPing);
+ // Local player states and values
+ addNetworkEventHandler("vrr.restoreCamera", restoreLocalCamera);
+ addNetworkEventHandler("vrr.cameraLookAt", setLocalCameraLookAt);
+ addNetworkEventHandler("vrr.freeze", setLocalPlayerFrozenState);
+ addNetworkEventHandler("vrr.control", setLocalPlayerControlState);
+ addNetworkEventHandler("vrr.fadeCamera", fadeLocalCamera);
+ addNetworkEventHandler("vrr.removeFromVehicle", removeLocalPlayerFromVehicle);
+ addNetworkEventHandler("vrr.clearWeapons", clearLocalPlayerWeapons);
+ addNetworkEventHandler("vrr.giveWeapon", giveLocalPlayerWeapon);
+ addNetworkEventHandler("vrr.position", setLocalPlayerPosition);
+ addNetworkEventHandler("vrr.heading", setLocalPlayerHeading);
+ addNetworkEventHandler("vrr.interior", setLocalPlayerInterior);
+ addNetworkEventHandler("vrr.spawned", onServerSpawnedLocalPlayer);
+ addNetworkEventHandler("vrr.money", setLocalPlayerCash);
+ addNetworkEventHandler("vrr.armour", setLocalPlayerArmour);
+ addNetworkEventHandler("vrr.localPlayerSkin", setLocalPlayerSkin);
+ addNetworkEventHandler("vrr.pedSpeak", makeLocalPlayerPedSpeak);
+ addNetworkEventHandler("vrr.infiniteRun", setLocalPlayerInfiniteRun);
+ addNetworkEventHandler("vrr.playerCop", setLocalPlayerAsCopState);
+ addNetworkEventHandler("vrr.health", setLocalPlayerHealth);
+ addNetworkEventHandler("vrr.wantedLevel", setLocalPlayerWantedLevel);
+ addNetworkEventHandler("vrr.playerPedId", sendLocalPlayerNetworkIdToServer);
+ addNetworkEventHandler("vrr.ped", setLocalPlayerPedPartsAndProps);
+ addNetworkEventHandler("vrr.spawn", serverRequestedLocalPlayerSpawn);
+ addNetworkEventHandler("vrr.clearPedState", clearLocalPedState);
+ addNetworkEventHandler("vrr.drunkEffect", setLocalPlayerDrunkEffect);
- addNetworkEventHandler("vrr.m", receiveChatBoxMessageFromServer);
- addNetworkEventHandler("vrr.chatScrollLines", setChatScrollLines);
+ // Vehicle
+ addNetworkEventHandler("vrr.vehicle", receiveVehicleFromServer);
+ addNetworkEventHandler("vrr.veh.lights", setVehicleLights);
+ addNetworkEventHandler("vrr.veh.engine", setVehicleEngine);
+ addNetworkEventHandler("vrr.veh.repair", repairVehicle);
- addNetworkEventHandler("vrr.radioStream", playStreamingRadio);
- addNetworkEventHandler("vrr.audioFileStream", playAudioFile);
- addNetworkEventHandler("vrr.stopRadioStream", stopStreamingRadio);
- addNetworkEventHandler("vrr.radioVolume", setStreamingRadioVolume);
+ // Radio
+ addNetworkEventHandler("vrr.radioStream", playStreamingRadio);
+ addNetworkEventHandler("vrr.audioFileStream", playAudioFile);
+ addNetworkEventHandler("vrr.stopRadioStream", stopStreamingRadio);
+ addNetworkEventHandler("vrr.radioVolume", setStreamingRadioVolume);
- addNetworkEventHandler("vrr.veh.lights", setVehicleLights);
- addNetworkEventHandler("vrr.veh.engine", setVehicleEngine);
- addNetworkEventHandler("vrr.veh.repair", repairVehicle);
+ // Key Bindings
+ addNetworkEventHandler("vrr.delKeyBind", unBindAccountKey);
+ addNetworkEventHandler("vrr.addKeyBind", bindAccountKey);
+ addNetworkEventHandler("vrr.clearKeyBinds", clearKeyBinds);
- addNetworkEventHandler("vrr.pedAnim", makePedPlayAnimation);
- addNetworkEventHandler("vrr.pedStopAnim", makePedStopAnimation);
- addNetworkEventHandler("vrr.localPlayerSkin", setLocalPlayerSkin);
- addNetworkEventHandler("vrr.forcePedAnim", forcePedAnimation);
- addNetworkEventHandler("vrr.hideAllGUI", hideAllGUI);
- addNetworkEventHandler("vrr.clientInfo", serverRequestedClientInfo);
- addNetworkEventHandler("vrr.interiorLights", updateInteriorLightsState);
+ // Weapon Damage
+ addNetworkEventHandler("vrr.weaponDamageEnabled", setPlayerWeaponDamageEnabled);
+ addNetworkEventHandler("vrr.weaponDamageEvent", setPlayerWeaponDamageEvent);
- addNetworkEventHandler("vrr.syncElement", forceSyncElementProperties);
- addNetworkEventHandler("vrr.elementPosition", setElementPosition);
- addNetworkEventHandler("vrr.elementCollisions", setElementCollisionsEnabled);
+ // GUI
+ addNetworkEventHandler("vrr.showRegistration", showRegistrationGUI);
+ addNetworkEventHandler("vrr.showNewCharacter", showNewCharacterGUI);
+ addNetworkEventHandler("vrr.showLogin", showLoginGUI);
- addNetworkEventHandler("vrr.vehBuyState", setVehiclePurchaseState);
+ // Business
+ addNetworkEventHandler("vrr.business", receiveBusinessFromServer);
- addNetworkEventHandler("vrr.showRegistration", showRegistrationGUI);
- addNetworkEventHandler("vrr.showNewCharacter", showNewCharacterGUI);
- addNetworkEventHandler("vrr.showLogin", showLoginGUI);
+ // House
+ addNetworkEventHandler("vrr.house", receiveHouseFromServer);
- addNetworkEventHandler("vrr.logLevel", setLogLevel);
- addNetworkEventHandler("vrr.infiniteRun", setLocalPlayerInfiniteRun);
+ // Locale
+ addNetworkEventHandler("vrr.localeString", receiveLocaleStringFromServer);
- addNetworkEventHandler("vrr.business", receiveBusinessFromServer);
- addNetworkEventHandler("vrr.house", receiveHouseFromServer);
-
- addNetworkEventHandler("vrr.holdObject", makePedHoldObject);
-
- addNetworkEventHandler("vrr.playerPedId", sendLocalPlayerNetworkIdToServer);
-
- addNetworkEventHandler("vrr.ped", setLocalPlayerPedPartsAndProps);
+ // Misc
+ addNetworkEventHandler("vrr.mouseCursor", toggleMouseCursor);
+ addNetworkEventHandler("vrr.mouseCamera", toggleMouseCamera);
+ addNetworkEventHandler("vrr.clearPeds", clearLocalPlayerOwnedPeds);
+ addNetworkEventHandler("vrr.passenger", enterVehicleAsPassenger);
+ addNetworkEventHandler("vrr.logo", setServerLogoRenderState);
+ addNetworkEventHandler("vrr.ambience", setCityAmbienceState);
+ addNetworkEventHandler("vrr.runCode", runClientCode);
+ addNetworkEventHandler("vrr.minuteDuration", setMinuteDuration);
+ addNetworkEventHandler("vrr.snow", setSnowState);
+ addNetworkEventHandler("vrr.enterPropertyKey", setEnterPropertyKey);
+ addNetworkEventHandler("vrr.skinSelect", toggleSkinSelect);
+ addNetworkEventHandler("vrr.hotbar", updatePlayerHotBar);
+ addNetworkEventHandler("vrr.showItemActionDelay", showItemActionDelay);
+ addNetworkEventHandler("vrr.set2DRendering", set2DRendering);
+ addNetworkEventHandler("vrr.mouseCameraForce", setMouseCameraState);
+ addNetworkEventHandler("vrr.logLevel", setLogLevel);
+ addNetworkEventHandler("vrr.hideAllGUI", hideAllGUI);
+ addNetworkEventHandler("vrr.nametag", updatePlayerNameTag);
+ addNetworkEventHandler("vrr.ping", updatePlayerPing);
+ addNetworkEventHandler("vrr.pedAnim", makePedPlayAnimation);
+ addNetworkEventHandler("vrr.pedStopAnim", makePedStopAnimation);
+ addNetworkEventHandler("vrr.forcePedAnim", forcePedAnimation);
+ addNetworkEventHandler("vrr.clientInfo", serverRequestedClientInfo);
+ addNetworkEventHandler("vrr.interiorLights", updateInteriorLightsState);
+ addNetworkEventHandler("vrr.cutsceneInterior", setCutsceneInterior);
+ addNetworkEventHandler("vrr.syncElement", forceSyncElementProperties);
+ addNetworkEventHandler("vrr.elementPosition", setElementPosition);
+ addNetworkEventHandler("vrr.elementCollisions", setElementCollisionsEnabled);
+ addNetworkEventHandler("vrr.vehBuyState", setVehiclePurchaseState);
+ addNetworkEventHandler("vrr.holdObject", makePedHoldObject);
}
// ===========================================================================
function sendResourceReadySignalToServer() {
- sendNetworkEventToServer("vrr.clientReady");
+ sendNetworkEventToServer("vrr.clientReady");
}
// ===========================================================================
function sendResourceStartedSignalToServer() {
- sendNetworkEventToServer("vrr.clientStarted");
+ sendNetworkEventToServer("vrr.clientStarted");
}
// ===========================================================================
function sendResourceStoppedSignalToServer() {
- if(isConnected) {
- sendNetworkEventToServer("vrr.clientStopped");
- }
+ if(isConnected) {
+ sendNetworkEventToServer("vrr.clientStopped");
+ }
}
// ===========================================================================
-function setPlayer2DRendering(hudState, labelState, smallGameMessageState, scoreboardState, hotBarState, 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;
+function set2DRendering(hudState, labelState, smallGameMessageState, scoreboardState, hotBarState, 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;
- if(getGame() == VRR_GAME_GTA_IV) {
- natives.displayCash(hudState);
- natives.displayAmmo(hudState);
- natives.displayHud(hudState);
- natives.displayRadar(hudState);
- natives.displayAreaName(hudState);
- } else {
- if(typeof setHUDEnabled != "undefined") {
- setHUDEnabled(hudState);
- }
- }
+ if(getGame() == VRR_GAME_GTA_IV) {
+ natives.displayCash(hudState);
+ natives.displayAmmo(hudState);
+ natives.displayHud(hudState);
+ natives.displayRadar(hudState);
+ natives.displayAreaName(hudState);
+ } else {
+ if(typeof setHUDEnabled != "undefined") {
+ setHUDEnabled(hudState);
+ }
+ }
- renderLabels = labelState;
- renderSmallGameMessage = smallGameMessageState;
- renderScoreBoard = scoreboardState;
- renderHotBar = hotBarState;
- renderItemActionDelay = itemActionDelayState;
+ renderLabels = labelState;
+ renderSmallGameMessage = smallGameMessageState;
+ renderScoreBoard = scoreboardState;
+ renderHotBar = hotBarState;
+ renderItemActionDelay = itemActionDelayState;
}
// ===========================================================================
-function onServerSpawnedPlayer(state) {
- logToConsole(LOG_DEBUG, `[VRR.Main] Setting spawned state to ${state}`);
- isSpawned = state;
- if(state) {
- setUpInitialGame();
- calledDeathEvent = false;
- }
+function onServerSpawnedLocalPlayer(state) {
+ logToConsole(LOG_DEBUG, `[VRR.Main] Setting spawned state to ${state}`);
+ isSpawned = state;
+ if(state) {
+ setUpInitialGame();
+ setTimeout(function() {
+ calledDeathEvent = false;
+ }, 1000);
+ }
}
// ===========================================================================
function tellServerPlayerUsedKeyBind(key) {
- sendNetworkEventToServer("vrr.useKeyBind", key);
+ sendNetworkEventToServer("vrr.useKeyBind", key);
}
// ===========================================================================
function tellServerPlayerArrivedAtJobRouteLocation() {
- sendNetworkEventToServer("vrr.arrivedAtJobRouteLocation");
+ sendNetworkEventToServer("vrr.arrivedAtJobRouteLocation");
}
// ===========================================================================
function tellServerItemActionDelayComplete() {
- sendNetworkEventToServer("vrr.itemActionDelayComplete");
+ sendNetworkEventToServer("vrr.itemActionDelayComplete");
}
// ===========================================================================
function sendServerClientInfo() {
- let clientVersion = "0.0.0.0";
- if(typeof CLIENT_VERSION_MAJOR != "undefined") {
- clientVersion = `${CLIENT_VERSION_MAJOR}.${CLIENT_VERSION_MINOR}.${CLIENT_VERSION_PATCH}.${CLIENT_VERSION_BUILD}`;
- }
- sendNetworkEventToServer("vrr.clientInfo", clientVersion, game.width, game.height);
+ let clientVersion = "0.0.0.0";
+ if(typeof CLIENT_VERSION_MAJOR != "undefined") {
+ clientVersion = `${CLIENT_VERSION_MAJOR}.${CLIENT_VERSION_MINOR}.${CLIENT_VERSION_PATCH}.${CLIENT_VERSION_BUILD}`;
+ }
+ sendNetworkEventToServer("vrr.clientInfo", clientVersion, game.width, game.height);
}
// ===========================================================================
function sendServerNewAFKStatus(state) {
- sendNetworkEventToServer("vrr.afk", state);
+ sendNetworkEventToServer("vrr.afk", state);
}
// ===========================================================================
@@ -210,109 +229,167 @@ function anchorBoat(vehicleId) {
// ===========================================================================
function setEnterPropertyKey(key) {
- enterPropertyKey = key;
+ enterPropertyKey = key;
}
// ===========================================================================
function serverRequestedClientInfo() {
- sendServerClientInfo();
+ sendServerClientInfo();
}
// ===========================================================================
function updateInteriorLightsState(state) {
- interiorLightsEnabled = state;
+ interiorLightsEnabled = state;
}
// ===========================================================================
function forceSyncElementProperties(elementId) {
- if(getElementFromId(elementId) == null) {
- return false;
- }
+ if(getElementFromId(elementId) == null) {
+ return false;
+ }
- syncElementProperties(getElementFromId(elementId));
+ syncElementProperties(getElementFromId(elementId));
}
// ===========================================================================
function setElementPosition(elementId, position) {
- if(getElementFromId(elementId) == null) {
- return false;
- }
+ if(getElementFromId(elementId) == null) {
+ return false;
+ }
- if(!getElementFromId(elementId).isSyncer) {
- return false;
- }
+ if(!getElementFromId(elementId).isSyncer) {
+ return false;
+ }
- getElementFromId(elementId).position = position;
+ getElementFromId(elementId).position = position;
}
// ===========================================================================
function setElementCollisionsEnabled(elementId, state) {
- if(getElementFromId(elementId) == null) {
- return false;
- }
+ if(getElementFromId(elementId) == null) {
+ return false;
+ }
- getElementFromId(elementId).collisionsEnabled = state;
+ getElementFromId(elementId).collisionsEnabled = state;
}
// ===========================================================================
function setLocalPlayerArmour(armour) {
- if(typeof localPlayer.armour != "undefined") {
- localPlayer.armour = armour;
- }
+ if(typeof localPlayer.armour != "undefined") {
+ localPlayer.armour = armour;
+ }
}
// ===========================================================================
-function forceLocalPlayerWantedLevel(wantedLevel) {
- forceWantedLevel = toInteger(wantedLevel);
+function setLocalPlayerWantedLevel(wantedLevel) {
+ forceWantedLevel = toInteger(wantedLevel);
}
// ===========================================================================
function setLogLevel(level) {
- logLevel = level;
+ logLevel = level;
}
// ===========================================================================
function setLocalPlayerInfiniteRun(state) {
- if(localPlayer != null) {
- if(getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) {
- game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), boolToInt(state));
- }
- }
+ if(localPlayer != null) {
+ if(getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) {
+ game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), boolToInt(state));
+ }
+ }
}
// ===========================================================================
function setLocalPlayerSkin(skinId) {
- if(getGame() == VRR_GAME_GTA_IV) {
- natives.changePlayerModel(natives.getPlayerId(), skinId);
- //localPlayer.skin = allowedSkins[skinSelectorIndex][0];
- //localPlayer.modelIndex = allowedSkins[skinSelectorIndex][0];
- } else {
- localPlayer.skin = skinId;
- }
+ logToConsole(LOG_INFO, skinId);
+ if(getGame() == VRR_GAME_GTA_IV) {
+ if(natives.isModelInCdimage(skinId)) {
+ natives.requestModel(skinId);
+ natives.loadAllObjectsNow();
+ if(natives.hasModelLoaded(skinId)) {
+ natives.changePlayerModel(natives.getPlayerId(), skinId);
+ }
+ }
+ } else {
+ localPlayer.skin = skinId;
+ }
}
// ===========================================================================
function makePedHoldObject(pedId, modelIndex) {
- if(getGame() == VRR_GAME_GTA_IV) {
- natives.givePedAmbientObject(natives.getPedFromNetworkId(pedId), getGameConfig().objects[getGame()][modelIndex][1])
- }
+ if(getGame() == VRR_GAME_GTA_IV) {
+ natives.givePedAmbientObject(natives.getPedFromNetworkId(pedId), getGameConfig().objects[getGame()][modelIndex][1])
+ }
}
// ===========================================================================
function sendLocalPlayerNetworkIdToServer() {
- sendNetworkEventToServer("vrr.playerPedId", natives.getNetworkIdFromPed(localPlayer));
+ sendNetworkEventToServer("vrr.playerPedId", natives.getNetworkIdFromPed(localPlayer));
+}
+
+// ===========================================================================
+
+function setCutsceneInterior(cutsceneName) {
+ if(getGame() == VRR_GAME_GTA_IV) {
+ if(cutsceneName == "") {
+ natives.clearCutscene();
+ } else {
+ if(natives.isInteriorScene()) {
+ natives.clearCutscene();
+ }
+ natives.initCutscene(cutsceneName);
+ }
+ }
+}
+
+// ===========================================================================
+
+function makeLocalPlayerPedSpeak(speechName) {
+ if(getGame() == VRR_GAME_GTA_IV) {
+ // if player is in vehicle, allow megaphone (if last arg is "1", it will cancel megaphone echo)
+ // Only speeches with _MEGAPHONE will have the bullhorn effect
+ // Afaik it only works on police voices anyway
+ if(localPlayer.vehicle != null) {
+ natives.sayAmbientSpeech(localPlayer, speechName, true, false, 0);
+ } else {
+ natives.sayAmbientSpeech(localPlayer, speechName, true, false, 1);
+ }
+ } else if(getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) {
+ // Don't have a way to get the ped ref ID and can't use ped in arg
+ //game.SET_CHAR_SAY(game.GET_PLAYER_ID(), int);
+ }
+}
+
+// ===========================================================================
+
+function setLocalPlayerAsCopState(state) {
+ if(getGame() == VRR_GAME_GTA_IV) {
+ natives.setPlayerAsCop(natives.getPlayerId(), state);
+ natives.setPoliceIgnorePlayer(natives.getPlayerId(), state);
+ }
+}
+
+// ===========================================================================
+
+function serverRequestedLocalPlayerSpawn(skinId, position) {
+ if(getGame() == VRR_GAME_GTA_IV) {
+ natives.createPlayer(skinId, position);
+ //if(isCustomCameraSupported()) {
+ // game.restoreCamera(true);
+ //}
+ }
}
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/skin-select.js b/scripts/client/skin-select.js
index 2b361383..bc0fd1e9 100644
--- a/scripts/client/skin-select.js
+++ b/scripts/client/skin-select.js
@@ -45,95 +45,111 @@ function loadSkinSelectMessageFontBottom() {
function processSkinSelectKeyPress(keyCode) {
if(usingSkinSelector) {
- if(keyCode == SDLK_PAGEUP) {
- if(skinSelectorIndex >= allowedSkins.length-1) {
- skinSelectorIndex = 1;
- } else {
- skinSelectorIndex = skinSelectorIndex + 1;
- }
- logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`);
- skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1];
- if(getGame() == VRR_GAME_GTA_IV) {
- //natives.changePlayerModel(natives.getPlayerId(), allowedSkins[skinSelectorIndex][0]);
- //localPlayer.skin = allowedSkins[skinSelectorIndex][0];
- //localPlayer.modelIndex = allowedSkins[skinSelectorIndex][0];
- } else {
- localPlayer.skin = allowedSkins[skinSelectorIndex][0];
- }
- } else if(keyCode == SDLK_PAGEDOWN) {
- if(skinSelectorIndex <= 0) {
- skinSelectorIndex = allowedSkins.length-1;
- } else {
- skinSelectorIndex = skinSelectorIndex - 1;
- }
- logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`);
- skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1];
- if(getGame() == VRR_GAME_GTA_IV) {
- //natives.changePlayerModel(natives.getPlayerId(), allowedSkins[skinSelectorIndex][0]);
- //localPlayer.skin = allowedSkins[skinSelectorIndex][0];
- //localPlayer.modelIndex = allowedSkins[skinSelectorIndex][0];
- } else {
- localPlayer.skin = allowedSkins[skinSelectorIndex][0];
- }
- } else if(keyCode == SDLK_RETURN) {
- sendNetworkEventToServer("vrr.skinSelected", skinSelectorIndex);
- toggleSkinSelect(false);
- return true;
- } else if(keyCode == SDLK_BACKSPACE) {
- sendNetworkEventToServer("vrr.skinSelected", -1);
- toggleSkinSelect(false);
- return true;
- }
- localPlayer.heading = skinSelectHeading;
- }
+ if(keyCode == SDLK_PAGEUP) {
+ if(skinSelectorIndex >= allowedSkins.length-1) {
+ skinSelectorIndex = 1;
+ } else {
+ skinSelectorIndex = skinSelectorIndex + 1;
+ }
+ logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`);
+ skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1];
+ if(getGame() == VRR_GAME_GTA_IV) {
+ let skinId = allowedSkins[skinSelectorIndex][0];
+ if(natives.isModelInCdimage(skinId)) {
+ natives.requestModel(skinId);
+ natives.loadAllObjectsNow();
+ if(natives.hasModelLoaded(skinId)) {
+ natives.changePlayerModel(natives.getPlayerId(), skinId);
+ }
+ }
+ } else {
+ localPlayer.skin = allowedSkins[skinSelectorIndex][0];
+ }
+ } else if(keyCode == SDLK_PAGEDOWN) {
+ if(skinSelectorIndex <= 0) {
+ skinSelectorIndex = allowedSkins.length-1;
+ } else {
+ skinSelectorIndex = skinSelectorIndex - 1;
+ }
+ logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`);
+ skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1];
+ if(getGame() == VRR_GAME_GTA_IV) {
+ let skinId = allowedSkins[skinSelectorIndex][0];
+ if(natives.isModelInCdimage(skinId)) {
+ natives.requestModel(skinId);
+ natives.loadAllObjectsNow();
+ if(natives.hasModelLoaded(skinId)) {
+ natives.changePlayerModel(natives.getPlayerId(), skinId);
+ }
+ }
+ } else {
+ localPlayer.skin = allowedSkins[skinSelectorIndex][0];
+ }
+ } else if(keyCode == SDLK_RETURN) {
+ sendNetworkEventToServer("vrr.skinSelected", skinSelectorIndex);
+ toggleSkinSelect(false);
+ return true;
+ } else if(keyCode == SDLK_BACKSPACE) {
+ sendNetworkEventToServer("vrr.skinSelected", -1);
+ toggleSkinSelect(false);
+ return true;
+ }
+ localPlayer.heading = skinSelectHeading;
+ }
}
// ===========================================================================
function processSkinSelectRendering() {
if(usingSkinSelector) {
- if(skinSelectMessageFontTop != null && skinSelectMessageFontBottom != null) {
- if(skinSelectMessageTextTop != "" && skinSelectMessageTextBottom != "") {
- skinSelectMessageFontTop.render(skinSelectMessageTextTop, [0, game.height-100], game.width, 0.5, 0.0, skinSelectMessageFontTop.size, skinSelectMessageColourTop, true, true, false, true);
- skinSelectMessageFontBottom.render(skinSelectMessageTextBottom, [0, game.height-65], game.width, 0.5, 0.0, skinSelectMessageFontBottom.size, skinSelectMessageColourBottom, true, true, false, true);
- }
- }
- }
+ if(skinSelectMessageFontTop != null && skinSelectMessageFontBottom != null) {
+ if(skinSelectMessageTextTop != "" && skinSelectMessageTextBottom != "") {
+ skinSelectMessageFontTop.render(skinSelectMessageTextTop, [0, game.height-100], game.width, 0.5, 0.0, skinSelectMessageFontTop.size, skinSelectMessageColourTop, true, true, false, true);
+ skinSelectMessageFontBottom.render(skinSelectMessageTextBottom, [0, game.height-65], game.width, 0.5, 0.0, skinSelectMessageFontBottom.size, skinSelectMessageColourBottom, true, true, false, true);
+ }
+ }
+ }
}
// ===========================================================================
function toggleSkinSelect(state) {
- if(state) {
- skinSelectorIndex = getAllowedSkinIndexFromSkin(localPlayer.skin);
- if(!skinSelectorIndex) {
- skinSelectorIndex = 0;
- }
+ if(state) {
+ skinSelectorIndex = getAllowedSkinIndexFromSkin(localPlayer.skin);
+ if(!skinSelectorIndex) {
+ skinSelectorIndex = 0;
+ }
- usingSkinSelector = true;
- skinSelectPosition = localPlayer.position;
- skinSelectHeading = localPlayer.heading;
+ usingSkinSelector = true;
+ skinSelectPosition = localPlayer.position;
+ skinSelectHeading = localPlayer.heading;
- if(isCustomCameraSupported()) {
- let tempPosition = localPlayer.position;
- tempPosition.z += 0.5;
- let frontCameraPosition = getPosInFrontOfPos(tempPosition, localPlayer.heading, 3);
- game.setCameraLookAt(frontCameraPosition, localPlayer.position, true);
- }
+ if(isCustomCameraSupported()) {
+ let tempPosition = localPlayer.position;
+ tempPosition.z += 0.5;
+ let frontCameraPosition = getPosInFrontOfPos(tempPosition, localPlayer.heading, 3);
+ game.setCameraLookAt(frontCameraPosition, localPlayer.position, true);
+ }
- 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];
- setLocalPlayerControlState(false, false);
- } else {
- usingSkinSelector = false;
- setLocalPlayerControlState(false, false);
- }
+ if(getGame() == VRR_GAME_GTA_IV) {
+ let skinId = allowedSkins[skinSelectorIndex][0];
+ if(natives.isModelInCdimage(skinId)) {
+ natives.requestModel(skinId);
+ natives.loadAllObjectsNow();
+ if(natives.hasModelLoaded(skinId)) {
+ natives.changePlayerModel(natives.getPlayerId(), skinId);
+ }
+ }
+ } else {
+ localPlayer.skin = allowedSkins[skinSelectorIndex][0];
+ }
+
+ skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1];
+ setLocalPlayerControlState(false, false);
+ } else {
+ usingSkinSelector = false;
+ setLocalPlayerControlState(false, false);
+ }
}
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/startup.js b/scripts/client/startup.js
index bd38327f..7c4b3e90 100644
--- a/scripts/client/startup.js
+++ b/scripts/client/startup.js
@@ -8,158 +8,167 @@
// ===========================================================================
function initClientScripts() {
- initGUIScript();
- initNameTagScript();
- initScoreBoardScript();
- initMessagingScript();
- initServerScript();
- initLogoScript();
- initLabelScript();
- initChatBoxScript();
- initAFKScript();
- initKeyBindScript();
- initEventScript();
- initSkinSelectScript();
+ initGUIScript();
+ initNameTagScript();
+ initScoreBoardScript();
+ initMessagingScript();
+ initServerScript();
+ initLogoScript();
+ initLabelScript();
+ initChatBoxScript();
+ initAFKScript();
+ initKeyBindScript();
+ initEventScript();
+ initSkinSelectScript();
}
// ===========================================================================
function setUpInitialGame() {
- if(getGame() == VRR_GAME_GTA_III) {
- game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0);
- game.setGameStat(STAT_PROGRESSMADE, 9999);
- game.setGameStat(STAT_TOTALPROGRESSINGAME, 9999);
- game.SET_CAR_DENSITY_MULTIPLIER(3.0);
- game.SET_PED_DENSITY_MULTIPLIER(3.0);
- game.onMission = true;
- SetStandardControlsEnabled(true);
- return true;
- }
+ switch(getGame()) {
+ case VRR_GAME_GTA_III:
+ game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0);
+ game.setGameStat(STAT_PROGRESSMADE, 9999);
+ game.setGameStat(STAT_TOTALPROGRESSINGAME, 9999);
+ //game.SET_CAR_DENSITY_MULTIPLIER(3.0); // No visual effect. Needs tweaking and testing.
+ //game.SET_PED_DENSITY_MULTIPLIER(3.0); // No visual effect. Needs tweaking and testing.
+ game.onMission = true; // Disables taxi/vigilante/etc and other start mission triggers
+ SetStandardControlsEnabled(true); // Provided by mouse camera script (mousecam.js)
+ break;
- if(getGame() == VRR_GAME_GTA_VC) {
- game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0);
- game.setGameStat(STAT_PROGRESSMADE, 9999);
- game.setGameStat(STAT_TOTALPROGRESSINGAME, 9999);
- game.SET_CAR_DENSITY_MULTIPLIER(3.0);
- game.SET_PED_DENSITY_MULTIPLIER(3.0);
+ case VRR_GAME_GTA_VC:
+ game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0);
+ game.setGameStat(STAT_PROGRESSMADE, 9999);
+ game.setGameStat(STAT_TOTALPROGRESSINGAME, 9999);
+ //game.SET_CAR_DENSITY_MULTIPLIER(3.0); // No visual effect. Needs tweaking and testing.
+ //game.SET_PED_DENSITY_MULTIPLIER(3.0); // No visual effect. Needs tweaking and testing.
- game.REQUEST_ANIMATION("bikev");
- game.REQUEST_ANIMATION("bikeh");
- game.REQUEST_ANIMATION("biked");
- game.REQUEST_ANIMATION("knife");
- game.REQUEST_ANIMATION("python");
- game.REQUEST_ANIMATION("shotgun");
- game.REQUEST_ANIMATION("buddy");
- game.REQUEST_ANIMATION("tec");
- game.REQUEST_ANIMATION("uzi");
- game.REQUEST_ANIMATION("rifle");
- game.REQUEST_ANIMATION("m60");
- game.REQUEST_ANIMATION("sniper");
- game.REQUEST_ANIMATION("grenade");
- game.REQUEST_ANIMATION("flame");
- game.REQUEST_ANIMATION("medic");
- game.REQUEST_ANIMATION("sunbathe");
- //game.REQUEST_ANIMATION("playidles");
- game.REQUEST_ANIMATION("riot");
- game.REQUEST_ANIMATION("strip");
- game.REQUEST_ANIMATION("lance");
- game.REQUEST_ANIMATION("skate");
+ game.REQUEST_ANIMATION("bikev");
+ game.REQUEST_ANIMATION("bikeh");
+ game.REQUEST_ANIMATION("biked");
+ game.REQUEST_ANIMATION("knife");
+ game.REQUEST_ANIMATION("python");
+ game.REQUEST_ANIMATION("shotgun");
+ game.REQUEST_ANIMATION("buddy");
+ game.REQUEST_ANIMATION("tec");
+ game.REQUEST_ANIMATION("uzi");
+ game.REQUEST_ANIMATION("rifle");
+ game.REQUEST_ANIMATION("m60");
+ game.REQUEST_ANIMATION("sniper");
+ game.REQUEST_ANIMATION("grenade");
+ game.REQUEST_ANIMATION("flame");
+ game.REQUEST_ANIMATION("medic");
+ game.REQUEST_ANIMATION("sunbathe");
+ //game.REQUEST_ANIMATION("playidles");
+ game.REQUEST_ANIMATION("riot");
+ game.REQUEST_ANIMATION("strip");
+ game.REQUEST_ANIMATION("lance");
+ game.REQUEST_ANIMATION("skate");
- game.LOAD_ALL_MODELS_NOW();
- game.onMission = true;
- SetStandardControlsEnabled(true);
- return true;
- }
+ game.LOAD_ALL_MODELS_NOW();
+ game.onMission = true; // Disables taxi/vigilante/etc and other start mission triggers
+ SetStandardControlsEnabled(true); // Provided by mouse camera script (mousecam.js)
+ break;
- if(getGame() == VRR_GAME_GTA_SA) {
- game.setGameStat(STAT_WEAPONTYPE_PISTOL_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_PISTOL_SILENCED_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_DESERT_EAGLE_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_SHOTGUN_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_SAWNOFF_SHOTGUN_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_SPAS12_SHOTGUN_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_MICRO_UZI_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_MP5_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_AK47_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_M4_SKILL, 400);
- game.setGameStat(STAT_DRIVING_SKILL, 9999);
- game.setGameStat(STAT_FAT, 9999);
- game.setGameStat(STAT_ENERGY, 9999);
- game.setGameStat(STAT_CYCLE_SKILL, 9999);
- game.setGameStat(STAT_BIKE_SKILL, 9999);
- game.setGameStat(STAT_GAMBLING, 9999);
- game.setGameStat(STAT_PROGRESS_MADE, 9999);
- game.setGameStat(STAT_RESPECT, 0);
- game.setGameStat(STAT_RESPECT_TOTAL, 0);
- game.setGameStat(STAT_SEX_APPEAL, 0);
- game.setGameStat(STAT_STAMINA, 9999);
- game.setGameStat(STAT_TOTAL_PROGRESS, 9999);
- game.setGameStat(STAT_UNDERWATER_STAMINA, 9999);
- game.setGameStat(STAT_BODY_MUSCLE, 9999);
+ case VRR_GAME_GTA_SA:
+ game.setGameStat(STAT_WEAPONTYPE_PISTOL_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_PISTOL_SILENCED_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_DESERT_EAGLE_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_SHOTGUN_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_SAWNOFF_SHOTGUN_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_SPAS12_SHOTGUN_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_MICRO_UZI_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_MP5_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_AK47_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_M4_SKILL, 400);
+ game.setGameStat(STAT_DRIVING_SKILL, 9999);
+ game.setGameStat(STAT_FAT, 9999);
+ game.setGameStat(STAT_ENERGY, 9999);
+ game.setGameStat(STAT_CYCLE_SKILL, 9999);
+ game.setGameStat(STAT_BIKE_SKILL, 9999);
+ game.setGameStat(STAT_GAMBLING, 9999);
+ game.setGameStat(STAT_PROGRESS_MADE, 9999);
+ game.setGameStat(STAT_RESPECT, 0);
+ game.setGameStat(STAT_RESPECT_TOTAL, 0);
+ game.setGameStat(STAT_SEX_APPEAL, 0);
+ game.setGameStat(STAT_STAMINA, 9999);
+ game.setGameStat(STAT_TOTAL_PROGRESS, 9999);
+ game.setGameStat(STAT_UNDERWATER_STAMINA, 9999);
+ game.setGameStat(STAT_BODY_MUSCLE, 9999);
- game.setDefaultInteriors(false);
- game.onMission = true;
- return true;
- }
+ game.setDefaultInteriors(false); // Disables default yellow cone at doors for entering places in singleplayer
+ game.onMission = true; // Disables taxi/vigilante/etc and other start mission triggers
+ break;
- if(getGame() == VRR_GAME_GTA_IV) {
- natives.allowEmergencyServices(false);
- natives.setCreateRandomCops(true);
- natives.setMaxWantedLevel(0);
- natives.setWantedMultiplier(0.0);
- natives.allowPlayerToCarryNonMissionObjects(natives.getPlayerId(), true);
- natives.setPlayerTeam(natives.getPlayerId(), 0);
- natives.loadAllObjectsNow();
- natives.setCellphoneRanked(false);
- natives.setOverrideNoSprintingOnPhoneInMultiplayer(false);
- natives.setSyncWeatherAndGameTime(false);
- natives.usePlayerColourInsteadOfTeamColour(true);
- natives.disablePauseMenu(true);
- natives.allowReactionAnims(localPlayer, true);
- natives.allowGameToPauseForStreaming(false);
- natives.allowStuntJumpsToTrigger(false);
- natives.setPickupsFixCars(false);
+ case VRR_GAME_GTA_IV:
+ natives.allowEmergencyServices(false);
+ natives.setCreateRandomCops(true);
+ natives.setMaxWantedLevel(0);
+ natives.setWantedMultiplier(0.0);
+ natives.allowPlayerToCarryNonMissionObjects(natives.getPlayerId(), true);
+ natives.setPlayerTeam(natives.getPlayerId(), 0);
+ natives.loadAllObjectsNow();
+ natives.setCellphoneRanked(false);
+ natives.setOverrideNoSprintingOnPhoneInMultiplayer(false);
+ natives.setSyncWeatherAndGameTime(false);
+ natives.usePlayerColourInsteadOfTeamColour(true);
+ natives.disablePauseMenu(true);
+ //natives.allowReactionAnims(localPlayer, false);
+ natives.allowGameToPauseForStreaming(false);
+ natives.allowStuntJumpsToTrigger(false);
+ natives.setPickupsFixCars(false);
+ natives.forceFullVoice(localPlayer);
- // HUD and Display
- //natives.displayCash(false);
- //natives.displayAmmo(false);
- //natives.displayHud(false);
- //natives.displayRadar(false);
- //natives.displayAreaName(false);
- //natives.displayPlayerNames(false);
- natives.setPoliceRadarBlips(false);
- natives.removeTemporaryRadarBlipsForPickups();
- natives.displayNonMinigameHelpMessages(false);
- natives.setDisplayPlayerNameAndIcon(natives.getPlayerId(), false);
+ // HUD and Display
+ //natives.displayCash(false);
+ //natives.displayAmmo(false);
+ //natives.displayHud(false);
+ //natives.displayRadar(false);
+ //natives.displayAreaName(false);
+ natives.displayPlayerNames(true);
+ natives.setPoliceRadarBlips(false);
+ natives.removeTemporaryRadarBlipsForPickups();
+ natives.displayNonMinigameHelpMessages(false);
+ natives.setDisplayPlayerNameAndIcon(natives.getPlayerId(), true);
- // Item/Money Dropping
- natives.setMoneyCarriedByAllNewPeds(0);
- natives.setDeadPedsDropWeapons(false);
- natives.setPlayersDropMoneyInNetworkGame(false);
+ // Item/Money Dropping
+ natives.setMoneyCarriedByAllNewPeds(0);
+ natives.setDeadPedsDropWeapons(false);
+ natives.setPlayersDropMoneyInNetworkGame(false);
- // Population
- //natives.dontSuppressAnyCarModels(5.0);
- //natives.dontSuppressAnyPedModels(5.0);
- //natives.forceGenerateParkedCarsTooCloseToOthers(true);
- //natives.setParkedCarDensityMultiplier(5.0);
- //natives.setRandomCarDensityMultiplier(5.0);
- //natives.setPedDensityMultiplier(5.0);
- //natives.setCarDensityMultiplier(5.0);
- //natives.setScenarioPedDensityMultiplier(5.0, 5.0);
- natives.switchRandomTrains(true);
- natives.switchRandomBoats(true);
- natives.switchAmbientPlanes(true);
- natives.switchMadDrivers(false);
+ // Population
+ //natives.dontSuppressAnyCarModels(5.0);
+ //natives.dontSuppressAnyPedModels(5.0);
+ //natives.forceGenerateParkedCarsTooCloseToOthers(true);
+ //natives.setParkedCarDensityMultiplier(5.0);
+ //natives.setRandomCarDensityMultiplier(5.0);
+ //natives.setPedDensityMultiplier(5.0);
+ //natives.setCarDensityMultiplier(5.0);
+ //natives.setScenarioPedDensityMultiplier(5.0, 5.0);
+ natives.switchRandomTrains(true);
+ natives.switchRandomBoats(true);
+ natives.switchAmbientPlanes(true);
+ natives.switchMadDrivers(false);
- natives.requestAnims("DANCING");
- return true;
- }
+ // Singleplayer Cellphone
+ natives.requestScript("spcellphone");
+ natives.startNewScript("spcellphone", 0);
+ // Script "v-blockedscripts" blocks the mpcellphone scripts
+ natives.setMessagesWaiting(false); // Seems to have no effect
+ natives.setMobilePhoneRadioState(false);
- if(getGame() == VRR_GAME_MAFIA_ONE) {
- game.mapEnabled = false;
- game.setTrafficEnabled(false);
- return true;
- }
+ // Animation libraries
+ natives.requestAnims("DANCING");
+
+ // Some last steps
+ natives.loadAllObjectsNow();
+ break;
+
+ case VRR_GAME_MAFIA_ONE:
+ game.mapEnabled = false;
+ game.setTrafficEnabled(false);
+ break;
+ }
}
// ===========================================================================
diff --git a/scripts/client/sync.js b/scripts/client/sync.js
index 3a2a3704..c3b641d7 100644
--- a/scripts/client/sync.js
+++ b/scripts/client/sync.js
@@ -8,37 +8,37 @@
// ===========================================================================
function processSync(event, deltaTime) {
- if(localPlayer != null) {
- if(!areServerElementsSupported()) {
- sendNetworkEventToServer("vrr.plr.pos", localPlayer.position);
- sendNetworkEventToServer("vrr.plr.rot", localPlayer.heading);
+ if(localPlayer != null) {
+ if(!areServerElementsSupported()) {
+ sendNetworkEventToServer("vrr.plr.pos", (localPlayer.vehicle != null) ? localPlayer.vehicle.position : localPlayer.position);
+ sendNetworkEventToServer("vrr.plr.rot", (localPlayer.vehicle != null) ? localPlayer.vehicle.heading : localPlayer.heading);
- //if(localPlayer.vehicle != null) {
- // sendNetworkEventToServer("vrr.veh.pos", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.position);
- // sendNetworkEventToServer("vrr.veh.rot", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.heading);
- //}
- }
+ //if(localPlayer.vehicle != null) {
+ // sendNetworkEventToServer("vrr.veh.pos", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.position);
+ // sendNetworkEventToServer("vrr.veh.rot", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.heading);
+ //}
+ }
- if(localPlayer.health <= 0) {
- if(!calledDeathEvent) {
- logToConsole(LOG_DEBUG, `Local player died`);
- localPlayer.clearWeapons();
- calledDeathEvent = true;
- sendNetworkEventToServer("vrr.playerDeath");
- }
- }
+ if(localPlayer.health <= 0) {
+ if(!calledDeathEvent) {
+ logToConsole(LOG_DEBUG, `Local player died`);
+ localPlayer.clearWeapons();
+ calledDeathEvent = true;
+ sendNetworkEventToServer("vrr.playerDeath");
+ }
+ }
- if(streamingRadioElement) {
- streamingRadio.position = getElementPosition(streamingRadioElement);
- //streamingRadio.volume = getStreamingRadioVolumeForPosition(streamingRadio.position);
- }
- }
+ if(streamingRadioElement) {
+ streamingRadio.position = getElementPosition(streamingRadioElement);
+ //streamingRadio.volume = getStreamingRadioVolumeForPosition(streamingRadio.position);
+ }
+ }
}
// ===========================================================================
function setVehicleEngine(vehicleId, state) {
- getElementFromId(vehicleId).engine = state;
+ getElementFromId(vehicleId).engine = state;
}
// ===========================================================================
@@ -46,370 +46,390 @@ function setVehicleEngine(vehicleId, state) {
function setVehicleLights(vehicleId, state) {
- if(getGame() != VRR_GAME_MAFIA_ONE) {
- if(!state) {
- getElementFromId(vehicleId).lightStatus = 2;
- } else {
- getElementFromId(vehicleId).lightStatus = 1;
- }
- } else if(getGame() == VRR_GAME_GTA_IV) {
- if(!state) {
- natives.forceCarLights(natives.getVehicleFromNetworkId(vehicleId, 0));
- } else {
- natives.forceCarLights(natives.getVehicleFromNetworkId(vehicleId, 1));
- }
- } else {
- if(!state) {
- getElementFromId(vehicleId).lights = false;
- } else {
- getElementFromId(vehicleId).lights = true;
- }
- }
+ if(getGame() != VRR_GAME_MAFIA_ONE) {
+ if(!state) {
+ getElementFromId(vehicleId).lightStatus = 2;
+ } else {
+ getElementFromId(vehicleId).lightStatus = 1;
+ }
+ } else if(getGame() == VRR_GAME_GTA_IV) {
+ if(!state) {
+ natives.forceCarLights(natives.getVehicleFromNetworkId(vehicleId, 0));
+ } else {
+ natives.forceCarLights(natives.getVehicleFromNetworkId(vehicleId, 1));
+ }
+ } else {
+ if(!state) {
+ getElementFromId(vehicleId).lights = false;
+ } else {
+ getElementFromId(vehicleId).lights = true;
+ }
+ }
}
// ===========================================================================
function repairVehicle(syncId) {
- getVehicleFromSyncId(syncId).fix();
+ getVehicleFromSyncId(syncId).fix();
}
// ===========================================================================
function syncVehicleProperties(vehicle) {
- if(!areServerElementsSupported()) {
- return false;
- }
+ if(!areServerElementsSupported()) {
+ return false;
+ }
- if(doesEntityDataExist(vehicle, "vrr.lights")) {
- let lightStatus = getEntityData(vehicle, "vrr.lights");
- if(!lightStatus) {
- vehicle.lightStatus = 2;
- } else {
- vehicle.lightStatus = 1;
- }
- }
+ if(doesEntityDataExist(vehicle, "vrr.lights")) {
+ let lightStatus = getEntityData(vehicle, "vrr.lights");
+ if(!lightStatus) {
+ vehicle.lightStatus = 2;
+ } else {
+ vehicle.lightStatus = 1;
+ }
+ }
- if(doesEntityDataExist(vehicle, "vrr.invincible")) {
- let invincible = getEntityData(vehicle, "vrr.invincible");
- element.setProofs(invincible, invincible, invincible, invincible, invincible);
- }
+ if(doesEntityDataExist(vehicle, "vrr.invincible")) {
+ let invincible = getEntityData(vehicle, "vrr.invincible");
+ element.setProofs(invincible, invincible, invincible, invincible, invincible);
+ }
- if(doesEntityDataExist(vehicle, "vrr.panelStatus")) {
- let panelsStatus = getEntityData(vehicle, "vrr.panelStatus");
- for(let i in panelsStatus) {
- vehicle.setPanelStatus(i, panelsStatus[i]);
- }
- }
+ if(doesEntityDataExist(vehicle, "vrr.panelStatus")) {
+ let panelsStatus = getEntityData(vehicle, "vrr.panelStatus");
+ for(let i in panelsStatus) {
+ vehicle.setPanelStatus(i, panelsStatus[i]);
+ }
+ }
- if(doesEntityDataExist(vehicle, "vrr.wheelStatus")) {
- let wheelsStatus = getEntityData(vehicle, "vrr.wheelStatus");
- for(let i in wheelsStatus) {
- vehicle.setWheelStatus(i, wheelsStatus[i]);
- }
- }
+ if(doesEntityDataExist(vehicle, "vrr.wheelStatus")) {
+ let wheelsStatus = getEntityData(vehicle, "vrr.wheelStatus");
+ for(let i in wheelsStatus) {
+ vehicle.setWheelStatus(i, wheelsStatus[i]);
+ }
+ }
- if(doesEntityDataExist(vehicle, "vrr.lightStatus")) {
- let lightStatus = getEntityData(vehicle, "vrr.lightStatus");
- for(let i in lightStatus) {
- vehicle.setLightStatus(i, lightStatus[i]);
- }
- }
+ if(doesEntityDataExist(vehicle, "vrr.lightStatus")) {
+ let lightStatus = getEntityData(vehicle, "vrr.lightStatus");
+ for(let i in lightStatus) {
+ vehicle.setLightStatus(i, lightStatus[i]);
+ }
+ }
- if(doesEntityDataExist(vehicle, "vrr.suspensionHeight")) {
- let suspensionHeight = getEntityData(vehicle, "vrr.suspensionHeight");
- vehicle.setSuspensionHeight(suspensionHeight);
- }
+ if(doesEntityDataExist(vehicle, "vrr.suspensionHeight")) {
+ let suspensionHeight = getEntityData(vehicle, "vrr.suspensionHeight");
+ vehicle.setSuspensionHeight(suspensionHeight);
+ }
- if(getGame() == VRR_GAME_GTA_SA) {
- let allUpgrades = getGameConfig().vehicleUpgrades[getGame()];
- for(let i in allUpgrades) {
- vehicle.removeUpgrade(i);
- }
+ if(getGame() == VRR_GAME_GTA_SA) {
+ let allUpgrades = getGameConfig().vehicleUpgrades[getGame()];
+ for(let i in allUpgrades) {
+ vehicle.removeUpgrade(i);
+ }
- if(doesEntityDataExist(vehicle, "vrr.upgrades")) {
- let upgrades = getEntityData(vehicle, "vrr.upgrades");
- for(let i in upgrades) {
- if(upgrades[i] != 0) {
- vehicle.addUpgrade(upgrades[i]);
- }
- }
- }
- }
+ if(doesEntityDataExist(vehicle, "vrr.upgrades")) {
+ let upgrades = getEntityData(vehicle, "vrr.upgrades");
+ for(let i in upgrades) {
+ if(upgrades[i] != 0) {
+ vehicle.addUpgrade(upgrades[i]);
+ }
+ }
+ }
+ }
- if(getGame() == VRR_GAME_GTA_SA || getGame() == VRR_GAME_GTA_IV) {
- if(doesEntityDataExist(vehicle, "vrr.livery")) {
- let livery = getEntityData(vehicle, "vrr.livery");
- if(getGame() == VRR_GAME_GTA_SA) {
- vehicle.setPaintJob(livery);
- } else if(getGame() == VRR_GAME_GTA_IV) {
- vehicle.livery = livery;
- }
- }
- }
+ if(getGame() == VRR_GAME_GTA_SA || getGame() == VRR_GAME_GTA_IV) {
+ if(doesEntityDataExist(vehicle, "vrr.livery")) {
+ let livery = getEntityData(vehicle, "vrr.livery");
+ if(getGame() == VRR_GAME_GTA_SA) {
+ vehicle.setPaintJob(livery);
+ } else if(getGame() == VRR_GAME_GTA_IV) {
+ vehicle.livery = livery;
+ }
+ }
+ }
}
// ===========================================================================
function syncCivilianProperties(civilian) {
- if(!areServerElementsSupported()) {
- return false;
- }
+ if(!areServerElementsSupported()) {
+ return false;
+ }
- if(getGame() == VRR_GAME_GTA_III) {
- if(doesEntityDataExist(civilian, "vrr.scale")) {
- let scaleFactor = getEntityData(civilian, "vrr.scale");
- let tempMatrix = civilian.matrix;
- tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
- let tempPosition = civilian.position;
- civilian.matrix = tempMatrix;
- tempPosition.z += scaleFactor.z;
- civilian.position = tempPosition;
- }
- }
+ if(getGame() == VRR_GAME_GTA_III) {
+ if(doesEntityDataExist(civilian, "vrr.scale")) {
+ let scaleFactor = getEntityData(civilian, "vrr.scale");
+ let tempMatrix = civilian.matrix;
+ tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
+ let tempPosition = civilian.position;
+ civilian.matrix = tempMatrix;
+ tempPosition.z += scaleFactor.z;
+ civilian.position = tempPosition;
+ }
+ }
- if(getGame() == VRR_GAME_GTA_SA) {
- if(doesEntityDataExist(civilian, "vrr.fightStyle")) {
- let fightStyle = getEntityData(civilian, "vrr.fightStyle");
- civilian.setFightStyle(fightStyle[0], fightStyle[1]);
- }
- }
+ if(getGame() == VRR_GAME_GTA_SA) {
+ if(doesEntityDataExist(civilian, "vrr.fightStyle")) {
+ let fightStyle = getEntityData(civilian, "vrr.fightStyle");
+ civilian.setFightStyle(fightStyle[0], fightStyle[1]);
+ }
+ }
- if(getGame() == VRR_GAME_GTA_III) {
- if(doesEntityDataExist(civilian, "vrr.walkStyle")) {
- let walkStyle = getEntityData(civilian, "vrr.walkStyle");
- civilian.walkStyle = walkStyle;
- }
- }
+ if(getGame() == VRR_GAME_GTA_III) {
+ if(doesEntityDataExist(civilian, "vrr.walkStyle")) {
+ let walkStyle = getEntityData(civilian, "vrr.walkStyle");
+ civilian.walkStyle = walkStyle;
+ }
+ }
- if(getGame() == VRR_GAME_GTA_IV) {
- if(doesEntityDataExist(civilian, "vrr.bodyPropHair")) {
- let bodyPropHair = getEntityData(civilian, "vrr.bodyPropHair");
- civilian.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]);
- }
+ if(getGame() == VRR_GAME_GTA_IV) {
+ if(doesEntityDataExist(civilian, "vrr.bodyPropHair")) {
+ let bodyPropHair = getEntityData(civilian, "vrr.bodyPropHair");
+ civilian.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]);
+ }
- if(doesEntityDataExist(civilian, "vrr.bodyPropHead")) {
- let bodyPropHead = getEntityData(civilian, "vrr.bodyPropHead");
- civilian.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]);
- }
+ if(doesEntityDataExist(civilian, "vrr.bodyPropHead")) {
+ let bodyPropHead = getEntityData(civilian, "vrr.bodyPropHead");
+ civilian.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]);
+ }
- if(doesEntityDataExist(civilian, "vrr.bodyPropEyes")) {
- let bodyPropEyes = getEntityData(civilian, "vrr.bodyPropEyes");
- civilian.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]);
- }
+ if(doesEntityDataExist(civilian, "vrr.bodyPropEyes")) {
+ let bodyPropEyes = getEntityData(civilian, "vrr.bodyPropEyes");
+ civilian.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]);
+ }
- if(doesEntityDataExist(civilian, "vrr.bodyPropLeftHand")) {
- let bodyPropLeftHand = getEntityData(civilian, "vrr.bodyPropLeftHand");
- civilian.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]);
- }
+ if(doesEntityDataExist(civilian, "vrr.bodyPropLeftHand")) {
+ let bodyPropLeftHand = getEntityData(civilian, "vrr.bodyPropLeftHand");
+ civilian.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]);
+ }
- if(doesEntityDataExist(civilian, "vrr.bodyPropRightHand")) {
- let bodyPropRightHand = getEntityData(civilian, "vrr.bodyPropRightHand");
- civilian.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]);
- }
+ if(doesEntityDataExist(civilian, "vrr.bodyPropRightHand")) {
+ let bodyPropRightHand = getEntityData(civilian, "vrr.bodyPropRightHand");
+ civilian.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]);
+ }
- if(doesEntityDataExist(civilian, "vrr.bodyPropLeftWrist")) {
- let bodyPropLeftWrist = getEntityData(civilian, "vrr.bodyPropLeftWrist");
- civilian.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]);
- }
+ if(doesEntityDataExist(civilian, "vrr.bodyPropLeftWrist")) {
+ let bodyPropLeftWrist = getEntityData(civilian, "vrr.bodyPropLeftWrist");
+ civilian.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]);
+ }
- if(doesEntityDataExist(civilian, "vrr.bodyPropRightWrist")) {
- let bodyPropRightWrist = getEntityData(civilian, "vrr.bodyPropRightWrist");
- civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
- }
+ if(doesEntityDataExist(civilian, "vrr.bodyPropRightWrist")) {
+ let bodyPropRightWrist = getEntityData(civilian, "vrr.bodyPropRightWrist");
+ civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
+ }
- if(doesEntityDataExist(civilian, "vrr.bodyPropRightWrist")) {
- let bodyPropRightWrist = getEntityData(civilian, "vrr.bodyPropRightWrist");
- civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
- }
+ if(doesEntityDataExist(civilian, "vrr.bodyPropRightWrist")) {
+ let bodyPropRightWrist = getEntityData(civilian, "vrr.bodyPropRightWrist");
+ civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
+ }
- if(doesEntityDataExist(civilian, "vrr.bodyPropHip")) {
- let bodyPropHip = getEntityData(civilian, "vrr.bodyPropHip");
- civilian.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]);
- }
+ if(doesEntityDataExist(civilian, "vrr.bodyPropHip")) {
+ let bodyPropHip = getEntityData(civilian, "vrr.bodyPropHip");
+ civilian.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]);
+ }
- if(doesEntityDataExist(civilian, "vrr.bodyPropLeftFoot")) {
- let bodyPropLeftFoot = getEntityData(civilian, "vrr.bodyPropLeftFoot");
- civilian.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]);
- }
+ if(doesEntityDataExist(civilian, "vrr.bodyPropLeftFoot")) {
+ let bodyPropLeftFoot = getEntityData(civilian, "vrr.bodyPropLeftFoot");
+ civilian.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]);
+ }
- if(doesEntityDataExist(civilian, "vrr.bodyPropRightFoot")) {
- let bodyPropRightFoot = getEntityData(civilian, "vrr.bodyPropRightFoot");
- civilian.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]);
- }
- }
+ if(doesEntityDataExist(civilian, "vrr.bodyPropRightFoot")) {
+ let bodyPropRightFoot = getEntityData(civilian, "vrr.bodyPropRightFoot");
+ civilian.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]);
+ }
+ }
- if(doesEntityDataExist(civilian, "vrr.anim")) {
- let animData = getEntityData(vehicle, "vrr.anim");
- civilian.addAnimation(animData[0], animData[1]);
- }
+ if(doesEntityDataExist(civilian, "vrr.anim")) {
+ let animData = getEntityData(civilian, "vrr.anim");
+ civilian.addAnimation(animData[0], animData[1]);
+ }
}
// ===========================================================================
function syncPlayerProperties(player) {
- if(!areServerElementsSupported()) {
- return false;
- }
+ if(!areServerElementsSupported()) {
+ return false;
+ }
- if(getGame() == VRR_GAME_GTA_III) {
- if(doesEntityDataExist(player, "vrr.scale")) {
- let scaleFactor = getEntityData(player, "vrr.scale");
- let tempMatrix = player.matrix;
- tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
- let tempPosition = player.position;
- player.matrix = tempMatrix;
- tempPosition.z += scaleFactor.z;
- player.position = tempPosition;
- }
- }
+ if(getGame() == VRR_GAME_GTA_III) {
+ if(doesEntityDataExist(player, "vrr.scale")) {
+ let scaleFactor = getEntityData(player, "vrr.scale");
+ let tempMatrix = player.matrix;
+ tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
+ let tempPosition = player.position;
+ player.matrix = tempMatrix;
+ tempPosition.z += scaleFactor.z;
+ player.position = tempPosition;
+ }
+ }
- if(getGame() == VRR_GAME_GTA_SA) {
- if(doesEntityDataExist(player, "vrr.fightStyle")) {
- let fightStyle = getEntityData(player, "vrr.fightStyle");
- player.setFightStyle(fightStyle[0], fightStyle[1]);
- }
- }
+ if(getGame() == VRR_GAME_GTA_SA) {
+ if(doesEntityDataExist(player, "vrr.fightStyle")) {
+ let fightStyle = getEntityData(player, "vrr.fightStyle");
+ player.setFightStyle(fightStyle[0], fightStyle[1]);
+ }
+ }
- //if(getGame() == VRR_GAME_GTA_SA) {
- // if(doesEntityDataExist(player, "vrr.walkStyle")) {
- // let walkStyle = getEntityData(player, "vrr.walkStyle");
- // player.walkStyle = walkStyle;
- // }
- //}
+ //if(getGame() == VRR_GAME_GTA_SA) {
+ // if(doesEntityDataExist(player, "vrr.walkStyle")) {
+ // let walkStyle = getEntityData(player, "vrr.walkStyle");
+ // player.walkStyle = walkStyle;
+ // }
+ //}
- if(getGame() == VRR_GAME_GTA_IV) {
- if(doesEntityDataExist(player, "vrr.bodyPartHair")) {
- let bodyPartHead = getEntityData(player, "vrr.bodyPartHair");
- player.changeBodyPart(0, bodyPartHead[0], bodyPartHair[1]);
- }
+ if(getGame() == VRR_GAME_GTA_IV) {
+ if(doesEntityDataExist(player, "vrr.bodyPartHair")) {
+ let bodyPartHead = getEntityData(player, "vrr.bodyPartHair");
+ player.changeBodyPart(0, bodyPartHead[0], bodyPartHair[1]);
+ }
- if(doesEntityDataExist(player, "vrr.bodyPartHead")) {
- let bodyPartHead = getEntityData(player, "vrr.bodyPartHead");
- player.changeBodyPart(1, bodyPartHead[0], bodyPartHead[1]);
- }
+ if(doesEntityDataExist(player, "vrr.bodyPartHead")) {
+ let bodyPartHead = getEntityData(player, "vrr.bodyPartHead");
+ player.changeBodyPart(1, bodyPartHead[0], bodyPartHead[1]);
+ }
- if(doesEntityDataExist(player, "vrr.bodyPartUpper")) {
- let bodyPartUpper = getEntityData(player, "vrr.bodyPartUpper");
- player.changeBodyPart(1, bodyPartUpper[0], bodyPartUpper[1]);
- }
+ if(doesEntityDataExist(player, "vrr.bodyPartUpper")) {
+ let bodyPartUpper = getEntityData(player, "vrr.bodyPartUpper");
+ player.changeBodyPart(1, bodyPartUpper[0], bodyPartUpper[1]);
+ }
- if(doesEntityDataExist(player, "vrr.bodyPartLower")) {
- let bodyPartLower = getEntityData(player, "vrr.bodyPartLower");
- player.changeBodyPart(1, bodyPartLower[0], bodyPartLower[1]);
- }
- }
+ if(doesEntityDataExist(player, "vrr.bodyPartLower")) {
+ let bodyPartLower = getEntityData(player, "vrr.bodyPartLower");
+ player.changeBodyPart(1, bodyPartLower[0], bodyPartLower[1]);
+ }
+ }
- if(getGame() == VRR_GAME_GTA_IV) {
- if(doesEntityDataExist(player, "vrr.bodyPropHair")) {
- let bodyPropHair = getEntityData(player, "vrr.bodyPropHair");
- player.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]);
- }
+ if(getGame() == VRR_GAME_GTA_IV) {
+ if(doesEntityDataExist(player, "vrr.bodyPropHair")) {
+ let bodyPropHair = getEntityData(player, "vrr.bodyPropHair");
+ player.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]);
+ }
- if(doesEntityDataExist(player, "vrr.bodyPropHead")) {
- let bodyPropHead = getEntityData(player, "vrr.bodyPropHead");
- player.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]);
- }
+ if(doesEntityDataExist(player, "vrr.bodyPropHead")) {
+ let bodyPropHead = getEntityData(player, "vrr.bodyPropHead");
+ player.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]);
+ }
- if(doesEntityDataExist(player, "vrr.bodyPropEyes")) {
- let bodyPropEyes = getEntityData(player, "vrr.bodyPropEyes");
- player.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]);
- }
+ if(doesEntityDataExist(player, "vrr.bodyPropEyes")) {
+ let bodyPropEyes = getEntityData(player, "vrr.bodyPropEyes");
+ player.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]);
+ }
- if(doesEntityDataExist(player, "vrr.bodyPropLeftHand")) {
- let bodyPropLeftHand = getEntityData(player, "vrr.bodyPropLeftHand");
- player.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]);
- }
+ if(doesEntityDataExist(player, "vrr.bodyPropLeftHand")) {
+ let bodyPropLeftHand = getEntityData(player, "vrr.bodyPropLeftHand");
+ player.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]);
+ }
- if(doesEntityDataExist(player, "vrr.bodyPropRightHand")) {
- let bodyPropRightHand = getEntityData(player, "vrr.bodyPropRightHand");
- player.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]);
- }
+ if(doesEntityDataExist(player, "vrr.bodyPropRightHand")) {
+ let bodyPropRightHand = getEntityData(player, "vrr.bodyPropRightHand");
+ player.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]);
+ }
- if(doesEntityDataExist(player, "vrr.bodyPropLeftWrist")) {
- let bodyPropLeftWrist = getEntityData(player, "vrr.bodyPropLeftWrist");
- player.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]);
- }
+ if(doesEntityDataExist(player, "vrr.bodyPropLeftWrist")) {
+ let bodyPropLeftWrist = getEntityData(player, "vrr.bodyPropLeftWrist");
+ player.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]);
+ }
- if(doesEntityDataExist(player, "vrr.bodyPropRightWrist")) {
- let bodyPropRightWrist = getEntityData(player, "vrr.bodyPropRightWrist");
- player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
- }
+ if(doesEntityDataExist(player, "vrr.bodyPropRightWrist")) {
+ let bodyPropRightWrist = getEntityData(player, "vrr.bodyPropRightWrist");
+ player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
+ }
- if(doesEntityDataExist(player, "vrr.bodyPropRightWrist")) {
- let bodyPropRightWrist = getEntityData(player, "vrr.bodyPropRightWrist");
- player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
- }
+ if(doesEntityDataExist(player, "vrr.bodyPropRightWrist")) {
+ let bodyPropRightWrist = getEntityData(player, "vrr.bodyPropRightWrist");
+ player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
+ }
- if(doesEntityDataExist(player, "vrr.bodyPropHip")) {
- let bodyPropHip = getEntityData(player, "vrr.bodyPropHip");
- player.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]);
- }
+ if(doesEntityDataExist(player, "vrr.bodyPropHip")) {
+ let bodyPropHip = getEntityData(player, "vrr.bodyPropHip");
+ player.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]);
+ }
- if(doesEntityDataExist(player, "vrr.bodyPropLeftFoot")) {
- let bodyPropLeftFoot = getEntityData(player, "vrr.bodyPropLeftFoot");
- player.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]);
- }
+ if(doesEntityDataExist(player, "vrr.bodyPropLeftFoot")) {
+ let bodyPropLeftFoot = getEntityData(player, "vrr.bodyPropLeftFoot");
+ player.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]);
+ }
- if(doesEntityDataExist(player, "vrr.bodyPropRightFoot")) {
- let bodyPropRightFoot = getEntityData(player, "vrr.bodyPropRightFoot");
- player.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]);
- }
- }
+ if(doesEntityDataExist(player, "vrr.bodyPropRightFoot")) {
+ let bodyPropRightFoot = getEntityData(player, "vrr.bodyPropRightFoot");
+ player.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]);
+ }
+ }
}
// ===========================================================================
function syncObjectProperties(object) {
- if(!areServerElementsSupported()) {
- return false;
- }
+ if(!areServerElementsSupported()) {
+ return false;
+ }
- if(getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) {
- if(doesEntityDataExist(object, "vrr.scale")) {
- let scaleFactor = getEntityData(object, "vrr.scale");
- let tempMatrix = object.matrix;
- tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
- let tempPosition = object.position;
- object.matrix = tempMatrix;
- tempPosition.z += scaleFactor.z;
- object.position = tempPosition;
- }
- }
+ if(getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) {
+ if(doesEntityDataExist(object, "vrr.scale")) {
+ let scaleFactor = getEntityData(object, "vrr.scale");
+ let tempMatrix = object.matrix;
+ tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
+ let tempPosition = object.position;
+ object.matrix = tempMatrix;
+ tempPosition.z += scaleFactor.z;
+ object.position = tempPosition;
+ }
+ }
}
// ===========================================================================
function syncElementProperties(element) {
- if(!areServerElementsSupported()) {
- return false;
- }
+ if(!areServerElementsSupported()) {
+ return false;
+ }
- if(doesEntityDataExist(element, "vrr.interior")) {
- if(typeof element.interior != "undefined") {
- element.interior = getEntityData(element, "vrr.interior");
- }
- }
+ if(doesEntityDataExist(element, "vrr.interior")) {
+ if(typeof element.interior != "undefined") {
+ element.interior = getEntityData(element, "vrr.interior");
+ }
+ }
- switch(element.type) {
- case ELEMENT_VEHICLE:
- syncVehicleProperties(element);
- break;
+ if(getGame() == VRR_GAME_MAFIA_ONE) {
+ switch(element.type) {
+ case ELEMENT_VEHICLE:
+ syncVehicleProperties(element);
+ break;
- case ELEMENT_PED:
- syncCivilianProperties(element);
- break;
+ case ELEMENT_PED:
+ syncCivilianProperties(element);
+ break;
- case ELEMENT_PLAYER:
- syncPlayerProperties(element);
- break;
+ case ELEMENT_PLAYER:
+ syncPlayerProperties(element);
+ break;
- case ELEMENT_OBJECT:
- syncObjectProperties(element);
- break;
+ default:
+ break;
+ }
+ } else {
+ switch(element.type) {
+ case ELEMENT_VEHICLE:
+ syncVehicleProperties(element);
+ break;
+
+ case ELEMENT_PED:
+ syncCivilianProperties(element);
+ break;
+
+ case ELEMENT_PLAYER:
+ syncPlayerProperties(element);
+ break;
+
+ case ELEMENT_OBJECT:
+ syncObjectProperties(element);
+ break;
+
+ default:
+ break;
+ }
+ }
- default:
- break;
- }
}
@@ -417,21 +437,21 @@ function syncElementProperties(element) {
// ===========================================================================
function receiveHouseFromServer(houseId, entrancePosition, blipModel, pickupModel, hasInterior) {
- if(getGame() == VRR_GAME_GTA_IV) {
-
- }
+ if(getGame() == VRR_GAME_GTA_IV) {
+
+ }
}
// ===========================================================================
function setLocalPlayerPedPartsAndProps(parts, props) {
- for(let i in parts) {
- localPlayer.changeBodyPart(parts[i][0], parts[i][1], parts[i][2]);
- }
+ for(let i in parts) {
+ localPlayer.changeBodyPart(parts[i][0], parts[i][1], parts[i][2]);
+ }
- for(let j in props) {
- localPlayer.changeBodyProp(props[j][0], props[j][1]);
- }
+ for(let j in props) {
+ localPlayer.changeBodyProp(props[j][0], props[j][1]);
+ }
}
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/utilities.js b/scripts/client/utilities.js
index 1a120772..9c105c4d 100644
--- a/scripts/client/utilities.js
+++ b/scripts/client/utilities.js
@@ -8,253 +8,253 @@
// ===========================================================================
let weaponSlots = [
- false,
- [
- 0,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8,
- 9,
- 10,
- 11
- ],
- [
- 0,
- 0,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 2,
- 2,
- 2,
- 2,
- 2,
- 3,
- 3,
- 4,
- 4,
- 4,
- 5,
- 5,
- 5,
- 5,
- 6,
- 6,
- 8,
- 8,
- 7,
- 7,
- 7,
- 7,
- 9,
- -1,
- 9,
- ],
- [
- 0,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 8,
- 8,
- 8,
- -1,
- -1,
- -1,
- 2,
- 2,
- 2,
- 3,
- 3,
- 3,
- 4,
- 4,
- 5,
- 5,
- 4,
- 6,
- 6,
- 7,
- 7,
- 7,
- 7,
- 8,
- 12,
- 9,
- 9,
- 9,
- 9,
- 9,
- 11,
- 9,
- 9,
- 9,
- ],
+ false,
+ [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9,
+ 10,
+ 11
+ ],
+ [
+ 0,
+ 0,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 2,
+ 2,
+ 2,
+ 2,
+ 2,
+ 3,
+ 3,
+ 4,
+ 4,
+ 4,
+ 5,
+ 5,
+ 5,
+ 5,
+ 6,
+ 6,
+ 8,
+ 8,
+ 7,
+ 7,
+ 7,
+ 7,
+ 9,
+ -1,
+ 9,
+ ],
+ [
+ 0,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 8,
+ 8,
+ 8,
+ -1,
+ -1,
+ -1,
+ 2,
+ 2,
+ 2,
+ 3,
+ 3,
+ 3,
+ 4,
+ 4,
+ 5,
+ 5,
+ 4,
+ 6,
+ 6,
+ 7,
+ 7,
+ 7,
+ 7,
+ 8,
+ 12,
+ 9,
+ 9,
+ 9,
+ 9,
+ 9,
+ 11,
+ 9,
+ 9,
+ 9,
+ ],
];
function openAllGarages() {
- switch(game.game) {
- case VRR_GAME_GTA_III:
- for(let i=0;i<=26;i++) {
- openGarage(i);
- game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i);
- }
- break;
+ switch(game.game) {
+ case VRR_GAME_GTA_III:
+ for(let i=0;i<=26;i++) {
+ openGarage(i);
+ game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i);
+ }
+ break;
- case VRR_GAME_GTA_VC:
- for(let i=0;i<=32;i++) {
- openGarage(i);
- game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i);
- }
- break;
+ case VRR_GAME_GTA_VC:
+ for(let i=0;i<=32;i++) {
+ openGarage(i);
+ game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i);
+ }
+ break;
- case VRR_GAME_GTA_SA:
- for(let i=0;i<=44;i++) {
- openGarage(i);
- }
- break;
+ case VRR_GAME_GTA_SA:
+ for(let i=0;i<=44;i++) {
+ openGarage(i);
+ }
+ break;
- default:
- break;
- }
+ default:
+ break;
+ }
}
// ===========================================================================
function closeAllGarages() {
- switch(game.game) {
- case VRR_GAME_GTA_III:
- for(let i=0;i<=26;i++) {
- closeGarage(i);
- game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i);
- }
- break;
+ switch(game.game) {
+ case VRR_GAME_GTA_III:
+ for(let i=0;i<=26;i++) {
+ closeGarage(i);
+ game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i);
+ }
+ break;
- case VRR_GAME_GTA_VC:
- for(let i=0;i<=32;i++) {
- closeGarage(i);
- game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i);
- }
- break;
+ case VRR_GAME_GTA_VC:
+ for(let i=0;i<=32;i++) {
+ closeGarage(i);
+ game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i);
+ }
+ break;
- case VRR_GAME_GTA_SA:
- for(let i=0;i<=44;i++) {
- closeGarage(i);
- }
- break;
+ case VRR_GAME_GTA_SA:
+ for(let i=0;i<=44;i++) {
+ closeGarage(i);
+ }
+ break;
- default:
- break;
- }
+ default:
+ break;
+ }
}
// ===========================================================================
function setLocalPlayerFrozenState(state) {
- logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting frozen state to ${state}`);
- gui.showCursor(state, !state);
+ logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting frozen state to ${state}`);
+ gui.showCursor(state, !state);
}
// ===========================================================================
function setLocalPlayerControlState(controlState, cursorState = false) {
- logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting control state to ${controlState} (Cursor: ${cursorState})`);
- controlsEnabled = controlState;
- if(getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) {
- game.SET_PLAYER_CONTROL(localClient.index, boolToInt(controlState));
- }
+ logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting control state to ${controlState} (Cursor: ${cursorState})`);
+ controlsEnabled = controlState;
+ if(getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) {
+ game.SET_PLAYER_CONTROL(localClient.index, boolToInt(controlState));
+ }
- if(getGame() != VRR_GAME_GTA_IV) {
- localPlayer.collisionsEnabled = controlState;
- localPlayer.invincible = true;
- }
+ if(getGame() != VRR_GAME_GTA_IV) {
+ localPlayer.collisionsEnabled = controlState;
+ localPlayer.invincible = true;
+ }
}
// ===========================================================================
function fadeLocalCamera(state, time) {
- if(isFadeCameraSupported()) {
- logToConsole(LOG_DEBUG, `[VRR.Utilities] Fading camera ${(state)?"in":"out"} for ${time} seconds`);
+ if(isFadeCameraSupported()) {
+ logToConsole(LOG_DEBUG, `[VRR.Utilities] Fading camera ${(state)?"in":"out"} for ${time} seconds`);
- if(isFadeCameraSupported()) {
- game.fadeCamera(state, time);
- }
- }
+ if(isFadeCameraSupported()) {
+ game.fadeCamera(state, time);
+ }
+ }
}
// ===========================================================================
function removeLocalPlayerFromVehicle() {
- localPlayer.removeFromVehicle();
+ localPlayer.removeFromVehicle();
}
// ===========================================================================
function restoreLocalCamera() {
- logToConsole(LOG_DEBUG, `[VRR.Utilities] Camera restored`);
- if(isCustomCameraSupported()) {
- game.restoreCamera(true);
- }
+ logToConsole(LOG_DEBUG, `[VRR.Utilities] Camera restored`);
+ if(isCustomCameraSupported()) {
+ game.restoreCamera(true);
+ }
};
// ===========================================================================
function clearLocalPlayerOwnedPeds() {
- logToConsole(LOG_DEBUG, `[VRR.Utilities] Clearing all self-owned peds ...`);
- clearSelfOwnedPeds();
- logToConsole(LOG_DEBUG, `[VRR.Utilities] All self-owned peds cleared`);
+ logToConsole(LOG_DEBUG, `[VRR.Utilities] Clearing all self-owned peds ...`);
+ clearSelfOwnedPeds();
+ logToConsole(LOG_DEBUG, `[VRR.Utilities] All self-owned peds cleared`);
};
// ===========================================================================
function setLocalCameraLookAt(cameraPosition, cameraLookAt) {
- logToConsole(LOG_DEBUG, `[VRR.Utilities] Set camera to look at [${cameraLookAt.x}, ${cameraLookAt.y}, ${cameraLookAt.z}] from [${cameraPosition.x}, ${cameraPosition.y}, ${cameraPosition.z}]`);
- if(isCustomCameraSupported()) {
- game.setCameraLookAt(cameraPosition, cameraLookAt, true);
- }
+ logToConsole(LOG_DEBUG, `[VRR.Utilities] Set camera to look at [${cameraLookAt.x}, ${cameraLookAt.y}, ${cameraLookAt.z}] from [${cameraPosition.x}, ${cameraPosition.y}, ${cameraPosition.z}]`);
+ if(isCustomCameraSupported()) {
+ game.setCameraLookAt(cameraPosition, cameraLookAt, true);
+ }
}
// ===========================================================================
function setCityAmbienceState(state, clearElements = false) {
- logToConsole(LOG_DEBUG, `[VRR.Utilities] Ambient civilians and traffic ${(state) ? "enabled" : "disabled"}`);
- game.setTrafficEnabled(state);
+ logToConsole(LOG_DEBUG, `[VRR.Utilities] Ambient civilians and traffic ${(state) ? "enabled" : "disabled"}`);
+ game.setTrafficEnabled(state);
- if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
- game.setGenerateCarsAroundCamera(state);
- if(game.game != VRR_GAME_GTA_SA) {
- game.setCiviliansEnabled(state);
- }
+ if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
+ game.setGenerateCarsAroundCamera(state);
+ if(game.game != VRR_GAME_GTA_SA) {
+ game.setCiviliansEnabled(state);
+ }
- if(clearElements) {
- clearSelfOwnedPeds();
- clearSelfOwnedVehicles();
- }
- }
+ if(clearElements) {
+ clearSelfOwnedPeds();
+ clearSelfOwnedVehicles();
+ }
+ }
}
// ===========================================================================
@@ -266,8 +266,8 @@ function runClientCode(code, returnTo) {
} catch(error) {
sendNetworkEventToServer("vrr.runCodeFail", returnTo, code);
return false;
- }
- sendNetworkEventToServer("vrr.runCodeSuccess", returnTo, code, returnValue);
+ }
+ sendNetworkEventToServer("vrr.runCodeSuccess", returnTo, code, returnValue);
}
// ===========================================================================
@@ -275,441 +275,437 @@ function runClientCode(code, returnTo) {
function enterVehicleAsPassenger() {
if(localPlayer.vehicle == null) {
let tempVehicle = getClosestVehicle(localPlayer.position);
- if(getGame() != VRR_GAME_GTA_IV) {
- if(tempVehicle != null) {
- localPlayer.enterVehicle(tempVehicle, false);
- }
- } else {
- for(let i = 0 ; i <= natives.getMaximumNumberOfPassengers(tempVehicle); i++) {
- if(natives.isCarPassengerSeatFree(tempVehicle, i)) {
- natives.taskEnterCarAsPassenger(localPlayer, tempVehicle, i, 1);
- }
- }
- }
+ if(getGame() != VRR_GAME_GTA_IV) {
+ if(tempVehicle != null) {
+ localPlayer.enterVehicle(tempVehicle, false);
+ }
+ } else {
+ // Disable for now. GTA IV has built-in passenger entry
+
+ //for(let i = 0 ; i <= natives.getMaximumNumberOfPassengers(tempVehicle); i++) {
+ // if(natives.isCarPassengerSeatFree(tempVehicle, i)) {
+ // natives.taskEnterCarAsPassenger(localPlayer, tempVehicle, i, 10000);
+ // }
+ //}
+ }
}
}
// ===========================================================================
function giveLocalPlayerWeapon(weaponId, ammo, active) {
- logToConsole(LOG_DEBUG, `[VRR.Utilities] Giving weapon ${weaponId} with ${ammo} ammo`);
- forceWeapon = weaponId;
- if(getGame() == VRR_GAME_MAFIA_ONE) {
- localPlayer.giveWeapon(weaponId, 0, ammo);
- forceWeaponAmmo = 0;
- forceWeaponClipAmmo = ammo;
- } else {
- localPlayer.giveWeapon(weaponId, ammo, active);
- if(getGame() < VRR_GAME_GTA_IV) {
- forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(weaponId));
- forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(weaponId));
- } else {
- forceWeaponAmmo = ammo;
- forceWeaponClipAmmo = ammo;
- }
- }
+ logToConsole(LOG_DEBUG, `[VRR.Utilities] Giving weapon ${weaponId} with ${ammo} ammo`);
+ forceWeapon = weaponId;
+ if(getGame() == VRR_GAME_MAFIA_ONE) {
+ localPlayer.giveWeapon(weaponId, 0, ammo);
+ forceWeaponAmmo = 0;
+ forceWeaponClipAmmo = ammo;
+ } else {
+ localPlayer.giveWeapon(weaponId, ammo, active);
+ if(getGame() < VRR_GAME_GTA_IV) {
+ forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(weaponId));
+ forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(weaponId));
+ } else {
+ forceWeaponAmmo = ammo;
+ forceWeaponClipAmmo = ammo;
+ }
+ }
}
// ===========================================================================
function clearLocalPlayerWeapons() {
- logToConsole(LOG_DEBUG, `[VRR.Utilities] Clearing weapons`);
- localPlayer.clearWeapons();
- forceWeapon = 0;
- forceWeaponAmmo = 0;
- forceWeaponClipAmmo = 0;
+ logToConsole(LOG_DEBUG, `[VRR.Utilities] Clearing weapons`);
+ localPlayer.clearWeapons();
+ forceWeapon = 0;
+ forceWeaponAmmo = 0;
+ forceWeaponClipAmmo = 0;
}
// ===========================================================================
function getClosestVehicle(pos) {
- return getElementsByType(ELEMENT_VEHICLE).reduce((i, j) => (i.position.distance(pos) < j.position.distance(pos)) ? i : j);
+ return getElementsByType(ELEMENT_VEHICLE).reduce((i, j) => (i.position.distance(pos) < j.position.distance(pos)) ? i : j);
}
// ===========================================================================
function setLocalPlayerPosition(position) {
- logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting position to ${position.x}, ${position.y}, ${position.z}`);
- if(typeof localPlayer.velocity != "undefined") {
- localPlayer.velocity = toVector3(0.0, 0.0, 0.0);
- }
+ logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting position to ${position.x}, ${position.y}, ${position.z}`);
+ if(typeof localPlayer.velocity != "undefined") {
+ localPlayer.velocity = toVector3(0.0, 0.0, 0.0);
+ }
- if(typeof localPlayer.position != "undefined") {
- localPlayer.position = position;
- }
+ if(typeof localPlayer.position != "undefined") {
+ localPlayer.position = position;
+ }
}
// ===========================================================================
function setLocalPlayerHeading(heading) {
- logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting heading to ${heading}`);
- if(typeof localPlayer.heading != "undefined") {
- localPlayer.heading = heading;
- }
+ logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting heading to ${heading}`);
+ if(typeof localPlayer.heading != "undefined") {
+ localPlayer.heading = heading;
+ }
}
// ===========================================================================
function setLocalPlayerInterior(interior) {
- logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting interior to ${interior}`);
- if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
- if(!isGTAIV()) {
- localPlayer.interior = interior;
- game.cameraInterior = interior;
- } else {
- let interiorId = natives.getInteriorAtCoords(localPlayer.position);
- natives.activateInterior(interiorId, true);
- }
- }
+ logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting interior to ${interior}`);
+ if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
+ if(!isGTAIV()) {
+ localPlayer.interior = interior;
+ game.cameraInterior = interior;
+ } else {
+ if(getGameConfig().mainWorldInterior != interior) {
+ let interiorId = natives.getInteriorAtCoords(localPlayer.position);
+ natives.activateInterior(interiorId, true);
+ natives.loadAllObjectsNow();
+ }
+ }
+ }
- //let vehicles = getElementsByType(ELEMENT_VEHICLE);
- //for(let i in vehicles) {
- // if(getEntityData(vehicles[i], "vrr.interior")) {
- // vehicles[i].interior = getEntityData(vehicles[i], "vrr.interior");
- // }
- //}
+ //let vehicles = getElementsByType(ELEMENT_VEHICLE);
+ //for(let i in vehicles) {
+ // if(getEntityData(vehicles[i], "vrr.interior")) {
+ // vehicles[i].interior = getEntityData(vehicles[i], "vrr.interior");
+ // }
+ //}
}
// ===========================================================================
function setSnowState(falling, ground) {
- logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting falling snow to ${falling} and ground snow to ${ground}`);
- snowing = falling;
- if(ground) {
- forceSnowing(false);
- forceSnowing(ground);
- }
+ logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting falling snow to ${falling} and ground snow to ${ground}`);
+ snowing = falling;
+ if(ground) {
+ forceSnowing(false);
+ forceSnowing(ground);
+ }
}
// ===========================================================================
function setLocalPlayerHealth(health) {
- localPlayer.health = health;
+ localPlayer.health = health;
}
// ===========================================================================
function isSnowEnabled() {
- return (typeof snowing != "undefined");
-}
-
-// ===========================================================================
-
-function playPedSpeech(pedName, speechId) {
- logToConsole(LOG_DEBUG, `[VRR.Utilities] Making ${pedName}'s ped talk (${speechId})`);
- if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
- game.SET_CHAR_SAY(int, int);
- }
+ return (typeof snowing != "undefined");
}
// ===========================================================================
function clearLocalPedState() {
- logToConsole(LOG_DEBUG, `[VRR.Utilities] Clearing local ped state`);
- localPlayer.clearObjective();
+ logToConsole(LOG_DEBUG, `[VRR.Utilities] Clearing local ped state`);
+ localPlayer.clearObjective();
}
// ===========================================================================
function getWeaponSlot(weaponId) {
- if(getGame() == VRR_GAME_GTA_IV) {
- return false;
- }
-
+ if(getGame() == VRR_GAME_GTA_IV) {
+ return false;
+ }
+
return weaponSlots[getGame()][weaponId];
}
// ===========================================================================
function setLocalPlayerDrunkEffect(amount, duration) {
- if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
- logToConsole(LOG_DEBUG, `[VRR.Utilities] Drunk effect set to ${amount} for ${duration}ms`);
- drunkEffectAmount = 0;
- drunkEffectDurationTimer = setInterval(function() {
- drunkEffectAmount = drunkEffectAmount;
- if(drunkEffectAmount > 0) {
- //game.SET_MOTION_BLUR(drunkEffectAmount);
- game.SET_PLAYER_DRUNKENNESS(drunkEffectAmount, duration);
- } else {
- clearInterval(drunkEffectDurationTimer);
- drunkEffectDurationTimer = null;
- }
- }, 1000);
- }
+ if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
+ logToConsole(LOG_DEBUG, `[VRR.Utilities] Drunk effect set to ${amount} for ${duration}ms`);
+ drunkEffectAmount = 0;
+ drunkEffectDurationTimer = setInterval(function() {
+ drunkEffectAmount = drunkEffectAmount;
+ if(drunkEffectAmount > 0) {
+ //game.SET_MOTION_BLUR(drunkEffectAmount);
+ game.SET_PLAYER_DRUNKENNESS(drunkEffectAmount, duration);
+ } else {
+ clearInterval(drunkEffectDurationTimer);
+ drunkEffectDurationTimer = null;
+ }
+ }, 1000);
+ }
}
// ===========================================================================
function getLocalPlayerVehicleSeat() {
- for(let i = 0 ; i <= 4 ; i++) {
- if(localPlayer.vehicle.getOccupant(i) == localPlayer) {
- return i;
- }
- }
+ for(let i = 0 ; i <= 4 ; i++) {
+ if(localPlayer.vehicle.getOccupant(i) == localPlayer) {
+ return i;
+ }
+ }
}
// ===========================================================================
function clearSelfOwnedPeds() {
- logToConsole(LOG_DEBUG, `Clearing self-owned peds`);
- getElementsByType(ELEMENT_PED).forEach(function(ped) {
- //if(ped.isOwner) {
- destroyElement(ped);
- //}
- });
+ logToConsole(LOG_DEBUG, `Clearing self-owned peds`);
+ getElementsByType(ELEMENT_PED).forEach(function(ped) {
+ //if(ped.isOwner) {
+ destroyElement(ped);
+ //}
+ });
}
// ===========================================================================
function clearSelfOwnedVehicles() {
- logToConsole(LOG_DEBUG, `Clearing self-owned vehicles`);
- getElementsByType(ELEMENT_VEHICLE).forEach(function(vehicle) {
- //if(vehicle.isOwner) {
- destroyElement(vehicle);
- //}
- });
+ logToConsole(LOG_DEBUG, `Clearing self-owned vehicles`);
+ getElementsByType(ELEMENT_VEHICLE).forEach(function(vehicle) {
+ //if(vehicle.isOwner) {
+ destroyElement(vehicle);
+ //}
+ });
}
// ===========================================================================
function setMouseCameraState(state) {
- logToConsole(LOG_DEBUG, `[VRR.Utilities] ${(state)?"Enabled":"Disabled"} mouse camera`);
- mouseCameraEnabled = state;
- SetStandardControlsEnabled(!mouseCameraEnabled);
+ logToConsole(LOG_DEBUG, `[VRR.Utilities] ${(state)?"Enabled":"Disabled"} mouse camera`);
+ mouseCameraEnabled = state;
+ SetStandardControlsEnabled(!mouseCameraEnabled);
}
// ===========================================================================
function toggleMouseCursor() {
- logToConsole(LOG_DEBUG, `[VRR.Utilities] ${(!gui.cursorEnabled)?"Enabled":"Disabled"} mouse cursor`);
- gui.showCursor(!gui.cursorEnabled, gui.cursorEnabled);
+ logToConsole(LOG_DEBUG, `[VRR.Utilities] ${(!gui.cursorEnabled)?"Enabled":"Disabled"} mouse cursor`);
+ gui.showCursor(!gui.cursorEnabled, gui.cursorEnabled);
}
// ===========================================================================
function toggleMouseCursor() {
- logToConsole(LOG_DEBUG, `[VRR.Utilities] ${(!gui.cursorEnabled)?"Enabled":"Disabled"} mouse cursor`);
- setMouseCameraState(!mouseCameraEnabled);
+ logToConsole(LOG_DEBUG, `[VRR.Utilities] ${(!gui.cursorEnabled)?"Enabled":"Disabled"} mouse cursor`);
+ setMouseCameraState(!mouseCameraEnabled);
}
// ===========================================================================
function setPlayerWeaponDamageEvent(clientName, eventType) {
- logToConsole(LOG_DEBUG, `[VRR.Utilities] Set ${clientName} damage event type to ${eventType}`);
- weaponDamageEvent[clientName] = eventType;
+ logToConsole(LOG_DEBUG, `[VRR.Utilities] Set ${clientName} damage event type to ${eventType}`);
+ weaponDamageEvent[clientName] = eventType;
}
// ===========================================================================
function setPlayerWeaponDamageEnabled(clientName, state) {
- logToConsole(LOG_DEBUG, `[VRR.Utilities] ${(state)?"Enabled":"Disabled"} damage from ${clientName}`);
- weaponDamageEnabled[clientName] = state;
+ logToConsole(LOG_DEBUG, `[VRR.Utilities] ${(state)?"Enabled":"Disabled"} damage from ${clientName}`);
+ weaponDamageEnabled[clientName] = state;
}
// ===========================================================================
function setLocalPlayerCash(amount) {
- logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting local player money`);
- if(typeof localPlayer.money != "undefined") {
- localPlayer.money = toInteger(amount);
- }
+ logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting local player money`);
+ if(typeof localPlayer.money != "undefined") {
+ localPlayer.money = toInteger(amount);
+ }
- if(getGame() == VRR_GAME_GTA_IV) {
- natives.setMultiplayerHudCash(amount);
- }
+ if(getGame() == VRR_GAME_GTA_IV) {
+ natives.setMultiplayerHudCash(amount);
+ }
}
// ===========================================================================
function destroyAutoCreatedPickups() {
- if(typeof ELEMENT_PICKUP != "undefined") {
- getElementsByType(ELEMENT_PICKUP).forEach(function(pickup) {
- if(pickup.isOwner) {
- destroyElement(pickup);
- }
- });
- }
+ if(typeof ELEMENT_PICKUP != "undefined") {
+ getElementsByType(ELEMENT_PICKUP).forEach(function(pickup) {
+ if(pickup.isOwner) {
+ destroyElement(pickup);
+ }
+ });
+ }
}
// ===========================================================================
function processLocalPlayerControlState() {
- if(localPlayer == null) {
- return false;
- }
+ if(localPlayer == null) {
+ return false;
+ }
- if(isSpawned) {
- return false;
- }
+ if(isSpawned) {
+ return false;
+ }
- if(!controlsEnabled) {
- clearLocalPedState();
- }
+ if(!controlsEnabled) {
+ clearLocalPedState();
+ }
}
// ===========================================================================
function processWantedLevelReset() {
- if(localPlayer == null) {
- return false;
- }
+ if(localPlayer == null) {
+ return false;
+ }
- if(!isSpawned) {
- return false;
- }
+ if(!isSpawned) {
+ return false;
+ }
- if(typeof localPlayer.wantedLevel != "undefined") {
- localPlayer.wantedLevel = forceWantedLevel;
- }
+ if(typeof localPlayer.wantedLevel != "undefined") {
+ localPlayer.wantedLevel = forceWantedLevel;
+ }
}
// ===========================================================================
function processLocalPlayerVehicleControlState() {
- if(areServerElementsSupported()) {
- if(inVehicle && localPlayer.vehicle != null) {
- if(getEntityData(localPlayer.vehicle, "vrr.engine") == false) {
- localPlayer.vehicle.engine = false;
- }
+ if(areServerElementsSupported()) {
+ if(inVehicle && localPlayer.vehicle != null) {
+ if(getEntityData(localPlayer.vehicle, "vrr.engine") == false) {
+ localPlayer.vehicle.engine = false;
+ }
- if(!localPlayer.vehicle.engine) {
- if(typeof localPlayer.vehicle.velocity != "undefined") {
- localPlayer.vehicle.velocity = toVector3(0.0, 0.0, 0.0);
- localPlayer.vehicle.turnVelocity = toVector3(0.0, 0.0, 0.0);
- }
+ if(!localPlayer.vehicle.engine) {
+ if(typeof localPlayer.vehicle.velocity != "undefined") {
+ localPlayer.vehicle.velocity = toVector3(0.0, 0.0, 0.0);
+ localPlayer.vehicle.turnVelocity = toVector3(0.0, 0.0, 0.0);
+ }
- if(parkedVehiclePosition) {
- localPlayer.vehicle.position = parkedVehiclePosition;
- localPlayer.vehicle.heading = parkedVehicleHeading;
- }
- } else {
- if(parkedVehiclePosition) {
- parkedVehiclePosition = false;
- parkedVehicleHeading = false;
- }
- }
- }
- }
+ if(parkedVehiclePosition) {
+ localPlayer.vehicle.position = parkedVehiclePosition;
+ localPlayer.vehicle.heading = parkedVehicleHeading;
+ }
+ } else {
+ if(parkedVehiclePosition) {
+ parkedVehiclePosition = false;
+ parkedVehicleHeading = false;
+ }
+ }
+ }
+ }
}
// ===========================================================================
function processLocalPlayerSphereEntryExitHandling() {
- let position = getLocalPlayerPosition();
+ let position = getLocalPlayerPosition();
- if(areMarkersSupported()) {
- getElementsByType(ELEMENT_MARKER).forEach(function(sphere) {
- if(getDistance(position, sphere.position) <= sphere.radius) {
- if(!inSphere) {
- inSphere = sphere;
- triggerEvent("OnLocalPlayerEnterSphere", null, sphere);
- }
- } else {
- if(inSphere) {
- inSphere = false;
- triggerEvent("OnLocalPlayerExitSphere", null, sphere);
- }
- }
- });
- }
+ if(areMarkersSupported()) {
+ getElementsByType(ELEMENT_MARKER).forEach(function(sphere) {
+ if(getDistance(position, sphere.position) <= sphere.radius) {
+ if(!inSphere) {
+ inSphere = sphere;
+ triggerEvent("OnLocalPlayerEnterSphere", null, sphere);
+ }
+ } else {
+ if(inSphere) {
+ inSphere = false;
+ triggerEvent("OnLocalPlayerExitSphere", null, sphere);
+ }
+ }
+ });
+ }
}
// ===========================================================================
function processJobRouteSphere() {
- if(game.game == VRR_GAME_GTA_SA) {
- let position = getLocalPlayerPosition();
- if(jobRouteLocationSphere != null) {
- if(getDistance(position, jobRouteLocationSphere.position) <= 2.0) {
- enteredJobRouteSphere();
- }
- }
- }
+ if(game.game == VRR_GAME_GTA_SA) {
+ let position = getLocalPlayerPosition();
+ if(jobRouteLocationSphere != null) {
+ if(getDistance(position, jobRouteLocationSphere.position) <= 2.0) {
+ enteredJobRouteSphere();
+ }
+ }
+ }
}
// ===========================================================================
function forceLocalPlayerEquippedWeaponItem() {
- if(typeof localPlayer.weapon != "undefined") {
- if(forceWeapon != 0) {
- if(localPlayer.weapon != forceWeapon) {
- localPlayer.weapon = forceWeapon;
- if(getGame() < VRR_GAME_GTA_IV) {
- localPlayer.setWeaponClipAmmunition(getWeaponSlot(forceWeapon), forceWeaponClipAmmo);
- localPlayer.setWeaponAmmunition(getWeaponSlot(forceWeapon), forceWeaponAmmo);
- }
- } else {
- if(getGame() < VRR_GAME_GTA_IV) {
- forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(forceWeapon));
- forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(forceWeapon));
- }
- }
- } else {
- if(localPlayer.weapon > 0) {
- localPlayer.clearWeapons();
- }
- }
- }
+ if(typeof localPlayer.weapon != "undefined") {
+ if(forceWeapon != 0) {
+ if(localPlayer.weapon != forceWeapon) {
+ localPlayer.weapon = forceWeapon;
+ if(getGame() < VRR_GAME_GTA_IV) {
+ localPlayer.setWeaponClipAmmunition(getWeaponSlot(forceWeapon), forceWeaponClipAmmo);
+ localPlayer.setWeaponAmmunition(getWeaponSlot(forceWeapon), forceWeaponAmmo);
+ }
+ } else {
+ if(getGame() < VRR_GAME_GTA_IV) {
+ forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(forceWeapon));
+ forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(forceWeapon));
+ }
+ }
+ } else {
+ if(localPlayer.weapon > 0) {
+ localPlayer.clearWeapons();
+ }
+ }
+ }
}
// ===========================================================================
function getLocalPlayerPosition() {
- let position = localPlayer.position;
- if(localPlayer.vehicle) {
- position = localPlayer.vehicle.position;
- }
+ let position = localPlayer.position;
+ if(localPlayer.vehicle) {
+ position = localPlayer.vehicle.position;
+ }
- return position;
+ return position;
}
// ===========================================================================
function processLocalPlayerVehicleEntryExitHandling() {
- if(localPlayer.vehicle) {
- if(!inVehicle) {
- inVehicle = localPlayer.vehicle;
- inVehicleSeat = getLocalPlayerVehicleSeat();
- triggerEvent("OnLocalPlayerEnteredVehicle", inVehicle, inVehicleSeat);
- }
- } else {
- if(inVehicle) {
- triggerEvent("OnLocalPlayerExitedVehicle", inVehicle, inVehicleSeat);
- inVehicle = false;
- inVehicleSeat = false;
- }
- }
+ if(localPlayer.vehicle) {
+ if(!inVehicle) {
+ inVehicle = localPlayer.vehicle;
+ inVehicleSeat = getLocalPlayerVehicleSeat();
+ triggerEvent("OnLocalPlayerEnteredVehicle", inVehicle, inVehicleSeat);
+ }
+ } else {
+ if(inVehicle) {
+ triggerEvent("OnLocalPlayerExitedVehicle", inVehicle, inVehicleSeat);
+ inVehicle = false;
+ inVehicleSeat = false;
+ }
+ }
}
// ===========================================================================
function getVehicleForNetworkEvent(vehicle) {
- if(getGame() == VRR_GAME_GTA_IV) {
- return natives.getNetworkIdFromVehicle(vehicle);
- }
- return vehicle;
+ if(getGame() == VRR_GAME_GTA_IV) {
+ return natives.getNetworkIdFromVehicle(vehicle);
+ }
+ return vehicle;
}
// ===========================================================================
function setMinuteDuration(minuteDuration) {
- logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting minute duration to ${minuteDuration}ms`);
+ logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting minute duration to ${minuteDuration}ms`);
- if(isTimeSupported()) {
- game.time.minuteDuration = minuteDuration;
- }
+ if(isTimeSupported()) {
+ game.time.minuteDuration = minuteDuration;
+ }
}
// ===========================================================================
function getStreamingRadioVolumeForPosition(position) {
- return streamingRadioVolume;
+ return streamingRadioVolume;
}
// ===========================================================================
function getLocalPlayerLookAtPosition() {
- if(localPlayer != null) {
+ if(localPlayer != null) {
let centerCameraPos = getWorldFromScreenPosition(toVector3(game.width/2, game.height/2, 0));
return getWorldFromScreenPosition(toVector3(game.width/2, game.height/2, getDistance(centerCameraPos, localPlayer.position)+20));
}
@@ -718,11 +714,11 @@ function getLocalPlayerLookAtPosition() {
// ===========================================================================
function processInteriorLightsRendering() {
- if(renderInteriorLights) {
- if(!interiorLightsEnabled) {
- graphics.drawRectangle(null, toVector2(0.0, 0.0), toVector2(game.width, game.height), interiorLightsColour, interiorLightsColour, interiorLightsColour, interiorLightsColour);
- }
- }
+ if(renderInteriorLights) {
+ if(!interiorLightsEnabled) {
+ graphics.drawRectangle(null, toVector2(0.0, 0.0), toVector2(game.width, game.height), interiorLightsColour, interiorLightsColour, interiorLightsColour, interiorLightsColour);
+ }
+ }
}
// ===========================================================================
@@ -749,80 +745,86 @@ function getPlayerFromParams(params) {
// ===========================================================================
function processNearbyPickups() {
- if(typeof ELEMENT_PICKUP != "undefined") {
- let pickups = getElementsByType(ELEMENT_PICKUP);
- for(let i in pickups) {
- if(getDistance(pickups[i].position, localPlayer.position) < 5) {
- //if(pickups[i].interior == localPlayer.interior && pickups[i].dimension == localPlayer.dimension) {
- if(currentPickup != pickups[i]) {
- currentPickup = pickups[i];
- sendNetworkEventToServer("vrr.pickup", pickups[i].id);
- }
- //}
- }
- }
- }
+ if(typeof ELEMENT_PICKUP != "undefined") {
+ let pickups = getElementsByType(ELEMENT_PICKUP);
+ for(let i in pickups) {
+ if(getDistance(pickups[i].position, localPlayer.position) < 5) {
+ //if(pickups[i].interior == localPlayer.interior && pickups[i].dimension == localPlayer.dimension) {
+ if(currentPickup != pickups[i]) {
+ currentPickup = pickups[i];
+ sendNetworkEventToServer("vrr.pickup", pickups[i].id);
+ }
+ //}
+ }
+ }
+ }
}
// ===========================================================================
function processGameSpecifics() {
- if(game.game < VRR_GAME_GTA_IV) {
- game.clearMessages();
- }
+ if(game.game < VRR_GAME_GTA_IV) {
+ game.clearMessages();
+ }
- destroyAutoCreatedPickups();
+ destroyAutoCreatedPickups();
}
// ===========================================================================
function processVehiclePurchasing() {
- if(vehiclePurchaseState == VRR_VEHBUYSTATE_TESTDRIVE) {
- if(inVehicle == false) {
- vehiclePurchaseState = VRR_VEHBUYSTATE_EXITVEH;
- sendNetworkEventToServer("vrr.vehBuyState", VRR_VEHBUYSTATE_EXITVEH);
- return false;
- } else {
- if(vehiclePurchasing == inVehicle) {
- if(getDistance(inVehicle.position, vehiclePurchasePosition) >= 25) {
- vehiclePurchaseState = VRR_VEHBUYSTATE_FARENOUGH;
- sendNetworkEventToServer("vrr.vehBuyState", VRR_VEHBUYSTATE_FARENOUGH);
- }
- } else {
- vehiclePurchaseState = VRR_VEHBUYSTATE_WRONGVEH;
- sendNetworkEventToServer("vrr.vehBuyState", VRR_VEHBUYSTATE_WRONGVEH);
- }
- }
- }
+ if(vehiclePurchaseState == VRR_VEHBUYSTATE_TESTDRIVE) {
+ if(inVehicle == false) {
+ vehiclePurchaseState = VRR_VEHBUYSTATE_EXITVEH;
+ sendNetworkEventToServer("vrr.vehBuyState", VRR_VEHBUYSTATE_EXITVEH);
+ return false;
+ } else {
+ if(vehiclePurchasing == inVehicle) {
+ if(getDistance(inVehicle.position, vehiclePurchasePosition) >= 25) {
+ vehiclePurchaseState = VRR_VEHBUYSTATE_FARENOUGH;
+ sendNetworkEventToServer("vrr.vehBuyState", VRR_VEHBUYSTATE_FARENOUGH);
+ }
+ } else {
+ vehiclePurchaseState = VRR_VEHBUYSTATE_WRONGVEH;
+ sendNetworkEventToServer("vrr.vehBuyState", VRR_VEHBUYSTATE_WRONGVEH);
+ }
+ }
+ }
}
// ===========================================================================
function setVehiclePurchaseState(state, vehicleId, position) {
- vehiclePurchaseState = state;
+ vehiclePurchaseState = state;
- if(vehicleId != null) {
- vehiclePurchasing = getElementFromId(vehicleId);
- } else {
- vehiclePurchasing = null;
- }
+ if(vehicleId != null) {
+ vehiclePurchasing = getElementFromId(vehicleId);
+ } else {
+ vehiclePurchasing = null;
+ }
- vehiclePurchasePosition = position;
+ vehiclePurchasePosition = position;
}
// ===========================================================================
function processVehicleFires() {
- let vehicles = getElementsByType(ELEMENT_VEHICLE);
- for(let i in vehicles) {
- if(vehicles[i].isSyncer) {
- if(!doesEntityDataExist(vehicles[i], "vrr.fire")) {
- triggerNetworkEvent("vrr.vehFire", vehicles[i].id);
- } else {
- vehicles[i].health = 249;
- }
- }
- }
+ let vehicles = getElementsByType(ELEMENT_VEHICLE);
+ for(let i in vehicles) {
+ if(vehicles[i].isSyncer) {
+ if(!doesEntityDataExist(vehicles[i], "vrr.fire")) {
+ triggerNetworkEvent("vrr.vehFire", vehicles[i].id);
+ } else {
+ vehicles[i].health = 249;
+ }
+ }
+ }
+}
+
+// ===========================================================================
+
+function getServerData() {
+ return serverData;
}
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/vehicle.js b/scripts/client/vehicle.js
new file mode 100644
index 00000000..2b28e5a2
--- /dev/null
+++ b/scripts/client/vehicle.js
@@ -0,0 +1,18 @@
+// ===========================================================================
+// Vortrex's Roleplay Resource
+// https://github.com/VortrexFTW/gtac_roleplay
+// ===========================================================================
+// FILE: vehicle.js
+// DESC: Provides vehicle functions and arrays with data
+// TYPE: Client (JavaScript)
+// ===========================================================================
+
+function receiveVehicleFromServer(vehicleId, position, model, colour1, colour2, colour3 = 0, colour4 = 0) {
+ logToConsole(LOG_DEBUG, `[VRR.Job] Received vehicle ${vehicleId} (${getVehicleNameFromModel(model, getGame())}) from server`);
+
+ if(getGame() == VRR_GAME_GTA_IV) {
+
+ }
+}
+
+// ===========================================================================
\ No newline at end of file
diff --git a/scripts/server/accent.js b/scripts/server/accent.js
index 41cea951..30697e45 100644
--- a/scripts/server/accent.js
+++ b/scripts/server/accent.js
@@ -8,30 +8,30 @@
// ===========================================================================
function getPlayerAccentText(client) {
- return getPlayerCurrentSubAccount(client).accent;
+ return getPlayerCurrentSubAccount(client).accent;
}
// ===========================================================================
function setPlayerAccentText(client, text) {
- getPlayerCurrentSubAccount(client).accent = text;
+ getPlayerCurrentSubAccount(client).accent = text;
}
// ===========================================================================
function doesPlayerHaveAccent(client) {
- return (getPlayerCurrentSubAccount(client).accent != "");
+ return (getPlayerCurrentSubAccount(client).accent != "");
}
// ===========================================================================
function getPlayerAccentInlineOutput(client) {
- let outputText = "";
- if(doesPlayerHaveAccent(client)) {
- outputText = `[${getPlayerAccentText(client)}] `;
- }
+ let outputText = "";
+ if(doesPlayerHaveAccent(client)) {
+ outputText = `[${getPlayerAccentText(client)}] `;
+ }
- return outputText;
+ return outputText;
}
// ===========================================================================
diff --git a/scripts/server/account.js b/scripts/server/account.js
index 549fcdff..9d52dafd 100644
--- a/scripts/server/account.js
+++ b/scripts/server/account.js
@@ -94,13 +94,13 @@ function toggleAutoSelectLastCharacterCommand(command, params, client) {
function toggleAccountGUICommand(command, params, client) {
let flagValue = getAccountSettingsFlagValue("NoGUI");
- if(!doesPlayerHaveGUIEnabled(client)) {
+ if(doesPlayerHaveGUIEnabled(client)) {
getPlayerData(client).accountData.settings = removeBitFlag(getPlayerData(client).accountData.settings, flagValue);
- messagePlayerNormal(client, getLocaleString(client, "GUIAccountSettingToggle", `{softRed}${toUpperCase(getLocaleString(client, "Off"))}`));
+ messagePlayerNormal(client, getLocaleString(client, "GUIAccountSettingToggle", `{softRed}${toUpperCase(getLocaleString(client, "Off"))}{MAINCOLOUR}`));
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} has toggled GUI for their account ON.`);
} else {
getPlayerData(client).accountData.settings = addBitFlag(getPlayerData(client).accountData.settings, flagValue);
- messagePlayerNormal(client, getLocaleString(client, "GUIAccountSettingToggle", `{softGreen}${toUpperCase(getLocaleString(client, "On"))}`));
+ messagePlayerNormal(client, getLocaleString(client, "GUIAccountSettingToggle", `{softGreen}${toUpperCase(getLocaleString(client, "On"))}{MAINCOLOUR}`));
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} has toggled GUI for their account ON.`);
}
@@ -271,6 +271,26 @@ function setAccountChatScrollLinesCommand(command, params, client) {
// ===========================================================================
+function setAccountChatAutoHideDelayCommand(command, params, client) {
+ if(areParamsEmpty(params)) {
+ messagePlayerSyntax(client, getCommandSyntaxText(command));
+ return false;
+ }
+
+ if(isNaN(params)) {
+ messagePlayerError(client, `The delay time must be a number!`);
+ return false;
+ }
+
+ let delay = Math.ceil(toInteger(params));
+
+ getPlayerData(client).accountData.chatAutoHideDelay = delay;
+ sendPlayerChatAutoHideDelay(client, delay);
+ messagePlayerSuccess(client, `Your chatbox will now automatically hide after ${toInteger(delay)} seconds!`);
+}
+
+// ===========================================================================
+
function setAccountEmailCommand(command, params, client) {
if(areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
@@ -569,6 +589,7 @@ function loginSuccess(client) {
if(doesServerHaveTesterOnlyEnabled()) {
if(!hasBitFlag(getPlayerData(client).accountData.flags.moderation, getModerationFlagValue("IsTester"))) {
setTimeout(function() {
+ getPlayerData(client).customDisconnectReason = "Kicked - Not a tester";
client.disconnect();
}, 3500);
@@ -580,13 +601,13 @@ function loginSuccess(client) {
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(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
- showPlayerPromptGUI(client, getLocaleString(client, "NoCharactersGUIMessage"), getLocaleString(client, "NoCharactersGUIWindowTitle"));
+ showPlayerPromptGUI(client, getLocaleString(client, "NoCharactersGUIMessage"), getLocaleString(client, "NoCharactersGUIWindowTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
getPlayerData(client).promptType = VRR_PROMPT_CREATEFIRSTCHAR;
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the no characters prompt GUI`);
} else {
@@ -600,8 +621,8 @@ function loginSuccess(client) {
getPlayerData(client).accountData.ipAddress = client.ip;
sendPlayerChatScrollLines(client, getPlayerData(client).accountData.chatScrollLines);
-
messagePlayerNormal(null, `👋 ${getPlayerName(client)} has joined the server`, getColourByName("softYellow"));
+ messageDiscordChatChannel(`👋 ${getPlayerName(client)} has joined the server`);
}
// ===========================================================================
@@ -636,6 +657,7 @@ function saveAccountToDatabase(accountData) {
["acct_svr_staff_flags", accountData.flags.admin],
["acct_svr_mod_flags", accountData.flags.moderation],
["acct_svr_chat_scroll_lines", accountData.chatScrollLines],
+ ["acct_svr_chat_auto_hide_delay", accountData.chatAutoHideDelay],
];
let queryString1 = createDatabaseUpdateQuery("acct_main", data, `acct_id=${accountData.databaseId}`);
@@ -915,13 +937,13 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress
} else {
messagePlayerError(client, "Password doesn't meet requirements!");
}
- return false
+ return false;
}
if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
if(!isValidEmailAddress(emailAddress)) {
showPlayerRegistrationFailedGUI(client, getLocaleString(client, "RegistrationFailedInvalidEmail"));
- return false
+ return false;
}
}
@@ -947,7 +969,7 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress
setAccountEmailVerificationCode(getPlayerData(client).accountData, emailVerificationCode);
sendEmailVerificationEmail(client, emailVerificationCode);
logToConsole(LOG_WARN, `${getPlayerDisplayForConsole(client)} was sent a registration email verification code`);
- }
+ }
if(doesServerHaveTesterOnlyEnabled() && !isPlayerATester(client)) {
setTimeout(function() {
@@ -962,7 +984,7 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress
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 {
messagePlayerAlert(client, getLocaleString(client, "RegistrationCreateCharReminder"));
@@ -979,6 +1001,10 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress
// ===========================================================================
function checkAccountResetPasswordRequest(client, inputText) {
+ if(!checkForSMTPModule() || !getEmailConfig().enabled) {
+ return false;
+ }
+
if(getPlayerData(client).passwordResetState == VRR_RESETPASS_STATE_NONE) {
if(toLowerCase(getPlayerData(client).accountData.emailAddress) != toLowerCase(inputText)) {
logToConsole(LOG_DEBUG|LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to reset their password (email not correct)`);
@@ -1063,7 +1089,7 @@ function isValidEmailAddress(emailAddress) {
// ===========================================================================
-function saveAllClientsToDatabase() {
+function savePlayersToDatabase() {
logToConsole(LOG_DEBUG, "[VRR.Account]: Saving all clients to database ...");
getClients().forEach(function(client) {
savePlayerToDatabase(client);
@@ -1078,7 +1104,7 @@ function savePlayerToDatabase(client) {
return false;
}
- if(!getPlayerData(client).loggedIn) {
+ if(!isPlayerLoggedIn(client)) {
return false;
}
@@ -1088,7 +1114,7 @@ function savePlayerToDatabase(client) {
if(getPlayerData(client).currentSubAccount != -1) {
//let subAccountData = getPlayerCurrentSubAccount(client);
- if(client.player != null) {
+ if(getPlayerPed(client) != null) {
if(getPlayerData(client).returnToPosition != null) {
getPlayerCurrentSubAccount(client).spawnPosition = getPlayerData(client).returnToPosition;
getPlayerCurrentSubAccount(client).spawnHeading = getPlayerData(client).returnToHeading.z;
@@ -1146,6 +1172,7 @@ function initClient(client) {
if(isAccountAutoIPLoginEnabled(tempAccountData) && getPlayerData(client).accountData.ipAddress == client.ip) {
messagePlayerAlert(client, getLocaleString(client, "AutoLoggedInIP"));
loginSuccess(client);
+ playRadioStreamForPlayer(client, getServerIntroMusicURL(), true, getPlayerStreamingRadioVolume(client));
} else {
if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI.`);
@@ -1153,6 +1180,12 @@ function initClient(client) {
} else {
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled).`);
messagePlayerNormal(client, getLocaleString(client, "WelcomeBack", getServerName(), getPlayerName(client), "/login"),getColourByName("softGreen"));
+
+ //if(checkForGeoIPModule()) {
+ // let iso = module.geoip.getCountryISO(client.ip);
+ // let localeId = getLocaleFromCountryISO(iso);
+ //}
+ //showGameMessage(client, getLocaleString(client, "LocaleOffer", `/lang ${getLocaleData(localeId)[2]}`), getColourByName("white"), 10000, "Roboto");
}
playRadioStreamForPlayer(client, getServerIntroMusicURL(), true, getPlayerStreamingRadioVolume(client));
}
diff --git a/scripts/server/animation.js b/scripts/server/animation.js
index 4c18f00f..1257043b 100644
--- a/scripts/server/animation.js
+++ b/scripts/server/animation.js
@@ -20,17 +20,17 @@ function playPlayerAnimationCommand(command, params, client) {
return false;
}
-let animationSlot = getAnimationFromParams(getParam(params, " ", 1));
- let animationPositionOffset = 1;
+ let animationSlot = getAnimationFromParams(getParam(params, " ", 1));
+ let animationPositionOffset = 1;
if(!animationSlot) {
- messagePlayerError(client, getLocaleString(client, "AnimationNotFound"));
+ messagePlayerError(client, getLocaleString(client, "InvalidAnimation"));
messagePlayerInfo(client, getLocaleString(client, "AnimationHelpTip"), `{ALTCOLOUR}/animlist{MAINCOLOUR}`);
return false;
}
if(toInteger(animationPositionOffset) < 0 || toInteger(animationPositionOffset) > 3) {
- messagePlayerError(client, getLocaleString(client, "AnimationInvalidDistance"));
+ messagePlayerError(client, getLocaleString(client, "InvalidAnimationDistance"));
return false;
}
@@ -39,7 +39,7 @@ let animationSlot = getAnimationFromParams(getParam(params, " ", 1));
}
if(isPlayerHandCuffed(client) || isPlayerTazed(client) || isPlayerInForcedAnimation(client)) {
- messagePlayerError(client, `You aren't able to do that`);
+ messagePlayerError(client, getLocaleString(client, "UnableToDoThat"));
return false;
}
@@ -51,17 +51,17 @@ let animationSlot = getAnimationFromParams(getParam(params, " ", 1));
function stopPlayerAnimationCommand(command, params, client) {
if(isPlayerHandCuffed(client) || isPlayerTazed(client) || isPlayerInForcedAnimation(client)) {
- messagePlayerError(client, `You aren't able to do that`);
+ messagePlayerError(client, getLocaleString(client, "UnableToDoThat"));
return false;
}
setPlayerPosition(client, getPlayerData(client).currentAnimationPositionReturnTo);
- makePedStopAnimation(getPlayerData(client).ped);
+ makePedStopAnimation(getPlayerPed(client));
getPlayerData(client).currentAnimation = -1;
getPlayerData(client).currentAnimationPositionOffset = false;
getPlayerData(client).currentAnimationPositionReturnTo = false;
- getPlayerData(client).animationStart = 0;
+ getPlayerData(client).animationStart = 0;
getPlayerData(client).animationForced = false;
setPlayerMouseCameraState(client, false);
@@ -70,7 +70,7 @@ function stopPlayerAnimationCommand(command, params, client) {
// ===========================================================================
function showAnimationListCommand(command, params, client) {
- let animList = getGameConfig().animations[getServerGame()].map(function(x) { return x[0]; });
+ let animList = getGameConfig().animations[getServerGame()].map(function(x) { return x.name; });
let chunkedList = splitArrayIntoChunks(animList, 10);
@@ -88,7 +88,7 @@ function showAnimationListCommand(command, params, client) {
* @return {Array} The animation's data (array)
*/
function getAnimationData(animationSlot, gameId = getServerGame()) {
- return getGameConfig().animations[gameId][animationSlot];
+ return getGameConfig().animations[gameId][animationSlot];
}
// ===========================================================================
@@ -100,14 +100,14 @@ function isPlayerInForcedAnimation(client) {
// ===========================================================================
function makePlayerPlayAnimation(client, animationSlot, offsetPosition = 1) {
- getPlayerData(client).currentAnimation = animationSlot;
+ getPlayerData(client).currentAnimation = animationSlot;
getPlayerData(client).currentAnimationPositionOffset = offsetPosition;
getPlayerData(client).currentAnimationPositionReturnTo = getPlayerPosition(client);
- getPlayerData(client).animationStart = getCurrentUnixTimestamp();
+ getPlayerData(client).animationStart = getCurrentUnixTimestamp();
getPlayerData(client).animationForced = false;
- makePedPlayAnimation(getPlayerData(client).ped, animationSlot, offsetPosition);
-
+ makePedPlayAnimation(getPlayerPed(client), animationSlot, offsetPosition);
+ setEntityData(getPlayerPed(client), "vrr.anim", animationSlot, true);
//if(getAnimationData(animationSlot)[9] != VRR_ANIMMOVE_NONE) {
// if(getGame() < VRR_GAME_GTA_SA) {
// setPlayerMouseCameraState(client, true);
@@ -118,35 +118,36 @@ function makePlayerPlayAnimation(client, animationSlot, offsetPosition = 1) {
// ===========================================================================
function forcePlayerPlayAnimation(client, animationSlot, offsetPosition = 1) {
- getPlayerData(client).currentAnimation = animationSlot;
+ getPlayerData(client).currentAnimation = animationSlot;
getPlayerData(client).currentAnimationPositionOffset = offsetPosition;
getPlayerData(client).currentAnimationPositionReturnTo = getPlayerPosition(client);
- getPlayerData(client).animationStart = getCurrentUnixTimestamp();
+ getPlayerData(client).animationStart = getCurrentUnixTimestamp();
getPlayerData(client).animationForced = true;
setPlayerControlState(client, false);
- forcePedAnimation(getPlayerData(client).ped, animationSlot, offsetPosition);
+ forcePedAnimation(getPlayerPed(client), animationSlot, offsetPosition);
}
// ===========================================================================
function makePlayerStopAnimation(client) {
//setPlayerPosition(client, getPlayerData(client).currentAnimationPositionReturnTo);
- makePedStopAnimation(getPlayerData(client).ped);
+ makePedStopAnimation(getPlayerPed(client));
getPlayerData(client).currentAnimation = -1;
getPlayerData(client).currentAnimationPositionOffset = false;
getPlayerData(client).currentAnimationPositionReturnTo = false;
- getPlayerData(client).animationStart = 0;
+ getPlayerData(client).animationStart = 0;
getPlayerData(client).animationForced = false;
}
// ===========================================================================
function getAnimationFromParams(params) {
+ let animations = getGameConfig().animations[getServerGame()];
if(isNaN(params)) {
- for(let i in getGameConfig().animations[getServerGame()]) {
- if(toLowerCase(getGameConfig().animations[getServerGame()][i][0]).indexOf(toLowerCase(params)) != -1) {
+ for(let i in animations) {
+ if(toLowerCase(animations[i].name).indexOf(toLowerCase(params)) != -1) {
return i;
}
}
diff --git a/scripts/server/anticheat.js b/scripts/server/anticheat.js
index 38ff2b63..9cf7fafb 100644
--- a/scripts/server/anticheat.js
+++ b/scripts/server/anticheat.js
@@ -8,14 +8,14 @@
// ===========================================================================
function initAntiCheatScript() {
- logToConsole(LOG_DEBUG, "[VRR.AntiCheat]: Initializing anticheat script ...");
+ logToConsole(LOG_DEBUG, "[VRR.AntiCheat]: Initializing anticheat script ...");
logToConsole(LOG_DEBUG, "[VRR.AntiCheat]: Anticheat script initialized!");
}
// ===========================================================================
function clearPlayerStateToEnterExitProperty(client) {
- if(getPlayerData(client).pedState != VRR_PEDSTATE_READY) {
+ if(getPlayerData(client).pedState != VRR_PEDSTATE_READY) {
if(getPlayerData(client).pedState == VRR_PEDSTATE_ENTERINGVEHICLE) {
sendPlayerClearPedState(client);
getPlayerData(client).pedState = VRR_PEDSTATE_READY;
diff --git a/scripts/server/ban.js b/scripts/server/ban.js
index cfd6154b..f95179c0 100644
--- a/scripts/server/ban.js
+++ b/scripts/server/ban.js
@@ -10,8 +10,8 @@
// ===========================================================================
function initBanScript() {
- logToConsole(LOG_INFO, "[VRR.Ban]: Initializing ban script ...");
- logToConsole(LOG_INFO, "[VRR.Ban]: Ban script initialized!");
+ logToConsole(LOG_INFO, "[VRR.Ban]: Initializing ban script ...");
+ logToConsole(LOG_INFO, "[VRR.Ban]: Ban script initialized!");
}
// ===========================================================================
@@ -22,24 +22,24 @@ function accountBanCommand(command, params, client) {
return false;
}
- let splitParams = params.split(" ");
- let targetClient = getPlayerFromParams(getParam(params, " ", 1));
- let reason = splitParams.slice(1).join(" ");
+ let splitParams = params.split(" ");
+ let targetClient = getPlayerFromParams(getParam(params, " ", 1));
+ let reason = splitParams.slice(1).join(" ");
- if(!targetClient) {
- messagePlayerError(client, "That player is not connected!")
- return false;
- }
-
- // Prevent banning admins with really high permissions
- if(doesPlayerHaveStaffPermission(targetClient, "ManageServer") || doesPlayerHaveStaffPermission(targetClient, "Developer")) {
- messagePlayerError(client, getLocaleString(client, "CantBanPlayer"));
- return false;
+ if(!targetClient) {
+ messagePlayerError(client, "That player is not connected!")
+ return false;
}
- logToConsole(LOG_WARN, `[VRR.Ban]: ${getPlayerDisplayForConsole(targetClient)} (${getPlayerData(targetClient).accountData.name}) account was banned by ${getPlayerDisplayForConsole(client)}. Reason: ${reason}`);
+ // Prevent banning admins with really high permissions
+ if(doesPlayerHaveStaffPermission(targetClient, "ManageServer") || doesPlayerHaveStaffPermission(targetClient, "Developer")) {
+ messagePlayerError(client, getLocaleString(client, "CantBanPlayer"));
+ return false;
+ }
- messageAdminAction(`{ALTCOLOUR}${getPlayerData(targetClient).currentSubAccountData.name} {MAINCOLOUR}has been account banned.`);
+ logToConsole(LOG_WARN, `[VRR.Ban]: ${getPlayerDisplayForConsole(targetClient)} (${getPlayerData(targetClient).accountData.name}) account was banned by ${getPlayerDisplayForConsole(client)}. Reason: ${reason}`);
+
+ announceAdminAction(`PlayerAccountBanned`, `{ALTCOLOUR}${targetClient.name}{MAINCOLOUR}`);
banAccount(getPlayerData(targetClient).accountData.databaseId, getPlayerData(client).accountData.databaseId, reason);
disconnectPlayer(client);
}
@@ -52,27 +52,27 @@ function subAccountBanCommand(command, params, client, fromDiscord) {
return false;
}
- let splitParams = params.split(" ");
- let targetClient = getPlayerFromParams(getParam(params, " ", 1));
- let reason = splitParams.slice(1).join(" ");
+ let splitParams = params.split(" ");
+ let targetClient = getPlayerFromParams(getParam(params, " ", 1));
+ let reason = splitParams.slice(1).join(" ");
- if(!targetClient) {
- messagePlayerError(client, "That player is not connected!")
- return false;
- }
+ if(!targetClient) {
+ messagePlayerError(client, "That player is not connected!")
+ return false;
+ }
// Prevent banning admins with really high permissions
if(doesPlayerHaveStaffPermission(targetClient, "ManageServer") || doesPlayerHaveStaffPermission(targetClient, "Developer")) {
messagePlayerError(client, getLocaleString(client, "CantBanPlayer"));
return false;
- }
+ }
- logToConsole(LOG_WARN, `[VRR.Ban]: ${getPlayerDisplayForConsole(targetClient)} (${getPlayerData(targetClient).accountData.name})'s subaccount was banned by ${getPlayerDisplayForConsole(client)}. Reason: ${reason}`);
+ logToConsole(LOG_WARN, `[VRR.Ban]: ${getPlayerDisplayForConsole(targetClient)} (${getPlayerData(targetClient).accountData.name})'s subaccount was banned by ${getPlayerDisplayForConsole(client)}. Reason: ${reason}`);
- messageAdminAction(`{ALTCOLOUR}${getPlayerData(targetClient).currentSubAccountData.name} {MAINCOLOUR}has been character banned.`);
- banSubAccount(getPlayerData(targetClient).currentSubAccountData.databaseId, getPlayerData(client).accountData.databaseId, reason);
+ announceAdminAction(`PlayerCharacterBanned`, `{ALTCOLOUR}${targetClient.name}{MAINCOLOUR}`);
+ banSubAccount(getPlayerData(targetClient).currentSubAccountData.databaseId, getPlayerData(client).accountData.databaseId, reason);
- disconnectPlayer(client);
+ disconnectPlayer(client);
}
// ===========================================================================
@@ -81,28 +81,28 @@ function ipBanCommand(command, params, client, fromDiscord) {
if(areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
return false;
- }
+ }
- let splitParams = params.split(" ");
- let targetClient = getPlayerFromParams(getParam(params, " ", 1));
- let reason = splitParams.slice(1).join(" ");
+ let splitParams = params.split(" ");
+ let targetClient = getPlayerFromParams(getParam(params, " ", 1));
+ let reason = splitParams.slice(1).join(" ");
- if(!targetClient) {
- messagePlayerError(client, "That player is not connected!")
- return false;
- }
+ if(!targetClient) {
+ messagePlayerError(client, "That player is not connected!")
+ return false;
+ }
// Prevent banning admins with really high permissions
if(doesPlayerHaveStaffPermission(targetClient, "ManageServer") || doesPlayerHaveStaffPermission(targetClient, "Developer")) {
messagePlayerError(client, getLocaleString(client, "CantBanPlayer"));
return false;
- }
+ }
- messageAdminAction(`{ALTCOLOUR}${getPlayerData(targetClient).currentSubAccountData.name} {MAINCOLOUR}has been IP banned.`);
- banIPAddress(targetClient.ip, getPlayerData(client).accountData.databaseId, reason);
+ announceAdminAction(`PlayerIPBanned`, `{ALTCOLOUR}${targetClient.name}{MAINCOLOUR}`);
+ banIPAddress(targetClient.ip, getPlayerData(client).accountData.databaseId, reason);
- server.banIP(targetClient.ip);
- targetClient.disconnect();
+ server.banIP(targetClient.ip);
+ targetClient.disconnect();
}
// ===========================================================================
@@ -111,190 +111,189 @@ function subNetBanCommand(command, params, client, fromDiscord) {
if(areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
return false;
- }
+ }
- let splitParams = params.split(" ");
- let targetClient = getPlayerFromParams(getParam(params, " ", 1));
- let octetAmount = Number(getParam(params, " ", 2));
- let reason = splitParams.slice(2).join(" ");
+ let splitParams = params.split(" ");
+ let targetClient = getPlayerFromParams(getParam(params, " ", 1));
+ let octetAmount = Number(getParam(params, " ", 2));
+ let reason = splitParams.slice(2).join(" ");
- if(!targetClient) {
- messagePlayerError(client, "That player is not connected!")
- return false;
- }
+ if(!targetClient) {
+ messagePlayerError(client, "That player is not connected!")
+ return false;
+ }
// Prevent banning admins with really high permissions
if(doesPlayerHaveStaffPermission(targetClient, "ManageServer") || doesPlayerHaveStaffPermission(targetClient, "Developer")) {
messagePlayerError(client, getLocaleString(client, "CantBanPlayer"));
return false;
- }
+ }
- messageAdminAction(`{ALTCOLOUR}${getPlayerData(targetClient).currentSubAccountData.name} {MAINCOLOUR}has been subnet banned`);
+ announceAdminAction(`PlayerSubNetBanned`, `{ALTCOLOUR}${targetClient.name}{MAINCOLOUR}`);
banSubNet(targetClient.ip, getSubNet(targetClient.ip, octetAmount), getPlayerData(client).accountData.databaseId, reason);
- server.banIP(targetClient.ip);
+ server.banIP(targetClient.ip);
}
// ===========================================================================
function banAccount(accountId, adminAccountId, reason) {
- let dbConnection = connectToDatabase();
- if(dbConnection) {
- let safeReason = dbConnection.escapetoString(reason);
- let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${VRR_BANTYPE_ACCOUNT}, ${accountId}, ${adminAccountId}, '${safeReason}');`);
- freeDatabaseQuery(dbQuery);
- dbConnection.close();
- return true;
- }
+ let dbConnection = connectToDatabase();
+ if(dbConnection) {
+ let safeReason = dbConnection.escapetoString(reason);
+ let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${VRR_BANTYPE_ACCOUNT}, ${accountId}, ${adminAccountId}, '${safeReason}');`);
+ freeDatabaseQuery(dbQuery);
+ dbConnection.close();
+ return true;
+ }
- return false;
+ return false;
}
// ===========================================================================
function banSubAccount(subAccountId, adminAccountId, reason) {
- let dbConnection = connectToDatabase();
- if(dbConnection) {
- let safeReason = dbConnection.escapetoString(reason);
- let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${VRR_BANTYPE_SUBACCOUNT}, ${subAccountId}, ${adminAccountId}, '${safeReason}');`);
- freeDatabaseQuery(dbQuery);
- dbConnection.close();
- return true;
- }
+ let dbConnection = connectToDatabase();
+ if(dbConnection) {
+ let safeReason = dbConnection.escapetoString(reason);
+ let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${VRR_BANTYPE_SUBACCOUNT}, ${subAccountId}, ${adminAccountId}, '${safeReason}');`);
+ freeDatabaseQuery(dbQuery);
+ dbConnection.close();
+ return true;
+ }
- return false;
+ return false;
}
// ===========================================================================
function banIPAddress(ipAddress, adminAccountId, reason) {
- let dbConnection = connectToDatabase();
- if(dbConnection) {
- let safeReason = dbConnection.escapetoString(reason);
- let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${VRR_BANTYPE_IPADDRESS}, INET_ATON(${ipAddress}), ${adminAccountId}, '${safeReason}');`);
- freeDatabaseQuery(dbQuery);
- dbConnection.close();
- return true;
- }
+ let dbConnection = connectToDatabase();
+ if(dbConnection) {
+ let safeReason = dbConnection.escapetoString(reason);
+ let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${VRR_BANTYPE_IPADDRESS}, INET_ATON(${ipAddress}), ${adminAccountId}, '${safeReason}');`);
+ freeDatabaseQuery(dbQuery);
+ dbConnection.close();
+ return true;
+ }
- return false;
+ return false;
}
// ===========================================================================
function banSubNet(ipAddressStart, ipAddressEnd, adminAccountId, reason) {
- let dbConnection = connectToDatabase();
- if(dbConnection) {
- let safeReason = dbConnection.escapetoString(reason);
- let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_ip_start, ban_ip_end, ban_who_banned, ban_reason) VALUES (${VRR_BANTYPE_SUBNET}, INET_ATON(${ipAddressStart}), INET_ATON(${ipAddressEnd}), ${adminAccountId}, '${safeReason}');`);
- freeDatabaseQuery(dbQuery);
- dbConnection.close();
- return true;
- }
+ let dbConnection = connectToDatabase();
+ if(dbConnection) {
+ let safeReason = dbConnection.escapetoString(reason);
+ let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_ip_start, ban_ip_end, ban_who_banned, ban_reason) VALUES (${VRR_BANTYPE_SUBNET}, INET_ATON(${ipAddressStart}), INET_ATON(${ipAddressEnd}), ${adminAccountId}, '${safeReason}');`);
+ freeDatabaseQuery(dbQuery);
+ dbConnection.close();
+ return true;
+ }
- return false;
+ return false;
}
// ===========================================================================
function unbanAccount(accountId, adminAccountId) {
- let dbConnection = connectToDatabase();
- if(dbConnection) {
- let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${VRR_BANTYPE_ACCOUNT} AND ban_detail=${accountId}`);
- freeDatabaseQuery(dbQuery);
- dbConnection.close();
- return true;
- }
+ let dbConnection = connectToDatabase();
+ if(dbConnection) {
+ let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${VRR_BANTYPE_ACCOUNT} AND ban_detail=${accountId}`);
+ freeDatabaseQuery(dbQuery);
+ dbConnection.close();
+ return true;
+ }
- return false;
+ return false;
}
// ===========================================================================
function unbanSubAccount(subAccountId, adminAccountId) {
- let dbConnection = connectToDatabase();
- if(dbConnection) {
- let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${VRR_BANTYPE_SUBACCOUNT} AND ban_detail=${subAccountId}`);
- freeDatabaseQuery(dbQuery);
- dbConnection.close();
- return true;
- }
+ let dbConnection = connectToDatabase();
+ if(dbConnection) {
+ let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${VRR_BANTYPE_SUBACCOUNT} AND ban_detail=${subAccountId}`);
+ freeDatabaseQuery(dbQuery);
+ dbConnection.close();
+ return true;
+ }
- return false;
+ return false;
}
// ===========================================================================
function unbanIPAddress(ipAddress, adminAccountId) {
- let dbConnection = connectToDatabase();
- if(dbConnection) {
- let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${VRR_BANTYPE_IPADDRESS} AND ban_detail=INET_ATON(${ipAddress})`);
- freeDatabaseQuery(dbQuery);
- dbConnection.close();
- return true;
- }
+ let dbConnection = connectToDatabase();
+ if(dbConnection) {
+ let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${VRR_BANTYPE_IPADDRESS} AND ban_detail=INET_ATON(${ipAddress})`);
+ freeDatabaseQuery(dbQuery);
+ dbConnection.close();
+ return true;
+ }
- return false;
+ return false;
}
// ===========================================================================
function unbanSubNet(ipAddressStart, ipAddressEnd, adminAccountId) {
- let dbConnection = connectToDatabase();
- if(dbConnection) {
- let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${VRR_BANTYPE_SUBNET} AND ban_ip_start=INET_ATON(${ipAddressStart}) AND ban_ip_end=INET_ATON(${ipAddressEnd})`);
- freeDatabaseQuery(dbQuery);
- dbConnection.close();
- return true;
- }
+ let dbConnection = connectToDatabase();
+ if(dbConnection) {
+ let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${VRR_BANTYPE_SUBNET} AND ban_ip_start=INET_ATON(${ipAddressStart}) AND ban_ip_end=INET_ATON(${ipAddressEnd})`);
+ freeDatabaseQuery(dbQuery);
+ dbConnection.close();
+ return true;
+ }
- return false;
+ return false;
}
// ===========================================================================
function isAccountBanned(accountId) {
- let bans = getServerData().bans;
- for(let i in bans) {
- if(bans[i].type == VRR_BANTYPE_ACCOUNT) {
- if(bans[i].detail == accountId) {
- return true;
- }
- }
- }
+ let bans = getServerData().bans;
+ for(let i in bans) {
+ if(bans[i].type == VRR_BANTYPE_ACCOUNT) {
+ if(bans[i].detail == accountId) {
+ return true;
+ }
+ }
+ }
- return false;
+ return false;
}
// ===========================================================================
function isSubAccountBanned(subAccountId) {
- let bans = getServerData().bans;
- for(let i in bans) {
- if(bans[i].type == VRR_BANTYPE_SUBACCOUNT) {
- if(bans[i].detail == subAccountId) {
- return true;
- }
- }
- }
+ let bans = getServerData().bans;
+ for(let i in bans) {
+ if(bans[i].type == VRR_BANTYPE_SUBACCOUNT) {
+ if(bans[i].detail == subAccountId) {
+ return true;
+ }
+ }
+ }
- return false;
+ return false;
}
// ===========================================================================
function isIpAddressBanned(ipAddress) {
- let bans = getServerData().bans;
- for(let i in bans) {
- if(bans[i].type == VRR_BANTYPE_IPADDRESS) {
- if(bans[i].detail == ipAddress) {
- return true;
- }
- }
- }
+ let bans = getServerData().bans;
+ for(let i in bans) {
+ if(bans[i].type == VRR_BANTYPE_IPADDRESS) {
+ if(bans[i].detail == ipAddress) {
+ return true;
+ }
+ }
+ }
- return false;
+ return false;
}
// ===========================================================================
-
diff --git a/scripts/server/bitflag.js b/scripts/server/bitflag.js
index b095c2e8..a7deb8c2 100644
--- a/scripts/server/bitflag.js
+++ b/scripts/server/bitflag.js
@@ -21,7 +21,6 @@ let serverBitFlags = {
npcTriggerTypeFlags: {},
npcTriggerConditionTypesFlags: {},
npcTriggerResponseTypeFlags: {},
- serverSettings: {}
};
// ===========================================================================
@@ -41,6 +40,8 @@ let serverBitFlagKeys = {
"ManageWorld",
"ManageAntiCheat",
"Developer",
+ "ManageNPCs",
+ "ManageRaces",
],
moderationFlagKeys: [
"None",
@@ -119,6 +120,8 @@ let serverBitFlagKeys = {
"NoRandomTips",
"NoActionTips",
],
+
+ // Not going to be used. Use trigger, condition, and response stuff in trigger.js
npcTriggerTypeKeys: [
"None",
"FarProximity", // Comes within a far distance of NPC
@@ -219,26 +222,6 @@ let serverBitFlagKeys = {
"ShowItemsAfterPurchase",
"BuyCommandAfterEnterBusiness",
],
- serverSettingsKeys: [
- "None",
- "GUI",
- "ServerLogo",
- "FallingSnow",
- "GroundSnow",
- "Anticheat",
- "CheckGameScripts",
- "GameScriptBlackList",
- "GameScriptWhiteList",
- "JobBlips",
- "JobPickups",
- "BusinessBlips",
- "BusinessPickups",
- "HouseBlips",
- "HousePickups",
- "DiscordBot",
- "RealTime",
- "Testing",
- ],
};
// ===========================================================================
@@ -255,7 +238,6 @@ function initBitFlagScript() {
serverBitFlags.npcTriggerTypes = createBitFlagTable(serverBitFlagKeys.npcTriggerTypeKeys);
serverBitFlags.npcTriggerConditionTypes = createBitFlagTable(serverBitFlagKeys.npcTriggerConditionTypeKeys);
serverBitFlags.npcTriggerResponseTypes = createBitFlagTable(serverBitFlagKeys.npcTriggerResponseTypeKeys);
- serverBitFlags.serverSettings = createBitFlagTable(serverBitFlagKeys.serverSettingsKeys);
logToConsole(LOG_INFO, "[VRR.BitFlag]: Bit flag script initialized successfully!");
return true;
}
@@ -311,15 +293,15 @@ function doesPlayerHaveStaffPermission(client, requiredFlags) {
}
// -1 is automatic override (having -1 for staff flags is basically god mode admin level)
- if(staffFlags == getStaffFlagValue("All")) {
- return true;
- }
+ if(staffFlags == getStaffFlagValue("All")) {
+ return true;
+ }
- if(hasBitFlag(staffFlags, requiredFlags)) {
- return true;
- }
+ if(hasBitFlag(staffFlags, requiredFlags)) {
+ return true;
+ }
- return false;
+ return false;
}
// ===========================================================================
@@ -341,22 +323,22 @@ function doesPlayerHaveClanPermission(client, requiredFlags) {
clanFlags = getPlayerCurrentSubAccount(client).clanFlags | getClanRankFlags(getPlayerCurrentSubAccount(client).clanRank);
// -1 is automatic override (having -1 for staff flags is basically god mode admin level)
- if(clanFlags == getClanFlagValue("All")) {
- return true;
- }
+ if(clanFlags == getClanFlagValue("All")) {
+ return true;
+ }
- if(hasBitFlag(clanFlags, requiredFlags)) {
- return true;
- }
+ if(hasBitFlag(clanFlags, requiredFlags)) {
+ return true;
+ }
- return false;
+ return false;
}
// ===========================================================================
function getStaffFlagValue(flagName) {
- if(flagName == "All") {
- return -1;
+ if(flagName == "All") {
+ return -1;
}
if(typeof serverBitFlags.staffFlags[flagName] == "undefined") {
@@ -369,8 +351,8 @@ function getStaffFlagValue(flagName) {
// ===========================================================================
function getClanFlagValue(flagName) {
- if(flagName == "All") {
- return -1;
+ if(flagName == "All") {
+ return -1;
}
if(typeof getServerBitFlags().clanFlags[flagName] == "undefined") {
@@ -383,8 +365,8 @@ function getClanFlagValue(flagName) {
// ===========================================================================
function getAccountSettingsFlagValue(flagName) {
- if(flagName == "All") {
- return -1;
+ if(flagName == "All") {
+ return -1;
}
if(typeof serverBitFlags.accountSettingsFlags[flagName] == "undefined") {
@@ -397,8 +379,8 @@ function getAccountSettingsFlagValue(flagName) {
// ===========================================================================
function getModerationFlagValue(flagName) {
- if(flagName == "All") {
- return -1;
+ if(flagName == "All") {
+ return -1;
}
if(typeof serverBitFlags.moderationFlags[flagName] == "undefined") {
@@ -410,20 +392,6 @@ function getModerationFlagValue(flagName) {
// ===========================================================================
-function getServerSettingsFlagValue(flagName) {
- if(flagName == "All") {
- return -1;
- }
-
- if(typeof serverBitFlags.serverSettings[flagName] == "undefined") {
- return false;
- }
-
- return serverBitFlags.serverSettings[flagName];
-}
-
-// ===========================================================================
-
function givePlayerStaffFlag(client, flagName) {
if(!getStaffFlagValue(flagName)) {
return false;
diff --git a/scripts/server/business.js b/scripts/server/business.js
index 3e9faaa2..343c09c1 100644
--- a/scripts/server/business.js
+++ b/scripts/server/business.js
@@ -9,9 +9,9 @@
function initBusinessScript() {
logToConsole(LOG_INFO, "[VRR.Business]: Initializing business script ...");
- getServerData().businesses = loadBusinessesFromDatabase();
-
-
+ if(!getServerConfig().devServer) {
+ getServerData().businesses = loadBusinessesFromDatabase();
+ }
createAllBusinessPickups();
createAllBusinessBlips();
@@ -138,13 +138,22 @@ function loadBusinessGameScriptsFromDatabase(businessId) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function createBusinessCommand(command, params, client) {
- let tempBusinessData = createBusiness(params, getPlayerPosition(client), toVector3(0.0, 0.0, 0.0), getGameConfig().pickupModels[getServerGame()].Business, getGameConfig().blipSprites[getServerGame()].Business, getPlayerInterior(client), getPlayerDimension(client));
+ let tempBusinessData = createBusiness(params, getPlayerPosition(client), toVector3(0.0, 0.0, 0.0), getGameConfig().pickupModels[getServerGame()].Business, getGameConfig().blipSprites[getServerGame()].Business, getPlayerInterior(client), getPlayerDimension(client), getPlayerData(client).interiorCutscene);
tempBusinessData.needsSaved = true;
let businessId = getServerData().businesses.push(tempBusinessData);
setAllBusinessIndexes();
- saveAllBusinessesToDatabase();
+ saveBusinessesToDatabase();
createBusinessEntrancePickup(businessId-1);
createBusinessExitPickup(businessId-1);
@@ -156,6 +165,15 @@ function createBusinessCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function createBusinessLocationCommand(command, params, client) {
if(!isPlayerSpawned(client)) {
messagePlayerError(client, "You must be spawned to use this command!");
@@ -182,7 +200,7 @@ function createBusinessLocationCommand(command, params, client) {
// ===========================================================================
-function createBusiness(name, entrancePosition, exitPosition, entrancePickupModel = -1, entranceBlipModel = -1, entranceInteriorId = 0, entranceVirtualWorld = 0, exitInteriorId = -1, exitVirtualWorld = -1, exitPickupModel = -1, exitBlipModel = -1) {
+function createBusiness(name, entrancePosition, exitPosition, entrancePickupModel = -1, entranceBlipModel = -1, entranceInteriorId = 0, entranceVirtualWorld = 0, exitInteriorId = -1, exitVirtualWorld = -1, exitPickupModel = -1, exitBlipModel = -1, entranceCutscene = "") {
let tempBusinessData = new BusinessData(false);
tempBusinessData.name = name;
@@ -192,6 +210,7 @@ function createBusiness(name, entrancePosition, exitPosition, entrancePickupMode
tempBusinessData.entranceBlipModel = entranceBlipModel;
tempBusinessData.entranceInterior = entranceInteriorId;
tempBusinessData.entranceDimension = entranceVirtualWorld;
+ tempBusinessData.entranceCutscene = entranceCutscene;
tempBusinessData.exitPosition = exitPosition;
tempBusinessData.exitRotation = 0.0;
@@ -205,6 +224,15 @@ function createBusiness(name, entrancePosition, exitPosition, entrancePickupMode
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function deleteBusinessCommand(command, params, client) {
let businessId = getPlayerBusiness(client);
@@ -223,6 +251,15 @@ function deleteBusinessCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function deleteBusinessLocationCommand(command, params, client) {
//let businessId = toInteger(getParam(params, " ", 2));
//deleteBusinessLocation(businessId);
@@ -231,6 +268,15 @@ function deleteBusinessLocationCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function setBusinessNameCommand(command, params, client) {
let newBusinessName = toString(params);
@@ -242,7 +288,7 @@ function setBusinessNameCommand(command, params, client) {
}
if(!canPlayerManageBusiness(client, businessId)) {
- messagePlayerError(client, "You can't change the name of this business!");
+ messagePlayerError(client, getLocaleString(client, "CantModifyBusiness"));
return false;
}
@@ -255,6 +301,15 @@ function setBusinessNameCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function setBusinessOwnerCommand(command, params, client) {
if(areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
@@ -275,7 +330,7 @@ function setBusinessOwnerCommand(command, params, client) {
}
if(!canPlayerManageBusiness(client, businessId)) {
- messagePlayerError(client, "You can't change the owner of this business!");
+ messagePlayerError(client, getLocaleString(client, "CantModifyBusiness"));
return false;
}
@@ -288,6 +343,15 @@ function setBusinessOwnerCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function setBusinessJobCommand(command, params, client) {
if(areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
@@ -308,7 +372,7 @@ function setBusinessJobCommand(command, params, client) {
}
if(!canPlayerManageBusiness(client, businessId)) {
- messagePlayerError(client, "You can't change the owner of this business!");
+ messagePlayerError(client, getLocaleString(client, "CantModifyBusiness"));
return false;
}
@@ -321,6 +385,15 @@ function setBusinessJobCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function setBusinessClanCommand(command, params, client) {
let businessId = getPlayerBusiness(client);
@@ -337,7 +410,7 @@ function setBusinessClanCommand(command, params, client) {
}
if(!canPlayerManageBusiness(client, businessId)) {
- messagePlayerError(client, "You can't give this business to a clan!");
+ messagePlayerError(client, getLocaleString(client, "CantModifyBusiness"));
return false;
}
@@ -350,6 +423,15 @@ function setBusinessClanCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function setBusinessRankCommand(command, params, client) {
let businessId = getPlayerBusiness(client);
@@ -361,7 +443,7 @@ function setBusinessRankCommand(command, params, client) {
let rankId = params;
if(!canPlayerManageBusiness(client, businessId)) {
- messagePlayerError(client, "You can't change this business rank level!");
+ messagePlayerError(client, getLocaleString(client, "CantModifyBusiness"));
return false;
}
@@ -421,7 +503,7 @@ function setBusinessRankCommand(command, params, client) {
}
if(!canPlayerManageBusiness(client, businessId)) {
- messagePlayerError(client, "You can't change this business rank!");
+ messagePlayerError(client, getLocaleString(client, "CantModifyBusiness"));
return false;
}
@@ -438,6 +520,15 @@ function setBusinessRankCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function setBusinessJobCommand(command, params, client) {
let businessId = getPlayerBusiness(client);
@@ -471,6 +562,15 @@ function setBusinessJobCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function setBusinessPublicCommand(command, params, client) {
let businessId = getPlayerBusiness(client);
@@ -492,6 +592,15 @@ function setBusinessPublicCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function removeBusinessOwnerCommand(command, params, client) {
let businessId = getPlayerBusiness(client);
@@ -513,6 +622,15 @@ function removeBusinessOwnerCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function lockUnlockBusinessCommand(command, params, client) {
let businessId = getPlayerBusiness(client);
@@ -526,7 +644,7 @@ function lockUnlockBusinessCommand(command, params, client) {
}
if(!canPlayerManageBusiness(client, businessId)) {
- messagePlayerError(client, "You can't change this business rank!");
+ messagePlayerError(client, getLocaleString(client, "CantModifyBusiness"));
return false;
}
@@ -570,6 +688,15 @@ function lockUnlockBusinessCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function setBusinessEntranceFeeCommand(command, params, client) {
let entranceFee = toInteger(getParam(params, " ", 1)) || 0;
let businessId = getPlayerBusiness(client);
@@ -580,7 +707,7 @@ function setBusinessEntranceFeeCommand(command, params, client) {
}
if(!canPlayerManageBusiness(client, businessId)) {
- messagePlayerError(client, "You can't change the entrance fee for this business!");
+ messagePlayerError(client, getLocaleString(client, "CantModifyBusiness"));
return false;
}
@@ -591,6 +718,15 @@ function setBusinessEntranceFeeCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function getBusinessInfoCommand(command, params, client) {
let businessId = getPlayerBusiness(client);
@@ -632,6 +768,15 @@ function getBusinessInfoCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function getBusinessFloorItemsCommand(command, params, client) {
let businessId = getPlayerBusiness(client);
@@ -649,6 +794,15 @@ function getBusinessFloorItemsCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function getBusinessStorageItemsCommand(command, params, client) {
let businessId = getPlayerBusiness(client);
@@ -666,6 +820,15 @@ function getBusinessStorageItemsCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function setBusinessPickupCommand(command, params, client) {
let typeParam = getParam(params, " ", 1) || "business";
let businessId = getPlayerBusiness(client);
@@ -702,6 +865,15 @@ function setBusinessPickupCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function setBusinessInteriorTypeCommand(command, params, client) {
let typeParam = getParam(params, " ", 1) || "business";
let businessId = getPlayerBusiness(client);
@@ -717,6 +889,7 @@ function setBusinessInteriorTypeCommand(command, params, client) {
getBusinessData(businessId).exitDimension = 0;
getBusinessData(businessId).exitInterior = -1;
getBusinessData(businessId).hasInterior = false;
+ getBusinessData(businessId).interiorCutscene = "";
getBusinessData(businessId).exitPickupModel = -1;
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} {MAINCOLOUR}removed business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} interior`);
return false;
@@ -738,6 +911,9 @@ function setBusinessInteriorTypeCommand(command, params, client) {
getBusinessData(businessId).exitInterior = getGameConfig().interiors[getServerGame()][typeParam][1];
getBusinessData(businessId).exitDimension = getBusinessData(businessId).databaseId+getGlobalConfig().businessDimensionStart;
getBusinessData(businessId).exitPickupModel = getGameConfig().pickupModels[getServerGame()].Exit;
+ if(getGameConfig().interiors[getServerGame()][typeParam].length == 3) {
+ getBusinessData(businessId).interiorCutscene = getGameConfig().interiors[getServerGame()][typeParam][2];
+ }
getBusinessData(businessId).hasInterior = true;
}
@@ -755,6 +931,15 @@ function setBusinessInteriorTypeCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function setBusinessBlipCommand(command, params, client) {
let typeParam = getParam(params, " ", 1) || "business";
let businessId = getPlayerBusiness(client);
@@ -791,6 +976,15 @@ function setBusinessBlipCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function giveDefaultItemsToBusinessCommand(command, params, client) {
let typeParam = getParam(params, " ", 1) || "business";
let businessId = getPlayerBusiness(client);
@@ -833,6 +1027,15 @@ function giveDefaultItemsToBusinessCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function setBusinessEntranceLabelToDealershipCommand(command, params, client) {
let businessId = getPlayerBusiness(client);
@@ -848,6 +1051,15 @@ function setBusinessEntranceLabelToDealershipCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function deleteBusinessFloorItemsCommand(command, params, client) {
let businessId = getPlayerBusiness(client);
@@ -868,6 +1080,15 @@ function deleteBusinessFloorItemsCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function deleteBusinessStorageItemsCommand(command, params, client) {
let businessId = getPlayerBusiness(client);
@@ -888,6 +1109,15 @@ function deleteBusinessStorageItemsCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function withdrawFromBusinessCommand(command, params, client) {
if(areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
@@ -903,7 +1133,7 @@ function withdrawFromBusinessCommand(command, params, client) {
}
if(!canPlayerManageBusiness(client, businessId)) {
- messagePlayerError(client, "You can't withdraw cash from this business!");
+ messagePlayerError(client, getLocaleString(client, "CantModifyBusiness"));
return false;
}
@@ -922,6 +1152,15 @@ function withdrawFromBusinessCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function setBusinessBuyPriceCommand(command, params, client) {
if(areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
@@ -937,7 +1176,7 @@ function setBusinessBuyPriceCommand(command, params, client) {
}
if(!canPlayerManageBusiness(client, businessId)) {
- messagePlayerError(client, "You can't change the purchase price for this business!");
+ messagePlayerError(client, getLocaleString(client, "CantModifyBusiness"));
return false;
}
@@ -955,6 +1194,15 @@ function setBusinessBuyPriceCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function depositIntoBusinessCommand(command, params, client) {
if(areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
@@ -990,6 +1238,15 @@ function depositIntoBusinessCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function orderItemForBusinessCommand(command, params, client) {
if(areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
@@ -1023,7 +1280,7 @@ function orderItemForBusinessCommand(command, params, client) {
}
if(!canPlayerManageBusiness(client, businessId)) {
- messagePlayerError(client, "You can't order items for this business!");
+ messagePlayerError(client, getLocaleString(client, "CantModifyBusiness"));
return false;
}
@@ -1042,6 +1299,15 @@ function orderItemForBusinessCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function orderItemForBusiness(businessId, itemType, amount) {
if(getBusinessData(businessId).till < orderTotalCost) {
let neededAmount = orderTotalCost-getBusinessData(businessId).till;
@@ -1056,6 +1322,15 @@ function orderItemForBusiness(businessId, itemType, amount) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function viewBusinessTillAmountCommand(command, params, client) {
let businessId = getPlayerBusiness(client);
@@ -1069,7 +1344,7 @@ function viewBusinessTillAmountCommand(command, params, client) {
}
if(!canPlayerManageBusiness(client, businessId)) {
- messagePlayerError(client, "You can't see the till amount for this business!");
+ messagePlayerError(client, getLocaleString(client, "CantModifyBusiness"));
return false;
}
@@ -1078,6 +1353,15 @@ function viewBusinessTillAmountCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function buyBusinessCommand(command, params, client) {
let businessId = getPlayerBusiness(client);
@@ -1108,6 +1392,15 @@ function buyBusinessCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function moveBusinessEntranceCommand(command, params, client) {
let businessId = getPlayerBusiness(client);
@@ -1139,6 +1432,15 @@ function moveBusinessEntranceCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function moveBusinessExitCommand(command, params, client) {
let businessId = getPlayerBusiness(client);
@@ -1178,6 +1480,14 @@ function getBusinessDataFromDatabaseId(databaseId) {
// ===========================================================================
+/**
+ * Gets the closest business entrance to a position
+ *
+ * @param {Vector3} position - The position to check
+ * @param {Number} dimension - The dimension to check
+ * @return {Number} The data index of the business
+ *
+ */
function getClosestBusinessEntrance(position, dimension) {
let closest = 0;
for(let i in getServerData().businesses) {
@@ -1192,6 +1502,14 @@ function getClosestBusinessEntrance(position, dimension) {
// ===========================================================================
+/**
+ * Gets the closest business exit to a position
+ *
+ * @param {Vector3} position - The position to check
+ * @param {Number} dimension - The dimension to check
+ * @return {Number} The data index of the business
+ *
+ */
function getClosestBusinessExit(position, dimension) {
let closest = 0;
for(let i in getServerData().businesses) {
@@ -1206,6 +1524,13 @@ function getClosestBusinessExit(position, dimension) {
// ===========================================================================
+/**
+ * Gets whether or not a client is in a business
+ *
+ * @param {Client} client - The client to check whether or not is in a business
+ * @return {Boolean} Whether or not the client is in a business
+ *
+ */
function isPlayerInAnyBusiness(client) {
for(let i in getServerData().businesses) {
if(getServerData().businesses[i].hasInterior && getServerData().businesses[i].exitDimension == getPlayerDimension(client)) {
@@ -1218,6 +1543,13 @@ function isPlayerInAnyBusiness(client) {
// ===========================================================================
+/**
+ * Gets the data index of the business a client is in
+ *
+ * @param {Client} client - The client to check whether or not is in a business
+ * @return {Number} The data index of the business
+ *
+ */
function getPlayerBusiness(client) {
let closestEntrance = getClosestBusinessEntrance(getPlayerPosition(client), getPlayerDimension(client));
if(getDistance(getPlayerPosition(client), getBusinessData(closestEntrance).entrancePosition) <= getGlobalConfig().enterPropertyDistance) {
@@ -1235,27 +1567,48 @@ function getPlayerBusiness(client) {
// ===========================================================================
-function saveAllBusinessesToDatabase() {
+/**
+ * Saves all server businesses to the database
+ *
+ * @return {Boolean} Whether or not the businesses were saved
+ *
+ */
+function saveBusinessesToDatabase() {
+ if(getServerConfig().devServer) {
+ return false;
+ }
+
for(let i in getServerData().businesses) {
if(getServerData().businesses[i].needsSaved) {
saveBusinessToDatabase(i);
}
}
+
+ return true
}
// ===========================================================================
+/**
+ * Saves a server businesses to the database by data index
+ *
+ * @param {Number} businessId - The data index of the business to save
+ * @return {Boolean} Whether or not the business was saved
+ *
+ */
function saveBusinessToDatabase(businessId) {
let tempBusinessData = getServerData().businesses[businessId];
- if(!tempBusinessData.needsSaved) {
- return false;
- }
+ if(!tempBusinessData.needsSaved) {
+ return false;
+ }
logToConsole(LOG_DEBUG, `[VRR.Business]: Saving business '${tempBusinessData.name}' to database ...`);
let dbConnection = connectToDatabase();
if(dbConnection) {
let safeBusinessName = escapeDatabaseString(dbConnection, tempBusinessData.name);
+ let safeExitCutscene = escapeDatabaseString(dbConnection, tempBusinessData.exitCustscene);
+ let safeEntranceCutscene = escapeDatabaseString(dbConnection, tempBusinessData.entranceCutscene);
let data = [
["biz_server", getServerId()],
@@ -1273,6 +1626,7 @@ function saveBusinessToDatabase(businessId) {
["biz_entrance_vw", tempBusinessData.entranceDimension],
["biz_entrance_pickup", tempBusinessData.entrancePickupModel],
["biz_entrance_blip", tempBusinessData.entranceBlipModel],
+ ["biz_entrance_cutscene", safeEntranceCutscene],
["biz_exit_pos_x", tempBusinessData.exitPosition.x],
["biz_exit_pos_y", tempBusinessData.exitPosition.y],
["biz_exit_pos_z", tempBusinessData.exitPosition.z],
@@ -1281,6 +1635,7 @@ function saveBusinessToDatabase(businessId) {
["biz_exit_vw", tempBusinessData.exitDimension],
["biz_exit_pickup", tempBusinessData.exitPickupModel],
["biz_exit_blip", tempBusinessData.exitBlipModel],
+ ["biz_exit_cutscene", safeExitCutscene],
["biz_has_interior", boolToInt(tempBusinessData.hasInterior)],
["biz_interior_lights", boolToInt(tempBusinessData.interiorLights)],
["biz_label_help_type", tempBusinessData.labelHelpType],
@@ -1310,6 +1665,12 @@ function saveBusinessToDatabase(businessId) {
// ===========================================================================
+/**
+ * Creates all server pickups for all businesses
+ *
+ * @return {Boolean} Whether or not the server pickups were created
+ *
+ */
function createAllBusinessPickups() {
if(!getServerConfig().createBusinessPickups) {
return false;
@@ -1320,10 +1681,18 @@ function createAllBusinessPickups() {
createBusinessExitPickup(i);
updateBusinessPickupLabelData(i);
}
+
+ return true;
}
// ===========================================================================
+/**
+ * Creates all server blips for all businesses
+ *
+ * @return {Boolean} Whether or not the server blips were created
+ *
+ */
function createAllBusinessBlips() {
if(!getServerConfig().createBusinessBlips) {
return false;
@@ -1337,7 +1706,14 @@ function createAllBusinessBlips() {
// ===========================================================================
-function createBusinessEntrancePickup(businessId) {
+/**
+ * Creates the entrance pickup for a business by data index
+ *
+ * @param {Number} businessId - The data index of the business to create the pickup for
+ * @return {Boolean} Whether or not the blip was created
+ *
+ */
+function createBusinessEntrancePickup(businessId) {
if(!getServerConfig().createBusinessPickups) {
return false;
}
@@ -1350,21 +1726,40 @@ function createBusinessEntrancePickup(businessId) {
}
logToConsole(LOG_VERBOSE, `[VRR.Job]: Creating entrance pickup for business ${getBusinessData(businessId).name} (model ${pickupModelId})`);
-
+
if(areServerElementsSupported()) {
- getBusinessData(businessId).entrancePickup = createGamePickup(pickupModelId, getBusinessData(businessId).entrancePosition, getGameConfig().pickupTypes[getServerGame()].business);
- setElementOnAllDimensions(getBusinessData(businessId).entrancePickup, false);
- setElementDimension(getBusinessData(businessId).entrancePickup, getBusinessData(businessId).entranceDimension);
- updateBusinessPickupLabelData(businessId);
- addToWorld(getBusinessData(businessId).entrancePickup);
+ let entrancePickup = createGamePickup(pickupModelId, getBusinessData(businessId).entrancePosition, getGameConfig().pickupTypes[getServerGame()].business);
+ if(entrancePickup != null) {
+ setElementOnAllDimensions(entrancePickup, false);
+ setElementDimension(entrancePickup, getBusinessData(businessId).entranceDimension);
+ setElementOnAllDimensions(entrancePickup, false);
+ setElementStreamInDistance(entrancePickup, getGlobalConfig().houseBlipStreamInDistance);
+ setElementStreamOutDistance(entrancePickup, getGlobalConfig().houseBlipStreamOutDistance);
+ setElementTransient(entrancePickup, false);
+ addToWorld(entrancePickup);
+
+ getBusinessData(businessId).entrancePickup = entrancePickup;
+ updateBusinessPickupLabelData(businessId);
+ }
} else {
sendBusinessToPlayer(null, businessId, getBusinessData(businessId), getBusinessData(businessId).entrancePosition, getBusinessData(businessId).entranceBlipModel, getBusinessData(businessId).entrancePickupModel, getBusinessData(businessId).hasInterior, false);
}
+
+ return true;
}
+
+ return false;
}
// ===========================================================================
+/**
+ * Creates the entrance pickup for a business by data index
+ *
+ * @param {Number} businessId - The data index of the business to create the entrance pickup for
+ * @return {Boolean} Whether or not the blip was created
+ *
+ */
function createBusinessEntranceBlip(businessId) {
if(!areServerElementsSupported()) {
return false;
@@ -1382,12 +1777,22 @@ function createBusinessEntranceBlip(businessId) {
}
logToConsole(LOG_VERBOSE, `[VRR.Job]: Creating entrance blip for business ${getBusinessData(businessId).name} (model ${blipModelId})`);
-
+
if(areServerElementsSupported()) {
- getBusinessData(businessId).entranceBlip = createGameBlip(getBusinessData(businessId).entrancePosition, blipModelId, 1, getColourByName("businessBlue"));
- setElementOnAllDimensions(getBusinessData(businessId).entranceBlip, false);
- setElementDimension(getBusinessData(businessId).entranceBlip, getBusinessData(businessId).entranceDimension);
- addToWorld(getBusinessData(businessId).entranceBlip);
+ let entranceBlip = createGameBlip(getBusinessData(businessId).entrancePosition, blipModelId, 1, getColourByName("businessBlue"));
+ if(entranceBlip != null) {
+ setElementOnAllDimensions(entranceBlip, false);
+ setElementDimension(entranceBlip, getBusinessData(businessId).entranceDimension);
+ setElementDimension(entranceBlip, getBusinessData(businessId).entranceDimension);
+ setElementOnAllDimensions(entranceBlip, false);
+ setElementStreamInDistance(entranceBlip, getGlobalConfig().businessBlipStreamInDistance);
+ setElementStreamOutDistance(entranceBlip, getGlobalConfig().businessBlipStreamOutDistance);
+ setElementTransient(entranceBlip, false);
+ addToWorld(entranceBlip);
+
+ getBusinessData(businessId).entranceBlip = entranceBlip;
+ }
+
} else {
sendBusinessToPlayer(null, businessId, getBusinessData(businessId).name, getBusinessData(businessId).entrancePosition, blipModelId, getBusinessData(businessId).entrancePickupModel, getBusinessData(businessId).hasInterior, false);
}
@@ -1396,6 +1801,13 @@ function createBusinessEntranceBlip(businessId) {
// ===========================================================================
+/**
+ * Creates the exit pickup for a business by data index
+ *
+ * @param {Number} businessId - The data index of the business to create the exit pickup for
+ * @return {Boolean} Whether or not the pickup was created
+ *
+ */
function createBusinessExitPickup(businessId) {
if(!getServerConfig().createBusinessPickups) {
return false;
@@ -1410,13 +1822,20 @@ function createBusinessExitPickup(businessId) {
}
logToConsole(LOG_VERBOSE, `[VRR.Job]: Creating exit pickup for business ${getBusinessData(businessId).name} (model ${pickupModelId})`);
-
+
if(areServerElementsSupported()) {
- getBusinessData(businessId).exitPickup = createGamePickup(pickupModelId, getBusinessData(businessId).exitPosition, getGameConfig().pickupTypes[getServerGame()].business);
- setElementDimension(getBusinessData(businessId).exitPickup, getBusinessData(businessId).exitDimension);
- setElementOnAllDimensions(getBusinessData(businessId).exitPickup, false);
- updateBusinessPickupLabelData(businessId);
- addToWorld(getBusinessData(businessId).exitPickup);
+ let exitPickup = createGamePickup(pickupModelId, getBusinessData(businessId).exitPosition, getGameConfig().pickupTypes[getServerGame()].business);
+ if(exitPickup != null) {
+ setElementDimension(exitPickup, getBusinessData(businessId).exitDimension);
+ setElementOnAllDimensions(exitPickup, false);
+ setElementStreamInDistance(exitPickup, getGlobalConfig().businessPickupStreamInDistance);
+ setElementStreamOutDistance(exitPickup, getGlobalConfig().businessPickupStreamOutDistance);
+ setElementTransient(exitPickup, false);
+ addToWorld(exitPickup);
+
+ getBusinessData(businessId).exitPickup = exitPickup;
+ updateBusinessPickupLabelData(businessId);
+ }
}
}
}
@@ -1424,6 +1843,13 @@ function createBusinessExitPickup(businessId) {
// ===========================================================================
+/**
+ * Creates the exit blip for a business by data index
+ *
+ * @param {Number} businessId - The data index of the business to create the exit blip for
+ * @return {Boolean} Whether or not the blip was created
+ *
+ */
function createBusinessExitBlip(businessId) {
if(!getServerConfig().createBusinessBlips) {
return false;
@@ -1440,13 +1866,17 @@ function createBusinessExitBlip(businessId) {
if(areServerElementsSupported()) {
logToConsole(LOG_VERBOSE, `[VRR.Job]: Creating exit blip for business ${getBusinessData(businessId).name} (model ${blipModelId})`);
- getBusinessData(businessId).exitBlip = createGameBlip(getBusinessData(businessId).exitPosition, blipModelId, 1, getColourByName("businessBlue"));
- setElementDimension(getBusinessData(businessId).exitBlip, getBusinessData(businessId).entranceDimension);
- setElementOnAllDimensions(getBusinessData(businessId).exitBlip, false);
- //getBusinessData(businessId).exitBlip.interior = getBusinessData(businessId).exitInterior;
- //setEntityData(getBusinessData(businessId).exitBlip, "vrr.owner.type", VRR_BLIP_BUSINESS_EXIT, false);
- //setEntityData(getBusinessData(businessId).exitBlip, "vrr.owner.id", businessId, false);
- addToWorld(getBusinessData(businessId).exitBlip);
+ let exitBlip = createGameBlip(getBusinessData(businessId).exitPosition, blipModelId, 1, getColourByName("businessBlue"));
+ if(exitBlip != null) {
+ setElementDimension(exitBlip, getBusinessData(businessId).exitDimension);
+ setElementOnAllDimensions(exitBlip, false);
+ setElementStreamInDistance(exitBlip, getGlobalConfig().businessBlipStreamInDistance);
+ setElementStreamOutDistance(exitBlip, getGlobalConfig().businessBlipStreamOutDistance);
+ setElementTransient(exitBlip, false);
+ addToWorld(exitBlip);
+
+ getBusinessData(businessId).exitBlip = exitBlip;
+ }
}
}
}
@@ -1454,6 +1884,13 @@ function createBusinessExitBlip(businessId) {
// ===========================================================================
+/**
+ * Deletes a business data and removes it from the database by data index
+ *
+ * @param {Number} businessId - The data index of the business to delete
+ * @return {Boolean} Whether or not the business was deleted
+ *
+ */
function deleteBusiness(businessId, deletedBy = 0) {
let tempBusinessData = getServerData().businesses[businessId];
@@ -1474,10 +1911,19 @@ function deleteBusiness(businessId, deletedBy = 0) {
removePlayersFromBusiness(businessId);
getServerData().businesses.splice(businessId, 1);
+
+ return true;
}
// ===========================================================================
+/**
+ * Forces all players to exit a business
+ *
+ * @param {Number} businessId - The data index of the business to force all players inside to exit from
+ * @return {Boolean} Whether or not the players were forced to exit
+ *
+ */
function removePlayersFromBusiness(businessId) {
getClients().forEach(function(client) {
if(doesBusinessHaveInterior(businessId)) {
@@ -1488,29 +1934,63 @@ function removePlayersFromBusiness(businessId) {
}
}
});
+
+ return true;
}
// ===========================================================================
+/**
+ * Forces a player to exit a business
+ *
+ * @param {Client} client - The client to force to exit the business
+ * @return {Boolean} Whether or not the player was forced to exit
+ *
+ */
function removePlayerFromBusinesses(client) {
if(isPlayerInAnyBusiness(client)) {
exitBusiness(client);
+ return true;
}
+
+ return false;
}
// ===========================================================================
+/**
+ * Handles a player exiting a business
+ *
+ * @param {Client} client - The client to force to exit the business
+ * @return {Boolean} Whether or not the player successfully exited the business
+ *
+ */
function exitBusiness(client) {
let businessId = getPlayerBusiness(client);
+
+ if(businessId == false) {
+ return false;
+ }
+
if(isPlayerSpawned(client)) {
setPlayerInterior(client, getServerData().businesses[businessId].entranceInterior);
setPlayerDimension(client, getServerData().businesses[businessId].entranceDimension);
setPlayerPosition(client, getServerData().businesses[businessId].entrancePosition);
+ return true;
}
+
+ return false;
}
// ===========================================================================
+/**
+ * Gets the name of the type of a business owner by type ID
+ *
+ * @param {Number} ownerType - The business owner type ID
+ * @return {String} Name of the business owner type
+ *
+ */
function getBusinessOwnerTypeText(ownerType) {
switch(ownerType) {
case VRR_BIZOWNER_CLAN:
@@ -1546,12 +2026,22 @@ function getBusinessData(businessId) {
// ===========================================================================
+/**
+ *
+ * @param {Number} businessId - The data index of the business
+ * @returns {Boolean} Whether or not the business has an interior
+ */
function doesBusinessHaveInterior(businessId) {
return getBusinessData(businessId).hasInterior;
}
// ===========================================================================
+/**
+ *
+ * @param {Number} businessId - The data index of the business
+ * @returns {Boolean} Whether or not the entrance pickup of the business was deleted
+ */
function deleteBusinessEntrancePickup(businessId) {
if(!areServerElementsSupported()) {
return false;
@@ -1561,11 +2051,20 @@ function deleteBusinessEntrancePickup(businessId) {
//removeFromWorld(getBusinessData(businessId).entrancePickup);
deleteGameElement(getBusinessData(businessId).entrancePickup);
getBusinessData(businessId).entrancePickup = null;
+
+ return true;
}
+
+ return false;
}
// ===========================================================================
+/**
+ *
+ * @param {Number} businessId - The data index of the business
+ * @returns {Boolean} Whether or not the exit pickup of the business was deleted
+ */
function deleteBusinessExitPickup(businessId) {
if(!areServerElementsSupported()) {
return false;
@@ -1580,6 +2079,11 @@ function deleteBusinessExitPickup(businessId) {
// ===========================================================================
+/**
+ *
+ * @param {Number} businessId - The data index of the business
+ * @returns {Boolean} Whether or not the entrance blip of the business was deleted
+ */
function deleteBusinessEntranceBlip(businessId) {
if(!areServerElementsSupported()) {
return false;
@@ -1594,6 +2098,11 @@ function deleteBusinessEntranceBlip(businessId) {
// ===========================================================================
+/**
+ *
+ * @param {Number} businessId - The data index of the business
+ * @returns {Boolean} Whether or not the exit blip of the business was deleted
+ */
function deleteBusinessExitBlip(businessId) {
if(!areServerElementsSupported()) {
return false;
@@ -1608,6 +2117,15 @@ function deleteBusinessExitBlip(businessId) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function reloadAllBusinessesCommand(command, params, client) {
let clients = getClients();
for(let i in clients) {
@@ -1631,29 +2149,25 @@ function reloadAllBusinessesCommand(command, params, client) {
setAllBusinessIndexes();
cacheAllBusinessItems();
- messageAdminAction(`All businesses have been reloaded by an admin!`);
+ announceAdminAction(`AllBusinessesReloaded`);
}
// ===========================================================================
+/**
+ * Sets the indexes of all businesses
+ *
+ * @returns {Boolean} Whether or not the exit blip of the business was deleted
+ */
function setAllBusinessIndexes() {
for(let i in getServerData().businesses) {
getServerData().businesses[i].index = i;
-
- //for(let j in getServerData().businesses[i].locations) {
- // getServerData().businesses[i].locations[j].index = j;
- // getServerData().businesses[i].locations[j].businessIndex = i;
- //}
-
- //for(let j in getServerData().businesses[i].gameScripts) {
- // getServerData().businesses[i].gameScripts[j].index = j;
- // getServerData().businesses[i].gameScripts[j].businessIndex = i;
- //}
}
}
// ===========================================================================
+// Adds an item to a business inventory by item type, amount and buy price
function addToBusinessInventory(businessId, itemType, amount, buyPrice) {
let tempItemData = new ItemData(false);
tempItemData.amount = amount;
@@ -1672,6 +2186,15 @@ function addToBusinessInventory(businessId, itemType, amount, buyPrice) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function buyFromBusinessCommand(command, params, client) {
let businessId = getPlayerBusiness(client);
@@ -1763,16 +2286,25 @@ function buyFromBusinessCommand(command, params, client) {
//messagePlayerSuccess(client, `You bought ${amount} {ALTCOLOUR}${itemName} {MAINCOLOUR}for ${totalCost} ${priceEach}`);
meActionToNearbyPlayers(client, `buys a ${itemName}`);
- if(!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand("inv")) {
+ if(doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand("inv")) {
let keyData = getPlayerKeyBindForCommand("inv");
messagePlayerNewbieTip(client, getLocaleString(client, "ViewInventoryKeyPressTip", `{ALTCOLOUR}${getKeyNameFromId(keyData.key)}{MAINCOLOUR}`));
} else {
- messagePlayerNewbieTip(client, getLocaleString(client, "ViewInventoryKeyPressTip", `{ALTCOLOUR}/inv{MAINCOLOUR}`));
+ messagePlayerNewbieTip(client, getLocaleString(client, "ViewInventoryCommandTip", `{ALTCOLOUR}/inv{MAINCOLOUR}`));
}
}
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function setBusinessItemSellPriceCommand(command, params, client) {
let businessId = getBusinessFromParams(getParam(params, " ", 3)) || getPlayerBusiness(client);
@@ -1807,6 +2339,15 @@ function setBusinessItemSellPriceCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function storeItemInBusinessStorageCommand(command, params, client) {
let businessId = getBusinessFromParams(getParam(params, " ", 3)) || getPlayerBusiness(client);
@@ -1842,6 +2383,15 @@ function storeItemInBusinessStorageCommand(command, params, client) {
// ===========================================================================
+/**
+ * This is a command handler function.
+ *
+ * @param {string} command - The command name used by the player
+ * @param {string} params - The parameters/args string used with the command by the player
+ * @param {Client} client - The client/player that used the command
+ * @return {bool} Whether or not the command was successful
+ *
+ */
function stockItemOnBusinessFloorCommand(command, params, client) {
let businessId = getPlayerBusiness(client);
@@ -1877,6 +2427,7 @@ function stockItemOnBusinessFloorCommand(command, params, client) {
// ===========================================================================
+// Gets the first free slot in a business's storage items
function getBusinessStorageFirstFreeItemSlot(businessId) {
for(let i in getBusinessData(businessId).storageItemCache) {
if(getBusinessData(businessId).storageItemCache[i] == -1) {
@@ -1889,6 +2440,7 @@ function getBusinessStorageFirstFreeItemSlot(businessId) {
// ===========================================================================
+// Gets the first free slot in a business's floor items
function getBusinessFloorFirstFreeItemSlot(businessId) {
for(let i in getBusinessData(businessId).floorItemCache) {
if(getBusinessData(businessId).floorItemCache[i] == -1) {
@@ -1901,6 +2453,7 @@ function getBusinessFloorFirstFreeItemSlot(businessId) {
// ===========================================================================
+// Caches all items for all businesses
function cacheAllBusinessItems() {
logToConsole(LOG_DEBUG, "[VRR.Business] Caching all business items ...");
for(let i in getServerData().businesses) {
@@ -1911,6 +2464,7 @@ function cacheAllBusinessItems() {
// ===========================================================================
+// Caches all items for a business by businessId
function cacheBusinessItems(businessId) {
getBusinessData(businessId).floorItemCache.splice(0, getBusinessData(businessId).floorItemCache.length);
getBusinessData(businessId).storageItemCache.splice(0, getBusinessData(businessId).storageItemCache.length);
@@ -1928,6 +2482,7 @@ function cacheBusinessItems(businessId) {
// ===========================================================================
+// Gets a business's data index from a business's databaseId
function getBusinessIdFromDatabaseId(databaseId) {
for(let i in getServerData().businesses) {
if(getBusinessData(i).databaseId == databaseId) {
@@ -1940,6 +2495,7 @@ function getBusinessIdFromDatabaseId(databaseId) {
// ===========================================================================
+// Updates all pickup data for a business by businessId
function updateBusinessPickupLabelData(businessId) {
if(!areServerElementsSupported()) {
return false;
@@ -1987,17 +2543,6 @@ function updateBusinessPickupLabelData(businessId) {
// ===========================================================================
-function getBusinessIdFromDatabaseId(databaseId) {
- let businesses = getServerData().businesses;
- for(let i in businesses) {
- if(businesses[i].databaseId == databaseId) {
- return i;
- }
- }
-}
-
-// ===========================================================================
-
function resetBusinessPickups(businessId) {
deleteBusinessPickups(businessId);
createBusinessEntrancePickup(businessId);
@@ -2207,17 +2752,17 @@ function getBusinessFromParams(params) {
// ===========================================================================
function deleteAllBusinessBlips() {
- for(let i in getServerData().businesses) {
- deleteBusinessBlips(i);
- }
+ for(let i in getServerData().businesses) {
+ deleteBusinessBlips(i);
+ }
}
// ===========================================================================
function deleteAllBusinessPickups() {
- for(let i in getServerData().businesses) {
- deleteBusinessPickups(i);
- }
+ for(let i in getServerData().businesses) {
+ deleteBusinessPickups(i);
+ }
}
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/server/business/bakery.js b/scripts/server/business/bakery.js
deleted file mode 100644
index 5a0d1e81..00000000
--- a/scripts/server/business/bakery.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
-// ===========================================================================
-// FILE: bakery.js
-// DESC: Provides bakery business functions and usage
-// TYPE: Business (JavaScript)
-// ===========================================================================
\ No newline at end of file
diff --git a/scripts/server/business/bar.js b/scripts/server/business/bar.js
deleted file mode 100644
index 24265882..00000000
--- a/scripts/server/business/bar.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
-// ===========================================================================
-// FILE: bar.js
-// DESC: Provides bar/pub business functions and usage
-// TYPE: Business (JavaScript)
-// ===========================================================================
\ No newline at end of file
diff --git a/scripts/server/business/burger.js b/scripts/server/business/burger.js
deleted file mode 100644
index 4de61d2b..00000000
--- a/scripts/server/business/burger.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
-// ===========================================================================
-// FILE: burger.js
-// DESC: Provides burger joint (McDonalds?) business functions and usage
-// TYPE: Business (JavaScript)
-// ===========================================================================
\ No newline at end of file
diff --git a/scripts/server/business/casino.js b/scripts/server/business/casino.js
deleted file mode 100644
index 7317cf7f..00000000
--- a/scripts/server/business/casino.js
+++ /dev/null
@@ -1,67 +0,0 @@
-// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
-// ===========================================================================
-// FILE: casino.js
-// DESC: Provides casino business functions and usage
-// TYPE: Business (JavaScript)
-// ===========================================================================
-
-let deckCards = [
- DeckCardData("deckCardSpadeAce", VRR_DECKCARD_SUIT_SPADE, 1),
- DeckCardData("deckCardSpade2", VRR_DECKCARD_SUIT_SPADE, 2),
- DeckCardData("deckCardSpade3", VRR_DECKCARD_SUIT_SPADE, 3),
- DeckCardData("deckCardSpade4", VRR_DECKCARD_SUIT_SPADE, 4),
- DeckCardData("deckCardSpade5", VRR_DECKCARD_SUIT_SPADE, 5),
- DeckCardData("deckCardSpade6", VRR_DECKCARD_SUIT_SPADE, 6),
- DeckCardData("deckCardSpade7", VRR_DECKCARD_SUIT_SPADE, 7),
- DeckCardData("deckCardSpade8", VRR_DECKCARD_SUIT_SPADE, 8),
- DeckCardData("deckCardSpade9", VRR_DECKCARD_SUIT_SPADE, 9),
- DeckCardData("deckCardSpade10", VRR_DECKCARD_SUIT_SPADE, 10),
- DeckCardData("deckCardSpadeJack", VRR_DECKCARD_SUIT_SPADE, 11),
- DeckCardData("deckCardSpadeQueen", VRR_DECKCARD_SUIT_SPADE, 12),
- DeckCardData("deckCardSpadeKing", VRR_DECKCARD_SUIT_SPADE, 13),
- DeckCardData("deckCardClubAce", VRR_DECKCARD_SUIT_CLUB, 1),
- DeckCardData("deckCardClub2", VRR_DECKCARD_SUIT_CLUB, 2),
- DeckCardData("deckCardClub3", VRR_DECKCARD_SUIT_CLUB, 3),
- DeckCardData("deckCardClub4", VRR_DECKCARD_SUIT_CLUB, 4),
- DeckCardData("deckCardClub5", VRR_DECKCARD_SUIT_CLUB, 5),
- DeckCardData("deckCardClub6", VRR_DECKCARD_SUIT_CLUB, 6),
- DeckCardData("deckCardClub7", VRR_DECKCARD_SUIT_CLUB, 7),
- DeckCardData("deckCardClub8", VRR_DECKCARD_SUIT_CLUB, 8),
- DeckCardData("deckCardClub9", VRR_DECKCARD_SUIT_CLUB, 9),
- DeckCardData("deckCardClub10", VRR_DECKCARD_SUIT_CLUB, 10),
- DeckCardData("deckCardClubJack", VRR_DECKCARD_SUIT_CLUB, 11),
- DeckCardData("deckCardClubQueen", VRR_DECKCARD_SUIT_CLUB, 12),
- DeckCardData("deckCardClubKing", VRR_DECKCARD_SUIT_CLUB, 13),
- DeckCardData("deckCardHeartAce", VRR_DECKCARD_SUIT_HEART, 1),
- DeckCardData("deckCardHeart2", VRR_DECKCARD_SUIT_HEART, 2),
- DeckCardData("deckCardHeart3", VRR_DECKCARD_SUIT_HEART, 3),
- DeckCardData("deckCardHeart4", VRR_DECKCARD_SUIT_HEART, 4),
- DeckCardData("deckCardHeart5", VRR_DECKCARD_SUIT_HEART, 5),
- DeckCardData("deckCardHeart6", VRR_DECKCARD_SUIT_HEART, 6),
- DeckCardData("deckCardHeart7", VRR_DECKCARD_SUIT_HEART, 7),
- DeckCardData("deckCardHeart8", VRR_DECKCARD_SUIT_HEART, 8),
- DeckCardData("deckCardHeart9", VRR_DECKCARD_SUIT_HEART, 9),
- DeckCardData("deckCardHeart10", VRR_DECKCARD_SUIT_HEART, 10),
- DeckCardData("deckCardHeartJack", VRR_DECKCARD_SUIT_HEART, 11),
- DeckCardData("deckCardHeartQueen", VRR_DECKCARD_SUIT_HEART, 12),
- DeckCardData("deckCardHeartKing", VRR_DECKCARD_SUIT_HEART, 13),
- DeckCardData("deckCardDiamondAce", VRR_DECKCARD_SUIT_DIAMOND, 1),
- DeckCardData("deckCardDiamond2", VRR_DECKCARD_SUIT_DIAMOND, 2),
- DeckCardData("deckCardDiamond3", VRR_DECKCARD_SUIT_DIAMOND, 3),
- DeckCardData("deckCardDiamond4", VRR_DECKCARD_SUIT_DIAMOND, 4),
- DeckCardData("deckCardDiamond5", VRR_DECKCARD_SUIT_DIAMOND, 5),
- DeckCardData("deckCardDiamond6", VRR_DECKCARD_SUIT_DIAMOND, 6),
- DeckCardData("deckCardDiamond7", VRR_DECKCARD_SUIT_DIAMOND, 7),
- DeckCardData("deckCardDiamond8", VRR_DECKCARD_SUIT_DIAMOND, 8),
- DeckCardData("deckCardDiamond9", VRR_DECKCARD_SUIT_DIAMOND, 9),
- DeckCardData( "deckCardDiamond10", VRR_DECKCARD_SUIT_DIAMOND, 10),
- DeckCardData("deckCardDiamondJack", VRR_DECKCARD_SUIT_DIAMOND, 11),
- DeckCardData("deckCardDiamondQueen", VRR_DECKCARD_SUIT_DIAMOND, 12),
- DeckCardData("deckCardDiamondKing", VRR_DECKCARD_SUIT_DIAMOND, 13),
-];
-
-let deckCardBacks = [
-
-]
\ No newline at end of file
diff --git a/scripts/server/business/clothing.js b/scripts/server/business/clothing.js
deleted file mode 100644
index 1a38adad..00000000
--- a/scripts/server/business/clothing.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
-// ===========================================================================
-// FILE: clothing.js
-// DESC: Provides clothing (skin) business functions and usage
-// TYPE: Business (JavaScript)
-// ===========================================================================
\ No newline at end of file
diff --git a/scripts/server/business/club.js b/scripts/server/business/club.js
deleted file mode 100644
index 80f083c4..00000000
--- a/scripts/server/business/club.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
-// ===========================================================================
-// FILE: club.js
-// DESC: Provides club/nightclub business functions and usage
-// TYPE: Business (JavaScript)
-// ===========================================================================
\ No newline at end of file
diff --git a/scripts/server/business/fuel.js b/scripts/server/business/fuel.js
deleted file mode 100644
index 217d82a4..00000000
--- a/scripts/server/business/fuel.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
-// ===========================================================================
-// FILE: fuel.js
-// DESC: Provides fuel/petrol business functions and usage
-// TYPE: Business (JavaScript)
-// ===========================================================================
\ No newline at end of file
diff --git a/scripts/server/business/mechanic.js b/scripts/server/business/mechanic.js
deleted file mode 100644
index 6eec8be0..00000000
--- a/scripts/server/business/mechanic.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
-// ===========================================================================
-// FILE: mechanic.js
-// DESC: Provides mechanic/vehicle repair business functions and usage
-// TYPE: Business (JavaScript)
-// ===========================================================================
\ No newline at end of file
diff --git a/scripts/server/business/pizza.js b/scripts/server/business/pizza.js
deleted file mode 100644
index d14bb7a0..00000000
--- a/scripts/server/business/pizza.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
-// ===========================================================================
-// FILE: pizza.js
-// DESC: Provides pizza restaurant business functions and usage
-// TYPE: Business (JavaScript)
-// ===========================================================================
\ No newline at end of file
diff --git a/scripts/server/business/restaurant.js b/scripts/server/business/restaurant.js
deleted file mode 100644
index 0491cfca..00000000
--- a/scripts/server/business/restaurant.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
-// ===========================================================================
-// FILE: restaurant.js
-// DESC: Provides generic restaurant business functions and usage
-// TYPE: Business (JavaScript)
-// ===========================================================================
\ No newline at end of file
diff --git a/scripts/server/business/vehicle.js b/scripts/server/business/vehicle.js
deleted file mode 100644
index b7990e73..00000000
--- a/scripts/server/business/vehicle.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
-// ===========================================================================
-// FILE: vehicle.js
-// DESC: Provides vehicle dealership business functions and usage
-// TYPE: Business (JavaScript)
-// ===========================================================================
\ No newline at end of file
diff --git a/scripts/server/business/weapon.js b/scripts/server/business/weapon.js
deleted file mode 100644
index e81fc514..00000000
--- a/scripts/server/business/weapon.js
+++ /dev/null
@@ -1,9 +0,0 @@
-// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
-// ===========================================================================
-// FILE: weapon.js
-// DESC: Provides weapon (ammunations & illegal gunshops) business usage
-// TYPE: Business (JavaScript)
-// ===========================================================================
-
diff --git a/scripts/server/chat.js b/scripts/server/chat.js
index 554dbeaa..cc06b70b 100644
--- a/scripts/server/chat.js
+++ b/scripts/server/chat.js
@@ -39,12 +39,13 @@ function processPlayerChat(client, messageText) {
messageText = messageText.substring(0, 128);
messagePlayerNormal(null, `💬 ${getCharacterFullName(client)}: ${messageText}`);
+ messageDiscordChatChannel(`💬 ${getCharacterFullName(client)}: ${messageText}`);
} else {
messagePlayerNormal(null, `🛡️ (ADMIN) - ${messageText}`);
}
-
- /*
- let clients = getClients();
+
+ /*
+ let clients = getClients();
for(let i in clients) {
let translatedText;
translatedText = await translateMessage(messageText, getPlayerData(client).locale, getPlayerData(clients[i]).locale);
@@ -52,9 +53,9 @@ function processPlayerChat(client, messageText) {
let original = (getPlayerData(client).locale == getPlayerData(clients[i]).locale) ? `` : ` {ALTCOLOUR}(${messageText})`;
messagePlayerNormal(clients[i], `💬 ${getCharacterFullName(client)}: [#FFFFFF]${translatedText}${original}`, clients[i], getColourByName("mediumGrey"));
}
- */
-
- //messageDiscordChatChannel(`💬 ${getCharacterFullName(client)}: ${messageText}`);
+ */
+
+ //messageDiscordChatChannel(`💬 ${getCharacterFullName(client)}: ${messageText}`);
}
// ===========================================================================
diff --git a/scripts/server/clan.js b/scripts/server/clan.js
index 0155dd4d..2c35c30b 100644
--- a/scripts/server/clan.js
+++ b/scripts/server/clan.js
@@ -9,7 +9,10 @@
function initClanScript() {
logToConsole(LOG_INFO, "[VRR.Clan]: Initializing clans script ...");
- getServerData().clans = loadClansFromDatabase();
+ if(!getServerConfig().devServer) {
+ getServerData().clans = loadClansFromDatabase();
+ }
+
setAllClanDataIndexes();
logToConsole(LOG_INFO, "[VRR.Clan]: Clan script initialized successfully!");
return true;
@@ -114,7 +117,7 @@ function createClanRank(clanId, rankId, rankName) {
let rankIndex = getClanData(clanId).ranks.push(tempClanRankData);
setAllClanDataIndexes();
- saveAllClanRanksToDatabase(clanId);
+ saveClanRanksToDatabase(clanId);
return rankIndex;
}
@@ -927,12 +930,20 @@ function doesClanIdExist(clanId) {
// ===========================================================================
function reloadAllClans() {
+ if(getServerConfig().devServer) {
+ return false;
+ }
+
getServerData().clans = loadClansFromDatabase();
}
// ===========================================================================
-function saveAllClanRanksToDatabase(clanId) {
+function saveClanRanksToDatabase(clanId) {
+ if(getServerConfig().devServer) {
+ return false;
+ }
+
let ranks = getServerData().clans[clanId].ranks;
for(let i in ranks) {
saveClanRankToDatabase(clanId, i);
@@ -948,9 +959,13 @@ function saveClanToDatabase(clanId) {
return false;
}
- if(!tempClanData.needsSaved) {
- return false;
- }
+ if(tempClanData.databaseId == -1) {
+ return false;
+ }
+
+ if(!tempClanData.needsSaved) {
+ return false;
+ }
let dbConnection = connectToDatabase();
if(dbConnection) {
@@ -982,7 +997,7 @@ function saveClanToDatabase(clanId) {
disconnectFromDatabase(dbConnection);
}
- saveAllClanRanksToDatabase(clanId);
+ saveClanRanksToDatabase(clanId);
return true;
}
@@ -994,41 +1009,41 @@ function saveClanToDatabase(clanId) {
function saveClanRankToDatabase(clanId, rankId) {
let tempClanRankData = getClanRankData(clanId, rankId);
- if(!tempClanRankData.needsSaved) {
- return false;
- }
+ if(!tempClanRankData.needsSaved) {
+ return false;
+ }
let dbConnection = connectToDatabase();
if(dbConnection) {
- let safeName = escapeDatabaseString(dbConnection, tempClanRankData.name);
- let safeTag = escapeDatabaseString(dbConnection, tempClanRankData.customTag);
- //let safeTitle = escapeDatabaseString(dbConnection, tempClanRankData.name);
+ let safeName = escapeDatabaseString(dbConnection, tempClanRankData.name);
+ let safeTag = escapeDatabaseString(dbConnection, tempClanRankData.customTag);
+ //let safeTitle = escapeDatabaseString(dbConnection, tempClanRankData.name);
- let data = [
- ["clan_rank_name", safeName],
- ["clan_rank_clan", tempClanRankData.clan],
- ["clan_rank_custom_tag", safeTag],
- //["clan_rank_title", safeTitle],
- ["clan_rank_flags", tempClanRankData.flags],
- ["clan_rank_level", tempClanRankData.level],
- ["clan_rank_enabled", boolToInt(tempClanRankData.enabled)],
- ];
+ let data = [
+ ["clan_rank_name", safeName],
+ ["clan_rank_clan", tempClanRankData.clan],
+ ["clan_rank_custom_tag", safeTag],
+ //["clan_rank_title", safeTitle],
+ ["clan_rank_flags", tempClanRankData.flags],
+ ["clan_rank_level", tempClanRankData.level],
+ ["clan_rank_enabled", boolToInt(tempClanRankData.enabled)],
+ ];
- let dbQuery = null;
- if(tempClanRankData.databaseId == 0) {
- let queryString = createDatabaseInsertQuery("clan_rank", data);
- dbQuery = queryDatabase(dbConnection, queryString);
- getClanRankData(clanId, rankId).databaseId = getDatabaseInsertId(dbConnection);
- getClanRankData(clanId, rankId).needsSaved = false;
- } else {
- let queryString = createDatabaseUpdateQuery("clan_rank", data, `clan_rank_id=${tempClanRankData.databaseId} LIMIT 1`);
- dbQuery = queryDatabase(dbConnection, queryString);
- getClanRankData(clanId, rankId).needsSaved = false;
- }
+ let dbQuery = null;
+ if(tempClanRankData.databaseId == 0) {
+ let queryString = createDatabaseInsertQuery("clan_rank", data);
+ dbQuery = queryDatabase(dbConnection, queryString);
+ getClanRankData(clanId, rankId).databaseId = getDatabaseInsertId(dbConnection);
+ getClanRankData(clanId, rankId).needsSaved = false;
+ } else {
+ let queryString = createDatabaseUpdateQuery("clan_rank", data, `clan_rank_id=${tempClanRankData.databaseId} LIMIT 1`);
+ dbQuery = queryDatabase(dbConnection, queryString);
+ getClanRankData(clanId, rankId).needsSaved = false;
+ }
- freeDatabaseQuery(dbQuery);
- disconnectFromDatabase(dbConnection);
- return true;
+ freeDatabaseQuery(dbQuery);
+ disconnectFromDatabase(dbConnection);
+ return true;
}
return false;
@@ -1071,7 +1086,11 @@ function setClanRankTitle(clanId, rankId, title) {
// ===========================================================================
-function saveAllClansToDatabase() {
+function saveClansToDatabase() {
+ if(getServerConfig().devServer) {
+ return false;
+ }
+
for(let i in getServerData().clans) {
saveClanToDatabase(i);
}
@@ -1134,6 +1153,11 @@ function getClanRankIdFromDatabaseId(clanId, databaseId) {
// ===========================================================================
+/**
+ * @param {number} clanId - The data index of the clan
+ * @param {number} clanRankId - The data index of the clan rank
+ * @return {ClanRankData} The clan rank's data (class instance)
+ */
function getClanRankData(clanId, rankId) {
return getServerData().clans[clanId].ranks[rankId];
}
@@ -1213,6 +1237,10 @@ let rankId = getClanRankFromParams(clanId, getParam(params, " ", 1));
}
*/
+/**
+ * @param {String} params - The params to search for
+ * @return {Number} The data index of a matching clan
+ */
function getClanFromParams(params) {
if(isNaN(params)) {
for(let i in getServerData().clans) {
@@ -1231,6 +1259,11 @@ function getClanFromParams(params) {
// ===========================================================================
+/**
+ * @param {Number} clanId - The clan ID to search ranks for
+ * @param {String} params - The params to search for
+ * @return {Number} The data index of a matching clan
+ */
function getClanRankFromParams(clanId, params) {
if(isNaN(params)) {
for(let i in getClanData(clanId).ranks) {
diff --git a/scripts/server/class.js b/scripts/server/class.js
index 5ece105d..aa6534be 100644
--- a/scripts/server/class.js
+++ b/scripts/server/class.js
@@ -19,7 +19,7 @@ function initClassScript() {
/**
* @class Representing data for server configuration
*/
-class ServerData {
+class ServerConfigData {
constructor(dbAssoc = false) {
this.databaseId = 0;
this.needsSaved = false;
@@ -58,7 +58,7 @@ class ServerData {
this.showLogo = true;
this.inflationMultiplier = 1;
this.testerOnly = false;
- this.settings = 0;
+ this.devServer = false;
this.antiCheat = {
enabled: false,
@@ -87,9 +87,6 @@ class ServerData {
this.realTimeZone = 0;
this.discordConfig = {
- eventChannelWebHookURL: "",
- chatChannelWebHookURL: "",
- adminChannelWebHookURL: "",
sendEvents: true,
sendChat: true,
sendAdminEvents: true,
@@ -104,7 +101,6 @@ class ServerData {
bank: dbAssoc["svr_newchar_bank"],
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.connectCameraLookAt = toVector3(dbAssoc["svr_connectcam_lookat_x"], dbAssoc["svr_connectcam_lookat_y"], dbAssoc["svr_connectcam_lookat_z"]);
@@ -113,6 +109,21 @@ class ServerData {
this.minute = toInteger(dbAssoc["svr_start_time_min"]);
this.minuteDuration = toInteger(dbAssoc["svr_time_min_duration"]);
this.weather = toInteger(dbAssoc["svr_start_weather"]);
+ //this.fallingSnow = intToBool(toInteger(dbAssoc["svr_start_snow_falling"]));
+ //this.groundSnow = intToBool(toInteger(dbAssoc["svr_start_snow_ground"]));
+ //this.useGUI = intToBool(toInteger(dbAssoc["svr_gui_enabled"]));
+ //this.showLogo = intToBool(toInteger(dbAssoc["svr_logo_enabled"]));
+ //this.testerOnly = intToBool(toInteger(dbAssoc["svr_tester_only"]));
+
+ /*
+ this.createJobPickups = intToBool(toInteger(dbAssoc["svr_job_pickups_enabled"]));
+ this.createBusinessPickups = intToBool(toInteger(dbAssoc["svr_biz_pickups_enabled"]));
+ this.createHousePickups = intToBool(toInteger(dbAssoc["svr_house_pickups_enabled"]));
+ this.createJobBlips = intToBool(toInteger(dbAssoc["svr_job_blips_enabled"]));
+ this.createBusinessBlips = intToBool(toInteger(dbAssoc["svr_biz_blips_enabled"]));
+ this.createHouseBlips = intToBool(toInteger(dbAssoc["svr_house_blips_enabled"]));
+ */
+
this.guiColourPrimary = [toInteger(dbAssoc["svr_gui_col1_r"]), toInteger(dbAssoc["svr_gui_col1_g"]), toInteger(dbAssoc["svr_gui_col1_b"])];
this.guiColourSecondary = [toInteger(dbAssoc["svr_gui_col2_r"]), toInteger(dbAssoc["svr_gui_col2_g"]), toInteger(dbAssoc["svr_gui_col2_b"])];
this.guiTextColourPrimary = [toInteger(dbAssoc["svr_gui_textcol1_r"]), toInteger(dbAssoc["svr_gui_textcol1_g"]), toInteger(dbAssoc["svr_gui_textcol1_b"])];
@@ -121,15 +132,14 @@ class ServerData {
this.discordBotToken = intToBool(dbAssoc["svr_discord_bot_token"]);
this.introMusicURL = dbAssoc["svr_intro_music"];
- this.realTimeZone = dbAssoc["svr_time_realtime_timezone"];
- this.discordConfig = {
- eventChannelWebHookURL: dbAssoc["svr_discord_event_webhook"],
- chatChannelWebHookURL: dbAssoc["svr_discord_chat_webhook"],
- adminChannelWebHookURL: dbAssoc["svr_discord_admin_webhook"],
+ //this.useRealTime = intToBool(toInteger(dbAssoc["svr_real_time_enabled"]));
+ //this.realTimeZone = dbAssoc["svr_real_time_timezone"];
+
+ this.discord = {
sendEvents: true,
sendChat: true,
- sendAdminEvents: true,
+ sendAdmin: true,
};
}
}
@@ -239,6 +249,10 @@ class ClientData {
this.locale = 0;
this.enteringVehicle = null;
+
+ this.customDisconnectReason = "";
+
+ this.interiorCutscene = "";
}
};
@@ -271,6 +285,7 @@ class AccountData {
this.twoFactorAuthVerificationCode = "";
this.chatScrollLines = 1;
+ this.chatAutoHideDelay = 0;
this.streamingRadioVolume = 20;
this.locale = 0;
@@ -300,6 +315,7 @@ class AccountData {
this.emailVerificationCode = dbAssoc["acct_code_verifyemail"];
this.twoFactorAuthVerificationCode = dbAssoc["acct_code_2fa"];
this.chatScrollLines = toInteger(dbAssoc["acct_svr_chat_scroll_lines"]);
+ this.chatAutoHideDelay = toInteger(dbAssoc["acct_svr_chat_auto_hide_delay"]);
this.streamingRadioVolume = toInteger(dbAssoc["acct_streaming_radio_volume"]);
this.locale = toInteger(dbAssoc["acct_locale"]);
}
@@ -524,6 +540,7 @@ class BusinessData {
this.entranceBlipModel = -1;
this.entrancePickup = null;
this.entranceBlip = null;
+ this.entranceCutscene = "";
this.exitPosition = false;
this.exitRotation = 0.0;
@@ -533,6 +550,7 @@ class BusinessData {
this.exitBlipModel = -1;
this.exitPickup = null;
this.exitBlip = null;
+ this.exitCutscene = "";
this.entranceFee = 0;
this.till = 0;
@@ -541,6 +559,8 @@ class BusinessData {
this.labelHelpType = VRR_PROPLABEL_INFO_NONE;
+ this.triggers = [];
+
if(dbAssoc) {
this.databaseId = toInteger(dbAssoc["biz_id"]);
this.name = toString(dbAssoc["biz_name"]);
@@ -557,6 +577,7 @@ class BusinessData {
this.entranceDimension = toInteger(dbAssoc["biz_entrance_vw"]);
this.entrancePickupModel = toInteger(dbAssoc["biz_entrance_pickup"]);
this.entranceBlipModel = toInteger(dbAssoc["biz_entrance_blip"]);
+ this.entranceCutscene = toString(dbAssoc["biz_entrance_cutscene"]);
this.exitPosition = toVector3(dbAssoc["biz_exit_pos_x"], dbAssoc["biz_exit_pos_y"], dbAssoc["biz_exit_pos_z"]);
this.exitRotation = toInteger(dbAssoc["biz_exit_rot_z"]);
@@ -564,12 +585,14 @@ class BusinessData {
this.exitDimension = toInteger(dbAssoc["biz_exit_vw"]);
this.exitPickupModel = toInteger(dbAssoc["biz_exit_pickup"]);
this.exitBlipModel = toInteger(dbAssoc["biz_exit_blip"]);
+ this.exitCutscene = toString(dbAssoc["biz_exit_cutscene"]);
this.entranceFee = toInteger(dbAssoc["biz_entrance_fee"]);
this.till = toInteger(dbAssoc["biz_till"]);
this.labelHelpType = toInteger(dbAssoc["biz_label_help_type"]);
this.streamingRadioStation = toInteger(dbAssoc["biz_radiostation"]);
+
}
};
};
@@ -658,6 +681,7 @@ class HouseData {
this.entranceBlipModel = -1;
this.entrancePickup = null;
this.entranceBlip = null;
+ this.entranceCutscene = "";
this.exitPosition = false;
this.exitRotation = 0.0;
@@ -667,9 +691,12 @@ class HouseData {
this.exitBlipModel = -1;
this.exitPickup = null;
this.exitBlip = null;
+ this.exitCutscene = "";
this.streamingRadioStation = -1;
+ this.triggers = [];
+
if(dbAssoc) {
this.databaseId = toInteger(dbAssoc["house_id"]);
this.description = toString(dbAssoc["house_description"]);
@@ -688,6 +715,7 @@ class HouseData {
this.entranceDimension = toInteger(dbAssoc["house_entrance_vw"]);
this.entrancePickupModel = toInteger(dbAssoc["house_entrance_pickup"]);
this.entranceBlipModel = toInteger(dbAssoc["house_entrance_blip"]);
+ this.entranceCutscene = toString(dbAssoc["house_entrance_cutscene"]);
this.exitPosition = toVector3(toFloat(dbAssoc["house_exit_pos_x"]), toFloat(dbAssoc["house_exit_pos_y"]), toFloat(dbAssoc["house_exit_pos_z"]));
this.exitRotation = toFloat(dbAssoc["house_exit_rot_z"]);
@@ -695,6 +723,7 @@ class HouseData {
this.exitDimension = toInteger(dbAssoc["house_exit_vw"]);
this.exitPickupModel = toInteger(dbAssoc["house_exit_pickup"]);
this.exitBlipModel = toInteger(dbAssoc["house_exit_blip"]);
+ this.exitCutscene = toString(dbAssoc["house_exit_cutscene"]);
}
}
};
@@ -934,6 +963,8 @@ class VehicleData {
this.lastActiveTime = false;
+ this.triggers = [];
+
if(dbAssoc) {
// General Info
this.databaseId = toInteger(dbAssoc["veh_id"]);
@@ -1003,7 +1034,7 @@ class VehicleData {
};
/**
- * @class Representing a command's data. Loaded and saved in the database
+ * @class Representing a command's data.
*/
class CommandData {
enable() {
@@ -1018,7 +1049,7 @@ class CommandData {
this.enabled = !this.enabled;
}
- constructor(command, handlerFunction, syntaxString, requiredStaffFlags, requireLogin, allowOnDiscord, helpDescription) {
+ constructor(command, handlerFunction, syntaxString = "", requiredStaffFlags = 0, requireLogin = true, allowOnDiscord = false, helpDescription = "") {
this.command = command;
this.handlerFunction = handlerFunction;
this.syntaxString = syntaxString;
@@ -1302,49 +1333,6 @@ class KeyBindData {
}
};
-class BlackListedGameScriptData {
- constructor(dbAssoc = false) {
- this.databaseId = 0;
- this.enabled = false
- this.serverId = 0;
- this.scriptName = "";
- this.index = -1;
- this.needsSaved = false;
-
- if(dbAssoc) {
- this.databaseId = dbAssoc["ac_script_bl_id"];
- this.enabled = intToBool(dbAssoc["ac_script_bl_enabled"]);
- this.serverId = dbAssoc["ac_script_bl_server"];
- this.scriptName = dbAssoc["ac_script_bl_name"];
- }
- }
-};
-
-class WhiteListedGameScriptData {
- constructor(dbAssoc = false) {
- this.databaseId = 0;
- this.enabled = false
- this.serverId = 0;
- this.scriptName = "";
- this.index = -1;
- this.needsSaved = false;
-
- if(dbAssoc) {
- this.databaseId = dbAssoc["ac_script_wl_id"];
- this.enabled = intToBool(dbAssoc["ac_script_wl_enabled"]);
- this.serverId = dbAssoc["ac_script_wl_server"];
- this.scriptName = dbAssoc["ac_script_wl_name"];
- }
- }
-};
-
-class InteriorTemplateData {
- constructor(exitPosition, exitInterior) {
- this.exitPosition = exitPosition;
- this.exitInterior = exitInterior;
- }
-};
-
class RadioStationData {
constructor(dbAssoc = false) {
this.databaseId = 0;
@@ -1486,6 +1474,7 @@ class ItemTypeData {
}
}
};
+
class NPCData {
constructor(dbAssoc = false) {
this.databaseId = 0;
@@ -1495,8 +1484,10 @@ class NPCData {
this.middleName = "Q";
this.skin = 0;
this.cash = 0;
- this.spawnPosition = toVector3(0.0, 0.0, 0.0);
- this.spawnHeading = 0.0;
+ this.position = toVector3(0.0, 0.0, 0.0);
+ this.rotation = toVector3(0.0, 0.0, 0.0);
+ this.scale = toVector3(1.0, 1.0, 1.0);
+ this.heading = 0.0;
this.clan = 0;
this.isWorking = false;
this.jobUniform = this.skin;
@@ -1505,13 +1496,16 @@ class NPCData {
this.weapons = [];
this.interior = 0;
this.dimension = 0;
- this.pedScale = toVector3(1.0, 1.0, 1.0);
this.walkStyle = 0;
this.fightStyle = 0;
this.health = 100;
this.armour = 100;
this.currentAction = VRR_NPCACTION_NONE;
this.triggers = [];
+ this.typeFlags = 0;
+ this.heedThreats = false;
+ this.threats = 0;
+ this.invincible = false;
this.bodyParts = {
hair: [0,0],
@@ -1533,6 +1527,8 @@ class NPCData {
rightFoot: [0,0],
};
+ this.triggers = [];
+
if(dbAssoc) {
this.databaseId = toInteger(dbAssoc["npc_id"]);
this.serverId = toInteger(dbAssoc["npc_server"]);
@@ -1541,21 +1537,24 @@ class NPCData {
this.middleName = dbAssoc["npc_name_middle"] || "";
this.skin = toInteger(dbAssoc["npc_skin"]);
this.cash = toInteger(dbAssoc["npc_cash"]);
- this.spawnPosition = toVector3(toFloat(dbAssoc["npc_pos_x"]), toFloat(dbAssoc["npc_pos_y"]), toFloat(dbAssoc["npc_pos_z"]));
- this.spawnHeading = toFloat(dbAssoc["npc_angle"]);
+ this.position = toVector3(toFloat(dbAssoc["npc_pos_x"]), toFloat(dbAssoc["npc_pos_y"]), toFloat(dbAssoc["npc_pos_z"]));
+ this.rotation = toVector3(toFloat(dbAssoc["npc_rot_x"]), toFloat(dbAssoc["npc_rot_y"]), toFloat(dbAssoc["npc_rot_z"]));
+ this.scale = toVector3(toFloat(dbAssoc["npc_scale_x"]), toFloat(dbAssoc["npc_scale_y"]), toFloat(dbAssoc["npc_scale_z"]));
+ this.heading = toFloat(dbAssoc["npc_rot_z"]);
this.lastLogin = toInteger(dbAssoc["npc_when_lastlogin"]);
- this.clan = toInteger(dbAssoc["npc_clan"]);
- this.clanFlags = toInteger(dbAssoc["npc_clan_flags"]);
- this.clanRank = toInteger(dbAssoc["npc_clan_rank"]);
- this.clanTitle = toInteger(dbAssoc["npc_clan_title"]);
+ this.rank = toInteger(dbAssoc["npc_rank"]);
+ this.title = toInteger(dbAssoc["npc_title"]);
this.job = toInteger(dbAssoc["npc_job"]);
this.interior = toInteger(dbAssoc["npc_int"]);
this.dimension = toInteger(dbAssoc["npc_vw"]);
- this.pedScale = toVector3(toFloat(dbAssoc["npc_scale_x"]), toFloat(dbAssoc["npc_scale_y"]), toFloat(dbAssoc["npc_scale_z"]));
this.walkStyle = toInteger(dbAssoc["npc_walkstyle"]);
this.fightStyle = toInteger(dbAssoc["npc_fightstyle"]);
this.health = toInteger(dbAssoc["npc_health"]);
this.armour = toInteger(dbAssoc["npc_armour"]);
+ this.typeFlags = toInteger(dbAssoc["npc_type_flags"]);
+ this.heedThreats = intToBool(dbAssoc["npc_headthreats"]);
+ this.threats = toInteger(dbAssoc["npc_threats"]);
+ this.invincible = intToBool(dbAssoc["npc_invincible"]);
this.bodyParts = {
hair: [toInteger(dbAssoc["npc_hd_part_hair_model"]) || 0, toInteger(dbAssoc["npc_hd_part_hair_texture"]) || 0],
@@ -1656,28 +1655,6 @@ class BanData {
}
}
-class DeckCardData {
- constructor(imageName, value) {
- this.imageName = imageName,
- this.value = value;
- }
-}
-
-class DeckCardGameData {
- constructor() {
- this.gameType = VRR_DECKCARD_GAME_NONE;
- this.playedCards = [];
- this.remainingCards = [];
- }
-}
-
-class DeckCardHandData {
- constructor() {
- this.cards = [];
- this.total = 0;
- }
-}
-
class JobRouteData {
constructor(dbAssoc = false) {
this.databaseId = 0;
@@ -1708,7 +1685,7 @@ class JobRouteData {
this.pay = toInteger(dbAssoc["job_route_pay"]);
this.startMessage = toString(dbAssoc["job_route_start_msg"]);
this.finishMessage = toString(dbAssoc["job_route_finish_msg"]);
- this.locationArriveMessage = toString(dbAssoc["job_route_loc_arrive_msg"]);
+ this.locationArriveMessage = toString(dbAssoc["job_route_loc_arrive_msg"]);
this.locationNextMessage = toString(dbAssoc["job_route_loc_next_msg"]);
this.vehicleColour1 = toInteger(dbAssoc["job_route_veh_colour1"]);
this.vehicleColour2 = toInteger(dbAssoc["job_route_veh_colour2"]);
@@ -1724,7 +1701,7 @@ class JobRouteLocationData {
this.routeId = 0;
this.enabled = false;
this.index = -1;
- this.jobIndex = -1;
+ this.jobIndex = -1;
this.routeIndex = -1;
this.needsSaved = false;
this.position = toVector3(0.0, 0.0, 0.0);
diff --git a/scripts/server/client.js b/scripts/server/client.js
index 5bd79c7c..1c6e6f79 100644
--- a/scripts/server/client.js
+++ b/scripts/server/client.js
@@ -8,95 +8,96 @@
// ===========================================================================
function initClientScript() {
- logToConsole(LOG_DEBUG, "[VRR.Client]: Initializing client script ...");
- addAllNetworkHandlers();
- logToConsole(LOG_DEBUG, "[VRR.Client]: Client script initialized!");
+ logToConsole(LOG_DEBUG, "[VRR.Client]: Initializing client script ...");
+ addAllNetworkHandlers();
+ logToConsole(LOG_DEBUG, "[VRR.Client]: Client script initialized!");
}
// ===========================================================================
function addAllNetworkHandlers() {
- logToConsole(LOG_DEBUG, "[VRR.Client]: Adding network handlers ...");
+ logToConsole(LOG_DEBUG, "[VRR.Client]: Adding network handlers ...");
- // KeyBind
- addNetworkEventHandler("vrr.useKeyBind", playerUsedKeyBind);
+ // KeyBind
+ addNetworkEventHandler("vrr.useKeyBind", playerUsedKeyBind);
- // GUI
- addNetworkEventHandler("vrr.promptAnswerNo", playerPromptAnswerNo);
- addNetworkEventHandler("vrr.promptAnswerYes", playerPromptAnswerYes);
- addNetworkEventHandler("vrr.toggleGUI", playerToggledGUI);
- addNetworkEventHandler("vrr.2fa", checkPlayerTwoFactorAuthentication);
+ // GUI
+ addNetworkEventHandler("vrr.promptAnswerNo", playerPromptAnswerNo);
+ addNetworkEventHandler("vrr.promptAnswerYes", playerPromptAnswerYes);
+ addNetworkEventHandler("vrr.toggleGUI", playerToggledGUI);
+ addNetworkEventHandler("vrr.2fa", checkPlayerTwoFactorAuthentication);
- // AFK
- addNetworkEventHandler("vrr.afk", playerChangeAFKState);
+ // AFK
+ addNetworkEventHandler("vrr.afk", playerChangeAFKState);
- // Event
- addNetworkEventHandler("vrr.pickup", onPlayerNearPickup);
- addNetworkEventHandler("vrr.enteredSphere", onPlayerEnteredSphere);
- addNetworkEventHandler("vrr.exitedSphere", onPlayerExitedSphere);
- addNetworkEventHandler("vrr.playerDeath", onPlayerDeath);
- addNetworkEventHandler("vrr.onPlayerEnterVehicle", onPlayerEnteredVehicle);
- addNetworkEventHandler("vrr.onPlayerExitVehicle", onPlayerExitedVehicle);
+ // Event
+ addNetworkEventHandler("vrr.pickup", onPlayerNearPickup);
+ addNetworkEventHandler("vrr.enteredSphere", onPlayerEnteredSphere);
+ addNetworkEventHandler("vrr.exitedSphere", onPlayerExitedSphere);
+ addNetworkEventHandler("vrr.playerDeath", onPlayerDeath);
+ addNetworkEventHandler("vrr.onPlayerEnterVehicle", onPlayerEnteredVehicle);
+ addNetworkEventHandler("vrr.onPlayerExitVehicle", onPlayerExitedVehicle);
- // Job
- addNetworkEventHandler("vrr.arrivedAtJobRouteLocation", playerArrivedAtJobRouteLocation);
+ // Job
+ addNetworkEventHandler("vrr.arrivedAtJobRouteLocation", playerArrivedAtJobRouteLocation);
- // Client
- addNetworkEventHandler("vrr.clientReady", playerClientReady);
- addNetworkEventHandler("vrr.guiReady", playerGUIReady);
- addNetworkEventHandler("vrr.clientStarted", playerClientStarted);
- addNetworkEventHandler("vrr.clientStopped", playerClientStopped);
+ // Client
+ addNetworkEventHandler("vrr.clientReady", playerClientReady);
+ addNetworkEventHandler("vrr.guiReady", playerGUIReady);
+ addNetworkEventHandler("vrr.clientStarted", playerClientStarted);
+ addNetworkEventHandler("vrr.clientStopped", playerClientStopped);
- // Account
- addNetworkEventHandler("vrr.checkLogin", checkLogin);
- addNetworkEventHandler("vrr.checkRegistration", checkRegistration);
- addNetworkEventHandler("vrr.checkResetPassword", checkAccountResetPasswordRequest);
- addNetworkEventHandler("vrr.checkChangePassword", checkAccountChangePassword);
+ // Account
+ addNetworkEventHandler("vrr.checkLogin", checkLogin);
+ addNetworkEventHandler("vrr.checkRegistration", checkRegistration);
+ addNetworkEventHandler("vrr.checkResetPassword", checkAccountResetPasswordRequest);
+ addNetworkEventHandler("vrr.checkChangePassword", checkAccountChangePassword);
- // Developer
- addNetworkEventHandler("vrr.runCodeSuccess", clientRunCodeSuccess);
- addNetworkEventHandler("vrr.runCodeFail", clientRunCodeFail);
+ // Developer
+ addNetworkEventHandler("vrr.runCodeSuccess", clientRunCodeSuccess);
+ addNetworkEventHandler("vrr.runCodeFail", clientRunCodeFail);
- // SubAccount
- addNetworkEventHandler("vrr.checkNewCharacter", checkNewCharacter);
- addNetworkEventHandler("vrr.nextCharacter", checkNextCharacter);
- addNetworkEventHandler("vrr.previousCharacter", checkPreviousCharacter);
- addNetworkEventHandler("vrr.selectCharacter", selectCharacter);
+ // SubAccount
+ addNetworkEventHandler("vrr.checkNewCharacter", checkNewCharacter);
+ addNetworkEventHandler("vrr.nextCharacter", checkNextCharacter);
+ addNetworkEventHandler("vrr.previousCharacter", checkPreviousCharacter);
+ addNetworkEventHandler("vrr.selectCharacter", selectCharacter);
- // Item
- addNetworkEventHandler("vrr.itemActionDelayComplete", playerItemActionDelayComplete);
- addNetworkEventHandler("vrr.weaponDamage", playerDamagedByPlayer);
+ // Item
+ addNetworkEventHandler("vrr.itemActionDelayComplete", playerItemActionDelayComplete);
+ addNetworkEventHandler("vrr.weaponDamage", playerDamagedByPlayer);
- // Misc
- addNetworkEventHandler("vrr.plr.pos", updatePositionInPlayerData);
- addNetworkEventHandler("vrr.plr.rot", updateHeadingInPlayerData);
- addNetworkEventHandler("vrr.skinSelected", playerFinishedSkinSelection);
- addNetworkEventHandler("vrr.clientInfo", updateConnectionLogOnClientInfoReceive);
- addNetworkEventHandler("vrr.vehBuyState", receiveVehiclePurchaseStateUpdateFromClient);
- addNetworkEventHandler("vrr.playerPedId", receivePlayerPedNetworkId);
+ // Misc
+ addNetworkEventHandler("vrr.plr.pos", updatePositionInPlayerData);
+ addNetworkEventHandler("vrr.plr.rot", updateHeadingInPlayerData);
+ addNetworkEventHandler("vrr.skinSelected", playerFinishedSkinSelection);
+ addNetworkEventHandler("vrr.clientInfo", updateConnectionLogOnClientInfoReceive);
+ addNetworkEventHandler("vrr.vehBuyState", receiveVehiclePurchaseStateUpdateFromClient);
+ addNetworkEventHandler("vrr.playerPedId", receivePlayerPedNetworkId);
+ addNetworkEventHandler("vrr.playerCop", setPlayerAsCopState);
}
// ===========================================================================
function updatePlayerNameTag(client) {
- //logToConsole(LOG_DEBUG, `[VRR.Client] Sending ${getPlayerDisplayForConsole(client)}'s updated nametag to all players`);
+ //logToConsole(LOG_DEBUG, `[VRR.Client] Sending ${getPlayerDisplayForConsole(client)}'s updated nametag to all players`);
sendNetworkEventToPlayer("vrr.nametag", null, getPlayerName(client), getPlayerNameForNameTag(client), getPlayerColour(client), getPlayerData(client).afk, getPlayerPing(client));
}
// ===========================================================================
function updateAllPlayerNameTags() {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending updated nametags to all players`);
- let clients = getClients();
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending updated nametags to all players`);
+ let clients = getClients();
for(let i in clients) {
- updatePlayerNameTag(clients[i]);
- }
+ updatePlayerNameTag(clients[i]);
+ }
}
// ===========================================================================
function updatePlayerPing(client) {
- //logToConsole(LOG_DEBUG, `[VRR.Client] Sending ${getPlayerDisplayForConsole(client)}'s ping to all players`);
+ //logToConsole(LOG_DEBUG, `[VRR.Client] Sending ${getPlayerDisplayForConsole(client)}'s ping to all players`);
sendNetworkEventToPlayer("vrr.ping", null, getPlayerName(client), client.ping);
}
@@ -114,7 +115,7 @@ function playerClientReady(client) {
function playerGUIReady(client) {
setEntityData(client, "vrr.guiReady", true, false);
- logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)}'s client GUI is initialized and ready!`);
+ logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)}'s client GUI is initialized and ready!`);
}
// ===========================================================================
@@ -130,37 +131,37 @@ function playerClientStarted(client) {
// ===========================================================================
function playerClientStopped(client) {
- logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)}'s client resources have stopped (possibly error?). Kicking them from the server ...`);
+ logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)}'s client resources have stopped (possibly error?). Kicking them from the server ...`);
client.disconnect();
}
// ===========================================================================
-function showGameMessage(client, text, colour, duration) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Showing game message to ${getPlayerDisplayForConsole(client)} (${text}) for ${duration} milliseconds`);
- sendNetworkEventToPlayer("vrr.smallGameMessage", client, text, colour, duration);
+function showGameMessage(client, text, colour, duration, fontName = "Pricedown") {
+ logToConsole(LOG_DEBUG, `[VRR.Client] Showing game message to ${getPlayerDisplayForConsole(client)} (${text}) for ${duration} milliseconds`);
+ sendNetworkEventToPlayer("vrr.smallGameMessage", client, text, colour, duration);
}
// ===========================================================================
function enableCityAmbienceForPlayer(client, clearElements = false) {
- //if(server.getCVar("civilians") == false) {
- // return false;
- //}
+ //if(server.getCVar("civilians") == false) {
+ // return false;
+ //}
- //logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s city ambience to ${toUpperCase(getOnOffFromBool(false))}`);
- //sendNetworkEventToPlayer("vrr.ambience", client, true);
+ //logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s city ambience to ${toUpperCase(getOnOffFromBool(false))}`);
+ //sendNetworkEventToPlayer("vrr.ambience", client, true);
}
// ===========================================================================
function disableCityAmbienceForPlayer(client, clearElements = false) {
- //if(server.getCVar("civilians") == true) {
- // return false;
- //}
+ //if(server.getCVar("civilians") == true) {
+ // return false;
+ //}
- //logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s city ambience to ${toUpperCase(getOnOffFromBool(false))}`);
- //sendNetworkEventToPlayer("vrr.ambience", client, false, clearElements);
+ //logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s city ambience to ${toUpperCase(getOnOffFromBool(false))}`);
+ //sendNetworkEventToPlayer("vrr.ambience", client, false, clearElements);
}
// ===========================================================================
@@ -173,30 +174,30 @@ function clearPlayerOwnedPeds(client) {
// ===========================================================================
function updatePlayerSpawnedState(client, state) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s spawned state ${toUpperCase(getOnOffFromBool(state))}`);
- getPlayerData(client).spawned = true;
- sendNetworkEventToPlayer("vrr.spawned", client, state);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s spawned state ${toUpperCase(getOnOffFromBool(state))}`);
+ getPlayerData(client).spawned = true;
+ sendNetworkEventToPlayer("vrr.spawned", client, state);
}
// ===========================================================================
function setPlayerControlState(client, state) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s control state ${toUpperCase(getOnOffFromBool(state))}`);
- sendNetworkEventToPlayer("vrr.control", client, state, !state);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s control state ${toUpperCase(getOnOffFromBool(state))}`);
+ sendNetworkEventToPlayer("vrr.control", client, state, !state);
}
// ===========================================================================
function updatePlayerShowLogoState(client, state) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s logo state ${toUpperCase(getOnOffFromBool(state))}`);
- sendNetworkEventToPlayer("vrr.logo", client, state);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s logo state ${toUpperCase(getOnOffFromBool(state))}`);
+ sendNetworkEventToPlayer("vrr.logo", client, state);
}
// ===========================================================================
function restorePlayerCamera(client) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Restoring ${getPlayerDisplayForConsole(client)}'s camera`);
- sendNetworkEventToPlayer("vrr.restoreCamera", client);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Restoring ${getPlayerDisplayForConsole(client)}'s camera`);
+ sendNetworkEventToPlayer("vrr.restoreCamera", client);
}
// ===========================================================================
@@ -208,484 +209,485 @@ function setPlayer2DRendering(client, hudState = false, labelState = false, smal
// ===========================================================================
function syncPlayerProperties(client) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to sync ${getPlayerDisplayForConsole(client)}'s player ped properties`);
- sendNetworkEventToPlayer("vrr.player.sync", null, client.player);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to sync ${getPlayerDisplayForConsole(client)}'s player ped properties`);
+ sendNetworkEventToPlayer("vrr.syncElement", null, getPlayerPed(client).id);
}
// ===========================================================================
function updatePlayerSnowState(client) {
- if(isSnowSupported(getServerGame())) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s snow state (Falling: ${toUpperCase(getOnOffFromBool(getServerConfig().fallingSnow))}, Ground: ${toUpperCase(getOnOffFromBool(getServerConfig().groundSnow))})`);
- sendNetworkEventToPlayer("vrr.snow", client, getServerConfig().fallingSnow, getServerConfig().groundSnow);
- }
+ if(isSnowSupported(getServerGame())) {
+ logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s snow state (Falling: ${toUpperCase(getOnOffFromBool(getServerConfig().fallingSnow))}, Ground: ${toUpperCase(getOnOffFromBool(getServerConfig().groundSnow))})`);
+ sendNetworkEventToPlayer("vrr.snow", client, getServerConfig().fallingSnow, getServerConfig().groundSnow);
+ }
}
// ===========================================================================
function updatePlayerHotBar(client) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending updated hotbar data to ${getPlayerDisplayForConsole(client)}`);
- let tempHotBarItems = [];
- for(let i in getPlayerData(client).hotBarItems) {
- let itemImage = "";
- let itemValue = 0;
- let itemExists = false;
- if(getPlayerData(client).hotBarItems[i] != -1) {
- if(getItemData(getPlayerData(client).hotBarItems[i])) {
- let itemData = getItemData(getPlayerData(client).hotBarItems[i]);
- let itemTypeData = getItemTypeData(itemData.itemTypeIndex);
- itemExists = true;
- itemImage = itemTypeData.hotbarImage;
- itemValue = itemData.value;
- }
- }
- tempHotBarItems.push([i, itemExists, itemImage, itemValue]);
- }
- sendNetworkEventToPlayer("vrr.hotbar", client, getPlayerData(client).activeHotBarSlot, tempHotBarItems);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending updated hotbar data to ${getPlayerDisplayForConsole(client)}`);
+ let tempHotBarItems = [];
+ for(let i in getPlayerData(client).hotBarItems) {
+ let itemImage = "";
+ let itemValue = 0;
+ let itemExists = false;
+ if(getPlayerData(client).hotBarItems[i] != -1) {
+ if(getItemData(getPlayerData(client).hotBarItems[i])) {
+ let itemData = getItemData(getPlayerData(client).hotBarItems[i]);
+ let itemTypeData = getItemTypeData(itemData.itemTypeIndex);
+ itemExists = true;
+ itemImage = itemTypeData.hotbarImage;
+ itemValue = itemData.value;
+ }
+ }
+ tempHotBarItems.push([i, itemExists, itemImage, itemValue]);
+ }
+ sendNetworkEventToPlayer("vrr.hotbar", client, getPlayerData(client).activeHotBarSlot, tempHotBarItems);
}
// ===========================================================================
function setPlayerWeaponDamageEnabled(client, state) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending weapon damage state for ${getPlayerDisplayForConsole(client)} to all players`);
- sendNetworkEventToPlayer("vrr.weaponDamageEnabled", null, getPlayerName(client), state);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending weapon damage state for ${getPlayerDisplayForConsole(client)} to all players`);
+ sendNetworkEventToPlayer("vrr.weaponDamageEnabled", null, getPlayerName(client), state);
}
// ===========================================================================
function setPlayerWeaponDamageEvent(client, eventType) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending weapon damage event (${eventType}) for ${getPlayerDisplayForConsole(client)} to all players`);
- sendNetworkEventToPlayer("vrr.weaponDamageEvent", null, getPlayerName(client), eventType);
- getPlayerData(client).weaponDamageEvent = eventType;
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending weapon damage event (${eventType}) for ${getPlayerDisplayForConsole(client)} to all players`);
+ sendNetworkEventToPlayer("vrr.weaponDamageEvent", null, getPlayerName(client), eventType);
+ getPlayerData(client).weaponDamageEvent = eventType;
}
// ===========================================================================
function sendJobRouteLocationToPlayer(client, position, colour) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending job route stop data to ${getPlayerDisplayForConsole(client)}`);
- sendNetworkEventToPlayer("vrr.showJobRouteLocation", client, position, colour);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending job route stop data to ${getPlayerDisplayForConsole(client)}`);
+ sendNetworkEventToPlayer("vrr.showJobRouteLocation", client, position, colour);
}
// ===========================================================================
function showPlayerChangePasswordGUI(client) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending change password GUI signal to ${getPlayerDisplayForConsole(client)}`);
- sendNetworkEventToPlayer("vrr.changePassword", client);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending change password GUI signal to ${getPlayerDisplayForConsole(client)}`);
+ sendNetworkEventToPlayer("vrr.changePassword", client);
}
// ===========================================================================
function showPlayerLoginSuccessGUI(client) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending login success GUI signal to ${getPlayerDisplayForConsole(client)}`);
- sendNetworkEventToPlayer("vrr.loginSuccess", client);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending login success GUI signal to ${getPlayerDisplayForConsole(client)}`);
+ sendNetworkEventToPlayer("vrr.loginSuccess", client);
}
// ===========================================================================
function showPlayerLoginFailedGUI(client, errorMessage) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending login failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
- sendNetworkEventToPlayer("vrr.loginFailed", client, errorMessage);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending login failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
+ sendNetworkEventToPlayer("vrr.loginFailed", client, errorMessage);
}
// ===========================================================================
function showPlayerRegistrationSuccessGUI(client) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending registration success GUI signal to ${getPlayerDisplayForConsole(client)}`);
- sendNetworkEventToPlayer("vrr.registrationSuccess", client);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending registration success GUI signal to ${getPlayerDisplayForConsole(client)}`);
+ sendNetworkEventToPlayer("vrr.registrationSuccess", client);
}
// ===========================================================================
function showPlayerRegistrationFailedGUI(client, errorMessage) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending registration failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
- sendNetworkEventToPlayer("vrr.registrationFailed", client, errorMessage);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending registration failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
+ sendNetworkEventToPlayer("vrr.registrationFailed", client, errorMessage);
}
// ===========================================================================
function sendPlayerGUIColours(client) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending GUI colours to ${getPlayerDisplayForConsole(client)}`);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending GUI colours to ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.guiColour", client, getServerConfig().guiColourPrimary[0], getServerConfig().guiColourPrimary[1], getServerConfig().guiColourPrimary[2], getServerConfig().guiColourSecondary[0], getServerConfig().guiColourSecondary[1], getServerConfig().guiColourSecondary[2], getServerConfig().guiTextColourPrimary[0], getServerConfig().guiTextColourPrimary[1], getServerConfig().guiTextColourPrimary[2]);
}
// ===========================================================================
function sendPlayerGUIInit(client) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending GUI init signal to ${getPlayerDisplayForConsole(client)}`);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending GUI init signal to ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.guiInit", client);
}
// ===========================================================================
function showPlayerLoginGUI(client, errorMessage = "") {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending show login GUI signal to ${getPlayerDisplayForConsole(client)}`);
- sendNetworkEventToPlayer("vrr.showLogin", client);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending show login GUI signal to ${getPlayerDisplayForConsole(client)}`);
+ sendNetworkEventToPlayer("vrr.showLogin", client);
}
// ===========================================================================
function showPlayerRegistrationGUI(client, errorMessage = "") {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending show registration GUI signal to ${getPlayerDisplayForConsole(client)}`);
- sendNetworkEventToPlayer("vrr.showRegistration", client);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending show registration GUI signal to ${getPlayerDisplayForConsole(client)}`);
+ sendNetworkEventToPlayer("vrr.showRegistration", client);
}
// ===========================================================================
function showPlayerNewCharacterGUI(client) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending show new character GUI signal to ${getPlayerDisplayForConsole(client)}`);
- sendNetworkEventToPlayer("vrr.showNewCharacter", client);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending show new character GUI signal to ${getPlayerDisplayForConsole(client)}`);
+ sendNetworkEventToPlayer("vrr.showNewCharacter", client);
}
// ===========================================================================
function showPlayerChangePasswordGUI(client, errorMessage = "") {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending show change password GUI signal to ${getPlayerDisplayForConsole(client)}`);
- sendNetworkEventToPlayer("vrr.showChangePassword", client);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending show change password GUI signal to ${getPlayerDisplayForConsole(client)}`);
+ sendNetworkEventToPlayer("vrr.showChangePassword", client);
}
// ===========================================================================
function showPlayerResetPasswordCodeInputGUI(client) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending show reset password GUI signal to ${getPlayerDisplayForConsole(client)}`);
- sendNetworkEventToPlayer("vrr.showResetPasswordCodeInput", client);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending show reset password GUI signal to ${getPlayerDisplayForConsole(client)}`);
+ sendNetworkEventToPlayer("vrr.showResetPasswordCodeInput", client);
}
// ===========================================================================
function showPlayerCharacterSelectGUI(client, firstName, lastName, cash, clan, lastPlayed, skin) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending character select GUI signal to ${getPlayerDisplayForConsole(client)}`);
- sendNetworkEventToPlayer("vrr.showCharacterSelect", client, firstName, lastName, cash, clan, lastPlayed, skin);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending character select GUI signal to ${getPlayerDisplayForConsole(client)}`);
+ sendNetworkEventToPlayer("vrr.showCharacterSelect", client, firstName, lastName, cash, clan, lastPlayed, skin);
}
// ===========================================================================
function updatePlayerCharacterSelectGUI(client, firstName, lastName, cash, clan, lastPlayed, skin) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending update character select GUI signal to ${getPlayerDisplayForConsole(client)}`);
- sendNetworkEventToPlayer("vrr.switchCharacterSelect", client, firstName, lastName, cash, clan, lastPlayed, skin);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending update character select GUI signal to ${getPlayerDisplayForConsole(client)}`);
+ sendNetworkEventToPlayer("vrr.switchCharacterSelect", client, firstName, lastName, cash, clan, lastPlayed, skin);
}
// ===========================================================================
function showPlayerCharacterSelectSuccessGUI(client) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending character select success GUI signal to ${getPlayerDisplayForConsole(client)}`);
- sendNetworkEventToPlayer("vrr.characterSelectSuccess", client);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending character select success GUI signal to ${getPlayerDisplayForConsole(client)}`);
+ sendNetworkEventToPlayer("vrr.characterSelectSuccess", client);
}
// ===========================================================================
function showPlayerCharacterSelectFailedGUI(client) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending character select failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
- sendNetworkEventToPlayer("vrr.characterSelectFailed", client);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending character select failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
+ sendNetworkEventToPlayer("vrr.characterSelectFailed", client);
}
// ===========================================================================
function showPlayerPromptGUI(client, promptMessage, promptTitle, yesButtonText, noButtonText) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending show prompt GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${promptTitle}, Message: ${promptMessage})`);
- sendNetworkEventToPlayer("vrr.showPrompt", client, promptMessage, promptTitle, yesButtonText, noButtonText);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending show prompt GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${promptTitle}, Message: ${promptMessage})`);
+ sendNetworkEventToPlayer("vrr.showPrompt", client, promptMessage, promptTitle, yesButtonText, noButtonText);
}
// ===========================================================================
function showPlayerInfoGUI(client, infoMessage, infoTitle, buttonText = "OK") {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending show info GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${infoTitle}, Message: ${infoMessage})`);
- sendNetworkEventToPlayer("vrr.showInfo", client, infoMessage, infoTitle, buttonText);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending show info GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${infoTitle}, Message: ${infoMessage})`);
+ sendNetworkEventToPlayer("vrr.showInfo", client, infoMessage, infoTitle, buttonText);
}
// ===========================================================================
function showPlayerErrorGUI(client, errorMessage, errorTitle, buttonText = "OK") {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending show error GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${errorTitle}, Message: ${errorMessage})`);
- sendNetworkEventToPlayer("vrr.showInfo", client, errorMessage, errorTitle, buttonText);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending show error GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${errorTitle}, Message: ${errorMessage})`);
+ sendNetworkEventToPlayer("vrr.showInfo", client, errorMessage, errorTitle, buttonText);
}
// ===========================================================================
function sendRunCodeToClient(client, code, returnTo) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending runcode to ${getPlayerDisplayForConsole(client)} (returnTo: ${getPlayerDisplayForConsole(getClientFromIndex(returnTo))}, Code: ${code})`);
- sendNetworkEventToPlayer("vrr.runCode", client, code, returnTo);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending runcode to ${getPlayerDisplayForConsole(client)} (returnTo: ${getPlayerDisplayForConsole(getClientFromIndex(returnTo))}, Code: ${code})`);
+ sendNetworkEventToPlayer("vrr.runCode", client, code, returnTo);
}
// ===========================================================================
function sendPlayerWorkingState(client, state) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending working state (${toUpperCase(getYesNoFromBool(state))}) to ${getPlayerDisplayForConsole(client)}`);
- sendNetworkEventToPlayer("vrr.working", client, state);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending working state (${toUpperCase(getYesNoFromBool(state))}) to ${getPlayerDisplayForConsole(client)}`);
+ sendNetworkEventToPlayer("vrr.working", client, state);
}
// ===========================================================================
function sendPlayerJobType(client, jobType) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending job type (${jobType}) to ${getPlayerDisplayForConsole(client)}`);
- sendNetworkEventToPlayer("vrr.jobType", client, jobType);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending job type (${jobType}) to ${getPlayerDisplayForConsole(client)}`);
+ sendNetworkEventToPlayer("vrr.jobType", client, jobType);
}
// ===========================================================================
function sendPlayerStopJobRoute(client) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to abort job route to ${getPlayerDisplayForConsole(client)}`);
- sendNetworkEventToPlayer("vrr.hideJobRouteLocation", client);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to abort job route to ${getPlayerDisplayForConsole(client)}`);
+ sendNetworkEventToPlayer("vrr.hideJobRouteLocation", client);
}
// ===========================================================================
function sendPlayerMouseCameraToggle(client) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to toggle mouse camera ${getPlayerDisplayForConsole(client)}`);
- sendNetworkEventToPlayer("vrr.mouseCamera", client);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to toggle mouse camera ${getPlayerDisplayForConsole(client)}`);
+ sendNetworkEventToPlayer("vrr.mouseCamera", client);
}
// ===========================================================================
function setPlayerMouseCameraState(client, state) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to toggle mouse camera ${getPlayerDisplayForConsole(client)}`);
- sendNetworkEventToPlayer("vrr.mouseCameraForce", client, state);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to toggle mouse camera ${getPlayerDisplayForConsole(client)}`);
+ sendNetworkEventToPlayer("vrr.mouseCameraForce", client, state);
}
// ===========================================================================
function sendPlayerMouseCursorToggle(client) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to toggle mouse cursor ${getPlayerDisplayForConsole(client)}`);
- sendNetworkEventToPlayer("vrr.mouseCursor", client);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to toggle mouse cursor ${getPlayerDisplayForConsole(client)}`);
+ sendNetworkEventToPlayer("vrr.mouseCursor", client);
}
// ===========================================================================
function sendAddAccountKeyBindToClient(client, key, keyState) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending added keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))}, State: ${(keyState) ? "down" : "up"})`);
- sendNetworkEventToPlayer("vrr.addKeyBind", client, toInteger(key), (keyState) ? KEYSTATE_DOWN : KEYSTATE_UP);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending added keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))}, State: ${(keyState) ? "down" : "up"})`);
+ sendNetworkEventToPlayer("vrr.addKeyBind", client, toInteger(key), (keyState) ? KEYSTATE_DOWN : KEYSTATE_UP);
}
// ===========================================================================
function sendClearKeyBindsToClient(client, key, keyState) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending added keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))}, State: ${(keyState) ? "down" : "up"})`);
- sendNetworkEventToPlayer("vrr.clearKeyBinds", client);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending added keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))}, State: ${(keyState) ? "down" : "up"})`);
+ sendNetworkEventToPlayer("vrr.clearKeyBinds", client);
}
// ===========================================================================
function sendRemoveAccountKeyBindToClient(client, key) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending deleted keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))})`);
- sendNetworkEventToPlayer("vrr.delKeyBind", client, toInteger(key));
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending deleted keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))})`);
+ sendNetworkEventToPlayer("vrr.delKeyBind", client, toInteger(key));
}
// ===========================================================================
function sendPlayerSetPosition(client, position) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending set position signal to ${getPlayerDisplayForConsole(client)} (Position: ${position.x}, ${position.y}, ${position.z})`);
- sendNetworkEventToPlayer("vrr.position", client, position);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending set position signal to ${getPlayerDisplayForConsole(client)} (Position: ${position.x}, ${position.y}, ${position.z})`);
+ sendNetworkEventToPlayer("vrr.position", client, position);
}
// ===========================================================================
function sendPlayerSetHeading(client, heading) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending set heading signal to ${getPlayerDisplayForConsole(client)} (Heading: ${heading})`);
- sendNetworkEventToPlayer("vrr.heading", client, heading);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending set heading signal to ${getPlayerDisplayForConsole(client)} (Heading: ${heading})`);
+ sendNetworkEventToPlayer("vrr.heading", client, heading);
}
// ===========================================================================
function sendPlayerSetInterior(client, interior) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending set interior signal to ${getPlayerDisplayForConsole(client)} (Interior: ${interior})`);
- sendNetworkEventToPlayer("vrr.interior", client, interior);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending set interior signal to ${getPlayerDisplayForConsole(client)} (Interior: ${interior})`);
+ sendNetworkEventToPlayer("vrr.interior", client, interior);
}
// ===========================================================================
function sendPlayerFrozenState(client, state) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending set frozen signal to ${getPlayerDisplayForConsole(client)} (State: ${toUpperCase(getYesNoFromBool(state))})`);
- sendNetworkEventToPlayer("vrr.frozen", client, state);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending set frozen signal to ${getPlayerDisplayForConsole(client)} (State: ${toUpperCase(getYesNoFromBool(state))})`);
+ sendNetworkEventToPlayer("vrr.frozen", client, state);
}
// ===========================================================================
function clearPlayerWeapons(client) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to clear weapons`);
- sendNetworkEventToPlayer("vrr.clearWeapons", client);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to clear weapons`);
+ sendNetworkEventToPlayer("vrr.clearWeapons", client);
}
// ===========================================================================
function showPlayerNewCharacterFailedGUI(client, errorMessage) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending new character failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
- sendNetworkEventToPlayer("vrr.newCharacterFailed", client, errorMessage);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending new character failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
+ sendNetworkEventToPlayer("vrr.newCharacterFailed", client, errorMessage);
}
// ===========================================================================
function sendPlayerRemoveFromVehicle(client) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending remove from vehicle signal to ${getPlayerDisplayForConsole(client)}`);
- sendNetworkEventToPlayer("vrr.removeFromVehicle", client);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Sending remove from vehicle signal to ${getPlayerDisplayForConsole(client)}`);
+ sendNetworkEventToPlayer("vrr.removeFromVehicle", client);
}
// ===========================================================================
function sendChatBoxMessageToPlayer(client, messageText, colour) {
- messageClient(messageText, client, colour);
+ //messageClient(messageText, client, colour);
+ sendNetworkEventToPlayer("m", client, messageText, colour);
}
// ===========================================================================
function showPlayerItemTakeDelay(client, itemId) {
- if(getItemData(itemId)) {
- let delay = getItemTypeData(getItemData(itemId).itemTypeIndex).pickupDelay;
- if(delay > 0) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Showing item TAKE delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
- sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay);
- } else {
- logToConsole(LOG_DEBUG, `[VRR.Client] Showing item TAKE delay to ${getPlayerDisplayForConsole(client)} (instant)`);
- playerItemActionDelayComplete(client);
- }
- }
+ if(getItemData(itemId)) {
+ let delay = getItemTypeData(getItemData(itemId).itemTypeIndex).pickupDelay;
+ if(delay > 0) {
+ logToConsole(LOG_DEBUG, `[VRR.Client] Showing item TAKE delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
+ sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay);
+ } else {
+ logToConsole(LOG_DEBUG, `[VRR.Client] Showing item TAKE delay to ${getPlayerDisplayForConsole(client)} (instant)`);
+ playerItemActionDelayComplete(client);
+ }
+ }
}
// ===========================================================================
function showPlayerItemUseDelay(client, itemSlot) {
- if(getItemData(getPlayerData(client).hotBarItems[itemSlot])) {
- let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).useDelay;
- if(delay > 0) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Showing item USE delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
- sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay);
- } else {
- logToConsole(LOG_DEBUG, `[VRR.Client] Showing item USE delay to ${getPlayerDisplayForConsole(client)} (instant)`);
- playerItemActionDelayComplete(client);
- }
- }
+ if(getItemData(getPlayerData(client).hotBarItems[itemSlot])) {
+ let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).useDelay;
+ if(delay > 0) {
+ logToConsole(LOG_DEBUG, `[VRR.Client] Showing item USE delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
+ sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay);
+ } else {
+ logToConsole(LOG_DEBUG, `[VRR.Client] Showing item USE delay to ${getPlayerDisplayForConsole(client)} (instant)`);
+ playerItemActionDelayComplete(client);
+ }
+ }
}
// ===========================================================================
function showPlayerItemDropDelay(client, itemSlot) {
- if(getItemData(getPlayerData(client).hotBarItems[itemSlot])) {
- let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).dropDelay;
- if(delay > 0) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Showing item DROP delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
- sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay);
- } else {
- logToConsole(LOG_DEBUG, `[VRR.Client] Showing item DROP delay to ${getPlayerDisplayForConsole(client)} (instant)`);
- playerItemActionDelayComplete(client);
- }
- }
+ if(getItemData(getPlayerData(client).hotBarItems[itemSlot])) {
+ let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).dropDelay;
+ if(delay > 0) {
+ logToConsole(LOG_DEBUG, `[VRR.Client] Showing item DROP delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
+ sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay);
+ } else {
+ logToConsole(LOG_DEBUG, `[VRR.Client] Showing item DROP delay to ${getPlayerDisplayForConsole(client)} (instant)`);
+ playerItemActionDelayComplete(client);
+ }
+ }
}
// ===========================================================================
function showPlayerItemPickupDelay(client, itemId) {
- if(getItemData(itemId)) {
- let delay = getItemTypeData(getItemData(itemId).itemTypeIndex).pickupDelay;
- if(delay > 0) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PICKUP delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
- sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay);
- } else {
- logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PICKUP delay to ${getPlayerDisplayForConsole(client)} (instant)`);
- playerItemActionDelayComplete(client);
- }
- }
+ if(getItemData(itemId)) {
+ let delay = getItemTypeData(getItemData(itemId).itemTypeIndex).pickupDelay;
+ if(delay > 0) {
+ logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PICKUP delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
+ sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay);
+ } else {
+ logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PICKUP delay to ${getPlayerDisplayForConsole(client)} (instant)`);
+ playerItemActionDelayComplete(client);
+ }
+ }
}
// ===========================================================================
function showPlayerItemPutDelay(client, itemSlot) {
- if(getItemData(getPlayerData(client).hotBarItems[itemSlot])) {
- let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).putDelay;
- if(delay > 0) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PUT delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
- sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay);
- } else {
- logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PUT delay to ${getPlayerDisplayForConsole(client)} (instant)`);
- playerItemActionDelayComplete(client);
- }
- }
+ if(getItemData(getPlayerData(client).hotBarItems[itemSlot])) {
+ let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).putDelay;
+ if(delay > 0) {
+ logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PUT delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
+ sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay);
+ } else {
+ logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PUT delay to ${getPlayerDisplayForConsole(client)} (instant)`);
+ playerItemActionDelayComplete(client);
+ }
+ }
}
// ===========================================================================
function showPlayerItemSwitchDelay(client, itemSlot) {
- if(itemSlot != -1) {
- if(getPlayerData(client).hotBarItems[itemSlot] != -1) {
- let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).switchDelay;
- if(delay > 0) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
- sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay);
- } else{
- logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`);
- playerItemActionDelayComplete(client);
- }
- } else {
- logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`);
- playerItemActionDelayComplete(client);
- }
- } else {
- logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`);
- playerSwitchItem(client, itemSlot);
- }
+ if(itemSlot != -1) {
+ if(getPlayerData(client).hotBarItems[itemSlot] != -1) {
+ let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).switchDelay;
+ if(delay > 0) {
+ logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
+ sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay);
+ } else{
+ logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`);
+ playerItemActionDelayComplete(client);
+ }
+ } else {
+ logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`);
+ playerItemActionDelayComplete(client);
+ }
+ } else {
+ logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`);
+ playerSwitchItem(client, itemSlot);
+ }
}
// ===========================================================================
function sendPlayerDrunkEffect(client, amount, duration) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Setting drunk effect for ${getPlayerDisplayForConsole(client)} to ${amount} for ${duration} milliseconds`);
- sendNetworkEventToPlayer("vrr.drunkEffect", client, amount, duration);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Setting drunk effect for ${getPlayerDisplayForConsole(client)} to ${amount} for ${duration} milliseconds`);
+ sendNetworkEventToPlayer("vrr.drunkEffect", client, amount, duration);
}
// ===========================================================================
function sendPlayerClearPedState(client) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Clearing ped state for ${getPlayerDisplayForConsole(client)}`);
- sendNetworkEventToPlayer("vrr.clearPedState", client);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Clearing ped state for ${getPlayerDisplayForConsole(client)}`);
+ sendNetworkEventToPlayer("vrr.clearPedState", client);
}
// ===========================================================================
function playerDamagedByPlayer(client, damagerEntityName, weaponId, pedPiece, healthLoss) {
- let damagerEntity = getPlayerFromParams(damagerEntityName);
+ let damagerEntity = getPlayerFromParams(damagerEntityName);
- if(isNull(damagerEntity)) {
- logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager entity from ID is null`);
- return false;
- }
+ if(isNull(damagerEntity)) {
+ logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager entity from ID is null`);
+ return false;
+ }
- logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)} was damaged by ${damagerEntity}`);
+ logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)} was damaged by ${damagerEntity}`);
- if(isNull(damagerEntity)) {
- logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager client is INVALID`);
- return false;
- }
+ if(isNull(damagerEntity)) {
+ logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager client is INVALID`);
+ return false;
+ }
- if(!getPlayerData(damagerEntity) || !getPlayerData(client)) {
- logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager's client data is INVALID`);
- return false;
- }
+ if(!getPlayerData(damagerEntity) || !getPlayerData(client)) {
+ logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager's client data is INVALID`);
+ return false;
+ }
- logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager is ${getPlayerDisplayForConsole(damagerEntity)}`);
+ logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager is ${getPlayerDisplayForConsole(damagerEntity)}`);
- switch(getPlayerData(damagerEntity).weaponDamageEvent) {
- case VRR_WEAPON_DAMAGE_EVENT_TAZER:
- logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} is using a tazer`);
- if(!isPlayerTazed(client) && !isPlayerHandCuffed(client) && !isPlayerInAnyVehicle(client)) {
- logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)} was not previously tazed, binded, or in a vehicle. Taze successful`);
- meActionToNearbyPlayers(damagerEntity, `electrifies ${getCharacterFullName(client)} with their tazer`);
- tazePlayer(client);
- }
- break;
+ switch(getPlayerData(damagerEntity).weaponDamageEvent) {
+ case VRR_WEAPON_DAMAGE_EVENT_TAZER:
+ logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} is using a tazer`);
+ if(!isPlayerTazed(client) && !isPlayerHandCuffed(client) && !isPlayerInAnyVehicle(client)) {
+ logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)} was not previously tazed, binded, or in a vehicle. Taze successful`);
+ meActionToNearbyPlayers(damagerEntity, `electrifies ${getCharacterFullName(client)} with their tazer`);
+ tazePlayer(client);
+ }
+ break;
- case VRR_WEAPON_DAMAGE_EVENT_EXTINGUISH:
- break;
+ case VRR_WEAPON_DAMAGE_EVENT_EXTINGUISH:
+ break;
- case VRR_WEAPON_DAMAGE_EVENT_MACE:
- break;
+ case VRR_WEAPON_DAMAGE_EVENT_MACE:
+ break;
- case VRR_WEAPON_DAMAGE_EVENT_NORMAL:
- logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} caused ${healthLoss} damage (damage reduction makes it ${(healthLoss*getPlayerData(client).incomingDamageMultiplier)})`);
- setPlayerHealth(client, getPlayerHealth(client)-(healthLoss*getPlayerData(client).incomingDamageMultiplier));
- break;
+ case VRR_WEAPON_DAMAGE_EVENT_NORMAL:
+ logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} caused ${healthLoss} damage (damage reduction makes it ${(healthLoss*getPlayerData(client).incomingDamageMultiplier)})`);
+ setPlayerHealth(client, getPlayerHealth(client)-(healthLoss*getPlayerData(client).incomingDamageMultiplier));
+ break;
- default:
- logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} caused ${healthLoss} damage (damage reduction makes it ${(healthLoss*getPlayerData(client).incomingDamageMultiplier)})`);
- setPlayerHealth(client, getPlayerHealth(client)-(healthLoss*getPlayerData(client).incomingDamageMultiplier));
- break;
- }
+ default:
+ logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} caused ${healthLoss} damage (damage reduction makes it ${(healthLoss*getPlayerData(client).incomingDamageMultiplier)})`);
+ setPlayerHealth(client, getPlayerHealth(client)-(healthLoss*getPlayerData(client).incomingDamageMultiplier));
+ break;
+ }
}
// ===========================================================================
@@ -703,44 +705,44 @@ function sendTimeMinuteDurationToPlayer(client, minuteDuration) {
// ===========================================================================
function updatePositionInPlayerData(client, position) {
- getPlayerData(client).syncPosition = position;
+ getPlayerData(client).syncPosition = position;
}
// ===========================================================================
function updateHeadingInPlayerData(client, heading) {
- getPlayerData(client).syncHeading = heading;
+ getPlayerData(client).syncHeading = heading;
}
// ===========================================================================
function updatePositionInVehicleData(client, vehicle, position) {
- getVehicleData(vehicle).syncPosition = position;
+ getVehicleData(vehicle).syncPosition = position;
}
// ===========================================================================
function updateHeadingInVehicleData(client, vehicle, heading) {
- getVehicleData(vehicle).syncHeading = heading;
+ getVehicleData(vehicle).syncHeading = heading;
}
// ===========================================================================
function forcePlayerIntoSkinSelect(client) {
- if(getGameConfig().skinChangePosition[getServerGame()].length > 0) {
- getPlayerData(client).returnToPosition = getPlayerPosition(client);
- getPlayerData(client).returnToHeading = getPlayerHeading(client);
- getPlayerData(client).returnToInterior = getPlayerInterior(client);
- getPlayerData(client).returnToDimension = getPlayerDimension(client);
- getPlayerData(client).returnToType = VRR_RETURNTO_TYPE_SKINSELECT;
+ if(getGameConfig().skinChangePosition[getServerGame()].length > 0) {
+ getPlayerData(client).returnToPosition = getPlayerPosition(client);
+ getPlayerData(client).returnToHeading = getPlayerHeading(client);
+ getPlayerData(client).returnToInterior = getPlayerInterior(client);
+ getPlayerData(client).returnToDimension = getPlayerDimension(client);
+ getPlayerData(client).returnToType = VRR_RETURNTO_TYPE_SKINSELECT;
- setPlayerPosition(client, getGameConfig().skinChangePosition[getServerGame()][0]);
- setPlayerHeading(client, getGameConfig().skinChangePosition[getServerGame()][1]);
- setPlayerInterior(client, getGameConfig().skinChangePosition[getServerGame()][2]);
- setPlayerDimension(client, client.index+500);
- }
+ setPlayerPosition(client, getGameConfig().skinChangePosition[getServerGame()][0]);
+ setPlayerHeading(client, getGameConfig().skinChangePosition[getServerGame()][1]);
+ setPlayerInterior(client, getGameConfig().skinChangePosition[getServerGame()][2]);
+ setPlayerDimension(client, client.index+500);
+ }
- sendNetworkEventToPlayer("vrr.skinSelect", client, true);
+ sendNetworkEventToPlayer("vrr.skinSelect", client, true);
}
// ===========================================================================
@@ -866,297 +868,313 @@ function sendAllFuelStationBlips(client) {
// ===========================================================================
function sendPlayerSetHealth(client, health) {
- sendNetworkEventToPlayer("vrr.health", client, health);
+ sendNetworkEventToPlayer("vrr.health", client, health);
}
// ===========================================================================
function sendPlayerSetArmour(client, armour) {
- sendNetworkEventToPlayer("vrr.armour", client, armour);
+ sendNetworkEventToPlayer("vrr.armour", client, armour);
}
// ===========================================================================
function playerFinishedSkinSelection(client, allowedSkinIndex) {
- sendNetworkEventToPlayer("vrr.skinSelect", client, false);
- if(allowedSkinIndex == -1) {
- messagePlayerAlert(client, "You canceled the skin change.");
- restorePlayerCamera(client);
+ sendNetworkEventToPlayer("vrr.skinSelect", client, false);
+ if(allowedSkinIndex == -1) {
+ messagePlayerAlert(client, "You canceled the skin change.");
+ restorePlayerCamera(client);
- if(getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == VRR_RETURNTO_TYPE_SKINSELECT) {
- setPlayerPosition(client, getPlayerData(client).returnToPosition);
- setPlayerHeading(client, getPlayerData(client).returnToHeading);
- setPlayerInterior(client, getPlayerData(client).returnToInterior);
- setPlayerDimension(client, getPlayerData(client).returnToDimension);
+ if(getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == VRR_RETURNTO_TYPE_SKINSELECT) {
+ setPlayerPosition(client, getPlayerData(client).returnToPosition);
+ setPlayerHeading(client, getPlayerData(client).returnToHeading);
+ setPlayerInterior(client, getPlayerData(client).returnToInterior);
+ setPlayerDimension(client, getPlayerData(client).returnToDimension);
- getPlayerData(client).returnToPosition = null;
- getPlayerData(client).returnToHeading = null;
- getPlayerData(client).returnToInterior = null;
- getPlayerData(client).returnToDimension = null;
- }
- return false;
- } else {
- getPlayerCurrentSubAccount(client).skin = getSkinIndexFromModel(allowedSkins[allowedSkinIndex][0]);
- if(isPlayerWorking(client)) {
- messagePlayerAlert(client, "Your new skin has been saved but won't be shown until you stop working.");
- setPlayerSkin(client, getJobData(getPlayerCurrentSubAccount(client).job).uniforms[getPlayerData(client).jobUniform].skinId);
- } else {
- setPlayerSkin(client, getPlayerCurrentSubAccount(client).skin);
- }
+ getPlayerData(client).returnToPosition = null;
+ getPlayerData(client).returnToHeading = null;
+ getPlayerData(client).returnToInterior = null;
+ getPlayerData(client).returnToDimension = null;
+ }
+ return false;
+ } else {
+ getPlayerCurrentSubAccount(client).skin = getSkinIndexFromModel(allowedSkins[allowedSkinIndex][0]);
+ if(isPlayerWorking(client)) {
+ messagePlayerAlert(client, "Your new skin has been saved but won't be shown until you stop working.");
+ setPlayerSkin(client, getJobData(getPlayerCurrentSubAccount(client).job).uniforms[getPlayerData(client).jobUniform].skinId);
+ } else {
+ setPlayerSkin(client, getPlayerCurrentSubAccount(client).skin);
+ }
- if(getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == VRR_RETURNTO_TYPE_SKINSELECT) {
- setPlayerPosition(client, getPlayerData(client).returnToPosition);
- setPlayerHeading(client, getPlayerData(client).returnToHeading);
- setPlayerInterior(client, getPlayerData(client).returnToInterior);
- setPlayerDimension(client, getPlayerData(client).returnToDimension);
+ if(getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == VRR_RETURNTO_TYPE_SKINSELECT) {
+ setPlayerPosition(client, getPlayerData(client).returnToPosition);
+ setPlayerHeading(client, getPlayerData(client).returnToHeading);
+ setPlayerInterior(client, getPlayerData(client).returnToInterior);
+ setPlayerDimension(client, getPlayerData(client).returnToDimension);
- getPlayerData(client).returnToPosition = null;
- getPlayerData(client).returnToHeading = null;
- getPlayerData(client).returnToInterior = null;
- getPlayerData(client).returnToDimension = null;
- }
+ getPlayerData(client).returnToPosition = null;
+ getPlayerData(client).returnToHeading = null;
+ getPlayerData(client).returnToInterior = null;
+ getPlayerData(client).returnToDimension = null;
+ }
- restorePlayerCamera(client);
- setPlayerControlState(client, true);
+ restorePlayerCamera(client);
+ setPlayerControlState(client, true);
- deleteItem(getPlayerData(client).itemActionItem);
- switchPlayerActiveHotBarSlot(client, -1);
- cachePlayerHotBarItems(client);
+ deleteItem(getPlayerData(client).itemActionItem);
+ switchPlayerActiveHotBarSlot(client, -1);
+ cachePlayerHotBarItems(client);
- meActionToNearbyPlayers(client, `changes their skin to ${allowedSkins[allowedSkinIndex][1]}`);
- }
+ meActionToNearbyPlayers(client, `changes their skin to ${allowedSkins[allowedSkinIndex][1]}`);
+ }
}
// ===========================================================================
function sendPlayerChatScrollLines(client, amount) {
- sendNetworkEventToPlayer("vrr.chatScrollLines", client, amount);
+ sendNetworkEventToPlayer("vrr.chatScrollLines", client, amount);
+}
+
+// ===========================================================================
+
+function sendPlayerChatAutoHideDelay(client, delay) {
+ sendNetworkEventToPlayer("vrr.chatAutoHideDelay", client, delay);
}
// ===========================================================================
function playRadioStreamForPlayer(client, streamURL, loop = true, volume = 0, element = false) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Forcing ${getPlayerDisplayForConsole(client)} to stream ${streamURL}`);
- sendNetworkEventToPlayer("vrr.radioStream", client, streamURL, loop, volume, element);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Forcing ${getPlayerDisplayForConsole(client)} to stream ${streamURL}`);
+ sendNetworkEventToPlayer("vrr.radioStream", client, streamURL, loop, volume, element);
}
// ===========================================================================
function playAudioFileForPlayer(client, audioName, loop = true, volume = 0, element = false) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Forcing ${getPlayerDisplayForConsole(client)} to play audio ${audioName}`);
- sendNetworkEventToPlayer("vrr.audioFileStream", client, audioName, loop, volume);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Forcing ${getPlayerDisplayForConsole(client)} to play audio ${audioName}`);
+ sendNetworkEventToPlayer("vrr.audioFileStream", client, audioName, loop, volume);
}
// ===========================================================================
function stopRadioStreamForPlayer(client) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Forcing ${getPlayerDisplayForConsole(client)} to stop their radio stream`);
- sendNetworkEventToPlayer("vrr.stopRadioStream", client);
+ logToConsole(LOG_DEBUG, `[VRR.Client] Forcing ${getPlayerDisplayForConsole(client)} to stop their radio stream`);
+ sendNetworkEventToPlayer("vrr.stopRadioStream", client);
}
// ===========================================================================
function setPlayerStreamingRadioVolume(client, volumeLevel, elementId = false) {
- getPlayerData(client).accountData.streamingRadioVolume = volumeLevel;
- getPlayerData(client).streamingRadioElement = elementId;
- sendNetworkEventToPlayer("vrr.radioVolume", client, volumeLevel, elementId);
+ getPlayerData(client).accountData.streamingRadioVolume = volumeLevel;
+ getPlayerData(client).streamingRadioElement = elementId;
+ sendNetworkEventToPlayer("vrr.radioVolume", client, volumeLevel, elementId);
}
// ===========================================================================
function setVehicleLightsState(vehicle, state) {
setEntityData(vehicle, "vrr.lights", getVehicleData(vehicle).lights);
- sendNetworkEventToPlayer("vrr.veh.lights", null, vehicle.id, state);
+ sendNetworkEventToPlayer("vrr.veh.lights", null, vehicle.id, state);
}
// ===========================================================================
function sendPlayerEnterPropertyKey(client, key) {
- sendNetworkEventToPlayer("vrr.enterPropertyKey", client, key);
+ sendNetworkEventToPlayer("vrr.enterPropertyKey", client, key);
}
// ===========================================================================
function makePedPlayAnimation(ped, animationSlot, positionOffset) {
- let animationData = getAnimationData(animationSlot);
- let freezePlayer = false;
- //if(animationData[9] != VRR_ANIMMOVE_NONE) {
- switch(animationData[9]) {
- case VRR_ANIMMOVE_FORWARD:
- setElementCollisionsEnabled(ped, false);
- setElementPosition(ped, getPosInFrontOfPos(getElementPosition(ped), fixAngle(getElementHeading(ped)), positionOffset));
- freezePlayer = true;
- break;
-
- case VRR_ANIMMOVE_BACK:
- setElementCollisionsEnabled(ped, false);
- setElementPosition(ped, getPosBehindPos(getElementPosition(ped), fixAngle(getElementHeading(ped)), positionOffset));
- freezePlayer = true;
- break;
-
- case VRR_ANIMMOVE_LEFT:
- setElementCollisionsEnabled(ped, false);
- setElementPosition(ped, getPosToLeftOfPos(getElementPosition(ped), fixAngle(getElementHeading(ped)), positionOffset));
- freezePlayer = true;
- break;
-
- case VRR_ANIMMOVE_RIGHT:
- setElementCollisionsEnabled(ped, false);
- setElementPosition(ped, getPosToRightOfPos(getElementPosition(ped), fixAngle(getElementHeading(ped)), positionOffset));
- freezePlayer = true;
- break;
- }
- //}
- sendNetworkEventToPlayer("vrr.pedAnim", null, ped.id, animationData[1], animationData[2], animationData[3], animationData[4], animationData[5], positionOffset, freezePlayer);
+ setEntityData(ped, "vrr.anim", animationSlot, true);
+ sendNetworkEventToPlayer("vrr.pedAnim", null, getPedForNetworkEvent(ped), animationSlot, positionOffset);
}
// ===========================================================================
-function makePedStopAnimation(pedId) {
- sendNetworkEventToPlayer("vrr.pedStopAnim", null, pedId);
+function makePedStopAnimation(ped) {
+ removeEntityData(ped, "vrr.anim");
+ sendNetworkEventToPlayer("vrr.pedStopAnim", null, getPedForNetworkEvent(ped));
}
// ===========================================================================
-function forcePedAnimation(ped, animationSlot) {
- let animationData = getAnimationData(animationSlot);
-
- sendNetworkEventToPlayer("vrr.forcePedAnim", null, ped.id, animationData[1], animationData[2], animationData[3], animationData[4]);
+function forcePedAnimation(ped, animationSlot, positionOffset = 0) {
+ addEntityData(ped, "vrr.anim", animationSlot, true);
+ sendNetworkEventToPlayer("vrr.forcePedAnim", null, getPedForNetworkEvent(ped), animationSlot, positionOffset);
}
// ===========================================================================
function hideAllPlayerGUI(client) {
- sendNetworkEventToPlayer("vrr.hideAllGUI", client);
+ sendNetworkEventToPlayer("vrr.hideAllGUI", client);
}
// ===========================================================================
function requestClientInfo(client) {
- sendNetworkEventToPlayer("vrr.clientInfo", client);
+ sendNetworkEventToPlayer("vrr.clientInfo", client);
}
// ===========================================================================
function updateInteriorLightsForPlayer(client, state) {
- sendNetworkEventToPlayer("vrr.interiorLights", client, state);
+ sendNetworkEventToPlayer("vrr.interiorLights", client, state);
}
// ===========================================================================
function forcePlayerToSyncElementProperties(client, element) {
- sendNetworkEventToPlayer("vrr.syncElement", client, element.id);
+ sendNetworkEventToPlayer("vrr.syncElement", client, element.id);
}
// ===========================================================================
function sendPlayerPedPartsAndProps(client) {
- let bodyParts = getPlayerCurrentSubAccount(client).bodyParts;
- let bodyProps = getPlayerCurrentSubAccount(client).bodyProps;
+ let bodyParts = getPlayerCurrentSubAccount(client).bodyParts;
+ let bodyProps = getPlayerCurrentSubAccount(client).bodyProps;
- sendNetworkEventToPlayer("vrr.ped", client, [bodyParts.hair, bodyParts.head, bodyParts.upper, bodyParts.lower], [bodyProps.hair, bodyProps.eyes, bodyProps.head, bodyProps.leftHand, bodyProps.rightHand, bodyProps.leftWrist, bodyProps.rightWrist, bodyParts.hip, bodyProps.leftFoot, bodyProps.rightFoot]);
-}
-
-// ===========================================================================
-
-function forcePlayerWantedLevel(client, wantedLevel) {
- sendNetworkEventToPlayer("vrr.wantedLevel", client, wantedLevel);
- return true;
+ sendNetworkEventToPlayer("vrr.ped", client, [bodyParts.hair, bodyParts.head, bodyParts.upper, bodyParts.lower], [bodyProps.hair, bodyProps.eyes, bodyProps.head, bodyProps.leftHand, bodyProps.rightHand, bodyProps.leftWrist, bodyProps.rightWrist, bodyParts.hip, bodyProps.leftFoot, bodyProps.rightFoot]);
}
// ===========================================================================
function onPlayerNearPickup(client, pickupId) {
- getPlayerData(client).currentPickup = getElementFromId(pickupId);
+ getPlayerData(client).currentPickup = getElementFromId(pickupId);
}
// ===========================================================================
function updateAllInteriorVehiclesForPlayer(client, interior, dimension) {
- for(let i in getServerData().vehicles) {
- if(getServerData().vehicles[i].vehicle != false) {
- if(getServerData().vehicles[i].interior == interior && getServerData().vehicles[i].dimension == dimension) {
- forcePlayerToSyncElementProperties(client, getServerData().vehicles[i].vehicle);
- }
- }
- }
+ for(let i in getServerData().vehicles) {
+ if(getServerData().vehicles[i].vehicle != false) {
+ if(getServerData().vehicles[i].interior == interior && getServerData().vehicles[i].dimension == dimension) {
+ forcePlayerToSyncElementProperties(client, getServerData().vehicles[i].vehicle);
+ }
+ }
+ }
}
// ===========================================================================
function setPlayerBuyingVehicleState(client, state, vehicleId, position) {
- if(getGlobalConfig().useServerSideVehiclePurchaseCheck == false) {
- sendNetworkEventToPlayer("vrr.vehBuyState", client, state, vehicleId, position);
- }
+ if(getGlobalConfig().useServerSideVehiclePurchaseCheck == false) {
+ sendNetworkEventToPlayer("vrr.vehBuyState", client, state, vehicleId, position);
+ }
}
// ==========================================================================
function receiveVehiclePurchaseStateUpdateFromClient(client, state) {
- if(getGlobalConfig().useServerSideVehiclePurchaseCheck == false) {
- checkVehicleBuying(client);
- }
+ if(getGlobalConfig().useServerSideVehiclePurchaseCheck == false) {
+ checkVehicleBuying(client);
+ }
}
// ===========================================================================
function sendPlayerLogLevel(client, tempLogLevel = logLevel) {
- sendNetworkEventToPlayer("vrr.logLevel", client, tempLogLevel);
+ sendNetworkEventToPlayer("vrr.logLevel", client, tempLogLevel);
}
// ==========================================================================
function setPlayerInfiniteRun(client, state) {
- sendNetworkEventToPlayer("vrr.infiniteRun", client, state);
+ sendNetworkEventToPlayer("vrr.infiniteRun", client, state);
}
// ==========================================================================
function sendBusinessToPlayer(client, businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems) {
- sendNetworkEventToPlayer("vrr.business", client, businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems);
+ sendNetworkEventToPlayer("vrr.business", client, businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems);
}
// ==========================================================================
function sendHouseToPlayer(client, houseId, entrancePosition, blipModel, pickupModel, hasInterior) {
- sendNetworkEventToPlayer("vrr.house", client, houseId, entrancePosition, blipModel, pickupModel, hasInterior);
+ sendNetworkEventToPlayer("vrr.house", client, houseId, entrancePosition, blipModel, pickupModel, hasInterior);
}
// ==========================================================================
function sendAllBusinessesToPlayer(client) {
- let businesses = getServerData().businesses;
- for(let i in businesses) {
- sendBusinessToPlayer(client, businesses[i].index, businesses[i].name, businesses[i].entrancePosition, businesses[i].entranceBlipModel, businesses[i].entrancePickupModel, businesses[i].hasInterior, false);
- }
+ let businesses = getServerData().businesses;
+ for(let i in businesses) {
+ sendBusinessToPlayer(client, businesses[i].index, businesses[i].name, businesses[i].entrancePosition, businesses[i].entranceBlipModel, businesses[i].entrancePickupModel, businesses[i].hasInterior, false);
+ }
}
// ==========================================================================
function sendAllHousesToPlayer(client) {
- let houses = getServerData().houses;
- for(let i in houses) {
- sendHouseToPlayer(client, houses[i].index, houses[i].entrancePosition, houses[i].entranceBlipModel, houses[i].entrancePickupModel, houses[i].hasInterior);
- }
+ let houses = getServerData().houses;
+ for(let i in houses) {
+ sendHouseToPlayer(client, houses[i].index, houses[i].entrancePosition, houses[i].entranceBlipModel, houses[i].entrancePickupModel, houses[i].hasInterior);
+ }
+}
+
+// ==========================================================================
+
+function sendAllJobsToPlayer(client) {
+ //let jobs = getServerData().jobs;
+ //for(let i in jobs) {
+ // for(let j in jobs[i].locations) {
+ // sendJobToPlayer(client, jobs[i].index, jobs[i].name, jobs[i].locations[j].position, jobs[i].blipModel);
+ // }
+ //}
}
// ==========================================================================
function makePlayerHoldObjectModel(client, modelIndex) {
- sendNetworkEventToPlayer("vrr.holdObject", client, getPlayerData(client).ped, modelIndex);
+ sendNetworkEventToPlayer("vrr.holdObject", client, getPlayerData(client).ped, modelIndex);
}
// ==========================================================================
function receivePlayerPedNetworkId(client, pedId) {
- getPlayerData(client).ped = pedId;
+ getPlayerData(client).ped = pedId;
}
// ==========================================================================
function requestPlayerPedNetworkId(client) {
- sendNetworkEventToPlayer("vrr.playerPedId", client);
+ sendNetworkEventToPlayer("vrr.playerPedId", client);
+}
+
+// ==========================================================================
+
+function setPlayerInCutsceneInterior(client, cutsceneName) {
+ getPlayerData(client).interiorCutscene = cutsceneName;
+ sendNetworkEventToPlayer("vrr.cutsceneInterior", client, cutsceneName);
+}
+
+// ==========================================================================
+
+function makePlayerPedSpeak(client, pedSpeechName) {
+ sendNetworkEventToPlayer("vrr.pedSpeak", client, pedSpeechName);
+}
+
+// ==========================================================================
+
+function setPlayerAsCopState(client, state) {
+ sendNetworkEventToPlayer("vrr.playerCop", client, state);
+}
+
+// ==========================================================================
+
+function tellPlayerToSpawn(client, skinId, position) {
+ sendNetworkEventToPlayer("vrr.spawn", client, skinId, position);
+}
+
+// ==========================================================================
+
+function sendPlayerLocaleStrings(client) {
+ let strings = getGlobalConfig().locale.sendStringsToClient;
+ for(let i in strings) {
+ sendNetworkEventToPlayer("vrr.localeString", client, strings[i], getLocaleString(client, strings[i]));
+ }
}
// ==========================================================================
\ No newline at end of file
diff --git a/scripts/server/command.js b/scripts/server/command.js
index c577d396..7f90d0e6 100644
--- a/scripts/server/command.js
+++ b/scripts/server/command.js
@@ -11,582 +11,609 @@ let serverCommands = [];
// ===========================================================================
-let builtInCommands = [
- "refresh",
- "restart",
- "stop",
- "start",
- "reconnect",
- "setname",
- "connect",
- "disconnect",
- "say",
- "dumpdoc",
-];
-
-// ===========================================================================
-
function initCommandScript() {
- logToConsole(LOG_INFO, "[VRR.Command]: Initializing commands script ...");
- serverCommands = loadCommands();
- //addAllCommandHandlers();
- logToConsole(LOG_INFO, "[VRR.Command]: Initialized commands script!");
+ logToConsole(LOG_INFO, "[VRR.Command]: Initializing commands script ...");
+ serverCommands = loadCommands();
+ cacheAllCommandsAliases(serverCommands);
+ addAllCommandHandlers();
+ logToConsole(LOG_INFO, "[VRR.Command]: Initialized commands script!");
}
// ===========================================================================
function loadCommands() {
- let tempCommands = {
- accent: [
- commandData("accent", setAccentCommand, "", getStaffFlagValue("None"), false, false, "Sets your character's accent"),
- commandData("accents", listAccentsCommand, "", getStaffFlagValue("None"), false, false, "Shows a list of all available accents"),
- commandData("accentlist", listAccentsCommand, "", getStaffFlagValue("None"), false, false, "Shows a list of all available accents"),
- ],
- account: [
- commandData("login", loginCommand, "", getStaffFlagValue("None"), false, false, "Login to an account"),
- commandData("register", registerCommand, "", getStaffFlagValue("None"), false, false, "Creates an account"),
- commandData("changepass", changeAccountPasswordCommand, " ", getStaffFlagValue("None"), true, false, "Change an account password"),
- commandData("iplogin", toggleAutoLoginByIPCommand, "", getStaffFlagValue("None"), true, false, "Toggle whether to automatically login if you join with the same IP as your last join"),
- commandData("autolastchar", toggleAutoSelectLastCharacterCommand, "", getStaffFlagValue("None"), true, false, "Toggle whether to automatically spawn with the last character you played as"),
- commandData("gui", toggleAccountGUICommand, "", getStaffFlagValue("None"), false, false, "Toggle whether to use GUI. If GUI is disabled on the server, it won't show even if you have GUI enabled."),
- commandData("2fa", toggleAccountTwoFactorAuthCommand, "", getStaffFlagValue("None"), true, false, "Set up and use two-factor authentication."),
- commandData("setemail", setAccountEmailCommand, "", getStaffFlagValue("None"), true, false, "Sets your email. To reset your password, you must have a valid email set and verified."),
- commandData("verifyemail", verifyAccountEmailCommand, "", getStaffFlagValue("None"), true, false, "Confirms/verifies your email."),
- //commandData("setdiscord", setAccountDiscordCommand, "", getStaffFlagValue("None"), true, false, "Set up the integration for discord. Allows you to see info and use in-game commands on discord."),
- commandData("notips", toggleNoRandomTipsCommand, "", getStaffFlagValue("None"), true, false, "Turn on and off random tips"),
- commandData("loginalert", toggleAccountLoginAttemptNotificationsCommand, "", getStaffFlagValue("None"), true, false, "Turn on and off email notifications for attempts to login to your account"),
- commandData("scrolllines", setAccountChatScrollLinesCommand, "", getStaffFlagValue("None"), true, false, "Sets how many chatbox lines to scroll at a time when using pageup/pagedown"),
+ let tempCommands = {
+ accent: [
+ new CommandData("accent", setAccentCommand, "", getStaffFlagValue("None"), false, false, "Sets your character's accent"),
+ new CommandData("accents", listAccentsCommand, "", getStaffFlagValue("None"), false, false, "Shows a list of all available accents"),
+ new CommandData("accentlist", listAccentsCommand, "", getStaffFlagValue("None"), false, false, "Shows a list of all available accents"),
+ ],
+ account: [
+ new CommandData("login", loginCommand, "", getStaffFlagValue("None"), false, false, "Login to an account"),
+ new CommandData("register", registerCommand, "", getStaffFlagValue("None"), false, false, "Creates an account"),
+ new CommandData("changepass", changeAccountPasswordCommand, " ", getStaffFlagValue("None"), true, false, "Change an account password"),
+ new CommandData("iplogin", toggleAutoLoginByIPCommand, "", getStaffFlagValue("None"), true, false, "Toggle whether to automatically login if you join with the same IP as your last join"),
+ new CommandData("autolastchar", toggleAutoSelectLastCharacterCommand, "", getStaffFlagValue("None"), true, false, "Toggle whether to automatically spawn with the last character you played as"),
+ new CommandData("gui", toggleAccountGUICommand, "", getStaffFlagValue("None"), false, false, "Toggle whether to use GUI. If GUI is disabled on the server, it won't show even if you have GUI enabled."),
+ new CommandData("2fa", toggleAccountTwoFactorAuthCommand, "", getStaffFlagValue("None"), true, false, "Set up and use two-factor authentication."),
+ new CommandData("setemail", setAccountEmailCommand, "", getStaffFlagValue("None"), true, false, "Sets your email. To reset your password, you must have a valid email set and verified."),
+ new CommandData("verifyemail", verifyAccountEmailCommand, "", getStaffFlagValue("None"), true, false, "Confirms/verifies your email."),
+ //new CommandData("setdiscord", setAccountDiscordCommand, "", getStaffFlagValue("None"), true, false, "Set up the integration for discord. Allows you to see info and use in-game commands on discord."),
+ new CommandData("notips", toggleNoRandomTipsCommand, "", getStaffFlagValue("None"), true, false, "Turn on and off random tips"),
+ new CommandData("loginalert", toggleAccountLoginAttemptNotificationsCommand, "", getStaffFlagValue("None"), true, false, "Turn on and off email notifications for attempts to login to your account"),
+ new CommandData("scrolllines", setAccountChatScrollLinesCommand, "", getStaffFlagValue("None"), true, false, "Sets how many chatbox lines to scroll at a time when using pageup/pagedown"),
+ new CommandData("chatautohide", setAccountChatAutoHideDelayCommand, "