Compare commits
291 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
17c3daddd7 | ||
|
|
b228981e05 | ||
|
|
ba624f13c3 | ||
|
|
8350edac74 | ||
|
|
4cf72b610e | ||
|
|
833f8872e2 | ||
|
|
0b564d66e8 | ||
|
|
45ea3bd1ce | ||
|
|
700e928bcc | ||
|
|
5044f6466e | ||
|
|
db40be7577 | ||
|
|
268a3a5f60 | ||
|
|
df05c18499 | ||
|
|
5862349117 | ||
|
|
0703ccb1a3 | ||
|
|
f9d1e8c384 | ||
|
|
cab6eace3a | ||
|
|
e1c82789d7 | ||
|
|
eae9e8266b | ||
|
|
2aefa09340 | ||
|
|
01ba414e9c | ||
|
|
fdf2d4a02f | ||
|
|
b1f9042b96 | ||
|
|
757df5db86 | ||
|
|
20d8b17099 | ||
|
|
39ec134b25 | ||
|
|
79812375f1 | ||
|
|
95abb20b5e | ||
|
|
44895aa2d0 | ||
|
|
cf0c578699 | ||
|
|
d144ef954d | ||
|
|
c091cb249a | ||
|
|
d7eb7d3e3a | ||
|
|
160090674a | ||
|
|
0e32d8bed8 | ||
|
|
2e75230d38 | ||
|
|
0f49ebfa63 | ||
|
|
7f1ab3a3e4 | ||
|
|
afed90a2eb | ||
|
|
3eda3acef7 | ||
|
|
c75ef6b89a | ||
|
|
a817db618b | ||
|
|
455e87bd87 | ||
|
|
98fda983a5 | ||
|
|
1eac24669f | ||
|
|
bc95fff5d3 | ||
|
|
82ced29c71 | ||
|
|
86906cbf6b | ||
|
|
b0c91a9d4e | ||
|
|
c67b0a8dad | ||
|
|
a9498f19ea | ||
|
|
54663dac0d | ||
|
|
ee4d4e3621 | ||
|
|
49dd7c0e21 | ||
|
|
775333f788 | ||
|
|
f0536caf4e | ||
|
|
e2d6973ba1 | ||
|
|
6cf4f337e8 | ||
|
|
57b4099037 | ||
|
|
a691949286 | ||
|
|
f14c3e8610 | ||
|
|
6e7a5780cc | ||
|
|
74b766ee58 | ||
|
|
4185f3b17d | ||
|
|
755b0a4867 | ||
|
|
4631e58eda | ||
|
|
16a91ef3b1 | ||
|
|
472136a7fb | ||
|
|
ce6f6e71d1 | ||
|
|
2d25539036 | ||
|
|
08721d1273 | ||
|
|
5360a46485 | ||
|
|
18f27dce8e | ||
|
|
345b8ba1e9 | ||
|
|
8ee9aa2347 | ||
|
|
1d00adb7e3 | ||
|
|
5eb459b308 | ||
|
|
2e2e44566d | ||
|
|
c725852b0b | ||
|
|
583e4c5252 | ||
|
|
0aacfdd818 | ||
|
|
0d57fb3186 | ||
|
|
79893be66f | ||
|
|
d9f4ec7c6f | ||
|
|
9c8593e833 | ||
|
|
bf353c10aa | ||
|
|
5572e0bd93 | ||
|
|
54703e2cd9 | ||
|
|
a691c2a9d0 | ||
|
|
f0291cfe91 | ||
|
|
8df407c2c1 | ||
|
|
9e6bcc0137 | ||
|
|
660d1191f3 | ||
|
|
89ed6d5023 | ||
|
|
b53542fbf6 | ||
|
|
427ecf7ea8 | ||
|
|
0b7fb7bbbd | ||
|
|
eaac0fd1a7 | ||
|
|
eeaf8aae8e | ||
|
|
0f4ce5a7fc | ||
|
|
c26bcb7076 | ||
|
|
71d4bec436 | ||
|
|
bb6a471396 | ||
|
|
0ef0474b2e | ||
|
|
91d21189dc | ||
|
|
6dfb45ff8a | ||
|
|
d5841dc0e6 | ||
|
|
2d3a9dbc4c | ||
|
|
b4d9371db2 | ||
|
|
e072d8d2e4 | ||
|
|
cad6d11a58 | ||
|
|
8e9a92e1c2 | ||
|
|
0d50c48305 | ||
|
|
485d9023c1 | ||
|
|
e1e912ae3c | ||
|
|
34b84aeea0 | ||
|
|
36e2175075 | ||
|
|
84ad138763 | ||
|
|
ab4106e568 | ||
|
|
4948ba8f98 | ||
|
|
94195d95d3 | ||
|
|
4f2c158192 | ||
|
|
f3f2dd0e7d | ||
|
|
d34b10470c | ||
|
|
a715cdcc9f | ||
|
|
e18b7c9b31 | ||
|
|
f0410ca5b8 | ||
|
|
bc548cfae0 | ||
|
|
f9e7597c4c | ||
|
|
472e6c7177 | ||
|
|
8ba392e834 | ||
|
|
d73246dd2b | ||
|
|
a59b4104f1 | ||
|
|
4f6dac29cf | ||
|
|
1e4cf380ff | ||
|
|
c1dedd3620 | ||
|
|
3679d68896 | ||
|
|
fd5efa45bd | ||
|
|
1ad22b48d4 | ||
|
|
01670a29fc | ||
|
|
2d8895b8d7 | ||
|
|
7e7983b74a | ||
|
|
cf5fb4d8f9 | ||
|
|
7ff030727a | ||
|
|
eb8debe48e | ||
|
|
132cb2254e | ||
|
|
c7d8c3734b | ||
|
|
ad8f12b6e3 | ||
|
|
67043af1a7 | ||
|
|
460d9381d3 | ||
|
|
5d61b45ed6 | ||
|
|
64a08ccd37 | ||
|
|
c9cf80e34c | ||
|
|
b24b5d726b | ||
|
|
0d9de6ec30 | ||
|
|
5b6c909b0b | ||
|
|
962334e1b7 | ||
|
|
8e2e5090c5 | ||
|
|
fb038b955b | ||
|
|
7349ab041d | ||
|
|
5942cdf5f2 | ||
|
|
a2999a6c3f | ||
|
|
38cccf88a6 | ||
|
|
22f6ba32af | ||
|
|
962281f5f4 | ||
|
|
338cfb7d38 | ||
|
|
056d35456c | ||
|
|
604f9e7cd9 | ||
|
|
beb9f6cafe | ||
|
|
51d5aba2a1 | ||
|
|
b0652947cc | ||
|
|
e7655f1e70 | ||
|
|
a17923450a | ||
|
|
5c5b255196 | ||
|
|
07af18c64e | ||
|
|
0542a3da5a | ||
|
|
eab0d96e5d | ||
|
|
4464b3f49a | ||
|
|
582fce8757 | ||
|
|
d80f04637c | ||
|
|
40b63b3403 | ||
|
|
47aa32d66f | ||
|
|
ba900addc5 | ||
|
|
be476f5d9c | ||
|
|
024051b9f8 | ||
|
|
a8a173e406 | ||
|
|
853e5e6b3d | ||
|
|
05ca5485f9 | ||
|
|
a7fed8751a | ||
|
|
8326561a58 | ||
|
|
45c5372499 | ||
|
|
1fd99729da | ||
|
|
b7de1e054a | ||
|
|
67b57399f3 | ||
|
|
61c6568641 | ||
|
|
d0a544522f | ||
|
|
b8d19d013a | ||
|
|
e72b54c3d4 | ||
|
|
10b856541f | ||
|
|
0acdf692db | ||
|
|
b84fb4ee9a | ||
|
|
9377ec1129 | ||
|
|
26f3ad8cef | ||
|
|
b01baa7302 | ||
|
|
926dc7bfcd | ||
|
|
655a784d27 | ||
|
|
6ed7cd9bc6 | ||
|
|
b9c5e2b949 | ||
|
|
b81a3db9ff | ||
|
|
f3b7a29f10 | ||
|
|
dbc84950cb | ||
|
|
410f9f5a53 | ||
|
|
5ce4bd15a3 | ||
|
|
a077699648 | ||
|
|
237f3fdc40 | ||
|
|
e27423e72b | ||
|
|
a93d07982c | ||
|
|
ee19f96442 | ||
|
|
1bce0b3e37 | ||
|
|
2ce374c28f | ||
|
|
c0c6e50b9c | ||
|
|
25bdc703c8 | ||
|
|
2979f0fb97 | ||
|
|
9255f38190 | ||
|
|
d4ffc12c9c | ||
|
|
879943767d | ||
|
|
51749606ec | ||
|
|
614e291886 | ||
|
|
617c59e795 | ||
|
|
19c65a11f7 | ||
|
|
c8678bfe8c | ||
|
|
3bd2cfbba2 | ||
|
|
c6b6a4ad68 | ||
|
|
55c257b0a8 | ||
|
|
5cb2e6d83d | ||
|
|
39c023d437 | ||
|
|
7671f1ad7e | ||
|
|
f42d757840 | ||
|
|
806c16bc98 | ||
|
|
2bdc656d57 | ||
|
|
cd6e9fe509 | ||
|
|
56b4cf3658 | ||
|
|
8e4b7d6b2f | ||
|
|
670efb53d6 | ||
|
|
bbfcc56013 | ||
|
|
1304d50f71 | ||
|
|
b5293447c3 | ||
|
|
e9bf890772 | ||
|
|
ca30e94451 | ||
|
|
6f3575790b | ||
|
|
75f2fc90b3 | ||
|
|
09316c3301 | ||
|
|
780b8aacdf | ||
|
|
4de8da0561 | ||
|
|
b711f3ebe1 | ||
|
|
56b1825508 | ||
|
|
5039f5a4f3 | ||
|
|
1896dd956f | ||
|
|
c94a40c2b1 | ||
|
|
65bad453ea | ||
|
|
798a1645ee | ||
|
|
c09ea0073b | ||
|
|
36f47f7009 | ||
|
|
7908c756f7 | ||
|
|
1ebbcb2a86 | ||
|
|
f634acbcb8 | ||
|
|
34e5748df9 | ||
|
|
78959dbef9 | ||
|
|
cdebb12226 | ||
|
|
9e44f4d2fa | ||
|
|
c4f8afecc0 | ||
|
|
c0963c4e66 | ||
|
|
54c07ccb65 | ||
|
|
fe4dfdcf4e | ||
|
|
526764185c | ||
|
|
c63ec5f4f6 | ||
|
|
d9ab8d3b54 | ||
|
|
5e08ac8dd4 | ||
|
|
c0dee692e0 | ||
|
|
744eca3b9d | ||
|
|
d6f24971ef | ||
|
|
87be1f3b42 | ||
|
|
2f133a456b | ||
|
|
55758854fb | ||
|
|
b2a30f225d | ||
|
|
21eaa4e97d | ||
|
|
ae6a08c457 | ||
|
|
db4967b5d0 | ||
|
|
674006abfd | ||
|
|
c933c32ac3 | ||
|
|
197256da4f |
@@ -7,7 +7,8 @@
|
|||||||
"flagImageFile": "uk.png",
|
"flagImageFile": "uk.png",
|
||||||
"countries": ["gb", "us", "au", "bz", "ca", "ie", "jm", "nz", "za", "tt"],
|
"countries": ["gb", "us", "au", "bz", "ca", "ie", "jm", "nz", "za", "tt"],
|
||||||
"requiresUnicode": false,
|
"requiresUnicode": false,
|
||||||
"contributor": "Vortrex"
|
"contributor": "Vortrex",
|
||||||
|
"enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
@@ -17,7 +18,8 @@
|
|||||||
"flagImageFile": "ru.png",
|
"flagImageFile": "ru.png",
|
||||||
"countries": ["ru", "ua"],
|
"countries": ["ru", "ua"],
|
||||||
"requiresUnicode": false,
|
"requiresUnicode": false,
|
||||||
"contributor": "VNDTTS"
|
"contributor": "VNDTTS",
|
||||||
|
"enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 2,
|
"id": 2,
|
||||||
@@ -27,7 +29,8 @@
|
|||||||
"flagImageFile": "pl.png",
|
"flagImageFile": "pl.png",
|
||||||
"countries": ["pl"],
|
"countries": ["pl"],
|
||||||
"requiresUnicode": false,
|
"requiresUnicode": false,
|
||||||
"contributor": "Suprise444"
|
"contributor": "Suprise444",
|
||||||
|
"enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 3,
|
"id": 3,
|
||||||
@@ -37,7 +40,8 @@
|
|||||||
"flagImageFile": "es.png",
|
"flagImageFile": "es.png",
|
||||||
"countries": ["es", "ar", "bo", "cl", "co", "cr", "do", "ec", "sv", "gt", "hn", "mx", "ni", "pa", "py", "pe", "pr", "uy", "ve"],
|
"countries": ["es", "ar", "bo", "cl", "co", "cr", "do", "ec", "sv", "gt", "hn", "mx", "ni", "pa", "py", "pe", "pr", "uy", "ve"],
|
||||||
"requiresUnicode": false,
|
"requiresUnicode": false,
|
||||||
"contributor": "PerikiyoXD"
|
"contributor": "PerikiyoXD",
|
||||||
|
"enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 4,
|
"id": 4,
|
||||||
@@ -47,7 +51,8 @@
|
|||||||
"flagImageFile": "cn.png",
|
"flagImageFile": "cn.png",
|
||||||
"countries": ["cn", "hk", "sg", "tw"],
|
"countries": ["cn", "hk", "sg", "tw"],
|
||||||
"requiresUnicode": true,
|
"requiresUnicode": true,
|
||||||
"contributor": "Renzuko_Ctone"
|
"contributor": "Renzuko_Ctone",
|
||||||
|
"enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 5,
|
"id": 5,
|
||||||
@@ -57,7 +62,8 @@
|
|||||||
"flagImageFile": "sa.png",
|
"flagImageFile": "sa.png",
|
||||||
"countries": ["dz", "bh", "eg", "iq", "jo", "kw", "lb", "ly", "ma", "om", "qa", "sa", "sy", "tn", "ae", "ye"],
|
"countries": ["dz", "bh", "eg", "iq", "jo", "kw", "lb", "ly", "ma", "om", "qa", "sa", "sy", "tn", "ae", "ye"],
|
||||||
"requiresUnicode": true,
|
"requiresUnicode": true,
|
||||||
"contributor": "! KASIR"
|
"contributor": "! KASIR",
|
||||||
|
"enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 6,
|
"id": 6,
|
||||||
@@ -67,7 +73,8 @@
|
|||||||
"flagImageFile": "sk.png",
|
"flagImageFile": "sk.png",
|
||||||
"countries": ["sk"],
|
"countries": ["sk"],
|
||||||
"requiresUnicode": false,
|
"requiresUnicode": false,
|
||||||
"contributor": "UAKLAUS"
|
"contributor": "UAKLAUS",
|
||||||
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 7,
|
"id": 7,
|
||||||
@@ -77,7 +84,8 @@
|
|||||||
"flagImageFile": "de.png",
|
"flagImageFile": "de.png",
|
||||||
"countries": ["de", "at", "be", "ch", "li", "lu"],
|
"countries": ["de", "at", "be", "ch", "li", "lu"],
|
||||||
"requiresUnicode": false,
|
"requiresUnicode": false,
|
||||||
"contributor": "Sladernimo"
|
"contributor": "Sladernimo",
|
||||||
|
"enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 8,
|
"id": 8,
|
||||||
@@ -87,7 +95,8 @@
|
|||||||
"flagImageFile": "fr.png",
|
"flagImageFile": "fr.png",
|
||||||
"countries": ["fr", "cd", "bj", "bf", "cd", "cg", "ga", "gn", "ml", "mc", "ne", "sn"],
|
"countries": ["fr", "cd", "bj", "bf", "cd", "cg", "ga", "gn", "ml", "mc", "ne", "sn"],
|
||||||
"requiresUnicode": false,
|
"requiresUnicode": false,
|
||||||
"contributor": "Cocam"
|
"contributor": "Cocam",
|
||||||
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 9,
|
"id": 9,
|
||||||
@@ -97,7 +106,8 @@
|
|||||||
"flagImageFile": "jp.png",
|
"flagImageFile": "jp.png",
|
||||||
"countries": ["jp"],
|
"countries": ["jp"],
|
||||||
"requiresUnicode": true,
|
"requiresUnicode": true,
|
||||||
"contributor": "Cocam"
|
"contributor": "Cocam",
|
||||||
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10,
|
"id": 10,
|
||||||
@@ -107,6 +117,29 @@
|
|||||||
"flagImageFile": "fi.png",
|
"flagImageFile": "fi.png",
|
||||||
"countries": ["fi"],
|
"countries": ["fi"],
|
||||||
"requiresUnicode": false,
|
"requiresUnicode": false,
|
||||||
"contributor": "SIMBA_MEOW"
|
"contributor": "SIMBA_MEOW",
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 11,
|
||||||
|
"englishName": "Lithuanian",
|
||||||
|
"stringsFile": "lithuanian.json",
|
||||||
|
"isoCode": "lt",
|
||||||
|
"flagImageFile": "lt.png",
|
||||||
|
"countries": ["lt"],
|
||||||
|
"requiresUnicode": false,
|
||||||
|
"contributor": "dovis",
|
||||||
|
"enabled": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 12,
|
||||||
|
"englishName": "Latvian",
|
||||||
|
"stringsFile": "latvian.json",
|
||||||
|
"isoCode": "lv",
|
||||||
|
"flagImageFile": "lv.png",
|
||||||
|
"countries": ["lv"],
|
||||||
|
"requiresUnicode": false,
|
||||||
|
"contributor": "YuOn",
|
||||||
|
"enabled": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
"applyUpkeep": true,
|
"applyUpkeep": true,
|
||||||
"grossIncomeMultiplier": 1.0,
|
"grossIncomeMultiplier": 1.0,
|
||||||
"incomeTaxRate": 0.7,
|
"incomeTaxRate": 0.7,
|
||||||
|
"currencyString": "${AMOUNT}",
|
||||||
"upKeepCosts": {
|
"upKeepCosts": {
|
||||||
"upKeepPerVehicle": 250,
|
"upKeepPerVehicle": 250,
|
||||||
"upKeepPerHouse": 350,
|
"upKeepPerHouse": 350,
|
||||||
|
|||||||
@@ -11,7 +11,8 @@
|
|||||||
"flagImageFile": "uk.png",
|
"flagImageFile": "uk.png",
|
||||||
"countries": ["gb", "us", "au", "bz", "ca", "ie", "jm", "nz", "za", "tt"],
|
"countries": ["gb", "us", "au", "bz", "ca", "ie", "jm", "nz", "za", "tt"],
|
||||||
"requiresUnicode": false,
|
"requiresUnicode": false,
|
||||||
"contributor": "Vortrex"
|
"contributor": "Vortrex",
|
||||||
|
"enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
@@ -21,7 +22,8 @@
|
|||||||
"flagImageFile": "ru.png",
|
"flagImageFile": "ru.png",
|
||||||
"countries": ["ru", "ua"],
|
"countries": ["ru", "ua"],
|
||||||
"requiresUnicode": false,
|
"requiresUnicode": false,
|
||||||
"contributor": "VNDTTS"
|
"contributor": "VNDTTS",
|
||||||
|
"enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 2,
|
"id": 2,
|
||||||
@@ -31,7 +33,8 @@
|
|||||||
"flagImageFile": "pl.png",
|
"flagImageFile": "pl.png",
|
||||||
"countries": ["pl"],
|
"countries": ["pl"],
|
||||||
"requiresUnicode": false,
|
"requiresUnicode": false,
|
||||||
"contributor": "Suprise444"
|
"contributor": "Suprise444",
|
||||||
|
"enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 3,
|
"id": 3,
|
||||||
@@ -41,7 +44,8 @@
|
|||||||
"flagImageFile": "es.png",
|
"flagImageFile": "es.png",
|
||||||
"countries": ["es", "ar", "bo", "cl", "co", "cr", "do", "ec", "sv", "gt", "hn", "mx", "ni", "pa", "py", "pe", "pr", "uy", "ve"],
|
"countries": ["es", "ar", "bo", "cl", "co", "cr", "do", "ec", "sv", "gt", "hn", "mx", "ni", "pa", "py", "pe", "pr", "uy", "ve"],
|
||||||
"requiresUnicode": false,
|
"requiresUnicode": false,
|
||||||
"contributor": "PerikiyoXD"
|
"contributor": "PerikiyoXD",
|
||||||
|
"enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 4,
|
"id": 4,
|
||||||
@@ -51,7 +55,8 @@
|
|||||||
"flagImageFile": "cn.png",
|
"flagImageFile": "cn.png",
|
||||||
"countries": ["cn", "hk", "sg", "tw"],
|
"countries": ["cn", "hk", "sg", "tw"],
|
||||||
"requiresUnicode": true,
|
"requiresUnicode": true,
|
||||||
"contributor": "Renzuko_Ctone"
|
"contributor": "Renzuko_Ctone",
|
||||||
|
"enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 5,
|
"id": 5,
|
||||||
@@ -61,7 +66,8 @@
|
|||||||
"flagImageFile": "sa.png",
|
"flagImageFile": "sa.png",
|
||||||
"countries": ["dz", "bh", "eg", "iq", "jo", "kw", "lb", "ly", "ma", "om", "qa", "sa", "sy", "tn", "ae", "ye"],
|
"countries": ["dz", "bh", "eg", "iq", "jo", "kw", "lb", "ly", "ma", "om", "qa", "sa", "sy", "tn", "ae", "ye"],
|
||||||
"requiresUnicode": true,
|
"requiresUnicode": true,
|
||||||
"contributor": "! KASIR"
|
"contributor": "! KASIR",
|
||||||
|
"enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 6,
|
"id": 6,
|
||||||
@@ -71,7 +77,8 @@
|
|||||||
"flagImageFile": "sk.png",
|
"flagImageFile": "sk.png",
|
||||||
"countries": ["sk"],
|
"countries": ["sk"],
|
||||||
"requiresUnicode": false,
|
"requiresUnicode": false,
|
||||||
"contributor": "UAKLAUS"
|
"contributor": "UAKLAUS",
|
||||||
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 7,
|
"id": 7,
|
||||||
@@ -81,7 +88,8 @@
|
|||||||
"flagImageFile": "de.png",
|
"flagImageFile": "de.png",
|
||||||
"countries": ["de", "at", "be", "ch", "li", "lu"],
|
"countries": ["de", "at", "be", "ch", "li", "lu"],
|
||||||
"requiresUnicode": false,
|
"requiresUnicode": false,
|
||||||
"contributor": "Sladernimo"
|
"contributor": "Sladernimo",
|
||||||
|
"enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 8,
|
"id": 8,
|
||||||
@@ -91,7 +99,8 @@
|
|||||||
"flagImageFile": "fr.png",
|
"flagImageFile": "fr.png",
|
||||||
"countries": ["fr", "cd", "bj", "bf", "cd", "cg", "ga", "gn", "ml", "mc", "ne", "sn"],
|
"countries": ["fr", "cd", "bj", "bf", "cd", "cg", "ga", "gn", "ml", "mc", "ne", "sn"],
|
||||||
"requiresUnicode": false,
|
"requiresUnicode": false,
|
||||||
"contributor": "Cocam"
|
"contributor": "Cocam",
|
||||||
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 9,
|
"id": 9,
|
||||||
@@ -101,7 +110,8 @@
|
|||||||
"flagImageFile": "jp.png",
|
"flagImageFile": "jp.png",
|
||||||
"countries": ["jp"],
|
"countries": ["jp"],
|
||||||
"requiresUnicode": true,
|
"requiresUnicode": true,
|
||||||
"contributor": "Cocam"
|
"contributor": "Cocam",
|
||||||
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10,
|
"id": 10,
|
||||||
@@ -111,7 +121,30 @@
|
|||||||
"flagImageFile": "fi.png",
|
"flagImageFile": "fi.png",
|
||||||
"countries": ["fi"],
|
"countries": ["fi"],
|
||||||
"requiresUnicode": false,
|
"requiresUnicode": false,
|
||||||
"contributor": "SIMBA_MEOW"
|
"contributor": "SIMBA_MEOW",
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 11,
|
||||||
|
"englishName": "Lithuanian",
|
||||||
|
"stringsFile": "lithuanian.json",
|
||||||
|
"isoCode": "lt",
|
||||||
|
"flagImageFile": "lt.png",
|
||||||
|
"countries": ["lt"],
|
||||||
|
"requiresUnicode": false,
|
||||||
|
"contributor": "dovis",
|
||||||
|
"enabled": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 12,
|
||||||
|
"englishName": "Latvian",
|
||||||
|
"stringsFile": "latvian.json",
|
||||||
|
"isoCode": "lv",
|
||||||
|
"flagImageFile": "lv.png",
|
||||||
|
"countries": ["lv"],
|
||||||
|
"requiresUnicode": false,
|
||||||
|
"contributor": "YuOn",
|
||||||
|
"enabled": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
BIN
files/fonts/aurora-bold-condensed.ttf
Normal file
BIN
files/fonts/aurora-bold-condensed.ttf
Normal file
Binary file not shown.
BIN
files/images/cursor.png
Normal file
BIN
files/images/cursor.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 476 B |
558
locale/finnish.json
Normal file
558
locale/finnish.json
Normal file
@@ -0,0 +1,558 @@
|
|||||||
|
{
|
||||||
|
"TranslationProvidedBy": "SIMBA_MEOW",
|
||||||
|
"LocaleEnglishName": "Finnish",
|
||||||
|
|
||||||
|
"LocaleNativeName": "Finnish",
|
||||||
|
"LocaleOffer": "Tämä Serveri on nyt käytettävissä suomen kielellä Käytä {1} jotta voit käyttää sitä",
|
||||||
|
"LocaleChanged1": "Sinun kieli on nyt vaihdettu suomeen. {1}",
|
||||||
|
"LocaleChanged2": "Tämä serveri nyt näyttää tekstit suomen kielellä. {1}",
|
||||||
|
"LocaleChangedNote": "Tämä ei vaihda tekstejä muilta pelaajilta.",
|
||||||
|
"AccentsListHeader": "Aksentit",
|
||||||
|
"HelpMainListHeader": "Ohje luokat",
|
||||||
|
"AccentNotFound": "Aksenttia ei löydetty",
|
||||||
|
"AccentSet": "Sinä vaihdoit sinun aksentin{1}",
|
||||||
|
"InvalidAnimation": "Tuo animaatio on väärä.",
|
||||||
|
"AnimationCommandTip": "Käytä {1} että näet listan toimivia animaatioita.",
|
||||||
|
"InvalidAnimationDistance": "etäisyyden pitää olla väliin 0 ja 3",
|
||||||
|
"AnimationStopCommandTip": "Käytä {1} lopettaaksesi animaation",
|
||||||
|
"CantBanClient": "Sinä et voi bannätä tätä pelaajaa",
|
||||||
|
"PlayerAccountBanned": "{1} Käyttäjä on nyt bannätty",
|
||||||
|
"ClanNotFound": "Claania ei löydetty",
|
||||||
|
"ClanNameTaken": "Claani tuolla nimellä on jo otettu",
|
||||||
|
"PlayerNotFound": "Pelaajaa ei löytynyt ",
|
||||||
|
"ClanCantRemoveRanks": "Sinä et voi poistaa tämän claanin rankkejä",
|
||||||
|
"ClanCantAddRanks": "sinä et voi lisätä claani ranksejä",
|
||||||
|
"ClanRankNotFound": "Claanin nimeä ei loytynyt",
|
||||||
|
"ClanCantChangeMemberTag": " Sinä et voi vaihtaa claanin jäsenen tagejä",
|
||||||
|
"ClanPlayerNotInSameClan": "Tuo pelaaja ei ole sinun claanissa.",
|
||||||
|
"ClanCantChangeRankLevel": "Sinä et voi vaihtaa claanin rankin leveleitä",
|
||||||
|
"ClanCantChangeRankTag": "Sinä et voi vaihtaa claanin rankin tägeja",
|
||||||
|
"NameNotRegistered": "Sinun käyttäjä ei ole Rekisteröitu! Käytä {1} että voit tehdä käyttäjän",
|
||||||
|
"AutomaticLoginIPToggle": "Automaatinen Kirjautuminen IP ltä on nyt päällä {1}",
|
||||||
|
"CouldNotRegisterAccount": "tässä oli ongelma luodettasi käyttäjää. Ole hyvä ja kysy adminilta.",
|
||||||
|
"RandomTipsToggle": "Randomi vinkit ovat nyt {1}",
|
||||||
|
"ActionTipsToggle": "toiminta vinkit ovat nyt {1}",
|
||||||
|
"AutoSpawnLastCharToggle": "Automaattinen spawni viimeksi käytettynä hahmo on {1}",
|
||||||
|
"AccountGUISettingToggle": "🖥️ GUI on nyt päällä {1}",
|
||||||
|
"On": "On",
|
||||||
|
"Off": "Off",
|
||||||
|
"Yes": "Kyllä",
|
||||||
|
"No": "Ei",
|
||||||
|
"True": "oikea",
|
||||||
|
"False": "väärin",
|
||||||
|
"Locked": "Lukittu",
|
||||||
|
"Unlocked": "Lukitsematon",
|
||||||
|
"PasswordNotGoodEnough": "Uusi salasana ei täytä vaatimuksia!",
|
||||||
|
"PasswordNeedsBase": "Salasanallasi pitää olla ainakin yksi {1}",
|
||||||
|
"PasswordNeedsCapitals": "{1} ISON alku kirjaimen",
|
||||||
|
"PasswordNeedsNumbers": "{1} Numerot",
|
||||||
|
"PasswordNeedsSymbols": "{1} Symboolit",
|
||||||
|
"PasswordsDontMatch": "Uusi salasana ja salasanan vahvistus eivät ole samat!",
|
||||||
|
"PasswordChanged": "Sinun salasanasi on vaihdettu!",
|
||||||
|
"AutoLoggedInIP": "Olet kirjautunut automaattisesti sisään IP osoitteella!",
|
||||||
|
"WelcomeBack": "Tervetuloa takaisin {1}, {2}! ole hyvä {3} jatkaaksesi.",
|
||||||
|
"WelcomeNewPlayer": "Tervetuloa {1}, {2}! ole hyvä {3} pelataaksesi.",
|
||||||
|
"InvalidPlayer": "Pelaajaa ei löytynyt!",
|
||||||
|
"InvalidBusiness": "Bisnestä ei löytynyt!",
|
||||||
|
"InvalidHouse": "Taloa ei löytynyt!",
|
||||||
|
"InvalidVehicle": "Ajoneuvoa ei löytynyt!",
|
||||||
|
"InvalidClan": "Claania ei löytynyt!",
|
||||||
|
"InvalidClanRank": "Claanin rankkiä ei löytynyt!",
|
||||||
|
"InvalidJob": "Työtä ei löytynyt!",
|
||||||
|
"InvalidItem": "kohdetta ei löytynyt!",
|
||||||
|
"InvalidItemType": "kohteen tyyppiä ei löytynyt!",
|
||||||
|
"InvalidRadioStation": "Radio kanavaa ei löytynyt!",
|
||||||
|
"InvalidGate": "porttia ei löytynyt!",
|
||||||
|
"EntersProperty": "avaa oven ja astuu sisään {1}",
|
||||||
|
"ExitsProperty": "avaa oven ja astuu pois {1}",
|
||||||
|
"EnterExitPropertyDoorLocked": "yrittää avata oven {1} ovi mutta epäonnistuu koska se on lukittu",
|
||||||
|
"PropertyNoInterior": "Tämä {1} ei sisällä sisätilaa, mutta voit silti käyttää komentoja ovikuvakkeessa.",
|
||||||
|
"NoBusinessWithItemType": "täällä ei ole kauppaa kyseisen tuotteen kanssa",
|
||||||
|
"HeaderKeyBinds": "avain sitoo",
|
||||||
|
"HeaderAccountHelp": "Käyttäjä apu",
|
||||||
|
"HeaderVehicleHelp": "ajoneuvo apu",
|
||||||
|
"HeaderVehicleDealershipHelp": "Ajoneuvo liikkeen apu",
|
||||||
|
"HeaderJobHelp": "työ apu",
|
||||||
|
"HeaderChatHelp": "Chatti apu",
|
||||||
|
"HeaderServerRules": "Serverin säännöt",
|
||||||
|
"HeaderWebsiteInfo": "Verkkosivusto",
|
||||||
|
"HeaderDiscordInfo": "Discord",
|
||||||
|
"HeaderAnimationsList": "Animaatioluettelo",
|
||||||
|
"HeaderPayAndSprayHelp": "maksa ja suihkuta apu",
|
||||||
|
"HeaderAmmunationHelp": "Ase kauppa apu",
|
||||||
|
"HeaderVehicleTuneupHelp": "ajoneuvon sävelmä apu",
|
||||||
|
"HeaderBindableKeysHelp": "sidottavat avaimet",
|
||||||
|
"HeaderSkinHelp": "Vaatteet/iho apu",
|
||||||
|
"HeaderBusinessHelp": "Kauppa/bisnes apu",
|
||||||
|
"HeaderClanHelp": "Claanin apu",
|
||||||
|
"HeaderPlayerVehiclesList": "pelaajan ajoneuvot ({1})",
|
||||||
|
"HeaderPlayerBusinessesList": "pelaajan bisnekset ({1})",
|
||||||
|
"HeaderClansList": "Claani Lista",
|
||||||
|
"HeaderAdminsList": "Admini Lista",
|
||||||
|
"HeaderBadgeInfo": "merkki Informaatio",
|
||||||
|
"HeaderAccentsList": "Aksentti Lista",
|
||||||
|
"HeaderPlayerInfo": "Pelaajan Informaatio ({1})",
|
||||||
|
"HeaderWealthandTaxHelp": "varallisuus and verot Informaatio",
|
||||||
|
"HeaderCommandInfo": "komennon Informaatio ({1})",
|
||||||
|
"HeaderRadioHelp": "Radio apu",
|
||||||
|
"HeaderRadioStationsList": "Radio asemat/kanavat",
|
||||||
|
"HeaderKeyBindsList": "avain sitomis Lista",
|
||||||
|
"RadioVolumeChanged": "{1} Sinä vaihdoit sinun radion ääniä to {2}%",
|
||||||
|
"VolumeLevelNotNumber": "Äänenvoimakkuuden on oltava numero",
|
||||||
|
"RadioStationLocationInvalid": "Sinun on oltava ajoneuvossa, talossa tai yrityksessä tai sinulla on oltava henkilökohtainen laite vaihtaaksesi radio asemaa!",
|
||||||
|
"ActionBusinessRadioStationChange": "vaihtaa bisnes radioasemaksi {1} ({2})",
|
||||||
|
"ActionHouseRadioStationChange": "muuttaa talon radioasemaksi {1} ({2})",
|
||||||
|
"ActionVehicleRadioStationChange": "vaihtaa ajoneuvon radioasemaksi {1} ({2})",
|
||||||
|
"ActionItemRadioStationChange": "vaihtaa {1}'s aseman {2} ({3})",
|
||||||
|
"RandomVehicleCommandsDisabled": "Tämä on satunnainen liikenneajoneuvo, eikä siihen voi käyttää komentoja.",
|
||||||
|
"HouseDoorLock": "Talo {1} {2}!",
|
||||||
|
"BusinessDoorLock": "Bisnes {1} {2}!",
|
||||||
|
"ServerGameModeRestarting": "Palvelinpelitila käynnistyy uudelleen!",
|
||||||
|
"HeaderSelfItemList": "Sinun inventoori",
|
||||||
|
"HeaderPlayerItemList": "Pelaajan inventoori ({1})",
|
||||||
|
"HeaderHouseItemList": "Talon inventoori",
|
||||||
|
"HeaderBusinessFloorItemList": "Bisnes Inventoori (myyntiin)",
|
||||||
|
"HeaderBusinessStorageItemList": "Bisnes Inventoori (tila)",
|
||||||
|
"HeaderItemItemList": "{1}'s Inventoori",
|
||||||
|
"ItemSlotNotNumber": "Tuotepaikan on oltava numero",
|
||||||
|
"ItemSlotMustBeBetween": "Tuotepaikan tulee olla välillä {1} ja {2}!",
|
||||||
|
"UseItemBugged": "Kohde, jota yrität käyttää, on viallinen. Virheraportti on lähetetty palvelimen kehittäjille.",
|
||||||
|
"PickupItemBugged": "Tuote, jota yrität ottaa, on viallinen. Virheraportti on lähetetty palvelimen kehittäjille.",
|
||||||
|
"DropItemBugged": "Kohde, jonka yrität pudottaa, on viallinen. Virheraportti on lähetetty palvelimen kehittäjille.",
|
||||||
|
"HandsBusy": "kätesi ovat vararru",
|
||||||
|
"CantUseItemInSkinChange": "Et voi käyttää kohdetta muokkaaessasi ulkonäköäsi",
|
||||||
|
"CantDropItemInSkinChange": "Et voi pudottaa esinettä, kun muokkaat ulkonäköäsi",
|
||||||
|
"CantPickupItemInSkinChange": "Et voi ottaa tuotetta, kun muokkaat ulkonäköäsi",
|
||||||
|
"CantSwitchItemInSkinChange": "Et voi vaihtaa kohdetta muokkaaessasi ulkonäköäsi",
|
||||||
|
"CantGiveItemInSkinChange": "Et voi antaa esinettä, kun muokkaat ulkonäköäsi",
|
||||||
|
"CantTakeItemInSkinChange": "Et voi ottaa esinettä mukauttaessasi ulkonäköäsi",
|
||||||
|
"ItemUnequippableNoAmmo": " {1} paikassa {2} ei ole ammuksia, eikä sitä voi varustaa!",
|
||||||
|
"NoSpaceSelfInventory": "Sinulla ei ole enää tilaa varastossasi",
|
||||||
|
"Business": "bisnes",
|
||||||
|
"House": "talo",
|
||||||
|
"Clan": "claani",
|
||||||
|
"Vehicle": "ajoneuvo",
|
||||||
|
"Item": "kohde",
|
||||||
|
"ItemType": "kohteen tyyppi",
|
||||||
|
"Gate": "portti",
|
||||||
|
"Door": "ovi",
|
||||||
|
"ClanRank": "claan ränkki",
|
||||||
|
"JobRank": "työ ränkki",
|
||||||
|
"RadioStation": "radio kanava",
|
||||||
|
"Months": [
|
||||||
|
"Tammikuu",
|
||||||
|
"Helmikuu",
|
||||||
|
"Maaliskuu",
|
||||||
|
"Huhtikuu",
|
||||||
|
"Toukokuu",
|
||||||
|
"Kesäkuu",
|
||||||
|
"Heinäkuu",
|
||||||
|
"Elokuu",
|
||||||
|
"Syyskuu",
|
||||||
|
"Lokakuu",
|
||||||
|
"Marraskuu",
|
||||||
|
"Joulukuu"
|
||||||
|
],
|
||||||
|
"WeekDays": [
|
||||||
|
"Sunnuntai",
|
||||||
|
"Maanantai",
|
||||||
|
"Tiistai",
|
||||||
|
"Keskiviikko",
|
||||||
|
"Torstai",
|
||||||
|
"Perjantai",
|
||||||
|
"Lauantai"
|
||||||
|
],
|
||||||
|
"CardinalDirections": [
|
||||||
|
"Pohjoinen",
|
||||||
|
"Koilinen",
|
||||||
|
"Itä",
|
||||||
|
"Kaakko",
|
||||||
|
"Etelä",
|
||||||
|
"Lounas",
|
||||||
|
"Länsi",
|
||||||
|
"Luonteinen"
|
||||||
|
],
|
||||||
|
"NewPlayerReadyToPlay": [
|
||||||
|
"Sinulle on annettu rahaa. Käyttää {1} löytää ostopaikkoja.",
|
||||||
|
"Jos tarvitset rahaa, työpaikat ovat keltaisia pisteitä tutkassa.",
|
||||||
|
"Autoa varten käy autoliikkeessä. Voit myös käyttää vuokra-ajoneuvoa spawnin lähellä tai matkustaa junalla",
|
||||||
|
"Muista lukea tämä{1} Ja käyttää {2} tiedoksi"
|
||||||
|
],
|
||||||
|
"YourCurrentVehicleDeleted": "ajoneuvo, jossa olit, poistettiin.",
|
||||||
|
"Distance": "Etäisyys",
|
||||||
|
"Meters": "Metrejä",
|
||||||
|
"Feet": "jalkaa",
|
||||||
|
"Kilometers": "Kilometrejä",
|
||||||
|
"Miles": "Maileja",
|
||||||
|
"MustBeVehicleDriver": "Sinun on oltava ajoneuvon kuljettaja!",
|
||||||
|
"PlayerJoined": "{1} on liittynyt peliin {2}!",
|
||||||
|
"PlayerLeftServer": "{1} poistui pelistä! ({2})",
|
||||||
|
"TakeItemFromHouse": "ottaa {1} talosta",
|
||||||
|
"TakeItemFromBusinessStorage": "ottaa {1} varastosta",
|
||||||
|
"TakeItemFromBusiness": "ottaaa {1} bisneksestä",
|
||||||
|
"TakeItemFromItem": "ottaa {1} {2}",
|
||||||
|
"TakeItemFromVehicleTrunk": "ottaa {1} tavaratilasta",
|
||||||
|
"TakeItemFromVehicleDash": "ottaa {1} hansikaslokerosta",
|
||||||
|
"JobEquipmentInventoryKeyBindTip": "Työvälineet ovat varastossasi. Paina {1} että näet sen",
|
||||||
|
"JobEquipmentInventoryCommandTip": "Työvälineet ovat varastossasi. Käytä {1} että näet sen.",
|
||||||
|
"AccountHelp": [
|
||||||
|
"ÄLÄ jaa salasanaasi kenenkään muun kanssa. {1} henkilökunta ei koskaan kysy sinulta salasanaasi",
|
||||||
|
"Käytä {1} vaihtaaksesi salasanasi ja {2} jos unohdit sen",
|
||||||
|
"Some settings you can use: {1}"
|
||||||
|
],
|
||||||
|
"VehicleHelp": [
|
||||||
|
"Henkilökohtaiset ajoneuvosi säästävät minne sinä tai joku muu jättää ne!",
|
||||||
|
"Vieraile jälleenmyyjissä ostamassa uusia ajoneuvoja (Käytä {1} saadaksesi lisää tietoa)",
|
||||||
|
"Some commands: {1}",
|
||||||
|
"Vieraile mekaanikkokorjaamolla korjaamassa, värjäämässä ja virittämässä autosi! {1} saadaaksesi tietoa"
|
||||||
|
],
|
||||||
|
"VehicleDealershipHelp": [
|
||||||
|
"Vieraile ajoneuvoliikkeessä ostamassa uusia ajoneuvoja. Käytä {1} löytääksesi yhden.",
|
||||||
|
"Jälleenmyyjällä mene auton sisään auto, jonka haluat ostaa, ja hinta näytetään sinulle",
|
||||||
|
"Jos haluat ostaa ajoneuvon, käytä {1}ja sinulle annetaan avaimet koeajeluun parkkipaikalla.",
|
||||||
|
"Aja pois jälleenmyyjältä uudella ajoneuvolla vahvistaaksesi oston."
|
||||||
|
],
|
||||||
|
"JobHelp": [
|
||||||
|
"Vieraile työpaikoilla saadaksesi työtä ja ansaitaksesi rahaa. Etsi kartalta keltaisia pisteitä",
|
||||||
|
"työpaikalla Käytä {1} saadaaksesi työpaikan. Käytä {2} lopettamaan työsi",
|
||||||
|
"Käytä {1} Aloittaaksesi työn. Sinä voit myös saada työn {2} ja {3}",
|
||||||
|
"useimmat työajoneuvot ovat lukittuja. Käytä {1} lähdellä yhtä astuaaksesi autoon.",
|
||||||
|
"Kun astut työajoneuvoon, sinulle näytetään tietoja työn suorittamisesta."
|
||||||
|
],
|
||||||
|
"ChatHelp": [
|
||||||
|
"There are two main types of chat: luonteen vastaisesti (OOC) ja luonteeltaan (IC)",
|
||||||
|
"Näiden kahden tyypin sekoittaminen ei ole oikea roolileikki. Katso {1} saadaaksesi lisää tietoa.",
|
||||||
|
"Some chat commands: {1}",
|
||||||
|
"Joillakin on saatavilla lyhyempiä nimiä ({1} puhua, {2} huutaa jne)"
|
||||||
|
],
|
||||||
|
"ServerRulesHelp": [
|
||||||
|
"Epärealistiset toimet (voimapelaaminen) eivät ole sallittuja. Et ole supermies.",
|
||||||
|
"Terroristin tai terrorismin roolileikkejä ei sallita.",
|
||||||
|
"Noudata aina moderaattorien ja järjestelmänvalvojien antamia ohjeita.",
|
||||||
|
"Älä sekoita keskusteluja (metapelaaminen). Et voi käyttää IC:ssä olevia tietoja, jotka vastaanotettiin OOC",
|
||||||
|
"Pidä englantia pääkeskusteluissa. Jos sinulla ei ole hyvää englantia, käytä {1}"
|
||||||
|
],
|
||||||
|
"AnimationHelp": [
|
||||||
|
"Animaatioiden avulla voit tehostaa roolipeliä visuaalisilla toimilla",
|
||||||
|
"Käytä nimeä {1} tai {2}, jos haluat käyttää animaatiota.",
|
||||||
|
"Näet luettelon animaatioista käyttämällä {1}"
|
||||||
|
],
|
||||||
|
"WeaponHelp": [
|
||||||
|
"Käy aseliikkeessä ostamaan aseita. Käytä {1} löytääksesi sellaisen.",
|
||||||
|
"Aseen ostaminen vaatii aseluvan.",
|
||||||
|
"Poliisilaitos hallinnoi aselupia. Hae siellä saadaksesi sellaisen.",
|
||||||
|
"Aseita voidaan ostaa myös laittomasti joiltakin yrityksiltä, asekauppiailta ja claaneista."
|
||||||
|
],
|
||||||
|
"SkinHelp": [
|
||||||
|
"Käytä vaatekaupassa {1} vaatteiden ostamiseen",
|
||||||
|
"Kun sinulla on vaate, varusta ja käytä sitä kuten mitä tahansa muuta esinettä näyttääksesi ihovalikoiman (katso {1} saadaksesi lisätietoja vaatteiden käytöstä)",
|
||||||
|
"Jotkin skinit on rajoitettu töihin, claaneihin tai muista syistä."
|
||||||
|
],
|
||||||
|
"KeyBindHelp": [
|
||||||
|
"Voit asettaa omat näppäinsidokset. Käytä {1} nähdäksesi sidotut avaimet.",
|
||||||
|
"Käytä {1} lisätäksesi uuden näppäimistön ja {2} poistaaksesi yhden.",
|
||||||
|
"Default keys are:{1} {1} ajoneuvon moottorille, {2} valoille ja {3} lukitsemiselle/lukituksen avaamiselle",
|
||||||
|
"Paina {1} nähdäksesi kohteesi ja {2} varustaaksesi kohteita tai {3} poistaaksesi kaikki.",
|
||||||
|
"Paina {1} käyttääksesi kohdetta, jota pidät, paina {2} pudottaaksesi sen tai paina {3} noutaaksesi esineen maasta."
|
||||||
|
],
|
||||||
|
"BusinessHelp": [
|
||||||
|
"Käytä {1} tuotteiden ostamiseen tai {2} nähdäksesi luettelon myytävistä missä tahansa yrityksessä",
|
||||||
|
"Yritykset näkyvät sinisillä nimillä sisäänkäynnin kuvakkeen yläpuolella.",
|
||||||
|
"Yrityksen omistajan komennot: {1}",
|
||||||
|
"Uusi myytävä auto ilmestyy, kun ajat pois myyjän luota."
|
||||||
|
],
|
||||||
|
"ClanHelp": [
|
||||||
|
"Pyydä järjestelmänvalvojaa luomaan Claani (Samanlainen kuin ryhmät/ryhmät/perheet)",
|
||||||
|
"Claanin omistajilla on täysi määräysvalta klaaniin, kun se on luotu",
|
||||||
|
"Clanin komennot: {1}",
|
||||||
|
"Lisää klaanikomentoja: {1}"
|
||||||
|
],
|
||||||
|
"RadioStationHelp": [
|
||||||
|
"Aseta asema ajoneuvollesi, talollesi tai yrityksellesi käyttämällä {1}-merkkiä",
|
||||||
|
"Käytä {2} nähdäksesi luettelon asemista",
|
||||||
|
"Voit muuttaa radion suoratoiston äänenvoimakkuutta käyttämällä {1}-arvoa 0-100 prosentteina"
|
||||||
|
],
|
||||||
|
"WealthAndTaxHelp": [
|
||||||
|
"Palkkapäivän verot ovat {1} prosenttia lasketusta omaisuudestasi.",
|
||||||
|
"Laskettu varallisuus on kokonaissumma, joka perustuu siihen, kuinka monta ajoneuvoa, taloa ja yritystä sinulla on.",
|
||||||
|
"Jokainen ajoneuvo on {1}, jokainen talo on {2} ja jokainen yritys on {3}",
|
||||||
|
"Käytä {1} nähdäksesi nykyisen varallisuutesi ja {2} nähdäksesi kuinka paljon maksat veroja jokaisena palkkapäivänä"
|
||||||
|
],
|
||||||
|
"MustBeInAVehicle": "Sinun täytyy olla ajoneuvossa!",
|
||||||
|
"MustBeInOrNearVehicle": "Sinun on oltava ajoneuvossa tai sen lähellä!",
|
||||||
|
"MustBeInVehicleFrontSeat": "Sinun tulee istua auton etupenkillä!",
|
||||||
|
"MustBeInVehicleDriverSeat": "Sinun täytyy olla kuljettaja!",
|
||||||
|
"DontHaveVehicleKey": "Sinulla ei ole avainta tähän ajoneuvoon!",
|
||||||
|
"NoGateAccess": "Sinulla ei ole pääsyä tälle portille!",
|
||||||
|
"GateBroken": "tämä portti on rikki!",
|
||||||
|
"GateHacked": "Portti ei vastaa!",
|
||||||
|
"RadioJammed": "Radiosta kuuluu vain staattista ääntä.",
|
||||||
|
"VehicleNotForSale": "Tämä ajoneuvo ei ole myynnissä!",
|
||||||
|
"VehicleNotForRent": "This vehicle is not for rent!",
|
||||||
|
"BusinessNotForSale": "Tämä yritys ei ole myytävänä!",
|
||||||
|
"BusinessNotForRent": "Tämä yritys ei ole vuokrattavissa!",
|
||||||
|
"HouseNotForSale": "Tämä talo ei ole myynnissä!",
|
||||||
|
"HouseNotForRent": "Tämä talo ei ole vuokrattavissa!",
|
||||||
|
"DealershipPurchaseTestDrive": "Aja ajoneuvo pois jälleenmyyjältä ostaaksesi se tai mene ulos peruuttaaksesi.",
|
||||||
|
"DealershipPurchaseExitedVehicle": "Peruutit ajoneuvon oston poistumalla ajoneuvosta!",
|
||||||
|
"VehiclePurchaseComplete": "Tämä ajoneuvo on nyt sinun! Se säästyy minne jätätkin sen.",
|
||||||
|
"VehiclePurchaseNotEnoughMoney": "Sinulla ei ole tarpeeksi rahaa ostaa tätä ajoneuvoa!",
|
||||||
|
"HousePurchaseNotEnoughMoney": "Sinulla ei ole tarpeeksi rahaa ostaa tätä taloa!",
|
||||||
|
"BusinessPurchaseNotEnoughMoney": "Sinulla ei ole tarpeeksi rahaa ostaa tätä yritystä",
|
||||||
|
|
||||||
|
"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!",
|
||||||
|
"RandomTips": [
|
||||||
|
"Look for yellow dots on your map for job locations",
|
||||||
|
"You can set custom key binds. Use {1} for details",
|
||||||
|
"Use {1} if you don't want to see tips and extra information",
|
||||||
|
"You can edit your keybinds using {1} and {2}",
|
||||||
|
"Press ℹ️ to see your inventory, and use number keys to select an item",
|
||||||
|
"Use {1} at a business to purchase items",
|
||||||
|
"Found a bug? Report it with {1}",
|
||||||
|
"Have an idea or suggestion for the server? Let the devs know using {1}",
|
||||||
|
"Want to buy a business? Use {1} at one for sale",
|
||||||
|
"Want to buy a house? Use {1} at one for sale",
|
||||||
|
"Want to buy a vehicle? Visit a dealership and enter one for info on how to buy it!",
|
||||||
|
"Switch to any of your characters with {1}",
|
||||||
|
"Use {1} to automatically login when connecting with the same IP",
|
||||||
|
"Use {1} to turn on/off the lights in your house or business",
|
||||||
|
"Use {1} to play an internet radio station in your car, house, or business",
|
||||||
|
"Want to make a clan? Use {1} for details",
|
||||||
|
"Legal weapons can be purchased at any ammunation"
|
||||||
|
],
|
||||||
|
"PromptResponseTip": "Use {1} to accept or {2} to decline",
|
||||||
|
"PlayerConnecting": "👋 {1} is connecting to the server ...",
|
||||||
|
"GetStartedJobVehicle": "Get in a {1} to get started.",
|
||||||
|
"VehicleTypes": {
|
||||||
|
"Car": "Car",
|
||||||
|
"Truck": "Truck",
|
||||||
|
"Van": "Van",
|
||||||
|
"Taxi": "Taxi",
|
||||||
|
"Bus": "Bus",
|
||||||
|
"PoliceCar": "Police Car",
|
||||||
|
"Ambulance": "Ambulance",
|
||||||
|
"FireTruck": "Fire Truck",
|
||||||
|
"Bike": "Bike",
|
||||||
|
"Motorbike": "Motorbike",
|
||||||
|
"Boat": "Boat",
|
||||||
|
"Helicopter": "Helicopter",
|
||||||
|
"Plane": "Plane",
|
||||||
|
"Train": "Train"
|
||||||
|
},
|
||||||
|
"AlreadyOnJobRoute": "You are already doing a job route!",
|
||||||
|
"GaveVehicleToClan": "You gave this {1} to your clan!",
|
||||||
|
"JobDisabled": "This job is disabled!",
|
||||||
|
"SetHouseClanConfirmMessage": "Are you sure you want to give this house to your clan?",
|
||||||
|
"SetHouseClanConfirmTitle": "Warning!",
|
||||||
|
"SetBusinessClanConfirmMessage": "Are you sure you want to give this business to your clan?",
|
||||||
|
"SetBusinessClanConfirmTitle": "Warning!",
|
||||||
|
"MustOwnHouse": "You don't own this house!",
|
||||||
|
"MustOwnBusiness": "You don't own this business!",
|
||||||
|
"GaveHouseToClan": "You gave this house to your clan!",
|
||||||
|
"GaveBusinessToClan": "You gave this business to your clan!",
|
||||||
|
"BuyBusinessConfirmMessage": "Are you sure you want to buy this business?",
|
||||||
|
"BuyBusinessConfirmTitle": "Attention!",
|
||||||
|
"BuyHouseConfirmMessage": "Are you sure you want to buy this house?",
|
||||||
|
"BuyHouseConfirmTitle": "Attention!",
|
||||||
|
"BuyBusinessLabel": "Use {1} to buy this business",
|
||||||
|
"BuyHouseLabel": "Use {1} to buy this house",
|
||||||
|
"RentHouseLabel": "Use {1} to rent this house",
|
||||||
|
"DisconnectReasons": [
|
||||||
|
"Lost Connection",
|
||||||
|
"Disconnected",
|
||||||
|
"Unsupported Client",
|
||||||
|
"Wrong Game",
|
||||||
|
"Incorrect Password",
|
||||||
|
"Unsupported Executable",
|
||||||
|
"Disconnected",
|
||||||
|
"Banned",
|
||||||
|
"Failed",
|
||||||
|
"Invalid Name",
|
||||||
|
"Crashed",
|
||||||
|
"Modified Game"
|
||||||
|
],
|
||||||
|
"AccountEmailAlreadyVerified": "You already set and verified your email!",
|
||||||
|
"EmailVerificationCodeSent": "A verification code and instructions have been sent to your email.",
|
||||||
|
"GUIPlayAsCharacterButton": "Play",
|
||||||
|
"GUINewCharacterButton": "New character",
|
||||||
|
"GUIPreviousCharacterButton": "Previous",
|
||||||
|
"GUINextCharacterButton": "Next",
|
||||||
|
"GUICharacterSelectWindowTitle": "Select a character",
|
||||||
|
"GUICharacterSelectMoneyLabel": "Money: ${1}",
|
||||||
|
"GUICharacterSelectClanLabel": "Clan: {1}",
|
||||||
|
"GUICharacterSelectLastPlayedLabel": "Last Played: {1} days, {2} hours, {3} minutes ago",
|
||||||
|
"GUILoginWindowLabelEnterPassword": "Please enter your password",
|
||||||
|
"GUILoginWindowSubmitButton": "Login",
|
||||||
|
"GUILoginWindowResetPasswordButton": "Reset password",
|
||||||
|
"GUILoginWindowPasswordPlaceholder": "Password",
|
||||||
|
"GUILoginWindowForgotPasswordLabel": "Forgot your password?",
|
||||||
|
"GUIRegisterWindowLabelCreateAccount": "Create an account",
|
||||||
|
"GUIRegisterWindowPasswordPlaceholder": "Password",
|
||||||
|
"GUIRegisterWindowConfirmPasswordPlaceholder": "Confirm password",
|
||||||
|
"GUIRegisterWindowEmailPlaceholder": "Email",
|
||||||
|
"GUIRegisterWindowSubmitButton": "Create account",
|
||||||
|
"GUINewCharacterMessageLabel": "Name your character",
|
||||||
|
"GUINewCharacterFirstNamePlaceholder": "First Name",
|
||||||
|
"GUINewCharacterLastNamePlaceholder": "Last Name",
|
||||||
|
"GUIChangePasswordWindowTitle": "Change Password",
|
||||||
|
"GUIChangePasswordPasswordLabel": "Enter a new password",
|
||||||
|
"GUIChangePasswordPasswordPlaceholder": "Password",
|
||||||
|
"GUIChangePasswordConfirmPasswordPlaceholder": "Confirm password",
|
||||||
|
"GUIChangePasswordSubmitButton": "Change Password",
|
||||||
|
"GUIResetPasswordWindowMessage": "Reset Password",
|
||||||
|
"GUIResetPasswordConfirmEmailLabel": "Please confirm your email",
|
||||||
|
"GUIResetPasswordEmailPlaceholder": "Email",
|
||||||
|
"GUIResetPasswordSubmitButton": "Reset Password",
|
||||||
|
"GUIResetPasswordLoginButton": "Login",
|
||||||
|
"GUIResetPasswordRememberMessage": "Remember your password?",
|
||||||
|
"HeaderJobList": "Jobs",
|
||||||
|
"HeaderBusinessInfo": "Business Info",
|
||||||
|
"HeaderHouseInfo": "House Info",
|
||||||
|
"HeaderClanInfo": "Clan Info",
|
||||||
|
"Locales": {
|
||||||
|
"English": "Englanti",
|
||||||
|
"Russian": "Venäjä",
|
||||||
|
"Spanish": "Espanja",
|
||||||
|
"German": "Saksa",
|
||||||
|
"Dutch": "Hollanti",
|
||||||
|
"Polish": "Puola",
|
||||||
|
"Chinese": "Chinese",
|
||||||
|
"French": "French",
|
||||||
|
"Japanese": "Japanese",
|
||||||
|
"Slovak": "Slovak",
|
||||||
|
"Arabic": "Arabic"
|
||||||
|
}
|
||||||
|
}
|
||||||
559
locale/french.json
Normal file
559
locale/french.json
Normal file
@@ -0,0 +1,559 @@
|
|||||||
|
{
|
||||||
|
"TranslationProvidedBy": "Cocam",
|
||||||
|
"LocaleEnglishName": "French",
|
||||||
|
|
||||||
|
"LocaleNativeName": "Français",
|
||||||
|
"LocaleOffer": "Ce serveur est disponible en Français. Appuie sur {1} pour changer la langue.",
|
||||||
|
"LocaleChanged1": "La langue est maintenant paramétrée sur {1}",
|
||||||
|
"LocaleChanged2": "Le serveur va maintenant afficher les messages en {1}",
|
||||||
|
"LocaleChangedNote": "Cela ne change pas les messages des autres joueurs",
|
||||||
|
"AccentsListHeader": "Accents",
|
||||||
|
"HelpMainListHeader": "Aide Catégorie",
|
||||||
|
"AccentNotFound": "Accent non trouvé",
|
||||||
|
"AccentSet": "Vous avez paramétré votre accent sur {1}",
|
||||||
|
"InvalidAnimation": "L'animation n'existe pas",
|
||||||
|
"AnimationCommandTip": "Utilise la commande {1} pour voir la liste des animations valides",
|
||||||
|
"InvalidAnimationDistance": "La distance doit être entre 0 et 3",
|
||||||
|
"AnimationStopCommandTip": "Utilise la commande {1} pour arrêter l'animation",
|
||||||
|
"CantBanClient": "Vous ne pouvez pas bannir cette personne",
|
||||||
|
"PlayerAccountBanned": "le compte {1} a été banni",
|
||||||
|
"ClanNotFound": "Clan non trouvé",
|
||||||
|
"ClanNameTaken": "Un clan avec ce nom existe déjà",
|
||||||
|
"PlayerNotFound": "Joueur non trouvé",
|
||||||
|
"ClanCantRemoveRanks": "Vous ne pouvez pas retirer le rang du clan",
|
||||||
|
"ClanCantAddRanks": "Vous ne pouvez pas ajouter de rang au clan",
|
||||||
|
"ClanRankNotFound": "Le rang du clan est introuvable",
|
||||||
|
"ClanCantChangeMemberTag": "Vous ne pouvez pas modifier les tags des membres du clan",
|
||||||
|
"ClanPlayerNotInSameClan": "Ce joueur n'est pas dans votre clan",
|
||||||
|
"ClanCantChangeRankLevel": "Vous ne pouvez pas modifier le niveau du rang du clan",
|
||||||
|
"ClanCantChangeRankTag": "Vous ne pouvez pas modifier les tags du rang du clan",
|
||||||
|
"NameNotRegistered": "Votre nom n'est pas enregistré ! Utilise {1} pour créer un compte.",
|
||||||
|
"AutomaticLoginIPToggle": "La connexion automatique par IP est maintenant {1}",
|
||||||
|
"CouldNotRegisterAccount": "Un problème est survenue lors de la création de votre compte. Merci de bien vouloir contacter le staff.",
|
||||||
|
"RandomTipsToggle": "Les conseils aléatoires sont maintenant {1}",
|
||||||
|
"ActionTipsToggle": "Les conseils d'action sont maintenant {1}",
|
||||||
|
"AutoSpawnLastCharToggle": "Réapparition automatique du dernier personnage utilisé est {1}",
|
||||||
|
"AccountGUISettingToggle": "🖥️ la GUI est {1}",
|
||||||
|
"On": "On",
|
||||||
|
"Off": "Off",
|
||||||
|
"Yes": "Oui",
|
||||||
|
"No": "Non",
|
||||||
|
"True": "Vrai",
|
||||||
|
"False": "Faux",
|
||||||
|
"Locked": "Verrouillé",
|
||||||
|
"Unlocked": "Déverrouillé",
|
||||||
|
"PasswordNotGoodEnough": "Le nouveau mot de passe doit répondre aux exigences !",
|
||||||
|
"PasswordNeedsBase": "Le mot de passe doit au moins avoir : {1}",
|
||||||
|
"PasswordNeedsCapitals": "{1} Une majuscule",
|
||||||
|
"PasswordNeedsNumbers": "{1} Un nombre",
|
||||||
|
"PasswordNeedsSymbols": "{1} Un caractère spécial",
|
||||||
|
"PasswordsDontMatch": "Le mot de passe et la confirmation ne sont pas identiques !",
|
||||||
|
"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!",
|
||||||
|
"PlayerJoined": "{1} has joined the game from {2}!",
|
||||||
|
"PlayerLeftServer": "{1} has left the game! ({2})",
|
||||||
|
"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!",
|
||||||
|
|
||||||
|
"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!",
|
||||||
|
"RandomTips": [
|
||||||
|
"Look for yellow dots on your map for job locations",
|
||||||
|
"You can set custom key binds. Use {1} for details",
|
||||||
|
"Use {1} if you don't want to see tips and extra information",
|
||||||
|
"You can edit your keybinds using {1} and {2}",
|
||||||
|
"Press ℹ️ to see your inventory, and use number keys to select an item",
|
||||||
|
"Use {1} at a business to purchase items",
|
||||||
|
"Found a bug? Report it with {1}",
|
||||||
|
"Have an idea or suggestion for the server? Let the devs know using {1}",
|
||||||
|
"Want to buy a business? Use {1} at one for sale",
|
||||||
|
"Want to buy a house? Use {1} at one for sale",
|
||||||
|
"Want to buy a vehicle? Visit a dealership and enter one for info on how to buy it!",
|
||||||
|
"Switch to any of your characters with {1}",
|
||||||
|
"Use {1} to automatically login when connecting with the same IP",
|
||||||
|
"Use {1} to turn on/off the lights in your house or business",
|
||||||
|
"Use {1} to play an internet radio station in your car, house, or business",
|
||||||
|
"Want to make a clan? Use {1} for details",
|
||||||
|
"Legal weapons can be purchased at any ammunation"
|
||||||
|
],
|
||||||
|
"PromptResponseTip": "Use {1} to accept or {2} to decline",
|
||||||
|
"PlayerConnecting": "👋 {1} is connecting to the server ...",
|
||||||
|
"GetStartedJobVehicle": "Get in a {1} to get started.",
|
||||||
|
"VehicleTypes": {
|
||||||
|
"Car": "Car",
|
||||||
|
"Truck": "Truck",
|
||||||
|
"Van": "Van",
|
||||||
|
"Taxi": "Taxi",
|
||||||
|
"Bus": "Bus",
|
||||||
|
"PoliceCar": "Police Car",
|
||||||
|
"Ambulance": "Ambulance",
|
||||||
|
"FireTruck": "Fire Truck",
|
||||||
|
"Bike": "Bike",
|
||||||
|
"Motorbike": "Motorbike",
|
||||||
|
"Boat": "Boat",
|
||||||
|
"Helicopter": "Helicopter",
|
||||||
|
"Plane": "Plane",
|
||||||
|
"Train": "Train"
|
||||||
|
},
|
||||||
|
"AlreadyOnJobRoute": "You are already doing a job route!",
|
||||||
|
"GaveVehicleToClan": "You gave this {1} to your clan!",
|
||||||
|
"JobDisabled": "This job is disabled!",
|
||||||
|
"SetHouseClanConfirmMessage": "Are you sure you want to give this house to your clan?",
|
||||||
|
"SetHouseClanConfirmTitle": "Warning!",
|
||||||
|
"SetBusinessClanConfirmMessage": "Are you sure you want to give this business to your clan?",
|
||||||
|
"SetBusinessClanConfirmTitle": "Warning!",
|
||||||
|
"MustOwnHouse": "You don't own this house!",
|
||||||
|
"MustOwnBusiness": "You don't own this business!",
|
||||||
|
"GaveHouseToClan": "You gave this house to your clan!",
|
||||||
|
"GaveBusinessToClan": "You gave this business to your clan!",
|
||||||
|
"BuyBusinessConfirmMessage": "Are you sure you want to buy this business?",
|
||||||
|
"BuyBusinessConfirmTitle": "Attention!",
|
||||||
|
"BuyHouseConfirmMessage": "Are you sure you want to buy this house?",
|
||||||
|
"BuyHouseConfirmTitle": "Attention!",
|
||||||
|
"BuyBusinessLabel": "Use {1} to buy this business",
|
||||||
|
"BuyHouseLabel": "Use {1} to buy this house",
|
||||||
|
"RentHouseLabel": "Use {1} to rent this house",
|
||||||
|
"DisconnectReasons": [
|
||||||
|
"Lost Connection",
|
||||||
|
"Disconnected",
|
||||||
|
"Unsupported Client",
|
||||||
|
"Wrong Game",
|
||||||
|
"Incorrect Password",
|
||||||
|
"Unsupported Executable",
|
||||||
|
"Disconnected",
|
||||||
|
"Banned",
|
||||||
|
"Failed",
|
||||||
|
"Invalid Name",
|
||||||
|
"Crashed",
|
||||||
|
"Modified Game"
|
||||||
|
],
|
||||||
|
"AccountEmailAlreadyVerified": "You already set and verified your email!",
|
||||||
|
"EmailVerificationCodeSent": "A verification code and instructions have been sent to your email.",
|
||||||
|
"GUIPlayAsCharacterButton": "Play",
|
||||||
|
"GUINewCharacterButton": "New character",
|
||||||
|
"GUIPreviousCharacterButton": "Previous",
|
||||||
|
"GUINextCharacterButton": "Next",
|
||||||
|
"GUICharacterSelectWindowTitle": "Select a character",
|
||||||
|
"GUICharacterSelectMoneyLabel": "Money: ${1}",
|
||||||
|
"GUICharacterSelectClanLabel": "Clan: {1}",
|
||||||
|
"GUICharacterSelectLastPlayedLabel": "Last Played: {1} days, {2} hours, {3} minutes ago",
|
||||||
|
"GUILoginWindowLabelEnterPassword": "Please enter your password",
|
||||||
|
"GUILoginWindowSubmitButton": "Login",
|
||||||
|
"GUILoginWindowResetPasswordButton": "Reset password",
|
||||||
|
"GUILoginWindowPasswordPlaceholder": "Password",
|
||||||
|
"GUILoginWindowForgotPasswordLabel": "Forgot your password?",
|
||||||
|
"GUIRegisterWindowLabelCreateAccount": "Create an account",
|
||||||
|
"GUIRegisterWindowPasswordPlaceholder": "Password",
|
||||||
|
"GUIRegisterWindowConfirmPasswordPlaceholder": "Confirm password",
|
||||||
|
"GUIRegisterWindowEmailPlaceholder": "Email",
|
||||||
|
"GUIRegisterWindowSubmitButton": "Create account",
|
||||||
|
"GUINewCharacterMessageLabel": "Name your character",
|
||||||
|
"GUINewCharacterFirstNamePlaceholder": "First Name",
|
||||||
|
"GUINewCharacterLastNamePlaceholder": "Last Name",
|
||||||
|
"GUINewCharacterSubmitButton": "Create Character",
|
||||||
|
"GUIChangePasswordWindowTitle": "Change Password",
|
||||||
|
"GUIChangePasswordPasswordLabel": "Enter a new password",
|
||||||
|
"GUIChangePasswordPasswordPlaceholder": "Password",
|
||||||
|
"GUIChangePasswordConfirmPasswordPlaceholder": "Confirm password",
|
||||||
|
"GUIChangePasswordSubmitButton": "Change Password",
|
||||||
|
"GUIResetPasswordWindowMessage": "Reset Password",
|
||||||
|
"GUIResetPasswordConfirmEmailLabel": "Please confirm your email",
|
||||||
|
"GUIResetPasswordEmailPlaceholder": "Email",
|
||||||
|
"GUIResetPasswordSubmitButton": "Reset Password",
|
||||||
|
"GUIResetPasswordLoginButton": "Login",
|
||||||
|
"GUIResetPasswordRememberMessage": "Remember your password?",
|
||||||
|
"HeaderJobList": "Jobs",
|
||||||
|
"HeaderBusinessInfo": "Business Info",
|
||||||
|
"HeaderHouseInfo": "House Info",
|
||||||
|
"HeaderClanInfo": "Clan Info",
|
||||||
|
"Locales": {
|
||||||
|
"English": "English",
|
||||||
|
"Russian": "Russian",
|
||||||
|
"Spanish": "Spanish",
|
||||||
|
"German": "German",
|
||||||
|
"Dutch": "Dutch",
|
||||||
|
"Polish": "Polish",
|
||||||
|
"Chinese": "Chinese",
|
||||||
|
"French": "French",
|
||||||
|
"Japanese": "Japanese",
|
||||||
|
"Slovak": "Slovak",
|
||||||
|
"Arabic": "Arabic"
|
||||||
|
}
|
||||||
|
}
|
||||||
558
locale/german.json
Normal file
558
locale/german.json
Normal file
@@ -0,0 +1,558 @@
|
|||||||
|
{
|
||||||
|
"TranslationProvidedBy": "Sladernimo",
|
||||||
|
"LocaleEnglishName": "German",
|
||||||
|
|
||||||
|
"LocaleNativeName": "German",
|
||||||
|
"LocaleOffer": "This server is available in German. 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",
|
||||||
|
"HelpMainListHeader": "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!",
|
||||||
|
"PlayerJoined": "{1} has joined the game from {2}!",
|
||||||
|
"PlayerLeftServer": "{1} has left the game! ({2})",
|
||||||
|
"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!",
|
||||||
|
|
||||||
|
"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!",
|
||||||
|
"RandomTips": [
|
||||||
|
"Look for yellow dots on your map for job locations",
|
||||||
|
"You can set custom key binds. Use {1} for details",
|
||||||
|
"Use {1} if you don't want to see tips and extra information",
|
||||||
|
"You can edit your keybinds using {1} and {2}",
|
||||||
|
"Press ℹ️ to see your inventory, and use number keys to select an item",
|
||||||
|
"Use {1} at a business to purchase items",
|
||||||
|
"Found a bug? Report it with {1}",
|
||||||
|
"Have an idea or suggestion for the server? Let the devs know using {1}",
|
||||||
|
"Want to buy a business? Use {1} at one for sale",
|
||||||
|
"Want to buy a house? Use {1} at one for sale",
|
||||||
|
"Want to buy a vehicle? Visit a dealership and enter one for info on how to buy it!",
|
||||||
|
"Switch to any of your characters with {1}",
|
||||||
|
"Use {1} to automatically login when connecting with the same IP",
|
||||||
|
"Use {1} to turn on/off the lights in your house or business",
|
||||||
|
"Use {1} to play an internet radio station in your car, house, or business",
|
||||||
|
"Want to make a clan? Use {1} for details",
|
||||||
|
"Legal weapons can be purchased at any ammunation"
|
||||||
|
],
|
||||||
|
"PromptResponseTip": "Use {1} to accept or {2} to decline",
|
||||||
|
"PlayerConnecting": "👋 {1} is connecting to the server ...",
|
||||||
|
"GetStartedJobVehicle": "Get in a {1} to get started.",
|
||||||
|
"VehicleTypes": {
|
||||||
|
"Car": "Car",
|
||||||
|
"Truck": "Truck",
|
||||||
|
"Van": "Van",
|
||||||
|
"Taxi": "Taxi",
|
||||||
|
"Bus": "Bus",
|
||||||
|
"PoliceCar": "Police Car",
|
||||||
|
"Ambulance": "Ambulance",
|
||||||
|
"FireTruck": "Fire Truck",
|
||||||
|
"Bike": "Bike",
|
||||||
|
"Motorbike": "Motorbike",
|
||||||
|
"Boat": "Boat",
|
||||||
|
"Helicopter": "Helicopter",
|
||||||
|
"Plane": "Plane",
|
||||||
|
"Train": "Train"
|
||||||
|
},
|
||||||
|
"AlreadyOnJobRoute": "You are already doing a job route!",
|
||||||
|
"GaveVehicleToClan": "You gave this {1} to your clan!",
|
||||||
|
"JobDisabled": "This job is disabled!",
|
||||||
|
"SetHouseClanConfirmMessage": "Are you sure you want to give this house to your clan?",
|
||||||
|
"SetHouseClanConfirmTitle": "Warning!",
|
||||||
|
"SetBusinessClanConfirmMessage": "Are you sure you want to give this business to your clan?",
|
||||||
|
"SetBusinessClanConfirmTitle": "Warning!",
|
||||||
|
"MustOwnHouse": "You don't own this house!",
|
||||||
|
"MustOwnBusiness": "You don't own this business!",
|
||||||
|
"GaveHouseToClan": "You gave this house to your clan!",
|
||||||
|
"GaveBusinessToClan": "You gave this business to your clan!",
|
||||||
|
"BuyBusinessConfirmMessage": "Are you sure you want to buy this business?",
|
||||||
|
"BuyBusinessConfirmTitle": "Attention!",
|
||||||
|
"BuyHouseConfirmMessage": "Are you sure you want to buy this house?",
|
||||||
|
"BuyHouseConfirmTitle": "Attention!",
|
||||||
|
"BuyBusinessLabel": "Use {1} to buy this business",
|
||||||
|
"BuyHouseLabel": "Use {1} to buy this house",
|
||||||
|
"RentHouseLabel": "Use {1} to rent this house",
|
||||||
|
"DisconnectReasons": [
|
||||||
|
"Lost Connection",
|
||||||
|
"Disconnected",
|
||||||
|
"Unsupported Client",
|
||||||
|
"Wrong Game",
|
||||||
|
"Incorrect Password",
|
||||||
|
"Unsupported Executable",
|
||||||
|
"Disconnected",
|
||||||
|
"Banned",
|
||||||
|
"Failed",
|
||||||
|
"Invalid Name",
|
||||||
|
"Crashed",
|
||||||
|
"Modified Game"
|
||||||
|
],
|
||||||
|
"AccountEmailAlreadyVerified": "You already set and verified your email!",
|
||||||
|
"EmailVerificationCodeSent": "A verification code and instructions have been sent to your email.",
|
||||||
|
"GUIPlayAsCharacterButton": "Spielen",
|
||||||
|
"GUINewCharacterButton": "Neuer Charakter",
|
||||||
|
"GUIPreviousCharacterButton": "Zurück",
|
||||||
|
"GUINextCharacterButton": "Weiter",
|
||||||
|
"GUICharacterSelectWindowTitle": "Wähle einen Charakter",
|
||||||
|
"GUICharacterSelectMoneyLabel": "Geld: ${1}",
|
||||||
|
"GUICharacterSelectClanLabel": "Clan: {1}",
|
||||||
|
"GUICharacterSelectLastPlayedLabel": "Zuletzt gespielt vor: {1} Tagen, {2} Stunden, {3} Minuten",
|
||||||
|
"GUILoginWindowLabelEnterPassword": "Bitte Passwort eingeben",
|
||||||
|
"GUILoginWindowSubmitButton": "Login",
|
||||||
|
"GUILoginWindowResetPasswordButton": "Passwort zurücksetzen",
|
||||||
|
"GUILoginWindowPasswordPlaceholder": "Passwort",
|
||||||
|
"GUILoginWindowForgotPasswordLabel": "Passwort vergessen?",
|
||||||
|
"GUIRegisterWindowLabelCreateAccount": "Profil erstellen",
|
||||||
|
"GUIRegisterWindowPasswordPlaceholder": "Passwort",
|
||||||
|
"GUIRegisterWindowConfirmPasswordPlaceholder": "Passwort bestätigen",
|
||||||
|
"GUIRegisterWindowEmailPlaceholder": "Email",
|
||||||
|
"GUIRegisterWindowSubmitButton": "Profil erstellen",
|
||||||
|
"GUINewCharacterMessageLabel": "Charakter Name",
|
||||||
|
"GUINewCharacterFirstNamePlaceholder": "Vorname",
|
||||||
|
"GUINewCharacterLastNamePlaceholder": "Nachname",
|
||||||
|
"GUIChangePasswordWindowTitle": "Passwort ändern",
|
||||||
|
"GUIChangePasswordPasswordLabel": "Neues Passwort eingeben",
|
||||||
|
"GUIChangePasswordPasswordPlaceholder": "Passwort",
|
||||||
|
"GUIChangePasswordConfirmPasswordPlaceholder": "Passwort bestätigen",
|
||||||
|
"GUIChangePasswordSubmitButton": "Passwort ändern",
|
||||||
|
"GUIResetPasswordWindowMessage": "Passwort zurücksetzen",
|
||||||
|
"GUIResetPasswordConfirmEmailLabel": "Bitte bestätige deine Email",
|
||||||
|
"GUIResetPasswordEmailPlaceholder": "Email",
|
||||||
|
"GUIResetPasswordSubmitButton": "Passwort zurücksetzen",
|
||||||
|
"GUIResetPasswordLoginButton": "Login",
|
||||||
|
"GUIResetPasswordRememberMessage": "Passwort bekannt?",
|
||||||
|
"HeaderJobList": "Jobs",
|
||||||
|
"HeaderBusinessInfo": "Business Info",
|
||||||
|
"HeaderHouseInfo": "House Info",
|
||||||
|
"HeaderClanInfo": "Clan Info",
|
||||||
|
"Locales": {
|
||||||
|
"English": "English",
|
||||||
|
"Russian": "Russian",
|
||||||
|
"Spanish": "Spanish",
|
||||||
|
"German": "German",
|
||||||
|
"Dutch": "Dutch",
|
||||||
|
"Polish": "Polish",
|
||||||
|
"Chinese": "Chinese",
|
||||||
|
"French": "French",
|
||||||
|
"Japanese": "Japanese",
|
||||||
|
"Slovak": "Slovak",
|
||||||
|
"Arabic": "Arabic"
|
||||||
|
}
|
||||||
|
}
|
||||||
559
locale/japanese.json
Normal file
559
locale/japanese.json
Normal file
@@ -0,0 +1,559 @@
|
|||||||
|
{
|
||||||
|
"TranslationProvidedBy": "Cocam",
|
||||||
|
"LocaleEnglishName": "Japanese",
|
||||||
|
|
||||||
|
"LocaleNativeName": "Japanese (Translate this to your native language)",
|
||||||
|
"LocaleOffer": "This server is available in Japanese. 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",
|
||||||
|
"HelpMainListHeader": "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!",
|
||||||
|
"PlayerJoined": "{1} has joined the game from {2}!",
|
||||||
|
"PlayerLeftServer": "{1} has left the game! ({2})",
|
||||||
|
"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!",
|
||||||
|
|
||||||
|
"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!",
|
||||||
|
"RandomTips": [
|
||||||
|
"Look for yellow dots on your map for job locations",
|
||||||
|
"You can set custom key binds. Use {1} for details",
|
||||||
|
"Use {1} if you don't want to see tips and extra information",
|
||||||
|
"You can edit your keybinds using {1} and {2}",
|
||||||
|
"Press ℹ️ to see your inventory, and use number keys to select an item",
|
||||||
|
"Use {1} at a business to purchase items",
|
||||||
|
"Found a bug? Report it with {1}",
|
||||||
|
"Have an idea or suggestion for the server? Let the devs know using {1}",
|
||||||
|
"Want to buy a business? Use {1} at one for sale",
|
||||||
|
"Want to buy a house? Use {1} at one for sale",
|
||||||
|
"Want to buy a vehicle? Visit a dealership and enter one for info on how to buy it!",
|
||||||
|
"Switch to any of your characters with {1}",
|
||||||
|
"Use {1} to automatically login when connecting with the same IP",
|
||||||
|
"Use {1} to turn on/off the lights in your house or business",
|
||||||
|
"Use {1} to play an internet radio station in your car, house, or business",
|
||||||
|
"Want to make a clan? Use {1} for details",
|
||||||
|
"Legal weapons can be purchased at any ammunation"
|
||||||
|
],
|
||||||
|
"PromptResponseTip": "Use {1} to accept or {2} to decline",
|
||||||
|
"PlayerConnecting": "👋 {1} is connecting to the server ...",
|
||||||
|
"GetStartedJobVehicle": "Get in a {1} to get started.",
|
||||||
|
"VehicleTypes": {
|
||||||
|
"Car": "Car",
|
||||||
|
"Truck": "Truck",
|
||||||
|
"Van": "Van",
|
||||||
|
"Taxi": "Taxi",
|
||||||
|
"Bus": "Bus",
|
||||||
|
"PoliceCar": "Police Car",
|
||||||
|
"Ambulance": "Ambulance",
|
||||||
|
"FireTruck": "Fire Truck",
|
||||||
|
"Bike": "Bike",
|
||||||
|
"Motorbike": "Motorbike",
|
||||||
|
"Boat": "Boat",
|
||||||
|
"Helicopter": "Helicopter",
|
||||||
|
"Plane": "Plane",
|
||||||
|
"Train": "Train"
|
||||||
|
},
|
||||||
|
"AlreadyOnJobRoute": "You are already doing a job route!",
|
||||||
|
"GaveVehicleToClan": "You gave this {1} to your clan!",
|
||||||
|
"JobDisabled": "This job is disabled!",
|
||||||
|
"SetHouseClanConfirmMessage": "Are you sure you want to give this house to your clan?",
|
||||||
|
"SetHouseClanConfirmTitle": "Warning!",
|
||||||
|
"SetBusinessClanConfirmMessage": "Are you sure you want to give this business to your clan?",
|
||||||
|
"SetBusinessClanConfirmTitle": "Warning!",
|
||||||
|
"MustOwnHouse": "You don't own this house!",
|
||||||
|
"MustOwnBusiness": "You don't own this business!",
|
||||||
|
"GaveHouseToClan": "You gave this house to your clan!",
|
||||||
|
"GaveBusinessToClan": "You gave this business to your clan!",
|
||||||
|
"BuyBusinessConfirmMessage": "Are you sure you want to buy this business?",
|
||||||
|
"BuyBusinessConfirmTitle": "Attention!",
|
||||||
|
"BuyHouseConfirmMessage": "Are you sure you want to buy this house?",
|
||||||
|
"BuyHouseConfirmTitle": "Attention!",
|
||||||
|
"BuyBusinessLabel": "Use {1} to buy this business",
|
||||||
|
"BuyHouseLabel": "Use {1} to buy this house",
|
||||||
|
"RentHouseLabel": "Use {1} to rent this house",
|
||||||
|
"DisconnectReasons": [
|
||||||
|
"Lost Connection",
|
||||||
|
"Disconnected",
|
||||||
|
"Unsupported Client",
|
||||||
|
"Wrong Game",
|
||||||
|
"Incorrect Password",
|
||||||
|
"Unsupported Executable",
|
||||||
|
"Disconnected",
|
||||||
|
"Banned",
|
||||||
|
"Failed",
|
||||||
|
"Invalid Name",
|
||||||
|
"Crashed",
|
||||||
|
"Modified Game"
|
||||||
|
],
|
||||||
|
"AccountEmailAlreadyVerified": "You already set and verified your email!",
|
||||||
|
"EmailVerificationCodeSent": "A verification code and instructions have been sent to your email.",
|
||||||
|
"GUIPlayAsCharacterButton": "Play",
|
||||||
|
"GUINewCharacterButton": "New character",
|
||||||
|
"GUIPreviousCharacterButton": "Previous",
|
||||||
|
"GUINextCharacterButton": "Next",
|
||||||
|
"GUICharacterSelectWindowTitle": "Select a character",
|
||||||
|
"GUICharacterSelectMoneyLabel": "Money: ${1}",
|
||||||
|
"GUICharacterSelectClanLabel": "Clan: {1}",
|
||||||
|
"GUICharacterSelectLastPlayedLabel": "Last Played: {1} days, {2} hours, {3} minutes ago",
|
||||||
|
"GUILoginWindowLabelEnterPassword": "Please enter your password",
|
||||||
|
"GUILoginWindowSubmitButton": "Login",
|
||||||
|
"GUILoginWindowResetPasswordButton": "Reset password",
|
||||||
|
"GUILoginWindowPasswordPlaceholder": "Password",
|
||||||
|
"GUILoginWindowForgotPasswordLabel": "Forgot your password?",
|
||||||
|
"GUIRegisterWindowLabelCreateAccount": "Create an account",
|
||||||
|
"GUIRegisterWindowPasswordPlaceholder": "Password",
|
||||||
|
"GUIRegisterWindowConfirmPasswordPlaceholder": "Confirm password",
|
||||||
|
"GUIRegisterWindowEmailPlaceholder": "Email",
|
||||||
|
"GUIRegisterWindowSubmitButton": "Create account",
|
||||||
|
"GUINewCharacterMessageLabel": "Name your character",
|
||||||
|
"GUINewCharacterFirstNamePlaceholder": "First Name",
|
||||||
|
"GUINewCharacterLastNamePlaceholder": "Last Name",
|
||||||
|
"GUINewCharacterSubmitButton": "Create Character",
|
||||||
|
"GUIChangePasswordWindowTitle": "Change Password",
|
||||||
|
"GUIChangePasswordPasswordLabel": "Enter a new password",
|
||||||
|
"GUIChangePasswordPasswordPlaceholder": "Password",
|
||||||
|
"GUIChangePasswordConfirmPasswordPlaceholder": "Confirm password",
|
||||||
|
"GUIChangePasswordSubmitButton": "Change Password",
|
||||||
|
"GUIResetPasswordWindowMessage": "Reset Password",
|
||||||
|
"GUIResetPasswordConfirmEmailLabel": "Please confirm your email",
|
||||||
|
"GUIResetPasswordEmailPlaceholder": "Email",
|
||||||
|
"GUIResetPasswordSubmitButton": "Reset Password",
|
||||||
|
"GUIResetPasswordLoginButton": "Login",
|
||||||
|
"GUIResetPasswordRememberMessage": "Remember your password?",
|
||||||
|
"HeaderJobList": "Jobs",
|
||||||
|
"HeaderBusinessInfo": "Business Info",
|
||||||
|
"HeaderHouseInfo": "House Info",
|
||||||
|
"HeaderClanInfo": "Clan Info",
|
||||||
|
"Locales": {
|
||||||
|
"English": "English",
|
||||||
|
"Russian": "Russian",
|
||||||
|
"Spanish": "Spanish",
|
||||||
|
"German": "German",
|
||||||
|
"Dutch": "Dutch",
|
||||||
|
"Polish": "Polish",
|
||||||
|
"Chinese": "Chinese",
|
||||||
|
"French": "French",
|
||||||
|
"Japanese": "Japanese",
|
||||||
|
"Slovak": "Slovak",
|
||||||
|
"Arabic": "Arabic"
|
||||||
|
}
|
||||||
|
}
|
||||||
24
meta.xml
24
meta.xml
@@ -1,5 +1,5 @@
|
|||||||
<meta>
|
<meta>
|
||||||
<info author="Vortrex" version="1.0" description="Vortrex's Roleplay Resource" />
|
<info author="Vortrex" version="1.0" description="Asshat Gaming Roleplay - Main Script" />
|
||||||
|
|
||||||
<!-- Shared -->
|
<!-- Shared -->
|
||||||
<script src="scripts/shared/const.js" type="server" language="javascript" />
|
<script src="scripts/shared/const.js" type="server" language="javascript" />
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
<script src="scripts/shared/gamedata.js" type="client" language="javascript" />
|
<script src="scripts/shared/gamedata.js" type="client" language="javascript" />
|
||||||
|
|
||||||
<!-- Multiplayer Mod (Wrapped Natives) -->
|
<!-- Multiplayer Mod (Wrapped Natives) -->
|
||||||
<!-- The goal is to just swap only these out when I port the script to a new mod, like Oakwood -->
|
<!-- The goal is to just swap only these out when I port the script to a new MP mod -->
|
||||||
<script src="scripts/server/native/connected.js" type="server" language="javascript" />
|
<script src="scripts/server/native/connected.js" type="server" language="javascript" />
|
||||||
<script src="scripts/client/native/connected.js" type="client" language="javascript" />
|
<script src="scripts/client/native/connected.js" type="client" language="javascript" />
|
||||||
|
|
||||||
@@ -50,6 +50,7 @@
|
|||||||
<script src="scripts/server/npc.js" type="server" language="javascript" />
|
<script src="scripts/server/npc.js" type="server" language="javascript" />
|
||||||
<script src="scripts/server/netevents.js" type="server" language="javascript" />
|
<script src="scripts/server/netevents.js" type="server" language="javascript" />
|
||||||
<script src="scripts/server/paintball.js" type="server" language="javascript" />
|
<script src="scripts/server/paintball.js" type="server" language="javascript" />
|
||||||
|
<script src="scripts/server/prompt.js" type="server" language="javascript" />
|
||||||
<script src="scripts/server/race.js" type="server" language="javascript" />
|
<script src="scripts/server/race.js" type="server" language="javascript" />
|
||||||
<script src="scripts/server/radio.js" type="server" language="javascript" />
|
<script src="scripts/server/radio.js" type="server" language="javascript" />
|
||||||
<script src="scripts/server/security.js" type="server" language="javascript" />
|
<script src="scripts/server/security.js" type="server" language="javascript" />
|
||||||
@@ -85,9 +86,11 @@
|
|||||||
<!-- Extra Client Files -->
|
<!-- Extra Client Files -->
|
||||||
<file type="client" src="files/fonts/roboto-regular.ttf" />
|
<file type="client" src="files/fonts/roboto-regular.ttf" />
|
||||||
<file type="client" src="files/fonts/pricedown.ttf" />
|
<file type="client" src="files/fonts/pricedown.ttf" />
|
||||||
|
<file type="client" src="files/fonts/aurora-bold-condensed.ttf" />
|
||||||
<file type="client" src="files/images/skins/none.png" />
|
<file type="client" src="files/images/skins/none.png" />
|
||||||
<!--<file type="client" src="files/images/server-logo.png" />-->
|
<!--<file type="client" src="files/images/server-logo.png" />-->
|
||||||
<file type="client" src="files/images/asshat-logo.png" />
|
<file type="client" src="files/images/asshat-logo.png" />
|
||||||
|
<file type="client" src="files/images/cursor.png" />
|
||||||
|
|
||||||
<!-- GUI -->
|
<!-- GUI -->
|
||||||
<script src="scripts/client/gui/2fa.js" type="client" language="javascript" />
|
<script src="scripts/client/gui/2fa.js" type="client" language="javascript" />
|
||||||
@@ -98,19 +101,28 @@
|
|||||||
<script src="scripts/client/gui/error.js" type="client" language="javascript" />
|
<script src="scripts/client/gui/error.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/gui/housemgr.js" type="client" language="javascript" />
|
<script src="scripts/client/gui/housemgr.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/gui/info.js" type="client" language="javascript" />
|
<script src="scripts/client/gui/info.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/gui/login.js" type="client" language="javascript" />
|
<script src="scripts/client/gui/inventory.js" type="client" language="javascript" />
|
||||||
|
<script src="scripts/client/gui/inventorybulk.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/gui/list.js" type="client" language="javascript" />
|
<script src="scripts/client/gui/list.js" type="client" language="javascript" />
|
||||||
|
<script src="scripts/client/gui/login.js" type="client" language="javascript" />
|
||||||
|
<script src="scripts/client/gui/localechooser.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/gui/newchar.js" type="client" language="javascript" />
|
<script src="scripts/client/gui/newchar.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/gui/register.js" type="client" language="javascript" />
|
<script src="scripts/client/gui/register.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/gui/resetpass.js" type="client" language="javascript" />
|
<script src="scripts/client/gui/resetpass.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/gui/yesno.js" type="client" language="javascript" />
|
<script src="scripts/client/gui/yesno.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/gui/localechooser.js" type="client" language="javascript" />
|
<script src="scripts/client/gui/games/blackjack.js" type="client" language="javascript" />
|
||||||
|
<script src="scripts/client/gui/games/betting.js" type="client" language="javascript" />
|
||||||
|
<script src="scripts/client/gui/games/5cardpoker.js" type="client" language="javascript" />
|
||||||
|
|
||||||
|
|
||||||
<!-- Client Scripts -->
|
<!-- Client Scripts -->
|
||||||
<script src="scripts/client/afk.js" type="client" language="javascript" />
|
<script src="scripts/client/afk.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/animation.js" type="client" language="javascript" />
|
<script src="scripts/client/animation.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/business.js" type="client" language="javascript" />
|
<script src="scripts/client/business.js" type="client" language="javascript" />
|
||||||
|
<script src="scripts/client/core.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/chat.js" type="client" language="javascript" />
|
<script src="scripts/client/chat.js" type="client" language="javascript" />
|
||||||
|
<script src="scripts/client/cursor.js" type="client" language="javascript" />
|
||||||
|
<script src="scripts/client/economy.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/event.js" type="client" language="javascript" />
|
<script src="scripts/client/event.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/gui.js" type="client" language="javascript" />
|
<script src="scripts/client/gui.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/gps.js" type="client" language="javascript" />
|
<script src="scripts/client/gps.js" type="client" language="javascript" />
|
||||||
@@ -121,19 +133,17 @@
|
|||||||
<script src="scripts/client/label.js" type="client" language="javascript" />
|
<script src="scripts/client/label.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/locale.js" type="client" language="javascript" />
|
<script src="scripts/client/locale.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/logo.js" type="client" language="javascript" />
|
<script src="scripts/client/logo.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/main.js" type="client" language="javascript" />
|
|
||||||
<script src="scripts/client/messaging.js" type="client" language="javascript" />
|
<script src="scripts/client/messaging.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/mousecam.js" type="client" language="javascript" />
|
<script src="scripts/client/mousecam.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/nametag.js" type="client" language="javascript" />
|
<script src="scripts/client/nametag.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/npc.js" type="client" language="javascript" />
|
<script src="scripts/client/npc.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/radio.js" type="client" language="javascript" />
|
<script src="scripts/client/radio.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/scoreboard.js" type="client" language="javascript" />
|
<script src="scripts/client/scoreboard.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/netevents.js" type="client" language="javascript" />
|
|
||||||
<script src="scripts/client/skin-select.js" type="client" language="javascript" />
|
<script src="scripts/client/skin-select.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/sync.js" type="client" language="javascript" />
|
<script src="scripts/client/sync.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/time.nut" type="client" language="squirrel" />
|
|
||||||
<script src="scripts/client/utilities.js" type="client" language="javascript" />
|
<script src="scripts/client/utilities.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/vehicle.js" type="client" language="javascript" />
|
<script src="scripts/client/vehicle.js" type="client" language="javascript" />
|
||||||
|
<script src="scripts/client/netevents.js" type="client" language="javascript" />
|
||||||
|
|
||||||
<!-- Locale Files -->
|
<!-- Locale Files -->
|
||||||
<file type="client" src="config/client/locale.json" />
|
<file type="client" src="config/client/locale.json" />
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
|
|
||||||
// Init AFK script
|
// Init AFK script
|
||||||
function initAFKScript() {
|
function initAFKScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.AFK]: Initializing AFK script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.AFK]: Initializing AFK script ...");
|
||||||
logToConsole(LOG_DEBUG, "[VRR.AFK]: AFK script initialized!");
|
logToConsole(LOG_DEBUG, "[AGRP.AFK]: AFK script initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -8,6 +8,13 @@
|
|||||||
// TYPE: Client (JavaScript)
|
// TYPE: Client (JavaScript)
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function initAnimationScript() {
|
||||||
|
logToConsole(LOG_DEBUG, "[AGRP.Animation]: Initializing animation script ...");
|
||||||
|
logToConsole(LOG_DEBUG, "[AGRP.Animation]: Animation script initialized!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
function makePedPlayAnimation(pedId, animationSlot, positionOffset) {
|
function makePedPlayAnimation(pedId, animationSlot, positionOffset) {
|
||||||
let ped = getElementFromId(pedId);
|
let ped = getElementFromId(pedId);
|
||||||
|
|
||||||
@@ -16,7 +23,7 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let animationData = getAnimationData(animationSlot);
|
let animationData = getAnimationData(animationSlot);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Animation] Playing animation ${animationData[0]} for ped ${pedId}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Animation] Playing animation ${animationData[0]} for ped ${pedId}`);
|
||||||
|
|
||||||
let freezePlayer = false;
|
let freezePlayer = false;
|
||||||
switch (animationData.moveType) {
|
switch (animationData.moveType) {
|
||||||
|
|||||||
@@ -17,18 +17,29 @@ class BusinessData {
|
|||||||
this.blipModel = blipModel;
|
this.blipModel = blipModel;
|
||||||
this.pickupModel = pickupModel;
|
this.pickupModel = pickupModel;
|
||||||
this.hasInterior = hasInterior;
|
this.hasInterior = hasInterior;
|
||||||
|
this.rentPrice = 0;
|
||||||
|
this.buyPrice = 0;
|
||||||
this.hasItems = hasItems;
|
this.hasItems = hasItems;
|
||||||
this.blipId = -1;
|
this.blipId = -1;
|
||||||
this.labelInfoType = 0;
|
this.labelInfoType = 0;
|
||||||
|
this.locked = false;
|
||||||
|
this.entranceFee = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems) {
|
function initBusinessScript() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Business] Received business ${businessId} (${name}) from server`);
|
logToConsole(LOG_DEBUG, "[AGRP.Business]: Initializing business script ...");
|
||||||
|
logToConsole(LOG_INFO, "[AGRP.Business]: Business script initialized!");
|
||||||
|
}
|
||||||
|
|
||||||
if (!areServerElementsSupported()) {
|
// ===========================================================================
|
||||||
|
|
||||||
|
function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked, hasItems, entranceFee) {
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Business] Received business ${businessId} (${name}) from server`);
|
||||||
|
|
||||||
|
if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE || getGame() == AGRP_GAME_GTA_IV) {
|
||||||
if (getBusinessData(businessId) != false) {
|
if (getBusinessData(businessId) != false) {
|
||||||
let businessData = getBusinessData(businessId);
|
let businessData = getBusinessData(businessId);
|
||||||
businessData.name = name;
|
businessData.name = name;
|
||||||
@@ -36,12 +47,26 @@ function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel
|
|||||||
businessData.blipModel = blipModel;
|
businessData.blipModel = blipModel;
|
||||||
businessData.pickupModel = pickupModel;
|
businessData.pickupModel = pickupModel;
|
||||||
businessData.hasInterior = hasInterior;
|
businessData.hasInterior = hasInterior;
|
||||||
|
businessData.buyPrice = buyPrice;
|
||||||
|
businessData.rentPrice = rentPrice;
|
||||||
businessData.hasItems = hasItems;
|
businessData.hasItems = hasItems;
|
||||||
|
businessData.locked = locked;
|
||||||
|
businessData.entranceFee = entranceFee;
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId} already exists. Checking blip ...`);
|
if (hasInterior && !hasItems) {
|
||||||
|
businessData.labelInfoType = AGRP_PROPLABEL_INFO_ENTER;
|
||||||
|
} else if (!hasInterior && hasItems) {
|
||||||
|
businessData.labelInfoType = AGRP_PROPLABEL_INFO_BUY;
|
||||||
|
} else {
|
||||||
|
if (businessData.buyPrice > 0) {
|
||||||
|
businessData.labelInfoType = AGRP_PROPLABEL_INFO_BUYBIZ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId} already exists. Checking blip ...`);
|
||||||
if (blipModel == -1) {
|
if (blipModel == -1) {
|
||||||
if (businessData.blipId != -1) {
|
if (businessData.blipId != -1) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been removed by the server`);
|
logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId}'s blip has been removed by the server`);
|
||||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
natives.removeBlipAndClearIndex(getBusinessData(businessId).blipId);
|
natives.removeBlipAndClearIndex(getBusinessData(businessId).blipId);
|
||||||
} else {
|
} else {
|
||||||
@@ -51,11 +76,11 @@ function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel
|
|||||||
//businesses.splice(businessData.index, 1);
|
//businesses.splice(businessData.index, 1);
|
||||||
//setAllBusinessDataIndexes();
|
//setAllBusinessDataIndexes();
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip is unchanged`);
|
logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId}'s blip is unchanged`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (businessData.blipId != -1) {
|
if (businessData.blipId != -1) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been changed by the server`);
|
logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId}'s blip has been changed by the server`);
|
||||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
natives.setBlipCoordinates(businessData.blipId, businessData.entrancePosition);
|
natives.setBlipCoordinates(businessData.blipId, businessData.entrancePosition);
|
||||||
natives.changeBlipSprite(businessData.blipId, businessData.blipModel);
|
natives.changeBlipSprite(businessData.blipId, businessData.blipModel);
|
||||||
@@ -68,20 +93,20 @@ function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel
|
|||||||
if (blipId != -1) {
|
if (blipId != -1) {
|
||||||
tempBusinessData.blipId = blipId;
|
tempBusinessData.blipId = blipId;
|
||||||
}
|
}
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId} doesn't exist. Adding ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId} doesn't exist. Adding ...`);
|
||||||
let tempBusinessData = new BusinessData(businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems);
|
let tempBusinessData = new BusinessData(businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems);
|
||||||
if (blipModel != -1) {
|
if (blipModel != -1) {
|
||||||
let blipId = createGameBlip(tempBusinessData.blipModel, tempBusinessData.entrancePosition, tempBusinessData.name);
|
let blipId = createGameBlip(tempBusinessData.blipModel, tempBusinessData.entrancePosition, tempBusinessData.name);
|
||||||
if (blipId != -1) {
|
if (blipId != -1) {
|
||||||
tempBusinessData.blipId = blipId;
|
tempBusinessData.blipId = blipId;
|
||||||
}
|
}
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId} has no blip.`);
|
logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId} has no blip.`);
|
||||||
}
|
}
|
||||||
getServerData().businesses.push(tempBusinessData);
|
getServerData().businesses.push(tempBusinessData);
|
||||||
setAllBusinessDataIndexes();
|
setAllBusinessDataIndexes();
|
||||||
|
|||||||
39
scripts/client/camera.js
Normal file
39
scripts/client/camera.js
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
// ===========================================================================
|
||||||
|
// Asshat Gaming Roleplay
|
||||||
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
|
// ===========================================================================
|
||||||
|
// FILE: camera.js
|
||||||
|
// DESC: Provides camera functions and usage
|
||||||
|
// TYPE: Client (JavaScript)
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
let cameraFadeEnabled = false;
|
||||||
|
let cameraFadeIn = false;
|
||||||
|
let cameraFadeStart = 0;
|
||||||
|
let cameraFadeDuration = 0;
|
||||||
|
let cameraFadeColour = 0;
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function processCameraFadeRendering() {
|
||||||
|
if (cameraFadeEnabled) {
|
||||||
|
let finishTime = cameraFadeStart + cameraFadeDuration;
|
||||||
|
if (sdl.ticks >= finishTime) {
|
||||||
|
cameraFadeEnabled = false;
|
||||||
|
cameraFadeDuration = 0;
|
||||||
|
cameraFadeStart = 0;
|
||||||
|
} else {
|
||||||
|
let currentTick = sdl.ticks - cameraFadeStart;
|
||||||
|
let progressPercent = Math.ceil(currentTick * 100 / cameraFadeDuration);
|
||||||
|
let rgbaArray = rgbaArrayFromToColour(cameraFadeColour);
|
||||||
|
|
||||||
|
let alpha = (cameraFadeIn) ? Math.ceil(255 / progressPercent) : Math.ceil(progressPercent / 255);
|
||||||
|
|
||||||
|
cameraFadeColour = toColour(rgbaArray[0], rgbaArray[1], rgbaArray[2], alpha);
|
||||||
|
graphics.drawRectangle(null, toVector2(0, 0), toVector2(game.width, game.height), cameraFadeColour, cameraFadeColour, cameraFadeColour, cameraFadeColour);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -29,11 +29,11 @@ let scrollDownKey = false;
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initChatBoxScript() {
|
function initChatBoxScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Chat]: Initializing chat script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.Chat]: Initializing chat script ...");
|
||||||
scrollUpKey = getKeyIdFromParams("pageup");
|
scrollUpKey = getKeyIdFromParams("pageup");
|
||||||
scrollDownKey = getKeyIdFromParams("pagedown");
|
scrollDownKey = getKeyIdFromParams("pagedown");
|
||||||
bindChatBoxKeys();
|
bindChatBoxKeys();
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Chat]: Chat script initialized!");
|
logToConsole(LOG_INFO, "[AGRP.Chat]: Chat script initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -53,7 +53,7 @@ function unBindChatBoxKeys() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function receiveChatBoxMessageFromServer(messageString, colour, hour, minute, second) {
|
function receiveChatBoxMessageFromServer(messageString, colour, hour, minute, second) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Chat]: Received chatbox message from server: ${messageString}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Chat]: Received chatbox message from server: ${messageString}`);
|
||||||
|
|
||||||
// Just in case it's hidden by auto hide
|
// Just in case it's hidden by auto hide
|
||||||
//setChatWindowEnabled(true);
|
//setChatWindowEnabled(true);
|
||||||
@@ -73,21 +73,21 @@ function receiveChatBoxMessageFromServer(messageString, colour, hour, minute, se
|
|||||||
|
|
||||||
let outputString = messageString;
|
let outputString = messageString;
|
||||||
if (chatTimeStampsEnabled == true) {
|
if (chatTimeStampsEnabled == true) {
|
||||||
//timeStampString = `{TIMESTAMPCOLOUR}[${findResourceByName("agrp_time").exports.getTimeStampOutput(timeStamp)}]{MAINCOLOUR}`;
|
let colourRGBA = rgbaArrayFromToColour(colour);
|
||||||
let timeStampString = `{TIMESTAMPCOLOUR}[${hour}:${minute}:${second}] `;
|
let timeStampString = `{TIMESTAMPCOLOUR}[${hour}:${minute}:${second}][${rgbToHex(colourRGBA[0], colourRGBA[1], colourRGBA[2])}] `;
|
||||||
outputString = `${timeStampString}${messageString}`;
|
outputString = `${timeStampString}${messageString}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Chat]: Changed colours in string: ${outputString}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Chat]: Changed colours in string: ${outputString}`);
|
||||||
outputString = replaceColoursInMessage(`${outputString}`);
|
outputString = replaceColoursInMessage(`${outputString}`);
|
||||||
|
|
||||||
if (chatEmojiEnabled == true) {
|
if (chatEmojiEnabled == true) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Chat]: Enabled emoji in string: ${outputString}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Chat]: Enabled emoji in string: ${outputString}`);
|
||||||
outputString = replaceEmojiInMessage(outputString);
|
outputString = replaceEmojiInMessage(outputString);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (profanityFilterEnabled == true) {
|
if (profanityFilterEnabled == true) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Chat]: Removed profanity in string: ${outputString}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Chat]: Removed profanity in string: ${outputString}`);
|
||||||
outputString = replaceProfanityInMessage(outputString);
|
outputString = replaceProfanityInMessage(outputString);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,12 +163,9 @@ function updateChatBox() {
|
|||||||
if (typeof chatBoxHistory[i] != "undefined") {
|
if (typeof chatBoxHistory[i] != "undefined") {
|
||||||
let outputString = chatBoxHistory[i][0];
|
let outputString = chatBoxHistory[i][0];
|
||||||
if (chatTimeStampsEnabled == true) {
|
if (chatTimeStampsEnabled == true) {
|
||||||
//let timeStampDate = new Date(chatBoxHistory[i][2]);
|
|
||||||
//let timeStampText = `${timeStampDate.getHours()}:${timeStampDate.getMinutes()}:${timeStampDate.getSeconds()}`;
|
|
||||||
//let timeStampText = findResourceByName("agrp_time").exports.getTimeStampOutput(chatBoxHistory[i][2]);
|
|
||||||
let timeStampText = `${chatBoxHistory[i][2]}:${chatBoxHistory[i][3]}:${chatBoxHistory[i][4]}`;
|
let timeStampText = `${chatBoxHistory[i][2]}:${chatBoxHistory[i][3]}:${chatBoxHistory[i][4]}`;
|
||||||
|
let colourRGBA = rgbaArrayFromToColour(chatBoxHistory[i][1]);
|
||||||
outputString = `{TIMESTAMPCOLOUR}[${timeStampText}]{MAINCOLOUR} ${chatBoxHistory[i][0]}`;
|
outputString = `{TIMESTAMPCOLOUR}[${timeStampText}][${rgbToHex(colourRGBA[0], colourRGBA[1], colourRGBA[2])}] ${chatBoxHistory[i][0]}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
outputString = replaceColoursInMessage(outputString);
|
outputString = replaceColoursInMessage(outputString);
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ let isSpawned = false;
|
|||||||
|
|
||||||
let garbageCollectorInterval = null;
|
let garbageCollectorInterval = null;
|
||||||
|
|
||||||
let parkedVehiclePosition = false;
|
//let parkedVehiclePosition = false;
|
||||||
let parkedVehicleHeading = false;
|
//let parkedVehicleHeading = false;
|
||||||
|
|
||||||
let renderHUD = true;
|
let renderHUD = true;
|
||||||
let renderLabels = true;
|
let renderLabels = true;
|
||||||
@@ -31,7 +31,7 @@ let renderHotBar = true;
|
|||||||
let renderItemActionDelay = true;
|
let renderItemActionDelay = true;
|
||||||
let renderInteriorLights = true;
|
let renderInteriorLights = true;
|
||||||
|
|
||||||
let logLevel = LOG_DEBUG;
|
let logLevel = LOG_INFO | LOG_DEBUG;
|
||||||
|
|
||||||
let weaponDamageEnabled = {};
|
let weaponDamageEnabled = {};
|
||||||
let weaponDamageEvent = {};
|
let weaponDamageEvent = {};
|
||||||
@@ -61,6 +61,7 @@ let interiorLightsEnabled = true;
|
|||||||
let interiorLightsColour = toColour(0, 0, 0, 150);
|
let interiorLightsColour = toColour(0, 0, 0, 150);
|
||||||
|
|
||||||
let mouseCameraEnabled = false;
|
let mouseCameraEnabled = false;
|
||||||
|
let mouseCursorEnabled = false;
|
||||||
|
|
||||||
let currentPickup = false;
|
let currentPickup = false;
|
||||||
|
|
||||||
@@ -83,6 +84,15 @@ let profanityFilterEnabled = false;
|
|||||||
|
|
||||||
let localLocaleId = 0;
|
let localLocaleId = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {Object} ServerData
|
||||||
|
* @property {Array.<HouseData>} houses
|
||||||
|
* @property {Array.<BusinessData>} businesses
|
||||||
|
* @property {Array.<VehicleData>} vehicles
|
||||||
|
* @property {Array} localeStrings
|
||||||
|
* @property {Array} localeOptions
|
||||||
|
* @property {Object} cvars
|
||||||
|
*/
|
||||||
let serverData = {
|
let serverData = {
|
||||||
houses: [],
|
houses: [],
|
||||||
businesses: [],
|
businesses: [],
|
||||||
@@ -90,6 +100,17 @@ let serverData = {
|
|||||||
localeOptions: [],
|
localeOptions: [],
|
||||||
vehicles: [],
|
vehicles: [],
|
||||||
jobs: [],
|
jobs: [],
|
||||||
|
cvars: {},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let localPlayerMoney = 0;
|
||||||
|
let localPlayerMoneyInterval = null;
|
||||||
|
|
||||||
|
let currencyString = "${AMOUNT}";
|
||||||
|
|
||||||
|
let mapChangeWarning = false;
|
||||||
|
|
||||||
|
let cruiseControlEnabled = false;
|
||||||
|
let cruiseControlSpeed = 0.0;
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
40
scripts/client/cursor.js
Normal file
40
scripts/client/cursor.js
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
// ===========================================================================
|
||||||
|
// Asshat Gaming Roleplay
|
||||||
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
|
// ===========================================================================
|
||||||
|
// FILE: cursor.js
|
||||||
|
// DESC: Provides cursor functions and usage
|
||||||
|
// TYPE: Client (JavaScript)
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
let cursorImage = null;
|
||||||
|
let cursorImagePath = "files/images/cursor.png";
|
||||||
|
let cursorSize = toVector2(16.0, 24.0);
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function initCursorScript() {
|
||||||
|
logToConsole(LOG_DEBUG, "[AGRP.Cursor]: Initializing cursor script ...");
|
||||||
|
let cursorStream = openFile(cursorImagePath);
|
||||||
|
if (cursorStream != null) {
|
||||||
|
cursorImage = graphics.loadPNG(cursorStream);
|
||||||
|
cursorStream.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
logToConsole(LOG_INFO, "[AGRP.Cursor]: Cursor script initialized!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function processMouseCursorRendering() {
|
||||||
|
if (isGameFeatureSupported("mouseCursor")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gui.cursorEnabled) {
|
||||||
|
graphics.drawRectangle(cursorImage, gui.cursorPosition, cursorSize);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -3,7 +3,11 @@
|
|||||||
// https://github.com/VortrexFTW/agrp_main
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
// (c) 2022 Asshat Gaming
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: 5cardpoker.js
|
// FILE: economy.js
|
||||||
// DESC: Provides 5-card poker games GUI
|
// DESC: Provides economy functions
|
||||||
// TYPE: Client (JavaScript)
|
// TYPE: Client (JavaScript)
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -9,9 +9,9 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initEventScript() {
|
function initEventScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Event]: Initializing event script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.Event]: Initializing event script ...");
|
||||||
addAllEventHandlers();
|
addAllEventHandlers();
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Event]: Event script initialized!");
|
logToConsole(LOG_DEBUG, "[AGRP.Event]: Event script initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -41,15 +41,15 @@ function addAllEventHandlers() {
|
|||||||
addEventHandler("OnPedExitedSphereEx", onPedExitedSphere);
|
addEventHandler("OnPedExitedSphereEx", onPedExitedSphere);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getGame() == AGRP_GAME_MAFIA_ONE) {
|
||||||
|
addEventHandler("OnMapLoaded", onMapLoaded);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onResourceStart(event, resource) {
|
function onResourceStart(event, resource) {
|
||||||
if (resource == thisResource) {
|
|
||||||
sendResourceStartedSignalToServer();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (resource == findResourceByName("v-events")) {
|
if (resource == findResourceByName("v-events")) {
|
||||||
// Remove and re-add events, in case v-events was loaded after agrp_main
|
// Remove and re-add events, in case v-events was loaded after agrp_main
|
||||||
removeEventHandler("OnPedEnteredVehicleEx");
|
removeEventHandler("OnPedEnteredVehicleEx");
|
||||||
@@ -62,13 +62,20 @@ function onResourceStart(event, resource) {
|
|||||||
addEventHandler("OnPedEnteredSphereEx", onPedEnteredSphere);
|
addEventHandler("OnPedEnteredSphereEx", onPedEnteredSphere);
|
||||||
addEventHandler("OnPedExitedSphereEx", onPedExitedSphere);
|
addEventHandler("OnPedExitedSphereEx", onPedExitedSphere);
|
||||||
}
|
}
|
||||||
//garbageCollectorInterval = setInterval(collectAllGarbage, 1000*60);
|
|
||||||
|
if (resource == thisResource) {
|
||||||
|
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.Event] onResourceStart called - Sending signal to server`);
|
||||||
|
garbageCollectorInterval = setInterval(collectAllGarbage, 1000 * 60);
|
||||||
|
localPlayerMoneyInterval = setInterval(updateLocalPlayerMoney, 1000 * 5);
|
||||||
|
sendResourceStartedSignalToServer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onResourceStop(event, resource) {
|
function onResourceStop(event, resource) {
|
||||||
if (resource == thisResource) {
|
if (resource == thisResource) {
|
||||||
|
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.Event] onResourceStop called - Sending signal to server`);
|
||||||
sendResourceStoppedSignalToServer();
|
sendResourceStoppedSignalToServer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -77,6 +84,8 @@ function onResourceStop(event, resource) {
|
|||||||
|
|
||||||
function onResourceReady(event, resource) {
|
function onResourceReady(event, resource) {
|
||||||
if (resource == thisResource) {
|
if (resource == thisResource) {
|
||||||
|
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.Event] onResourceReady called - Sending signal to server`);
|
||||||
|
loadLocaleConfig();
|
||||||
sendResourceReadySignalToServer();
|
sendResourceReadySignalToServer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -84,6 +93,7 @@ function onResourceReady(event, resource) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onProcess(event, deltaTime) {
|
function onProcess(event, deltaTime) {
|
||||||
|
logToConsole(LOG_VERBOSE, `[AGRP.Event] onProcess`);
|
||||||
if (localPlayer == null) {
|
if (localPlayer == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -101,9 +111,9 @@ function onProcess(event, deltaTime) {
|
|||||||
processNearbyPickups();
|
processNearbyPickups();
|
||||||
processVehiclePurchasing();
|
processVehiclePurchasing();
|
||||||
processVehicleBurning();
|
processVehicleBurning();
|
||||||
|
processVehicleCruiseControl();
|
||||||
//checkChatBoxAutoHide(); // Will be uncommented on 1.4.0 GTAC update
|
//checkChatBoxAutoHide(); // Will be uncommented on 1.4.0 GTAC update
|
||||||
//processVehicleFires();
|
//processVehicleFires();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -118,6 +128,9 @@ function onKeyUp(event, keyCode, scanCode, keyModifiers) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onDrawnHUD(event) {
|
function onDrawnHUD(event) {
|
||||||
|
logToConsole(LOG_VERBOSE, `[AGRP.Event] HUD drawn`);
|
||||||
|
processMouseCursorRendering();
|
||||||
|
|
||||||
if (!renderHUD) {
|
if (!renderHUD) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -139,7 +152,7 @@ function onDrawnHUD(event) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onPedWasted(event, wastedPed, killerPed, weapon, pedPiece) {
|
function onPedWasted(event, wastedPed, killerPed, weapon, pedPiece) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Ped ${wastedPed.name} died`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Ped ${wastedPed.name} died`);
|
||||||
wastedPed.clearWeapons();
|
wastedPed.clearWeapons();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,27 +165,62 @@ function onElementStreamIn(event, element) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onPedExitedVehicle(event, ped, vehicle, seat) {
|
function onPedExitedVehicle(event, ped, vehicle, seat) {
|
||||||
//logToConsole(LOG_DEBUG, `[VRR.Event] Local player exited vehicle`);
|
//logToConsole(LOG_DEBUG, `[AGRP.Event] Local player exited vehicle`);
|
||||||
//sendNetworkEventToServer("agrp.onPlayerExitVehicle", getVehicleForNetworkEvent(vehicle), seat);
|
//sendNetworkEventToServer("agrp.onPlayerExitVehicle", getVehicleForNetworkEvent(vehicle), seat);
|
||||||
|
|
||||||
if (inVehicleSeat) {
|
cruiseControlEnabled = false;
|
||||||
parkedVehiclePosition = false;
|
cruiseControlSpeed = 0.0;
|
||||||
parkedVehicleHeading = false;
|
|
||||||
|
if (localPlayer != null) {
|
||||||
|
if (ped == localPlayer) {
|
||||||
|
if (areServerElementsSupported()) {
|
||||||
|
if (inVehicleSeat == 0) {
|
||||||
|
//setVehicleEngine(vehicle.id, false);
|
||||||
|
//if (!inVehicle.engine) {
|
||||||
|
// parkedVehiclePosition = false;
|
||||||
|
// parkedVehicleHeading = false;
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function onPedExitingVehicle(event, ped, vehicle, seat) {
|
||||||
|
//logToConsole(LOG_DEBUG, `[AGRP.Event] Local player exited vehicle`);
|
||||||
|
//sendNetworkEventToServer("agrp.onPlayerExitVehicle", getVehicleForNetworkEvent(vehicle), seat);
|
||||||
|
|
||||||
|
if (localPlayer != null) {
|
||||||
|
if (ped == localPlayer) {
|
||||||
|
cruiseControlEnabled = false;
|
||||||
|
cruiseControlSpeed = 0.0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onPedEnteredVehicle(event, ped, vehicle, seat) {
|
function onPedEnteredVehicle(event, ped, vehicle, seat) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Local player entered vehicle`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Ped entered vehicle`);
|
||||||
//sendNetworkEventToServer("agrp.onPlayerEnterVehicle", getVehicleForNetworkEvent(vehicle), seat);
|
//sendNetworkEventToServer("agrp.onPlayerEnterVehicle", getVehicleForNetworkEvent(vehicle), seat);
|
||||||
|
|
||||||
|
cruiseControlEnabled = false;
|
||||||
|
cruiseControlSpeed = 0.0;
|
||||||
|
|
||||||
|
if (localPlayer != null) {
|
||||||
|
if (ped == localPlayer) {
|
||||||
if (areServerElementsSupported()) {
|
if (areServerElementsSupported()) {
|
||||||
if (inVehicleSeat == 0) {
|
if (inVehicleSeat == 0) {
|
||||||
setVehicleEngine(vehicle.id, false);
|
//parkedVehiclePosition = inVehicle.position;
|
||||||
if (!inVehicle.engine) {
|
//parkedVehicleHeading = inVehicle.heading;
|
||||||
parkedVehiclePosition = inVehicle.position;
|
if (doesEntityDataExist(vehicle, "agrp.server") == true) {
|
||||||
parkedVehicleHeading = inVehicle.heading;
|
//setVehicleEngine(vehicle.id, false);
|
||||||
|
setVehicleEngine(vehicle.id, getEntityData(vehicle, "agrp.engine"));
|
||||||
|
//setLocalPlayerControlState(false, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -183,7 +231,7 @@ function onPedEnteredVehicle(event, ped, vehicle, seat) {
|
|||||||
function onPedInflictDamage(event, damagedEntity, damagerEntity, weaponId, healthLoss, pedPiece) {
|
function onPedInflictDamage(event, damagedEntity, damagerEntity, weaponId, healthLoss, pedPiece) {
|
||||||
//let damagerEntityString = (!isNull(damagedEntity)) ? `${damagerEntity.name} (${damagerEntity.name}, ${damagerEntity.type} - ${typeof damagerEntity})` : `Unknown ped`;
|
//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`;
|
//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}`);
|
//logToConsole(LOG_DEBUG, `[AGRP.Event] ${damagerEntityString} damaged ${damagedEntityString}'s '${pedPiece} with weapon ${weaponId}`);
|
||||||
if (!isNull(damagedEntity) && !isNull(damagerEntity)) {
|
if (!isNull(damagedEntity) && !isNull(damagerEntity)) {
|
||||||
if (damagedEntity.isType(ELEMENT_PLAYER)) {
|
if (damagedEntity.isType(ELEMENT_PLAYER)) {
|
||||||
if (damagedEntity == localPlayer) {
|
if (damagedEntity == localPlayer) {
|
||||||
@@ -247,3 +295,9 @@ function onEntityProcess(event, entity) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function onMapLoaded(mapName) {
|
||||||
|
sendNetworkEventToServer("agrp.mapLoaded", mapName);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -17,7 +17,7 @@ let gpsBlipBlinkTimer = null;
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showGPSLocation(position, colour) {
|
function showGPSLocation(position, colour) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GPS] Showing gps location`);
|
logToConsole(LOG_DEBUG, `[AGRP.GPS] Showing gps location`);
|
||||||
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
|
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
|
||||||
if (getGame() == AGRP_GAME_GTA_SA) {
|
if (getGame() == AGRP_GAME_GTA_SA) {
|
||||||
// Server-side spheres don't show in GTA SA for some reason.
|
// Server-side spheres don't show in GTA SA for some reason.
|
||||||
|
|||||||
@@ -41,14 +41,14 @@ let creatingCharacter = false;
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initGUIScript() {
|
function initGUIScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.GUI]: Initializing GUI script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.GUI]: Initializing GUI script ...");
|
||||||
logToConsole(LOG_DEBUG, "[VRR.GUI]: GUI script initialized!");
|
logToConsole(LOG_DEBUG, "[AGRP.GUI]: GUI script initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initGUI() {
|
function initGUI() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Initializing GUI ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Initializing GUI ...`);
|
||||||
|
|
||||||
initLoginGUI();
|
initLoginGUI();
|
||||||
initRegisterGUI();
|
initRegisterGUI();
|
||||||
@@ -62,13 +62,19 @@ function initGUI() {
|
|||||||
initResetPasswordGUI();
|
initResetPasswordGUI();
|
||||||
initChangePasswordGUI();
|
initChangePasswordGUI();
|
||||||
initLocaleChooserGUI();
|
initLocaleChooserGUI();
|
||||||
|
//initInventoryGUI();
|
||||||
|
//initInventoryBulkGUI();
|
||||||
|
//initClanManagerGUI();
|
||||||
|
//initBusinessManagerGUI();
|
||||||
|
//initHouseManagerGUI();
|
||||||
|
//initFiveCardPokerGUI();
|
||||||
|
//initBettingGUI();
|
||||||
|
//initBlackJackGUI();
|
||||||
|
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
guiReady = true;
|
guiReady = true;
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] All GUI created successfully!`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] All GUI created successfully!`);
|
||||||
|
|
||||||
loadLocaleConfig();
|
|
||||||
|
|
||||||
sendNetworkEventToServer("agrp.guiReady", true);
|
sendNetworkEventToServer("agrp.guiReady", true);
|
||||||
};
|
};
|
||||||
@@ -76,7 +82,7 @@ function initGUI() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function closeAllWindows() {
|
function closeAllWindows() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Closing all GUI windows`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Closing all GUI windows`);
|
||||||
infoDialog.window.shown = false;
|
infoDialog.window.shown = false;
|
||||||
yesNoDialog.window.shown = false;
|
yesNoDialog.window.shown = false;
|
||||||
errorDialog.window.shown = false;
|
errorDialog.window.shown = false;
|
||||||
@@ -89,6 +95,14 @@ function closeAllWindows() {
|
|||||||
passwordReset.window.shown = false;
|
passwordReset.window.shown = false;
|
||||||
passwordChange.window.shown = false;
|
passwordChange.window.shown = false;
|
||||||
localeChooser.window.shown = false;
|
localeChooser.window.shown = false;
|
||||||
|
//houseManager.window.shown = false;
|
||||||
|
//businessManager.window.shown = false;
|
||||||
|
//clanManager.window.shown = false;
|
||||||
|
//inventoryGUI.window.shown = false;
|
||||||
|
//inventoryBulkGUI.window.shown = false;
|
||||||
|
//bettingGUI.window.shown = false;
|
||||||
|
//blackJackGUI.window.shown = false;
|
||||||
|
//fiveCardPokerGUI.window.shown = false;
|
||||||
|
|
||||||
mexui.setInput(false);
|
mexui.setInput(false);
|
||||||
mexui.focusedControl = false;
|
mexui.focusedControl = false;
|
||||||
@@ -157,13 +171,45 @@ function isAnyGUIActive() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if (clanManager.window.shown == true) {
|
||||||
|
// return true;
|
||||||
|
//}
|
||||||
|
|
||||||
|
//if (businessManager.window.shown == true) {
|
||||||
|
// return true;
|
||||||
|
//}
|
||||||
|
|
||||||
|
//if (houseManager.window.shown == true) {
|
||||||
|
// return true;
|
||||||
|
//}
|
||||||
|
|
||||||
|
//if (inventoryGUI.window.shown == true) {
|
||||||
|
// return true;
|
||||||
|
//}
|
||||||
|
|
||||||
|
//if (inventoryBulkGUI.window.shown == true) {
|
||||||
|
// return true;
|
||||||
|
//}
|
||||||
|
|
||||||
|
//if (bettingGUI.window.shown == true) {
|
||||||
|
// return true;
|
||||||
|
//}
|
||||||
|
|
||||||
|
//if (blackJackGUI.window.shown == true) {
|
||||||
|
// return true;
|
||||||
|
//}
|
||||||
|
|
||||||
|
//if (fiveCardPokerGUI.window.shown == true) {
|
||||||
|
// return true;
|
||||||
|
//}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setGUIColours(red1, green1, blue1, red2, green2, blue2, red3, green3, blue3) {
|
function setGUIColours(red1, green1, blue1, red2, green2, blue2, red3, green3, blue3) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Received new GUI colours from server: ${red1}, ${green1}, ${blue1} / ${red2}, ${green2}, ${blue2} / ${red3}, ${green3}, ${blue3}`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Received new GUI colours from server: ${red1}, ${green1}, ${blue1} / ${red2}, ${green2}, ${blue2} / ${red3}, ${green3}, ${blue3}`);
|
||||||
primaryColour = [red1, green1, blue1];
|
primaryColour = [red1, green1, blue1];
|
||||||
secondaryColour = [red2, green2, blue2];
|
secondaryColour = [red2, green2, blue2];
|
||||||
primaryTextColour = [red3, green3, blue3];
|
primaryTextColour = [red3, green3, blue3];
|
||||||
@@ -183,41 +229,45 @@ function hideAllGUI() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function processGUIKeyPress(keyCode) {
|
function processGUIKeyPress(keyCode) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Processing key press: ${keyCode}`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Processing key press: ${keyCode}`);
|
||||||
|
|
||||||
|
if (!guiReady) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isAnyGUIActive()) {
|
if (!isAnyGUIActive()) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] GUI is not active. Cancelling keypress processing.`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] GUI is not active. Cancelling keypress processing.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (keyCode == SDLK_RETURN || keyCode == SDLK_RETURN2) {
|
if (keyCode == SDLK_RETURN || keyCode == SDLK_RETURN2) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Key press is submit (${guiSubmitKey})`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Key press is submit (${guiSubmitKey})`);
|
||||||
if (guiSubmitKey != false) {
|
if (guiSubmitKey != false) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Calling submit key function`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Calling submit key function`);
|
||||||
guiSubmitKey.call();
|
guiSubmitKey.call();
|
||||||
}
|
}
|
||||||
} else if (keyCode == getKeyIdFromParams("left") || keyCode == getKeyIdFromParams("a")) {
|
} else if (keyCode == getKeyIdFromParams("left") || keyCode == getKeyIdFromParams("a")) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Key press is left (${guiLeftKey})`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Key press is left (${guiLeftKey})`);
|
||||||
if (guiLeftKey != false) {
|
if (guiLeftKey != false) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Calling left key function`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Calling left key function`);
|
||||||
guiLeftKey.call();
|
guiLeftKey.call();
|
||||||
}
|
}
|
||||||
} else if (keyCode == getKeyIdFromParams("right") || keyCode == getKeyIdFromParams("d")) {
|
} else if (keyCode == getKeyIdFromParams("right") || keyCode == getKeyIdFromParams("d")) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Key press is right (${guiRightKey})`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Key press is right (${guiRightKey})`);
|
||||||
if (guiRightKey != false) {
|
if (guiRightKey != false) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Calling right key function`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Calling right key function`);
|
||||||
guiRightKey.call();
|
guiRightKey.call();
|
||||||
}
|
}
|
||||||
} else if (keyCode == getKeyIdFromParams("down") || keyCode == getKeyIdFromParams("s")) {
|
} else if (keyCode == getKeyIdFromParams("down") || keyCode == getKeyIdFromParams("s")) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Key press is down (${guiDownKey})`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Key press is down (${guiDownKey})`);
|
||||||
if (guiDownKey != false) {
|
if (guiDownKey != false) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Calling down key function`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Calling down key function`);
|
||||||
guiDownKey.call();
|
guiDownKey.call();
|
||||||
}
|
}
|
||||||
} else if (keyCode == getKeyIdFromParams("up") || keyCode == getKeyIdFromParams("w")) {
|
} else if (keyCode == getKeyIdFromParams("up") || keyCode == getKeyIdFromParams("w")) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Key press is up (${guiUpKey})`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Key press is up (${guiUpKey})`);
|
||||||
if (guiUpKey != false) {
|
if (guiUpKey != false) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Calling up key function`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Calling up key function`);
|
||||||
guiUpKey.call();
|
guiUpKey.call();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -234,6 +284,10 @@ function processToggleGUIKeyPress(keyCode) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function resetGUIStrings() {
|
function resetGUIStrings() {
|
||||||
|
if (!guiReady) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Login GUI
|
// Login GUI
|
||||||
login.messageLabel.text = getLocaleString("GUILoginWindowLabelEnterPassword");
|
login.messageLabel.text = getLocaleString("GUILoginWindowLabelEnterPassword");
|
||||||
login.passwordInput.placeholder = getLocaleString("GUILoginWindowPasswordPlaceholder");
|
login.passwordInput.placeholder = getLocaleString("GUILoginWindowPasswordPlaceholder");
|
||||||
@@ -278,3 +332,15 @@ function resetGUIStrings() {
|
|||||||
newCharacter.lastNameInput.placeholder = getLocaleString("GUINewCharacterLastNamePlaceholder");
|
newCharacter.lastNameInput.placeholder = getLocaleString("GUINewCharacterLastNamePlaceholder");
|
||||||
newCharacter.createCharacterButton.text = toUpperCase(getLocaleString("GUINewCharacterSubmitButton"));
|
newCharacter.createCharacterButton.text = toUpperCase(getLocaleString("GUINewCharacterSubmitButton"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function dimAllGUIElementsInWindow(guiObject) {
|
||||||
|
for (let i in guiObject) {
|
||||||
|
if (i != "window") {
|
||||||
|
guiObject[i].shown = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -21,7 +21,7 @@ let twoFactorAuth = {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initTwoFactorAuthenticationGUI() {
|
function initTwoFactorAuthenticationGUI() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating two factor auth GUI ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating two factor auth GUI ...`);
|
||||||
twoFactorAuth.window = mexui.window(game.width / 2 - 150, game.height / 2 - 129, 300, 258, 'LOGIN', {
|
twoFactorAuth.window = mexui.window(game.width / 2 - 150, game.height / 2 - 129, 300, 258, 'LOGIN', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
||||||
@@ -95,14 +95,14 @@ function initTwoFactorAuthenticationGUI() {
|
|||||||
},
|
},
|
||||||
}, checkTwoFactorAuth);
|
}, checkTwoFactorAuth);
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Created two factor auth GUI`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created two factor auth GUI`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showTwoFactorAuthGUI() {
|
function showTwoFactorAuthGUI() {
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing two-factor authentication window`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing two-factor authentication window`);
|
||||||
setChatWindowEnabled(false);
|
setChatWindowEnabled(false);
|
||||||
mexui.setInput(true);
|
mexui.setInput(true);
|
||||||
twoFactorAuth.window.shown = true;
|
twoFactorAuth.window.shown = true;
|
||||||
@@ -113,7 +113,7 @@ function showTwoFactorAuthGUI() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function twoFactorAuthFailed(errorMessage) {
|
function twoFactorAuthFailed(errorMessage) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports two-factor authentication failed. Reason: ${errorMessage}`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports two-factor authentication failed. Reason: ${errorMessage}`);
|
||||||
twoFactorAuth.messageLabel.text = errorMessage;
|
twoFactorAuth.messageLabel.text = errorMessage;
|
||||||
twoFactorAuth.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
|
twoFactorAuth.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
|
||||||
twoFactorAuth.codeInput.text = "";
|
twoFactorAuth.codeInput.text = "";
|
||||||
@@ -122,14 +122,14 @@ function twoFactorAuthFailed(errorMessage) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function twoFactorAuthSuccess() {
|
function twoFactorAuthSuccess() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports two-factor authentication was successful`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports two-factor authentication was successful`);
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function checkTwoFactorAuth() {
|
function checkTwoFactorAuth() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Checking two-factor authentication with server ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Checking two-factor authentication with server ...`);
|
||||||
sendNetworkEventToServer("agrp.2fa", twoFactorAuth.codeInput.lines[0]);
|
sendNetworkEventToServer("agrp.2fa", twoFactorAuth.codeInput.lines[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,3 +7,79 @@
|
|||||||
// DESC: Provides business manager GUI
|
// DESC: Provides business manager GUI
|
||||||
// TYPE: Client (JavaScript)
|
// TYPE: Client (JavaScript)
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
/*
|
||||||
|
class BusinessManagerData {
|
||||||
|
constructor(businessIndex, name, locked, entranceFee, buyPrice, rentPrice, floorItems, storageItems) {
|
||||||
|
this.businessIndex = businessIndex;
|
||||||
|
this.name = name;
|
||||||
|
this.locked = locked;
|
||||||
|
this.entranceFee = entranceFee;
|
||||||
|
this.buyPrice = buyPrice;
|
||||||
|
this.rentPrice = rentPrice;
|
||||||
|
this.till = till;
|
||||||
|
this.ownerName = ownerName;
|
||||||
|
this.floorItems = floorItems;
|
||||||
|
this.storageItems = storageItems;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
let businessManager = {
|
||||||
|
window: null,
|
||||||
|
generalTabButton: null,
|
||||||
|
floorItemsTab: null,
|
||||||
|
storageItemsTab: null,
|
||||||
|
orderItemsTab: null,
|
||||||
|
data: null,
|
||||||
|
|
||||||
|
// General Tab
|
||||||
|
businessName: null,
|
||||||
|
businessOwnerName: null,
|
||||||
|
businessEntranceFee: null,
|
||||||
|
businessBuyPrice: null,
|
||||||
|
businessRentPrice: null,
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function initBusinessManagerGUI() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function showBusinessManagerGUI() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function hideBusinessManagerGUI() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function updateBusinessManagerGUIStrings() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function receiveBusinessManagerData(businessIndex, name, locked, entranceFee, buyPrice, rentPrice, floorItems, storageItems) {
|
||||||
|
let businessManagerData = new BusinessManagerData(businessIndex, name, locked, entranceFee, buyPrice, rentPrice, floorItems, storageItems);
|
||||||
|
businessManager.data = businessManagerData;
|
||||||
|
updateBusinessManagerGUIStrings();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function saveBusinessData() {
|
||||||
|
sendNetworkEventToServer("agrp.businessManagerSave", businessManager.data.businessIndex);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -20,7 +20,7 @@ let passwordChange = {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initChangePasswordGUI() {
|
function initChangePasswordGUI() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating password change GUI ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating password change GUI ...`);
|
||||||
passwordChange.window = mexui.window(game.width / 2 - 130, game.height / 2 - 125, 300, 250, 'Change Password', {
|
passwordChange.window = mexui.window(game.width / 2 - 130, game.height / 2 - 125, 300, 250, 'Change Password', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
||||||
@@ -111,13 +111,13 @@ function initChangePasswordGUI() {
|
|||||||
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
|
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
|
||||||
},
|
},
|
||||||
}, checkChangePassword);
|
}, checkChangePassword);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Created change password GUI`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created change password GUI`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function passwordChangeFailed(errorMessage) {
|
function passwordChangeFailed(errorMessage) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports change password failed. Reason: ${errorMessage}`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports change password failed. Reason: ${errorMessage}`);
|
||||||
passwordChange.messageLabel.text = errorMessage;
|
passwordChange.messageLabel.text = errorMessage;
|
||||||
passwordChange.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
|
passwordChange.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
|
||||||
passwordChange.passwordInput.text = "";
|
passwordChange.passwordInput.text = "";
|
||||||
@@ -128,14 +128,14 @@ function passwordChangeFailed(errorMessage) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function checkChangePassword() {
|
function checkChangePassword() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Checking password change with server ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Checking password change with server ...`);
|
||||||
sendNetworkEventToServer("agrp.checkChangePassword", passwordChange.passwordInput.lines[0], passwordChange.confirmPasswordInput.lines[0]);
|
sendNetworkEventToServer("agrp.checkChangePassword", passwordChange.passwordInput.lines[0], passwordChange.confirmPasswordInput.lines[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showChangePasswordGUI(errorMessage) {
|
function showChangePasswordGUI(errorMessage) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing change password window`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing change password window`);
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
setChatWindowEnabled(false);
|
setChatWindowEnabled(false);
|
||||||
mexui.setInput(true);
|
mexui.setInput(true);
|
||||||
@@ -150,7 +150,7 @@ function showChangePasswordGUI(errorMessage) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function passwordChangeSuccess() {
|
function passwordChangeSuccess() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports password change was successful`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports password change was successful`);
|
||||||
guiSubmitKey = false;
|
guiSubmitKey = false;
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ let characterSelect = {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initCharacterSelectGUI() {
|
function initCharacterSelectGUI() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating character select GUI ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating character select GUI ...`);
|
||||||
characterSelect.window = mexui.window(game.width / 2 - 215, game.height / 2 - 83, 430, 190, 'SELECT CHARACTER', {
|
characterSelect.window = mexui.window(game.width / 2 - 215, game.height / 2 - 83, 430, 190, 'SELECT CHARACTER', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
||||||
@@ -151,18 +151,18 @@ function initCharacterSelectGUI() {
|
|||||||
borderColour: toColour(0, 0, 0, 0),
|
borderColour: toColour(0, 0, 0, 0),
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Created character select GUI`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created character select GUI`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, skinId) {
|
function showCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, skinId) {
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing character selection window`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing character selection window`);
|
||||||
setChatWindowEnabled(false);
|
setChatWindowEnabled(false);
|
||||||
mexui.setInput(true);
|
mexui.setInput(true);
|
||||||
characterSelect.nameText.text = `${firstName} ${lastName}`;
|
characterSelect.nameText.text = `${firstName} ${lastName}`;
|
||||||
characterSelect.cashText.text = `Money: $${cash}`;
|
characterSelect.cashText.text = `Money: ${getCurrencyString(cash)}`;
|
||||||
characterSelect.clanText.text = `Clan: ${clan}`;
|
characterSelect.clanText.text = `Clan: ${clan}`;
|
||||||
characterSelect.lastPlayedText.text = `Last Played: ${lastPlayed}`;
|
characterSelect.lastPlayedText.text = `Last Played: ${lastPlayed}`;
|
||||||
characterSelect.skinImage = characterSelect.window.image(310, 32, 100, 90, "files/images/skins/none.png");
|
characterSelect.skinImage = characterSelect.window.image(310, 32, 100, 90, "files/images/skins/none.png");
|
||||||
@@ -179,39 +179,39 @@ function showCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, ski
|
|||||||
|
|
||||||
function showNewCharacter() {
|
function showNewCharacter() {
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing new character dialog window`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing new character dialog window`);
|
||||||
showNewCharacterGUI();
|
showNewCharacterGUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function selectNextCharacter() {
|
function selectNextCharacter() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Requesting next character info from server for character select window`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Requesting next character info from server for character select window`);
|
||||||
sendNetworkEventToServer("agrp.nextCharacter");
|
sendNetworkEventToServer("agrp.nextCharacter");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function selectPreviousCharacter() {
|
function selectPreviousCharacter() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Requesting previous character info from server for character select window`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Requesting previous character info from server for character select window`);
|
||||||
sendNetworkEventToServer("agrp.previousCharacter");
|
sendNetworkEventToServer("agrp.previousCharacter");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function selectThisCharacter() {
|
function selectThisCharacter() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Tell server the current shown character was selected in character select window`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Tell server the current shown character was selected in character select window`);
|
||||||
sendNetworkEventToServer("agrp.selectCharacter");
|
sendNetworkEventToServer("agrp.selectCharacter");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function switchCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, skinId) {
|
function switchCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, skinId) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Updating character info with data from server`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Updating character info with data from server`);
|
||||||
setChatWindowEnabled(false);
|
setChatWindowEnabled(false);
|
||||||
characterSelect.window.shown = false;
|
characterSelect.window.shown = false;
|
||||||
characterSelect.nameText.text = `${firstName} ${lastName}`;
|
characterSelect.nameText.text = `${firstName} ${lastName}`;
|
||||||
characterSelect.cashText.text = `Money: $${cash}`;
|
characterSelect.cashText.text = `Money: ${getCurrencyString(cash)}`;
|
||||||
characterSelect.clanText.text = `Clan: ${clan}`;
|
characterSelect.clanText.text = `Clan: ${clan}`;
|
||||||
characterSelect.lastPlayedText.text = `Last Played: ${lastPlayed}`;
|
characterSelect.lastPlayedText.text = `Last Played: ${lastPlayed}`;
|
||||||
|
|
||||||
@@ -230,7 +230,7 @@ function switchCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, s
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function characterSelectSuccess() {
|
function characterSelectSuccess() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports character selection was successful`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports character selection was successful`);
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,12 +10,16 @@
|
|||||||
|
|
||||||
let clanManager = {
|
let clanManager = {
|
||||||
window: null,
|
window: null,
|
||||||
generalTab: null,
|
generalTabButton: null,
|
||||||
ranksTab: null,
|
ranksTabButton: null,
|
||||||
membersTab: null,
|
membersTabButton: null,
|
||||||
vehiclesTab: null,
|
vehiclesTabButton: null,
|
||||||
businessesTab: null,
|
businessesTabButton: null,
|
||||||
housesTab: null,
|
housesTabButton: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function initClanManagerGUI() {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -17,7 +17,7 @@ let errorDialog = {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initErrorDialogGUI() {
|
function initErrorDialogGUI() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating error GUI ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating error GUI ...`);
|
||||||
errorDialog.window = mexui.window(getScreenWidth() / 2 - 200, getScreenHeight() / 2 - 70, 400, 140, 'ERROR', {
|
errorDialog.window = mexui.window(getScreenWidth() / 2 - 200, getScreenHeight() / 2 - 70, 400, 140, 'ERROR', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
||||||
@@ -59,14 +59,14 @@ function initErrorDialogGUI() {
|
|||||||
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], 255),
|
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], 255),
|
||||||
},
|
},
|
||||||
}, closeErrorDialog);
|
}, closeErrorDialog);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Created error GUI ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created error GUI ...`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showErrorGUI(errorMessage, errorTitle, buttonText) {
|
function showErrorGUI(errorMessage, errorTitle, buttonText) {
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing error window. Error: ${errorTitle} - ${errorMessage}`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing error window. Error: ${errorTitle} - ${errorMessage}`);
|
||||||
setChatWindowEnabled(false);
|
setChatWindowEnabled(false);
|
||||||
mexui.setInput(true);
|
mexui.setInput(true);
|
||||||
errorDialog.messageLabel.text = errorMessage;
|
errorDialog.messageLabel.text = errorMessage;
|
||||||
@@ -78,7 +78,7 @@ function showErrorGUI(errorMessage, errorTitle, buttonText) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function closeErrorDialog() {
|
function closeErrorDialog() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Closing error dialog`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Closing error dialog`);
|
||||||
errorDialog.window.shown = false;
|
errorDialog.window.shown = false;
|
||||||
mexui.setInput(false);
|
mexui.setInput(false);
|
||||||
}
|
}
|
||||||
|
|||||||
40
scripts/client/gui/games/5cardpoker.js
Normal file
40
scripts/client/gui/games/5cardpoker.js
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
// ===========================================================================
|
||||||
|
// Asshat Gaming Roleplay
|
||||||
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
|
// ===========================================================================
|
||||||
|
// FILE: 5cardpoker.js
|
||||||
|
// DESC: Provides 5-card poker games GUI
|
||||||
|
// TYPE: Client (JavaScript)
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
let fiveCardPokerGUI = {
|
||||||
|
window: null,
|
||||||
|
}
|
||||||
|
|
||||||
|
function initFiveCardPokerGUI() {
|
||||||
|
// Render a five card poker game in MexUI
|
||||||
|
//logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating five-card poker GUI ...`);
|
||||||
|
fiveCardPokerGUI.window = mexui.window(game.width / 2 - 200, game.height - 150, 400, 400, 'Five Card Poker', {
|
||||||
|
main: {
|
||||||
|
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], 0),
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
textSize: 11.0,
|
||||||
|
textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], 255),
|
||||||
|
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
|
||||||
|
},
|
||||||
|
icon: {
|
||||||
|
textSize: 0.0,
|
||||||
|
textColour: toColour(0, 0, 0, 0),
|
||||||
|
backgroundColour: toColour(0, 0, 0, 0),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
fiveCardPokerGUI.window.titleBarShown = false;
|
||||||
|
|
||||||
|
fiveCardPokerGUI.window.shown = false;
|
||||||
|
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created five card poker GUI`);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -23,7 +23,7 @@ let dealerCards = [];
|
|||||||
|
|
||||||
function initBlackJackGUI() {
|
function initBlackJackGUI() {
|
||||||
// Render a blackjack game in MexUI
|
// Render a blackjack game in MexUI
|
||||||
//logToConsole(LOG_DEBUG, `[VRR.GUI] Creating blackjack GUI ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating blackjack GUI ...`);
|
||||||
blackJackGUI.window = mexui.window(game.width / 2 - 200, game.height - 150, 400, 400, 'Blackjack', {
|
blackJackGUI.window = mexui.window(game.width / 2 - 200, game.height - 150, 400, 400, 'Blackjack', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], 0),
|
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], 0),
|
||||||
@@ -43,7 +43,7 @@ function initBlackJackGUI() {
|
|||||||
|
|
||||||
blackJackGUI.window.shown = false;
|
blackJackGUI.window.shown = false;
|
||||||
|
|
||||||
//logToConsole(LOG_DEBUG, `[VRR.GUI] Created blackjack GUI`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created blackjack GUI`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -17,7 +17,7 @@ let infoDialog = {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initInfoDialogGUI() {
|
function initInfoDialogGUI() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating info dialog GUI ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating info dialog GUI ...`);
|
||||||
infoDialog.window = mexui.window(getScreenWidth() / 2 - 200, getScreenHeight() / 2 - 70, 400, 140, 'Information', {
|
infoDialog.window = mexui.window(getScreenWidth() / 2 - 200, getScreenHeight() / 2 - 70, 400, 140, 'Information', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
||||||
@@ -58,13 +58,13 @@ function initInfoDialogGUI() {
|
|||||||
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], 255),
|
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], 255),
|
||||||
},
|
},
|
||||||
}, closeInfoDialog);
|
}, closeInfoDialog);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Created info dialog GUI`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created info dialog GUI`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function closeInfoDialog() {
|
function closeInfoDialog() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Closing info dialog`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Closing info dialog`);
|
||||||
infoDialog.window.shown = false;
|
infoDialog.window.shown = false;
|
||||||
mexui.setInput(false);
|
mexui.setInput(false);
|
||||||
}
|
}
|
||||||
@@ -73,7 +73,7 @@ function closeInfoDialog() {
|
|||||||
|
|
||||||
function showInfoGUI(infoMessage, infoTitle, buttonText) {
|
function showInfoGUI(infoMessage, infoTitle, buttonText) {
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing info dialog window. Info: ${infoTitle} - ${infoMessage}`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing info dialog window. Info: ${infoTitle} - ${infoMessage}`);
|
||||||
mexui.setInput(true);
|
mexui.setInput(true);
|
||||||
infoDialog.messageLabel.text = infoMessage;
|
infoDialog.messageLabel.text = infoMessage;
|
||||||
infoDialog.okayButton.text = buttonText;
|
infoDialog.okayButton.text = buttonText;
|
||||||
|
|||||||
45
scripts/client/gui/inventory.js
Normal file
45
scripts/client/gui/inventory.js
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
// ===========================================================================
|
||||||
|
// Asshat Gaming Roleplay
|
||||||
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
|
// ===========================================================================
|
||||||
|
// FILE: inventory.js
|
||||||
|
// DESC: Provides inventory dialog box GUI
|
||||||
|
// TYPE: Client (JavaScript)
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
let inventoryGUI = [
|
||||||
|
{
|
||||||
|
window: null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
window: null,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function initInventoryGUI() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function closeAllInventoryGUI() {
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Closing all inventory GUI`);
|
||||||
|
for (let i in inventoryGUI) {
|
||||||
|
inventoryGUI[i].window.shown = false;
|
||||||
|
}
|
||||||
|
mexui.setInput(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function showInventoryGUI(inventoryIndex, items) {
|
||||||
|
closeAllWindows();
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing inventory window. Index: ${inventoryIndex}`);
|
||||||
|
inventoryGUI[inventoryIndex].window.shown = true;
|
||||||
|
mexui.setInput(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
45
scripts/client/gui/inventorybulk.js
Normal file
45
scripts/client/gui/inventorybulk.js
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
// ===========================================================================
|
||||||
|
// Asshat Gaming Roleplay
|
||||||
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
|
// ===========================================================================
|
||||||
|
// FILE: inventorybulk.js
|
||||||
|
// DESC: Provides bulk inventory box GUI
|
||||||
|
// TYPE: Client (JavaScript)
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
let inventoryBulkGUI = [
|
||||||
|
{
|
||||||
|
window: null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
window: null,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function initInventoryBulkGUI() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function closeAllInventoryBulkGUI() {
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Closing all bulk inventory GUI`);
|
||||||
|
for (let i in inventoryBulkGUI) {
|
||||||
|
inventoryBulkGUI[i].window.shown = false;
|
||||||
|
}
|
||||||
|
mexui.setInput(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function showInventoryBulkGUI(inventoryIndex, items) {
|
||||||
|
closeAllWindows();
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing bulk inventory window. Index: ${inventoryIndex}`);
|
||||||
|
inventoryBulkGUI[inventoryIndex].window.shown = true;
|
||||||
|
mexui.setInput(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -12,12 +12,14 @@ let listDialog = {
|
|||||||
window: null,
|
window: null,
|
||||||
messageLabel: null,
|
messageLabel: null,
|
||||||
listGrid: null,
|
listGrid: null,
|
||||||
|
|
||||||
|
listRows: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initListGUI() {
|
function initListGUI() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating list dialog GUI ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating list dialog GUI ...`);
|
||||||
listDialog.window = mexui.window(game.width / 2 - 200, game.height / 2 - 70, 400, 500, 'List', {
|
listDialog.window = mexui.window(game.width / 2 - 200, game.height / 2 - 70, 400, 500, 'List', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
||||||
@@ -71,14 +73,14 @@ function initListGUI() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Created list dialog GUI`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created list dialog GUI`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showListGUI() {
|
function showListGUI() {
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing login window`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing list window`);
|
||||||
setChatWindowEnabled(false);
|
setChatWindowEnabled(false);
|
||||||
mexui.setInput(true);
|
mexui.setInput(true);
|
||||||
listDialog.window.shown = true;
|
listDialog.window.shown = true;
|
||||||
@@ -90,19 +92,56 @@ function showListGUI() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function checkListDialogSelection() {
|
function checkListDialogSelection() {
|
||||||
|
if (!listDialog.listGrid.activeRow) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
sendNetworkEventToServer("agrp.list.select", listDialog.listGrid.activeRow.getEntryIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function selectPreviousListItem() {
|
function selectPreviousListItem() {
|
||||||
|
if (!listDialog.listGrid.activeRow) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
let activeRowId = listDialog.listGrid.activeRow.getEntryIndex();
|
||||||
|
if (activeRowId <= 1) {
|
||||||
|
listDialog.listGrid.activeRow = 0;
|
||||||
|
} else {
|
||||||
|
listDialog.listGrid.activeRow = listDialog.listRows[activeRowId - 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
//sendNetworkEventToServer("agrp.list.next", listDialog.listGrid.activeRow.getEntryIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function selectNextListItem() {
|
function selectNextListItem() {
|
||||||
|
let activeRowId = listDialog.listGrid.activeRow.getEntryIndex();
|
||||||
|
if (activeRowId >= listDialog.listRows.length - 1) {
|
||||||
|
listDialog.listGrid.activeRow = 0;
|
||||||
|
} else {
|
||||||
|
listDialog.listGrid.activeRow = listDialog.listRows[activeRowId + 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
//sendNetworkEventToServer("agrp.list.next", listDialog.listGrid.activeRow.getEntryIndex());
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function clearListGUI() {
|
||||||
|
listDialog.listGrid.removeAllEntries();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function populateListGUI(listItems) {
|
||||||
|
for (let i in listItems) {
|
||||||
|
let row = listDialog.listGrid.row(listItems[i]);
|
||||||
|
listDialog.listRows.push(row);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -20,7 +20,7 @@ let flagImageGap = toVector2(5, 5);
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initLocaleChooserGUI() {
|
function initLocaleChooserGUI() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating locale chooser GUI ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating locale chooser GUI ...`);
|
||||||
localeChooser.window = mexui.window(game.width / 2 - 200, game.height - 150, 60, 60, 'Choose a language', {
|
localeChooser.window = mexui.window(game.width / 2 - 200, game.height - 150, 60, 60, 'Choose a language', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], 0),
|
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], 0),
|
||||||
@@ -40,15 +40,13 @@ function initLocaleChooserGUI() {
|
|||||||
|
|
||||||
localeChooser.window.shown = false;
|
localeChooser.window.shown = false;
|
||||||
|
|
||||||
loadLocaleConfig();
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created locale chooser GUI`);
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Created locale chooser GUI`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function closeLocaleChooserGUI() {
|
function closeLocaleChooserGUI() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Closing locale chooser window`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Closing locale chooser window`);
|
||||||
localeChooser.window.shown = false;
|
localeChooser.window.shown = false;
|
||||||
for (let i in localeChooser.flagImages) {
|
for (let i in localeChooser.flagImages) {
|
||||||
localeChooser.flagImages[i].shown = false;
|
localeChooser.flagImages[i].shown = false;
|
||||||
@@ -59,9 +57,6 @@ function closeLocaleChooserGUI() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showLocaleChooserGUI(position = toVector2(0.0, 0.0)) {
|
function showLocaleChooserGUI(position = toVector2(0.0, 0.0)) {
|
||||||
// Disabled for now until image loading crash can be fixed
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (position.x != 0.0 && position.y != 0.0) {
|
if (position.x != 0.0 && position.y != 0.0) {
|
||||||
localeChooser.window.position = position;
|
localeChooser.window.position = position;
|
||||||
} else {
|
} else {
|
||||||
@@ -69,7 +64,7 @@ function showLocaleChooserGUI(position = toVector2(0.0, 0.0)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//closeAllWindows();
|
//closeAllWindows();
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing locale chooser window`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing locale chooser window`);
|
||||||
mexui.setInput(true);
|
mexui.setInput(true);
|
||||||
localeChooser.window.shown = true;
|
localeChooser.window.shown = true;
|
||||||
|
|
||||||
@@ -81,7 +76,7 @@ function showLocaleChooserGUI(position = toVector2(0.0, 0.0)) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function toggleLocaleChooserGUI() {
|
function toggleLocaleChooserGUI() {
|
||||||
if (localeChooser.window.shown) {
|
if (localeChooser.window.shown == true) {
|
||||||
closeLocaleChooserGUI();
|
closeLocaleChooserGUI();
|
||||||
} else {
|
} else {
|
||||||
showLocaleChooserGUI();
|
showLocaleChooserGUI();
|
||||||
@@ -91,14 +86,14 @@ function toggleLocaleChooserGUI() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function localeChooserSetLocale(localeId) {
|
function localeChooserSetLocale(localeId) {
|
||||||
logToConsole(LOG_DEBUG | LOG_WARN, `[VRR.GUI] Asking server to change locale to ${localeId}`);
|
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.GUI] Asking server to change locale to ${localeId}`);
|
||||||
sendLocaleSelectToServer(localeId);
|
sendLocaleSelectToServer(localeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function resetLocaleChooserOptions() {
|
function resetLocaleChooserOptions() {
|
||||||
logToConsole(LOG_DEBUG | LOG_WARN, `[VRR.GUI] Resetting locale chooser options`);
|
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.GUI] Resetting locale chooser options`);
|
||||||
|
|
||||||
// let tempLocaleOptions = getServerData().localeOptions; // getAvailableLocaleOptions();
|
// let tempLocaleOptions = getServerData().localeOptions; // getAvailableLocaleOptions();
|
||||||
let tempLocaleOptions = getAvailableLocaleOptions();
|
let tempLocaleOptions = getAvailableLocaleOptions();
|
||||||
@@ -122,7 +117,7 @@ function resetLocaleChooserOptions() {
|
|||||||
|
|
||||||
localeChooser.flagImages[i].shown = false;
|
localeChooser.flagImages[i].shown = false;
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG | LOG_WARN, `[VRR.GUI] Created locale chooser option ${tempLocaleOptions[i].englishName} with image ${imagePath}`);
|
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.GUI] Created locale chooser option ${tempLocaleOptions[i].englishName} with image ${imagePath}`);
|
||||||
|
|
||||||
//localeChooser.activeRingImages.push(activeRingImage);
|
//localeChooser.activeRingImages.push(activeRingImage);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ let loginHTML =
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initLoginGUI() {
|
function initLoginGUI() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating login GUI ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating login GUI ...`);
|
||||||
login.window = mexui.window(getScreenWidth() / 2 - 150, getScreenHeight() / 2 - 135, 300, 275, 'LOGIN', {
|
login.window = mexui.window(getScreenWidth() / 2 - 150, getScreenHeight() / 2 - 135, 300, 275, 'LOGIN', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
||||||
@@ -109,7 +109,7 @@ function initLoginGUI() {
|
|||||||
login.loginButton = login.window.button(20, 205, 260, 30, 'LOGIN', {
|
login.loginButton = login.window.button(20, 205, 260, 30, 'LOGIN', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
|
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
|
||||||
textColour: toColour(0, 0, 0, 255),
|
textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], 255),
|
||||||
textSize: 12.0,
|
textSize: 12.0,
|
||||||
textFont: mainFont,
|
textFont: mainFont,
|
||||||
textAlign: 0.5,
|
textAlign: 0.5,
|
||||||
@@ -122,7 +122,7 @@ function initLoginGUI() {
|
|||||||
login.forgotPasswordButton = login.window.button(180, 240, 100, 15, 'RESET PASS', {
|
login.forgotPasswordButton = login.window.button(180, 240, 100, 15, 'RESET PASS', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
|
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
|
||||||
textColour: toColour(0, 0, 0, 255),
|
textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], 255),
|
||||||
textSize: 8.0,
|
textSize: 8.0,
|
||||||
textFont: mainFont,
|
textFont: mainFont,
|
||||||
textAlign: 0.5,
|
textAlign: 0.5,
|
||||||
@@ -144,14 +144,14 @@ function initLoginGUI() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Created login GUI`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created login GUI`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showLoginGUI() {
|
function showLoginGUI() {
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing login window`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing login window`);
|
||||||
setChatWindowEnabled(false);
|
setChatWindowEnabled(false);
|
||||||
mexui.setInput(true);
|
mexui.setInput(true);
|
||||||
login.window.shown = true;
|
login.window.shown = true;
|
||||||
@@ -165,14 +165,14 @@ function showLoginGUI() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function checkLogin() {
|
function checkLogin() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Checking login with server ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Checking login with server ...`);
|
||||||
sendNetworkEventToServer("agrp.checkLogin", login.passwordInput.lines[0]);
|
sendNetworkEventToServer("agrp.checkLogin", login.passwordInput.lines[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loginFailed(errorMessage) {
|
function loginFailed(errorMessage) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports login failed`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports login failed`);
|
||||||
login.messageLabel.text = errorMessage;
|
login.messageLabel.text = errorMessage;
|
||||||
login.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
|
login.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
|
||||||
login.passwordInput.text = "";
|
login.passwordInput.text = "";
|
||||||
@@ -181,7 +181,7 @@ function loginFailed(errorMessage) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loginSuccess() {
|
function loginSuccess() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports login was successful`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports login was successful`);
|
||||||
guiSubmitKey = false;
|
guiSubmitKey = false;
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
}
|
}
|
||||||
@@ -190,7 +190,7 @@ function loginSuccess() {
|
|||||||
|
|
||||||
function switchToPasswordResetGUI() {
|
function switchToPasswordResetGUI() {
|
||||||
//closeAllWindows();
|
//closeAllWindows();
|
||||||
//logToConsole(LOG_DEBUG, `[VRR.GUI] Showing password reset dialog window`);
|
//logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing password reset dialog window`);
|
||||||
//showResetPasswordGUI();
|
//showResetPasswordGUI();
|
||||||
sendNetworkEventToServer("agrp.checkResetPassword", "");
|
sendNetworkEventToServer("agrp.checkResetPassword", "");
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ let newCharacter = {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initNewCharacterGUI() {
|
function initNewCharacterGUI() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating new character GUI ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating new character GUI ...`);
|
||||||
newCharacter.window = mexui.window(getScreenWidth() / 2 - 130, getScreenHeight() / 2 - 115, 300, 230, 'NEW CHARACTER', {
|
newCharacter.window = mexui.window(getScreenWidth() / 2 - 130, getScreenHeight() / 2 - 115, 300, 230, 'NEW CHARACTER', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
||||||
@@ -111,13 +111,13 @@ function initNewCharacterGUI() {
|
|||||||
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
|
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
|
||||||
},
|
},
|
||||||
}, checkNewCharacter);
|
}, checkNewCharacter);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Created new character GUI`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created new character GUI`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function newCharacterFailed(errorMessage) {
|
function newCharacterFailed(errorMessage) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports new character creation failed. Reason: ${errorMessage}`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports new character creation failed. Reason: ${errorMessage}`);
|
||||||
newCharacter.messageLabel.text = errorMessage;
|
newCharacter.messageLabel.text = errorMessage;
|
||||||
newCharacter.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
|
newCharacter.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
|
||||||
newCharacter.firstNameInput.text = "";
|
newCharacter.firstNameInput.text = "";
|
||||||
@@ -135,7 +135,7 @@ function newCharacterFailed(errorMessage) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function checkNewCharacter() {
|
function checkNewCharacter() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Checking new character with server ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Checking new character with server ...`);
|
||||||
if (newCharacter.firstNameInput.lines[0].length < 2) {
|
if (newCharacter.firstNameInput.lines[0].length < 2) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -153,7 +153,7 @@ function checkNewCharacter() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showNewCharacterGUI() {
|
function showNewCharacterGUI() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing new character window`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing new character window`);
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
setChatWindowEnabled(false);
|
setChatWindowEnabled(false);
|
||||||
mexui.setInput(true);
|
mexui.setInput(true);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ let register = {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initRegisterGUI() {
|
function initRegisterGUI() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating register GUI ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating register GUI ...`);
|
||||||
register.window = mexui.window(getScreenWidth() / 2 - 150, getScreenHeight() / 2 - 150, 300, 300, 'Register', {
|
register.window = mexui.window(getScreenWidth() / 2 - 150, getScreenHeight() / 2 - 150, 300, 300, 'Register', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
||||||
@@ -131,13 +131,13 @@ function initRegisterGUI() {
|
|||||||
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
|
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
|
||||||
},
|
},
|
||||||
}, checkRegistration);
|
}, checkRegistration);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Created register GUI`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created register GUI`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function registrationFailed(errorMessage) {
|
function registrationFailed(errorMessage) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports registration failed. Reason: ${errorMessage}`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports registration failed. Reason: ${errorMessage}`);
|
||||||
register.messageLabel.text = errorMessage;
|
register.messageLabel.text = errorMessage;
|
||||||
register.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
|
register.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
|
||||||
register.passwordInput.text = "";
|
register.passwordInput.text = "";
|
||||||
@@ -148,14 +148,14 @@ function registrationFailed(errorMessage) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function checkRegistration() {
|
function checkRegistration() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Checking registration with server ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Checking registration with server ...`);
|
||||||
sendNetworkEventToServer("agrp.checkRegistration", register.passwordInput.lines[0], register.confirmPasswordInput.lines[0], register.emailInput.lines[0]);
|
sendNetworkEventToServer("agrp.checkRegistration", register.passwordInput.lines[0], register.confirmPasswordInput.lines[0], register.emailInput.lines[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showRegistrationGUI() {
|
function showRegistrationGUI() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing registration window`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing registration window`);
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
setChatWindowEnabled(false);
|
setChatWindowEnabled(false);
|
||||||
mexui.setInput(true);
|
mexui.setInput(true);
|
||||||
@@ -171,7 +171,7 @@ function showRegistrationGUI() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function registrationSuccess() {
|
function registrationSuccess() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports registration was successful`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports registration was successful`);
|
||||||
guiSubmitKey = false;
|
guiSubmitKey = false;
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ let passwordReset = {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initResetPasswordGUI() {
|
function initResetPasswordGUI() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating password reset GUI ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating password reset GUI ...`);
|
||||||
passwordReset.window = mexui.window(getScreenWidth() / 2 - 150, getScreenHeight() / 2 - 135, 300, 275, 'RESET PASSWORD', {
|
passwordReset.window = mexui.window(getScreenWidth() / 2 - 150, getScreenHeight() / 2 - 135, 300, 275, 'RESET PASSWORD', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
||||||
@@ -121,14 +121,14 @@ function initResetPasswordGUI() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Created password reset GUI`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created password reset GUI`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showResetPasswordGUI() {
|
function showResetPasswordGUI() {
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing password reset window`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing password reset window`);
|
||||||
setChatWindowEnabled(false);
|
setChatWindowEnabled(false);
|
||||||
mexui.setInput(true);
|
mexui.setInput(true);
|
||||||
passwordReset.window.shown = true;
|
passwordReset.window.shown = true;
|
||||||
@@ -142,14 +142,14 @@ function showResetPasswordGUI() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function checkResetPassword() {
|
function checkResetPassword() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Checking password reset with server (${passwordReset.emailInput.lines[0]}) ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Checking password reset with server (${passwordReset.emailInput.lines[0]}) ...`);
|
||||||
sendNetworkEventToServer("agrp.checkResetPassword", passwordReset.emailInput.lines[0]);
|
sendNetworkEventToServer("agrp.checkResetPassword", passwordReset.emailInput.lines[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function resetPasswordFailed(errorMessage) {
|
function resetPasswordFailed(errorMessage) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports password reset failed`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports password reset failed`);
|
||||||
passwordReset.messageLabel.text = errorMessage;
|
passwordReset.messageLabel.text = errorMessage;
|
||||||
passwordReset.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
|
passwordReset.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
|
||||||
passwordReset.emailInput.text = "";
|
passwordReset.emailInput.text = "";
|
||||||
@@ -158,7 +158,7 @@ function resetPasswordFailed(errorMessage) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function resetPasswordCodeInputGUI() {
|
function resetPasswordCodeInputGUI() {
|
||||||
logToConsole(LOG_DEBUG | LOG_WARN, `[VRR.GUI] Server reports password reset email confirmation was successful. Asking for code ...`);
|
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.GUI] Server reports password reset email confirmation was successful. Asking for code ...`);
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
|
|
||||||
passwordReset.messageLabel.text = getLocaleString("GUIResetPasswordCodeInputLabel");
|
passwordReset.messageLabel.text = getLocaleString("GUIResetPasswordCodeInputLabel");
|
||||||
@@ -173,7 +173,7 @@ function resetPasswordCodeInputGUI() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function resetPasswordEmailInputGUI() {
|
function resetPasswordEmailInputGUI() {
|
||||||
logToConsole(LOG_DEBUG | LOG_WARN, `[VRR.GUI] Server reports password reset request was approved. Asking for email ...`);
|
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.GUI] Server reports password reset request was approved. Asking for email ...`);
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
|
|
||||||
passwordReset.messageLabel.text = getLocaleString("GUIResetPasswordConfirmEmailLabel");
|
passwordReset.messageLabel.text = getLocaleString("GUIResetPasswordConfirmEmailLabel");
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ let yesNoDialog = {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initYesNoDialogGUI() {
|
function initYesNoDialogGUI() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Created prompt GUI ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created prompt GUI ...`);
|
||||||
yesNoDialog.window = mexui.window(game.width / 2 - 200, game.height / 2 - 70, 400, 140, 'Question', {
|
yesNoDialog.window = mexui.window(game.width / 2 - 200, game.height / 2 - 70, 400, 140, 'Question', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
||||||
@@ -74,14 +74,14 @@ function initYesNoDialogGUI() {
|
|||||||
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], 255),
|
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], 255),
|
||||||
},
|
},
|
||||||
}, yesNoDialogAnswerNo);
|
}, yesNoDialogAnswerNo);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Created prompt GUI`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created prompt GUI`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showYesNoPromptGUI(promptMessage, promptTitle, yesButtonText, noButtonText) {
|
function showYesNoPromptGUI(promptMessage, promptTitle, yesButtonText, noButtonText) {
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing prompt window. Prompt: ${promptTitle} - ${promptMessage}`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing prompt window. Prompt: ${promptTitle} - ${promptMessage}`);
|
||||||
mexui.setInput(true);
|
mexui.setInput(true);
|
||||||
|
|
||||||
yesNoDialog.messageLabel.text = "";
|
yesNoDialog.messageLabel.text = "";
|
||||||
@@ -100,7 +100,7 @@ function showYesNoPromptGUI(promptMessage, promptTitle, yesButtonText, noButtonT
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function yesNoDialogAnswerNo() {
|
function yesNoDialogAnswerNo() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Responding with answer NO to server prompt`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Responding with answer NO to server prompt`);
|
||||||
sendNetworkEventToServer("agrp.promptAnswerNo");
|
sendNetworkEventToServer("agrp.promptAnswerNo");
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
}
|
}
|
||||||
@@ -108,7 +108,7 @@ function yesNoDialogAnswerNo() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function yesNoDialogAnswerYes() {
|
function yesNoDialogAnswerYes() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Responding with answer YES to server prompt`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Responding with answer YES to server prompt`);
|
||||||
sendNetworkEventToServer("agrp.promptAnswerYes");
|
sendNetworkEventToServer("agrp.promptAnswerYes");
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,16 +17,19 @@ class HouseData {
|
|||||||
this.blipModel = blipModel;
|
this.blipModel = blipModel;
|
||||||
this.pickupModel = pickupModel;
|
this.pickupModel = pickupModel;
|
||||||
this.hasInterior = hasInterior;
|
this.hasInterior = hasInterior;
|
||||||
|
this.rentPrice = 0;
|
||||||
|
this.buyPrice = 0;
|
||||||
this.blipId = -1;
|
this.blipId = -1;
|
||||||
|
this.locked = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function receiveHouseFromServer(houseId, description, entrancePosition, blipModel, pickupModel, hasInterior) {
|
function receiveHouseFromServer(houseId, description, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.House] Received house ${houseId} (${name}) from server`);
|
logToConsole(LOG_DEBUG, `[AGRP.House] Received house ${houseId} (${name}) from server`);
|
||||||
|
|
||||||
if (!areServerElementsSupported()) {
|
if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE || getGame() == AGRP_GAME_GTA_IV) {
|
||||||
if (getHouseData(houseId) != false) {
|
if (getHouseData(houseId) != false) {
|
||||||
let houseData = getHouseData(houseId);
|
let houseData = getHouseData(houseId);
|
||||||
houseData.description = description;
|
houseData.description = description;
|
||||||
@@ -34,11 +37,24 @@ function receiveHouseFromServer(houseId, description, entrancePosition, blipMode
|
|||||||
houseData.blipModel = blipModel;
|
houseData.blipModel = blipModel;
|
||||||
houseData.pickupModel = pickupModel;
|
houseData.pickupModel = pickupModel;
|
||||||
houseData.hasInterior = hasInterior;
|
houseData.hasInterior = hasInterior;
|
||||||
|
houseData.buyPrice = buyPrice;
|
||||||
|
houseData.rentPrice = rentPrice;
|
||||||
|
houseData.locked = locked;
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId} already exists. Checking blip ...`);
|
if (houseData.buyPrice > 0) {
|
||||||
|
houseData.labelInfoType = AGRP_PROPLABEL_INFO_BUYHOUSE;
|
||||||
|
} else {
|
||||||
|
if (houseData.rentPrice > 0) {
|
||||||
|
houseData.labelInfoType = AGRP_PROPLABEL_INFO_RENTHOUSE;
|
||||||
|
} else {
|
||||||
|
houseData.labelInfoType = AGRP_PROPLABEL_INFO_ENTER;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.House] House ${houseId} already exists. Checking blip ...`);
|
||||||
if (blipModel == -1) {
|
if (blipModel == -1) {
|
||||||
if (houseData.blipId != -1) {
|
if (houseData.blipId != -1) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been removed by the server`);
|
logToConsole(LOG_DEBUG, `[AGRP.House] House ${houseId}'s blip has been removed by the server`);
|
||||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
natives.removeBlipAndClearIndex(getHouseData(houseId).blipId);
|
natives.removeBlipAndClearIndex(getHouseData(houseId).blipId);
|
||||||
} else {
|
} else {
|
||||||
@@ -46,11 +62,11 @@ function receiveHouseFromServer(houseId, description, entrancePosition, blipMode
|
|||||||
}
|
}
|
||||||
houseData.blipId = -1;
|
houseData.blipId = -1;
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip is unchanged`);
|
logToConsole(LOG_DEBUG, `[AGRP.House] House ${houseId}'s blip is unchanged`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (houseData.blipId != -1) {
|
if (houseData.blipId != -1) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been changed by the server`);
|
logToConsole(LOG_DEBUG, `[AGRP.House] House ${houseId}'s blip has been changed by the server`);
|
||||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
natives.setBlipCoordinates(houseData.blipId, houseData.entrancePosition);
|
natives.setBlipCoordinates(houseData.blipId, houseData.entrancePosition);
|
||||||
natives.changeBlipSprite(houseData.blipId, houseData.blipModel);
|
natives.changeBlipSprite(houseData.blipId, houseData.blipModel);
|
||||||
@@ -63,20 +79,20 @@ function receiveHouseFromServer(houseId, description, entrancePosition, blipMode
|
|||||||
if (blipId != -1) {
|
if (blipId != -1) {
|
||||||
houseData.blipId = blipId;
|
houseData.blipId = blipId;
|
||||||
}
|
}
|
||||||
logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
|
logToConsole(LOG_DEBUG, `[AGRP.House] House ${houseId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId} doesn't exist. Adding ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.House] House ${houseId} doesn't exist. Adding ...`);
|
||||||
let tempHouseData = new HouseData(houseId, description, entrancePosition, blipModel, pickupModel, hasInterior);
|
let tempHouseData = new HouseData(houseId, description, entrancePosition, blipModel, pickupModel, hasInterior);
|
||||||
if (blipModel != -1) {
|
if (blipModel != -1) {
|
||||||
let blipId = createGameBlip(tempHouseData.blipModel, tempHouseData.entrancePosition, "House");
|
let blipId = createGameBlip(tempHouseData.blipModel, tempHouseData.entrancePosition, "House");
|
||||||
if (blipId != -1) {
|
if (blipId != -1) {
|
||||||
tempHouseData.blipId = blipId;
|
tempHouseData.blipId = blipId;
|
||||||
}
|
}
|
||||||
logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
|
logToConsole(LOG_DEBUG, `[AGRP.House] House ${houseId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId} has no blip.`);
|
logToConsole(LOG_DEBUG, `[AGRP.House] House ${houseId} has no blip.`);
|
||||||
}
|
}
|
||||||
getServerData().houses.push(tempHouseData);
|
getServerData().houses.push(tempHouseData);
|
||||||
setAllHouseDataIndexes();
|
setAllHouseDataIndexes();
|
||||||
|
|||||||
34
scripts/client/index.js
Normal file
34
scripts/client/index.js
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
// For RAGEMP only
|
||||||
|
|
||||||
|
// Shared Scripts
|
||||||
|
require("shared/const.js");
|
||||||
|
require("shared/utilities.js");
|
||||||
|
require("shared/gamedata.js");
|
||||||
|
|
||||||
|
// Multiplayer Mod (Wrapped Natives)
|
||||||
|
require("native/ragemp.js");
|
||||||
|
|
||||||
|
// Client Scripts
|
||||||
|
require("gui.js");
|
||||||
|
require("main.js");
|
||||||
|
require("nametag.js");
|
||||||
|
require("sync.js");
|
||||||
|
require("scoreboard.js");
|
||||||
|
require("keybind.js");
|
||||||
|
require("chatbox.js");
|
||||||
|
require("label.js");
|
||||||
|
require("skin-select.js");
|
||||||
|
require("server.js");
|
||||||
|
require("job.js");
|
||||||
|
require("event.js");
|
||||||
|
require("item.js");
|
||||||
|
require("utilities.js");
|
||||||
|
require("messaging.js");
|
||||||
|
require("logo.js");
|
||||||
|
require("afk.js");
|
||||||
|
require("mousecam.js");
|
||||||
|
require("radio.js");
|
||||||
|
require("animation.js");
|
||||||
|
|
||||||
|
// Startup
|
||||||
|
require("startup.js");
|
||||||
@@ -17,8 +17,8 @@ let itemActionDelaySize = toVector2(200, 5);
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initItemScript() {
|
function initItemScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Item]: Initializing item script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.Item]: Initializing item script ...");
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Item]: Item script initialized!");
|
logToConsole(LOG_DEBUG, "[AGRP.Item]: Item script initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -48,7 +48,7 @@ function processItemActionRendering() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function updatePlayerHotBar(activeSlot, itemsArray) {
|
function updatePlayerHotBar(activeSlot, itemsArray) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Main] Updating hotbar`);
|
logToConsole(LOG_DEBUG, `[AGRP.Main] Updating hotbar`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -36,28 +36,28 @@ class JobData {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initJobScript() {
|
function initJobScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Job]: Initializing job script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.Job]: Initializing job script ...");
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Job]: Job script initialized!");
|
logToConsole(LOG_DEBUG, "[AGRP.Job]: Job script initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setLocalPlayerJobType(tempJobType) {
|
function setLocalPlayerJobType(tempJobType) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job] Set local player job type to ${tempJobType}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job] Set local player job type to ${tempJobType}`);
|
||||||
localPlayerJobType = tempJobType;
|
localPlayerJobType = tempJobType;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setLocalPlayerWorkingState(tempWorking) {
|
function setLocalPlayerWorkingState(tempWorking) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job] Setting working state to ${tempWorking}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job] Setting working state to ${tempWorking}`);
|
||||||
localPlayerWorking = tempWorking;
|
localPlayerWorking = tempWorking;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showJobRouteLocation(position, colour) {
|
function showJobRouteLocation(position, colour) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job] Showing job route location at ${position.x}, ${position.y}, ${position.z}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job] Showing job route location at ${position.x}, ${position.y}, ${position.z}`);
|
||||||
hideJobRouteLocation();
|
hideJobRouteLocation();
|
||||||
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
|
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
|
||||||
if (getGame() == AGRP_GAME_GTA_SA) {
|
if (getGame() == AGRP_GAME_GTA_SA) {
|
||||||
@@ -81,7 +81,7 @@ function showJobRouteLocation(position, colour) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function enteredJobRouteSphere() {
|
function enteredJobRouteSphere() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job] Entered job route sphere`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job] Entered job route sphere`);
|
||||||
hideJobRouteLocation();
|
hideJobRouteLocation();
|
||||||
tellServerPlayerArrivedAtJobRouteLocation();
|
tellServerPlayerArrivedAtJobRouteLocation();
|
||||||
}
|
}
|
||||||
@@ -115,7 +115,7 @@ function blinkJobRouteLocationBlip(times, position, colour) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function hideJobRouteLocation() {
|
function hideJobRouteLocation() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job] Hiding job route location`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job] Hiding job route location`);
|
||||||
|
|
||||||
if (jobRouteLocationBlip != null) {
|
if (jobRouteLocationBlip != null) {
|
||||||
destroyElement(jobRouteLocationBlip);
|
destroyElement(jobRouteLocationBlip);
|
||||||
@@ -138,9 +138,9 @@ function hideJobRouteLocation() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, pickupModel) {
|
function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, pickupModel) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job] Received job ${jobId} (${name}) from server`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job] Received job ${jobId} (${name}) from server`);
|
||||||
|
|
||||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE || getGame() == AGRP_GAME_GTA_IV) {
|
||||||
if (getJobData(jobId) != false) {
|
if (getJobData(jobId) != false) {
|
||||||
let jobData = getJobData(jobId);
|
let jobData = getJobData(jobId);
|
||||||
jobData.jobLocationId = jobLocationId;
|
jobData.jobLocationId = jobLocationId;
|
||||||
@@ -149,10 +149,10 @@ function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, p
|
|||||||
jobData.blipModel = blipModel;
|
jobData.blipModel = blipModel;
|
||||||
jobData.pickupModel = pickupModel;
|
jobData.pickupModel = pickupModel;
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId} already exists. Checking blip ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job] Job ${jobId} already exists. Checking blip ...`);
|
||||||
if (blipModel == -1) {
|
if (blipModel == -1) {
|
||||||
if (jobData.blipId != -1) {
|
if (jobData.blipId != -1) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been removed by the server`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job] Job ${jobId}'s blip has been removed by the server`);
|
||||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
natives.removeBlipAndClearIndex(getJobData(jobId).blipId);
|
natives.removeBlipAndClearIndex(getJobData(jobId).blipId);
|
||||||
} else {
|
} else {
|
||||||
@@ -160,11 +160,11 @@ function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, p
|
|||||||
}
|
}
|
||||||
jobData.blipId = -1;
|
jobData.blipId = -1;
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip is unchanged`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job] Job ${jobId}'s blip is unchanged`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (jobData.blipId != -1) {
|
if (jobData.blipId != -1) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been changed by the server`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job] Job ${jobId}'s blip has been changed by the server`);
|
||||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
natives.setBlipCoordinates(jobData.blipId, jobData.position);
|
natives.setBlipCoordinates(jobData.blipId, jobData.position);
|
||||||
natives.changeBlipSprite(jobData.blipId, jobData.blipModel);
|
natives.changeBlipSprite(jobData.blipId, jobData.blipModel);
|
||||||
@@ -177,20 +177,20 @@ function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, p
|
|||||||
if (blipId != -1) {
|
if (blipId != -1) {
|
||||||
jobData.blipId = blipId;
|
jobData.blipId = blipId;
|
||||||
}
|
}
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job] Job ${jobId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId} doesn't exist. Adding ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job] Job ${jobId} doesn't exist. Adding ...`);
|
||||||
let tempJobData = new JobData(jobId, jobLocationId, name, position, blipModel, pickupModel);
|
let tempJobData = new JobData(jobId, jobLocationId, name, position, blipModel, pickupModel);
|
||||||
if (blipModel != -1) {
|
if (blipModel != -1) {
|
||||||
let blipId = createGameBlip(blipModel, tempJobData.position, tempJobData.name);
|
let blipId = createGameBlip(blipModel, tempJobData.position, tempJobData.name);
|
||||||
if (blipId != -1) {
|
if (blipId != -1) {
|
||||||
tempJobData.blipId = blipId;
|
tempJobData.blipId = blipId;
|
||||||
}
|
}
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job] Job ${jobId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId} has no blip.`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job] Job ${jobId} has no blip.`);
|
||||||
}
|
}
|
||||||
getServerData().jobs.push(tempJobData);
|
getServerData().jobs.push(tempJobData);
|
||||||
setAllJobDataIndexes();
|
setAllJobDataIndexes();
|
||||||
|
|||||||
@@ -17,14 +17,14 @@ let keyBindLongHoldDuration = 1500;
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initKeyBindScript() {
|
function initKeyBindScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.KeyBind]: Initializing key bind script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.KeyBind]: Initializing key bind script ...");
|
||||||
logToConsole(LOG_DEBUG, "[VRR.KeyBind]: Key bind script initialized!");
|
logToConsole(LOG_DEBUG, "[AGRP.KeyBind]: Key bind script initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function bindAccountKey(key, keyState) {
|
function bindAccountKey(key, keyState) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Binded key ${toUpperCase(getKeyNameFromId(key))} (${key})`);
|
logToConsole(LOG_DEBUG, `[AGRP.KeyBind]: Binded key ${toUpperCase(getKeyNameFromId(key))} (${key})`);
|
||||||
keyBinds.push(toInteger(key));
|
keyBinds.push(toInteger(key));
|
||||||
bindKey(toInteger(key), keyState, function (event) {
|
bindKey(toInteger(key), keyState, function (event) {
|
||||||
if (isAnyGUIActive()) {
|
if (isAnyGUIActive()) {
|
||||||
@@ -33,14 +33,14 @@ function bindAccountKey(key, keyState) {
|
|||||||
|
|
||||||
if (hasKeyBindDelayElapsed()) {
|
if (hasKeyBindDelayElapsed()) {
|
||||||
if (canLocalPlayerUseKeyBinds()) {
|
if (canLocalPlayerUseKeyBinds()) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Using keybind for key ${toUpperCase(getKeyNameFromId(key))} (${key})`);
|
logToConsole(LOG_DEBUG, `[AGRP.KeyBind]: Using keybind for key ${toUpperCase(getKeyNameFromId(key))} (${key})`);
|
||||||
lastKeyBindUse = sdl.ticks;
|
lastKeyBindUse = sdl.ticks;
|
||||||
tellServerPlayerUsedKeyBind(key);
|
tellServerPlayerUsedKeyBind(key);
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Failed to use keybind for key ${toUpperCase(getKeyNameFromId(key))} (${key}) - Not allowed to use keybinds!`);
|
logToConsole(LOG_DEBUG, `[AGRP.KeyBind]: Failed to use keybind for key ${toUpperCase(getKeyNameFromId(key))} (${key}) - Not allowed to use keybinds!`);
|
||||||
}
|
}
|
||||||
} else {
|
} 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!`);
|
logToConsole(LOG_DEBUG, `[AGRP.KeyBind]: Failed to use keybind for key ${toUpperCase(getKeyNameFromId(key))} (${key}) - Not enough time has passed since last keybind use!`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -48,7 +48,7 @@ function bindAccountKey(key, keyState) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function unBindAccountKey(key) {
|
function unBindAccountKey(key) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Unbinded key ${toUpperCase(getKeyNameFromId(key))} (${key})`);
|
logToConsole(LOG_DEBUG, `[AGRP.KeyBind]: Unbinded key ${toUpperCase(getKeyNameFromId(key))} (${key})`);
|
||||||
unbindKey(key);
|
unbindKey(key);
|
||||||
keyBinds.splice(keyBinds.indexOf(key), 1);
|
keyBinds.splice(keyBinds.indexOf(key), 1);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -14,7 +14,12 @@ let jobLabels = [];
|
|||||||
|
|
||||||
let propertyLabelNameFont = null;
|
let propertyLabelNameFont = null;
|
||||||
let propertyLabelLockedFont = null;
|
let propertyLabelLockedFont = null;
|
||||||
let propertyLabelHeight = 1.0;
|
let propertyLabelHeight = (getGame() == AGRP_GAME_MAFIA_ONE) ? 2.0 : 1.0;
|
||||||
|
let propertyPickupRenderDistance = 75.0;
|
||||||
|
let propertyLabelRenderDistance = 5.0;
|
||||||
|
let propertyLabelLockedOffset = 16;
|
||||||
|
let propertyLabelNameOffset = 20;
|
||||||
|
let propertyLabelPriceOffset = 16;
|
||||||
|
|
||||||
let jobNameLabelFont = null;
|
let jobNameLabelFont = null;
|
||||||
let jobHelpLabelFont = null;
|
let jobHelpLabelFont = null;
|
||||||
@@ -23,21 +28,15 @@ let unlockedColour = toColour(50, 205, 50, 255);
|
|||||||
let lockedColour = toColour(205, 92, 92, 255);
|
let lockedColour = toColour(205, 92, 92, 255);
|
||||||
let jobHelpColour = toColour(234, 198, 126, 255);
|
let jobHelpColour = toColour(234, 198, 126, 255);
|
||||||
|
|
||||||
let renderLabelDistance = 7.5;
|
|
||||||
|
|
||||||
let propertyLabelLockedOffset = 16;
|
|
||||||
let propertyLabelNameOffset = 18;
|
|
||||||
let propertyLabelPriceOffset = 16;
|
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initLabelScript() {
|
function initLabelScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Label]: Initializing label script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.Label]: Initializing label script ...");
|
||||||
propertyLabelNameFont = initLabelPropertyNameFont();
|
propertyLabelNameFont = initLabelPropertyNameFont();
|
||||||
propertyLabelLockedFont = initLabelPropertyLockedFont();
|
propertyLabelLockedFont = initLabelPropertyLockedFont();
|
||||||
jobNameLabelFont = initLabelJobNameFont();
|
jobNameLabelFont = initLabelJobNameFont();
|
||||||
jobHelpLabelFont = initLabelJobHelpFont();
|
jobHelpLabelFont = initLabelJobHelpFont();
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Label]: Label script initialized!");
|
logToConsole(LOG_DEBUG, "[AGRP.Label]: Label script initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -66,7 +65,7 @@ function initLabelJobHelpFont() {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function renderPropertyEntranceLabel(name, position, locked, isBusiness, price, rentPrice, labelInfoType) {
|
function renderPropertyEntranceLabel(name, position, locked, isBusiness, price, rentPrice, labelInfoType, fee) {
|
||||||
if (localPlayer == null) {
|
if (localPlayer == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -81,32 +80,33 @@ function renderPropertyEntranceLabel(name, position, locked, isBusiness, price,
|
|||||||
|
|
||||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
if (!natives.doesViewportExist(natives.getGameViewportId())) {
|
if (!natives.doesViewportExist(natives.getGameViewportId())) {
|
||||||
logToConsole(LOG_INFO, "[VRR.Label]: Game viewport does not exist!");
|
logToConsole(LOG_INFO, "[AGRP.Label]: Game viewport does not exist!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!natives.isViewportActive(natives.getGameViewportId())) {
|
if (!natives.isViewportActive(natives.getGameViewportId())) {
|
||||||
logToConsole(LOG_INFO, "[VRR.Label]: Game viewport is not active!");
|
logToConsole(LOG_INFO, "[AGRP.Label]: Game viewport is not active!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let tempPosition = position;
|
position = getPosAbovePos(position, propertyLabelHeight);
|
||||||
tempPosition.z = tempPosition.z + propertyLabelHeight;
|
|
||||||
let screenPosition = new Vec3(0.0, 0.0, 0.0);
|
let screenPosition = new Vec3(0.0, 0.0, 0.0);
|
||||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
screenPosition = natives.getViewportPositionOfCoord(tempPosition, natives.getGameViewportId());
|
screenPosition = natives.getViewportPositionOfCoord(position, natives.getGameViewportId());
|
||||||
} else {
|
} else {
|
||||||
screenPosition = getScreenFromWorldPosition(tempPosition);
|
screenPosition = getScreenFromWorldPosition(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logToConsole(LOG_VERBOSE, `[AGRP.Label] World [${position.x}, ${position.y}, ${position.z}] to screen [${screenPosition.x}, ${screenPosition.y}, ${screenPosition.z}]`);
|
||||||
|
|
||||||
if (screenPosition.x < 0 || screenPosition.x > game.width) {
|
if (screenPosition.x < 0 || screenPosition.x > game.width) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let text = "";
|
let text = "";
|
||||||
if (price > "0") {
|
if (toInteger(price) > 0) {
|
||||||
text = getLocaleString("PropertyForSaleLabel", price);
|
text = getLocaleString("PropertyForSaleLabel", getCurrencyString(price));
|
||||||
let size = propertyLabelLockedFont.measure(text, game.width, 0.0, 0.0, propertyLabelLockedFont.size, true, 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, toColour(200, 200, 200, 255), false, true, false, 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);
|
||||||
|
|
||||||
@@ -114,8 +114,17 @@ function renderPropertyEntranceLabel(name, position, locked, isBusiness, price,
|
|||||||
}
|
}
|
||||||
|
|
||||||
text = "";
|
text = "";
|
||||||
if (rentPrice != "0") {
|
if (toInteger(rentPrice) > 0) {
|
||||||
text = getLocaleString("PropertyForRentLabel", rentPrice);
|
text = getLocaleString("PropertyForRentLabel", getCurrencyString(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;
|
||||||
|
}
|
||||||
|
|
||||||
|
text = "";
|
||||||
|
if (toInteger(fee) > 0) {
|
||||||
|
text = getLocaleString("PropertyEntranceFeeLabel", getCurrencyString(fee));
|
||||||
let size = propertyLabelLockedFont.measure(text, game.width, 0.0, 0.0, propertyLabelLockedFont.size, true, 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, toColour(200, 200, 200, 255), false, true, false, 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);
|
||||||
|
|
||||||
@@ -174,7 +183,7 @@ function renderPropertyEntranceLabel(name, position, locked, isBusiness, price,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (getDistance(localPlayer.position, position) <= renderLabelDistance - 2) {
|
if (getDistance(localPlayer.position, position) <= propertyLabelRenderDistance - 2) {
|
||||||
let size = propertyLabelLockedFont.measure(infoText, game.width, 0.0, 0.0, propertyLabelLockedFont.size, true, true);
|
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);
|
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;
|
screenPosition.y -= propertyLabelLockedOffset;
|
||||||
@@ -212,12 +221,12 @@ function renderPropertyExitLabel(position) {
|
|||||||
|
|
||||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
if (!natives.doesViewportExist(natives.getGameViewportId())) {
|
if (!natives.doesViewportExist(natives.getGameViewportId())) {
|
||||||
logToConsole(LOG_INFO, "[VRR.Label]: Game viewport does not exist!");
|
logToConsole(LOG_INFO, "[AGRP.Label]: Game viewport does not exist!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!natives.isViewportActive(natives.getGameViewportId())) {
|
if (!natives.isViewportActive(natives.getGameViewportId())) {
|
||||||
logToConsole(LOG_INFO, "[VRR.Label]: Game viewport is not active!");
|
logToConsole(LOG_INFO, "[AGRP.Label]: Game viewport is not active!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -257,12 +266,12 @@ function renderJobLabel(name, position, jobType) {
|
|||||||
|
|
||||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
if (!natives.doesViewportExist(natives.getGameViewportId())) {
|
if (!natives.doesViewportExist(natives.getGameViewportId())) {
|
||||||
logToConsole(LOG_INFO, "[VRR.Label]: Game viewport does not exist!");
|
logToConsole(LOG_INFO, "[AGRP.Label]: Game viewport does not exist!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!natives.isViewportActive(natives.getGameViewportId())) {
|
if (!natives.isViewportActive(natives.getGameViewportId())) {
|
||||||
logToConsole(LOG_INFO, "[VRR.Label]: Game viewport is not active!");
|
logToConsole(LOG_INFO, "[AGRP.Label]: Game viewport is not active!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -309,26 +318,41 @@ function renderJobLabel(name, position, jobType) {
|
|||||||
|
|
||||||
function processLabelRendering() {
|
function processLabelRendering() {
|
||||||
if (renderLabels) {
|
if (renderLabels) {
|
||||||
if (!areServerElementsSupported()) {
|
if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE) {
|
||||||
if (localPlayer != null) {
|
if (localPlayer != null) {
|
||||||
getServerData().businesses.forEach((business) => {
|
getServerData().businesses.forEach((business) => {
|
||||||
if (getDistance(localPlayer.position, business.entrancePosition) <= 75.0) {
|
if (getDistance(localPlayer.position, business.entrancePosition) <= propertyPickupRenderDistance) {
|
||||||
|
if (getGame() == AGRP_GAME_GTA_IV || getGame() == AGRP_GAME_GTA_IV_EFLC) {
|
||||||
natives.drawColouredCylinder(getPosBelowPos(business.entrancePosition, 1.0), 0.0, 0.0, 0, 153, 255, 255);
|
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);
|
}
|
||||||
|
|
||||||
|
if (getDistance(localPlayer.position, business.entrancePosition) <= propertyLabelRenderDistance) {
|
||||||
|
renderPropertyEntranceLabel(business.name, business.entrancePosition, business.locked, true, business.buyPrice, business.rentPrice, business.labelInfoType, business.entranceFee);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
getServerData().houses.forEach((house) => {
|
getServerData().houses.forEach((house) => {
|
||||||
if (getDistance(localPlayer.position, house.entrancePosition) <= 75.0) {
|
if (getDistance(localPlayer.position, house.entrancePosition) <= propertyPickupRenderDistance) {
|
||||||
|
if (getGame() == AGRP_GAME_GTA_IV || getGame() == AGRP_GAME_GTA_IV_EFLC) {
|
||||||
natives.drawColouredCylinder(getPosBelowPos(house.entrancePosition, 1.0), 0.0, 0.0, 0, 200, 0, 255);
|
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);
|
}
|
||||||
|
|
||||||
|
if (getDistance(localPlayer.position, house.entrancePosition) <= propertyLabelRenderDistance) {
|
||||||
|
renderPropertyEntranceLabel(house.description, house.entrancePosition, house.locked, true, house.buyPrice, house.rentPrice, house.labelInfoType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
getServerData().jobs.forEach((job) => {
|
getServerData().jobs.forEach((job) => {
|
||||||
if (getDistance(localPlayer.position, job.position) <= 75.0) {
|
if (getDistance(localPlayer.position, job.position) <= propertyPickupRenderDistance) {
|
||||||
|
if (getGame() == AGRP_GAME_GTA_IV || getGame() == AGRP_GAME_GTA_IV_EFLC) {
|
||||||
natives.drawColouredCylinder(getPosBelowPos(job.position, 1.0), 0.0, 0.0, 255, 255, 0, 255);
|
natives.drawColouredCylinder(getPosBelowPos(job.position, 1.0), 0.0, 0.0, 255, 255, 0, 255);
|
||||||
//renderJobLabel(job.name, job.position, job.jobType);
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getDistance(localPlayer.position, job.position) <= 5.0) {
|
||||||
|
renderJobLabel(job.name, job.position, job.jobType);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -339,26 +363,30 @@ function processLabelRendering() {
|
|||||||
let pickups = getElementsByType(ELEMENT_PICKUP);
|
let pickups = getElementsByType(ELEMENT_PICKUP);
|
||||||
for (let i in pickups) {
|
for (let i in pickups) {
|
||||||
if (pickups[i].getData("agrp.label.type") != null) {
|
if (pickups[i].getData("agrp.label.type") != null) {
|
||||||
if (getDistance(localPlayer.position, pickups[i].position) <= renderLabelDistance) {
|
if (getDistance(localPlayer.position, pickups[i].position) <= propertyLabelRenderDistance) {
|
||||||
if (!pickups[i].isOnScreen) {
|
if (!pickups[i].isOnScreen) {
|
||||||
let price = "0";
|
let price = "0";
|
||||||
let rentPrice = "0";
|
let rentPrice = "0";
|
||||||
let labelInfoType = AGRP_PROPLABEL_INFO_NONE;
|
let labelInfoType = AGRP_PROPLABEL_INFO_NONE;
|
||||||
if (pickups[i].getData("agrp.label.price") != null) {
|
if (pickups[i].getData("agrp.label.price") != null) {
|
||||||
price = makeLargeNumberReadable(pickups[i].getData("agrp.label.price"));
|
price = pickups[i].getData("agrp.label.price");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pickups[i].getData("agrp.label.rentprice") != null) {
|
if (pickups[i].getData("agrp.label.rentprice") != null) {
|
||||||
rentPrice = makeLargeNumberReadable(pickups[i].getData("agrp.label.rentprice"));
|
rentPrice = pickups[i].getData("agrp.label.rentprice");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pickups[i].getData("agrp.label.help") != null) {
|
if (pickups[i].getData("agrp.label.help") != null) {
|
||||||
labelInfoType = pickups[i].getData("agrp.label.help");
|
labelInfoType = pickups[i].getData("agrp.label.help");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pickups[i].getData("agrp.label.fee") != null) {
|
||||||
|
fee = pickups[i].getData("agrp.label.fee");
|
||||||
|
}
|
||||||
|
|
||||||
switch (pickups[i].getData("agrp.label.type")) {
|
switch (pickups[i].getData("agrp.label.type")) {
|
||||||
case AGRP_LABEL_BUSINESS: {
|
case AGRP_LABEL_BUSINESS: {
|
||||||
renderPropertyEntranceLabel(pickups[i].getData("agrp.label.name"), pickups[i].position, pickups[i].getData("agrp.label.locked"), true, price, rentPrice, labelInfoType);
|
renderPropertyEntranceLabel(pickups[i].getData("agrp.label.name"), pickups[i].position, pickups[i].getData("agrp.label.locked"), true, price, rentPrice, labelInfoType, fee);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,10 +35,10 @@ function getAvailableLocaleOptions() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadLocaleConfig() {
|
function loadLocaleConfig() {
|
||||||
let configFile = loadTextFile("config/client/locale.json");
|
let configFile = getContentsOfTextFile("config/client/locale.json");
|
||||||
getServerData().localeOptions = JSON.parse(configFile);
|
getServerData().localeOptions = JSON.parse(configFile);
|
||||||
|
|
||||||
resetLocaleChooserOptions();
|
//resetLocaleChooserOptions();
|
||||||
loadAllLocaleStrings();
|
loadAllLocaleStrings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,11 +47,12 @@ function loadLocaleConfig() {
|
|||||||
function loadAllLocaleStrings() {
|
function loadAllLocaleStrings() {
|
||||||
let localeOptions = getServerData().localeOptions;
|
let localeOptions = getServerData().localeOptions;
|
||||||
for (let i in localeOptions) {
|
for (let i in localeOptions) {
|
||||||
logToConsole(LOG_INFO, `[VRR.Locale] Loading locale strings for ${localeOptions[i].englishName} (${i})`);
|
logToConsole(LOG_INFO, `[AGRP.Locale] Loading locale strings for ${localeOptions[i].englishName} (${i})`);
|
||||||
let localeFile = loadTextFile(`locale/${localeOptions[i].stringsFile}`);
|
let localeStringFile = getContentsOfTextFile(`locale/${localeOptions[i].stringsFile}`);
|
||||||
let localeData = JSON.parse(localeFile);
|
let localeStringData = JSON.parse(localeStringFile);
|
||||||
|
|
||||||
getServerData().localeStrings[i] = localeData;
|
let localeId = localeOptions[i].id;
|
||||||
|
getServerData().localeStrings[localeId] = localeStringData;
|
||||||
}
|
}
|
||||||
|
|
||||||
resetGUIStrings();
|
resetGUIStrings();
|
||||||
@@ -60,7 +61,7 @@ function loadAllLocaleStrings() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setLocale(tempLocaleId) {
|
function setLocale(tempLocaleId) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Locale] Setting locale to ${tempLocaleId} (${getServerData().localeOptions[tempLocaleId].englishName})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Locale] Setting locale to ${tempLocaleId} (${getServerData().localeOptions[tempLocaleId].englishName})`);
|
||||||
localLocaleId = tempLocaleId;
|
localLocaleId = tempLocaleId;
|
||||||
resetGUIStrings();
|
resetGUIStrings();
|
||||||
}
|
}
|
||||||
@@ -15,14 +15,18 @@ let logoSize = toVector2(128, 128);
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initLogoScript() {
|
function initLogoScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Logo]: Initializing logo script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.Logo]: Initializing logo script ...");
|
||||||
//logoImage = loadLogoImage();
|
//logoImage = loadLogoImage();
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Logo]: Logo script initialized!");
|
logToConsole(LOG_DEBUG, "[AGRP.Logo]: Logo script initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadLogoImage() {
|
function loadLogoImage() {
|
||||||
|
//if (getGame() == AGRP_GAME_MAFIA_ONE) {
|
||||||
|
// return false;
|
||||||
|
//}
|
||||||
|
|
||||||
let logoStream = openFile(mainLogoPath);
|
let logoStream = openFile(mainLogoPath);
|
||||||
let tempLogoImage = null;
|
let tempLogoImage = null;
|
||||||
if (logoStream != null) {
|
if (logoStream != null) {
|
||||||
@@ -36,6 +40,10 @@ function loadLogoImage() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function processLogoRendering() {
|
function processLogoRendering() {
|
||||||
|
if (getGame() == AGRP_GAME_MAFIA_ONE) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (renderLogo) {
|
if (renderLogo) {
|
||||||
if (logoImage != null) {
|
if (logoImage != null) {
|
||||||
graphics.drawRectangle(logoImage, logoPos, logoSize);
|
graphics.drawRectangle(logoImage, logoPos, logoSize);
|
||||||
@@ -46,7 +54,7 @@ function processLogoRendering() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setServerLogoRenderState(state) {
|
function setServerLogoRenderState(state) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Main] Server logo ${(state) ? "enabled" : "disabled"}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Main] Server logo ${(state) ? "enabled" : "disabled"}`);
|
||||||
renderLogo = state;
|
renderLogo = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ let smallGameMessageTimer = null;
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initMessagingScript() {
|
function initMessagingScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Messaging]: Initializing messaging script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.Messaging]: Initializing messaging script ...");
|
||||||
smallGameMessageFonts = loadSmallGameMessageFonts();
|
smallGameMessageFonts = loadSmallGameMessageFonts();
|
||||||
bigGameMessageFonts = loadSmallGameMessageFonts();
|
bigGameMessageFonts = loadSmallGameMessageFonts();
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Messaging]: Messaging script initialized!");
|
logToConsole(LOG_DEBUG, "[AGRP.Messaging]: Messaging script initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -39,6 +39,12 @@ function loadSmallGameMessageFonts() {
|
|||||||
fontStream.close();
|
fontStream.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fontStream = openFile("files/fonts/aurora-bold-condensed.ttf");
|
||||||
|
if (fontStream != null) {
|
||||||
|
tempSmallGameMessageFonts["AuroraBdCnBT"] = lucasFont.createFont(fontStream, 20.0);
|
||||||
|
fontStream.close();
|
||||||
|
}
|
||||||
|
|
||||||
tempSmallGameMessageFonts["Roboto"] = lucasFont.createDefaultFont(20.0, "Roboto");
|
tempSmallGameMessageFonts["Roboto"] = lucasFont.createDefaultFont(20.0, "Roboto");
|
||||||
tempSmallGameMessageFonts["RobotoLight"] = lucasFont.createDefaultFont(20.0, "Roboto", "Light");
|
tempSmallGameMessageFonts["RobotoLight"] = lucasFont.createDefaultFont(20.0, "Roboto", "Light");
|
||||||
|
|
||||||
@@ -55,6 +61,12 @@ function loadBigGameMessageFont() {
|
|||||||
fontStream.close();
|
fontStream.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fontStream = openFile("files/fonts/aurora-bold-condensed.ttf");
|
||||||
|
if (fontStream != null) {
|
||||||
|
tempBigGameMessageFonts["AuroraBdCnBT"] = lucasFont.createFont(fontStream, 20.0);
|
||||||
|
fontStream.close();
|
||||||
|
}
|
||||||
|
|
||||||
tempBigGameMessageFonts["Roboto"] = lucasFont.createDefaultFont(28.0, "Roboto");
|
tempBigGameMessageFonts["Roboto"] = lucasFont.createDefaultFont(28.0, "Roboto");
|
||||||
tempBigGameMessageFonts["RobotoLight"] = lucasFont.createDefaultFont(28.0, "Roboto", "Light");
|
tempBigGameMessageFonts["RobotoLight"] = lucasFont.createDefaultFont(28.0, "Roboto", "Light");
|
||||||
|
|
||||||
@@ -64,10 +76,10 @@ function loadBigGameMessageFont() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function processSmallGameMessageRendering() {
|
function processSmallGameMessageRendering() {
|
||||||
logToConsole(LOG_VERBOSE, "[VRR.Messaging]: Processing small game message rendering ...");
|
logToConsole(LOG_VERBOSE, "[AGRP.Messaging]: Processing small game message rendering ...");
|
||||||
if (renderSmallGameMessage) {
|
if (renderSmallGameMessage) {
|
||||||
if (smallGameMessageText != "") {
|
if (smallGameMessageText != "") {
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Messaging]: Rendering small game message: ${smallGameMessageText}`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Messaging]: Rendering small game message: ${smallGameMessageText}`);
|
||||||
if (smallGameMessageFonts[smallGameMessageFontName] != null) {
|
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);
|
smallGameMessageFonts[smallGameMessageFontName].render(smallGameMessageText, [0, game.height - 90], game.width, 0.5, 0.0, smallGameMessageFonts[smallGameMessageFontName].size, smallGameMessageColour, true, true, false, true);
|
||||||
}
|
}
|
||||||
@@ -78,7 +90,7 @@ function processSmallGameMessageRendering() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showSmallGameMessage(text, colour, duration, fontName) {
|
function showSmallGameMessage(text, colour, duration, fontName) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Messaging] Showing small game message '${text}' using font ${fontName} for ${duration}ms`);
|
logToConsole(LOG_DEBUG, `[AGRP.Messaging] Showing small game message '${text}' using font ${fontName} for ${duration}ms`);
|
||||||
if (smallGameMessageText != "") {
|
if (smallGameMessageText != "") {
|
||||||
clearTimeout(smallGameMessageTimer);
|
clearTimeout(smallGameMessageTimer);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,34 +12,29 @@
|
|||||||
// CREDITS TO LUCASC190 FOR MAKING THE MOUSE CAMERA
|
// CREDITS TO LUCASC190 FOR MAKING THE MOUSE CAMERA
|
||||||
// WALKING CODE ADDED BY VORTREX
|
// WALKING CODE ADDED BY VORTREX
|
||||||
|
|
||||||
function SetStandardControlsEnabled(bEnabled)
|
function SetStandardControlsEnabled(bEnabled) {
|
||||||
{
|
|
||||||
if (typeof gta == "undefined") {
|
if (typeof gta == "undefined") {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (game.standardControls === undefined)
|
if (game.standardControls === undefined) {
|
||||||
{
|
|
||||||
logToConsole(LOG_WARN, "game.standardControls not implemented");
|
logToConsole(LOG_WARN, "game.standardControls not implemented");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
game.standardControls = bEnabled;
|
game.standardControls = bEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
function GetCurrentPlayerIndex()
|
function GetCurrentPlayerIndex() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function GetPlayerPed(uiIndex)
|
function GetPlayerPed(uiIndex) {
|
||||||
{
|
|
||||||
if (uiIndex >= 1)
|
if (uiIndex >= 1)
|
||||||
throw new Error("player index out of range");
|
throw new Error("player index out of range");
|
||||||
return localPlayer;
|
return localPlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
function GetPedVehicle(pPed)
|
function GetPedVehicle(pPed) {
|
||||||
{
|
|
||||||
return pPed.vehicle;
|
return pPed.vehicle;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,8 +44,7 @@ let ENTITYTYPE_PED = 3;
|
|||||||
let ENTITYTYPE_OBJECT = 4;
|
let ENTITYTYPE_OBJECT = 4;
|
||||||
let ENTITYTYPE_DUMMY = 5;
|
let ENTITYTYPE_DUMMY = 5;
|
||||||
|
|
||||||
function GetEntityType(Entity)
|
function GetEntityType(Entity) {
|
||||||
{
|
|
||||||
if (Entity.isType(ELEMENT_BUILDING))
|
if (Entity.isType(ELEMENT_BUILDING))
|
||||||
return ENTITYTYPE_BUILDING;
|
return ENTITYTYPE_BUILDING;
|
||||||
if (Entity.isType(ELEMENT_VEHICLE))
|
if (Entity.isType(ELEMENT_VEHICLE))
|
||||||
@@ -64,35 +58,29 @@ function GetEntityType(Entity)
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
function GetPlaceableMatrix(pPlaceable)
|
function GetPlaceableMatrix(pPlaceable) {
|
||||||
{
|
|
||||||
if (pPlaceable == GetCamera())
|
if (pPlaceable == GetCamera())
|
||||||
return game.cameraMatrix;
|
return game.cameraMatrix;
|
||||||
return pPlaceable.matrix;
|
return pPlaceable.matrix;
|
||||||
}
|
}
|
||||||
|
|
||||||
function GetEntityModel(pEntity)
|
function GetEntityModel(pEntity) {
|
||||||
{
|
|
||||||
return pEntity;
|
return pEntity;
|
||||||
}
|
}
|
||||||
|
|
||||||
function GetModelBoundingSphere(usModel)
|
function GetModelBoundingSphere(usModel) {
|
||||||
{
|
|
||||||
return [usModel.boundingRadius, usModel.boundingCentre.x, usModel.boundingCentre.y, usModel.boundingCentre.z];
|
return [usModel.boundingRadius, usModel.boundingCentre.x, usModel.boundingCentre.y, usModel.boundingCentre.z];
|
||||||
}
|
}
|
||||||
|
|
||||||
function GetMouseSpeed()
|
function GetMouseSpeed() {
|
||||||
{
|
|
||||||
if (gui.cursorEnabled)
|
if (gui.cursorEnabled)
|
||||||
return [0, 0];
|
return [0, 0];
|
||||||
let MouseSpeed = game.getMouseSpeed();
|
let MouseSpeed = game.getMouseSpeed();
|
||||||
return [MouseSpeed.x, -MouseSpeed.y];
|
return [MouseSpeed.x, -MouseSpeed.y];
|
||||||
}
|
}
|
||||||
|
|
||||||
function GetMouseSensitivity()
|
function GetMouseSensitivity() {
|
||||||
{
|
if (game.getMouseSensitivity === undefined) {
|
||||||
if (game.getMouseSensitivity === undefined)
|
|
||||||
{
|
|
||||||
//logToConsole(LOG_ERROR, "game.getMouseSensitivity not implemented");
|
//logToConsole(LOG_ERROR, "game.getMouseSensitivity not implemented");
|
||||||
return [0.0025, 0.003];
|
return [0.0025, 0.003];
|
||||||
}
|
}
|
||||||
@@ -104,26 +92,21 @@ let GetCamera;
|
|||||||
{
|
{
|
||||||
const Camera = Symbol();
|
const Camera = Symbol();
|
||||||
|
|
||||||
GetCamera = function()
|
GetCamera = function () {
|
||||||
{
|
|
||||||
return Camera;
|
return Camera;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function AreEntityCollisionsEnabled(pEntity)
|
function AreEntityCollisionsEnabled(pEntity) {
|
||||||
{
|
|
||||||
return pEntity.collisionsEnabled;
|
return pEntity.collisionsEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
function SetEntityCollisionsEnabled(pEntity, bCollisionsEnabled)
|
function SetEntityCollisionsEnabled(pEntity, bCollisionsEnabled) {
|
||||||
{
|
|
||||||
pEntity.collisionsEnabled = bCollisionsEnabled;
|
pEntity.collisionsEnabled = bCollisionsEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
function ProcessLineOfSight(vecStartX, vecStartY, vecStartZ, vecEndX, vecEndY, vecEndZ, bCheckBuildings, bCheckVehicles, bCheckPeds, bCheckObjects, bCheckDummies, bCheckSeeThroughStuff, bIgnoreSomeObjectsForCamera)
|
function ProcessLineOfSight(vecStartX, vecStartY, vecStartZ, vecEndX, vecEndY, vecEndZ, bCheckBuildings, bCheckVehicles, bCheckPeds, bCheckObjects, bCheckDummies, bCheckSeeThroughStuff, bIgnoreSomeObjectsForCamera) {
|
||||||
{
|
if (game.processLineOfSight === undefined) {
|
||||||
if (game.processLineOfSight === undefined)
|
|
||||||
{
|
|
||||||
logToConsole(LOG_WARN, "game.processLineOfSight not implemented");
|
logToConsole(LOG_WARN, "game.processLineOfSight not implemented");
|
||||||
return [null];
|
return [null];
|
||||||
}
|
}
|
||||||
@@ -133,10 +116,8 @@ function ProcessLineOfSight(vecStartX, vecStartY, vecStartZ, vecEndX, vecEndY, v
|
|||||||
return [Result.position.x, Result.position.y, Result.position.z, Result.normal.x, Result.normal.y, Result.normal.z, Result.entity];
|
return [Result.position.x, Result.position.y, Result.position.z, Result.normal.x, Result.normal.y, Result.normal.z, Result.entity];
|
||||||
}
|
}
|
||||||
|
|
||||||
function SetPlaceableMatrix(pPlaceable, mat)
|
function SetPlaceableMatrix(pPlaceable, mat) {
|
||||||
{
|
if (pPlaceable == GetCamera()) {
|
||||||
if (pPlaceable == GetCamera())
|
|
||||||
{
|
|
||||||
game.setCameraMatrix(mat);
|
game.setCameraMatrix(mat);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -149,20 +130,17 @@ let GetTickCount;
|
|||||||
{
|
{
|
||||||
let FrameCount = 0;
|
let FrameCount = 0;
|
||||||
|
|
||||||
setInterval(() =>
|
setInterval(() => {
|
||||||
{
|
|
||||||
++FrameCount;
|
++FrameCount;
|
||||||
}, 0);
|
}, 0);
|
||||||
|
|
||||||
let GTAFrameCount = 0;
|
let GTAFrameCount = 0;
|
||||||
|
|
||||||
addEventHandler("OnProcess", (event, deltaTime) =>
|
addEventHandler("OnProcess", (event, deltaTime) => {
|
||||||
{
|
|
||||||
++GTAFrameCount;
|
++GTAFrameCount;
|
||||||
});
|
});
|
||||||
|
|
||||||
GetTickCount = function(bGTA, bFrames)
|
GetTickCount = function (bGTA, bFrames) {
|
||||||
{
|
|
||||||
if (bFrames)
|
if (bFrames)
|
||||||
return bGTA ? GTAFrameCount : FrameCount;
|
return bGTA ? GTAFrameCount : FrameCount;
|
||||||
else
|
else
|
||||||
@@ -192,8 +170,7 @@ function applyMultiplierTimeStep(m,t)//TODO: Move this to MathUtil.js
|
|||||||
//TODO: confirm
|
//TODO: confirm
|
||||||
|
|
||||||
const identityMatrix = new Matrix4x4();
|
const identityMatrix = new Matrix4x4();
|
||||||
if (identityMatrix.setIdentity === undefined)
|
if (identityMatrix.setIdentity === undefined) {
|
||||||
{
|
|
||||||
identityMatrix.m11 = 1;
|
identityMatrix.m11 = 1;
|
||||||
identityMatrix.m12 = 0;
|
identityMatrix.m12 = 0;
|
||||||
identityMatrix.m13 = 0;
|
identityMatrix.m13 = 0;
|
||||||
@@ -230,36 +207,31 @@ cameraIdentityMatrix.m42 = 0;
|
|||||||
cameraIdentityMatrix.m43 = 0;
|
cameraIdentityMatrix.m43 = 0;
|
||||||
cameraIdentityMatrix.m44 = 1;
|
cameraIdentityMatrix.m44 = 1;
|
||||||
|
|
||||||
function createMultipliedMatrix()
|
function createMultipliedMatrix() {
|
||||||
{
|
|
||||||
let matrix = new Matrix4x4();
|
let matrix = new Matrix4x4();
|
||||||
matrix.setMultiply.apply(matrix, arguments);
|
matrix.setMultiply.apply(matrix, arguments);
|
||||||
return matrix;
|
return matrix;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createXRotationMatrix(x)
|
function createXRotationMatrix(x) {
|
||||||
{
|
|
||||||
let matrix = new Matrix4x4();
|
let matrix = new Matrix4x4();
|
||||||
matrix.setRotateX(x);
|
matrix.setRotateX(x);
|
||||||
return matrix;
|
return matrix;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createYRotationMatrix(x)
|
function createYRotationMatrix(x) {
|
||||||
{
|
|
||||||
let matrix = new Matrix4x4();
|
let matrix = new Matrix4x4();
|
||||||
matrix.setRotateY(x);
|
matrix.setRotateY(x);
|
||||||
return matrix;
|
return matrix;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createZRotationMatrix(z)
|
function createZRotationMatrix(z) {
|
||||||
{
|
|
||||||
let matrix = new Matrix4x4();
|
let matrix = new Matrix4x4();
|
||||||
matrix.setRotateZ(z);
|
matrix.setRotateZ(z);
|
||||||
return matrix;
|
return matrix;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createTranslationMatrix(x,y,z)
|
function createTranslationMatrix(x, y, z) {
|
||||||
{
|
|
||||||
let matrix = new Matrix4x4();
|
let matrix = new Matrix4x4();
|
||||||
matrix.setTranslate([x, y, z]);
|
matrix.setTranslate([x, y, z]);
|
||||||
return matrix;
|
return matrix;
|
||||||
@@ -267,31 +239,26 @@ function createTranslationMatrix(x,y,z)
|
|||||||
|
|
||||||
//TODO: createScaleMatrix
|
//TODO: createScaleMatrix
|
||||||
|
|
||||||
function getDotProduct(x,y,z,x2,y2,z2)
|
function getDotProduct(x, y, z, x2, y2, z2) {
|
||||||
{
|
|
||||||
return x * x2 + y * y2 + z * z2;
|
return x * x2 + y * y2 + z * z2;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCrossProduct(x,y,z,x2,y2,z2)
|
function getCrossProduct(x, y, z, x2, y2, z2) {
|
||||||
{
|
|
||||||
return [y * z2 - z * y2, z * x2 - x * z2, x * y2 - y * x2];
|
return [y * z2 - z * y2, z * x2 - x * z2, x * y2 - y * x2];
|
||||||
}
|
}
|
||||||
|
|
||||||
function getLength(x,y,z)
|
function getLength(x, y, z) {
|
||||||
{
|
|
||||||
return Math.sqrt(getDotProduct(x, y, z, x, y, z));
|
return Math.sqrt(getDotProduct(x, y, z, x, y, z));
|
||||||
}
|
}
|
||||||
|
|
||||||
function normalise(x,y,z)
|
function normalise(x, y, z) {
|
||||||
{
|
|
||||||
let length = getLength(x, y, z);
|
let length = getLength(x, y, z);
|
||||||
if (length == 0)
|
if (length == 0)
|
||||||
throw new Error("an attempt was made to normalise a three dimensional vector with a length of zero");
|
throw new Error("an attempt was made to normalise a three dimensional vector with a length of zero");
|
||||||
return [x / length, y / length, z / length];
|
return [x / length, y / length, z / length];
|
||||||
}
|
}
|
||||||
|
|
||||||
function createLookAtLHMatrix(eyeX, eyeY, eyeZ, atX, atY, atZ, upX,upY,upZ)
|
function createLookAtLHMatrix(eyeX, eyeY, eyeZ, atX, atY, atZ, upX, upY, upZ) {
|
||||||
{
|
|
||||||
let matrix = new Matrix4x4();
|
let matrix = new Matrix4x4();
|
||||||
let [lookX, lookY, lookZ] = normalise(atX - eyeX, atY - eyeY, atZ - eyeZ);
|
let [lookX, lookY, lookZ] = normalise(atX - eyeX, atY - eyeY, atZ - eyeZ);
|
||||||
let [rightX, rightY, rightZ] = normalise.apply(null, getCrossProduct(upX, upY, upZ, lookX, lookY, lookZ));
|
let [rightX, rightY, rightZ] = normalise.apply(null, getCrossProduct(upX, upY, upZ, lookX, lookY, lookZ));
|
||||||
@@ -323,8 +290,7 @@ function createLookAtLHMatrix(eyeX, eyeY, eyeZ, atX, atY, atZ, upX,upY,upZ)
|
|||||||
return matrix;
|
return matrix;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDifferenceBetweenAngles(current,target)
|
function getDifferenceBetweenAngles(current, target) {
|
||||||
{
|
|
||||||
let f = (((target - current) + Math.PI) / (Math.PI * 2));
|
let f = (((target - current) + Math.PI) / (Math.PI * 2));
|
||||||
return ((f - Math.floor(f)) * (Math.PI * 2)) - Math.PI;
|
return ((f - Math.floor(f)) * (Math.PI * 2)) - Math.PI;
|
||||||
}
|
}
|
||||||
@@ -336,13 +302,11 @@ let easeStartPosX, easeStartPosY, easeStartPosZ;
|
|||||||
let easeStartLookX, easeStartLookY, easeStartLookZ;
|
let easeStartLookX, easeStartLookY, easeStartLookZ;
|
||||||
let easeStartUpX, easeStartUpY, easeStartUpZ;
|
let easeStartUpX, easeStartUpY, easeStartUpZ;
|
||||||
|
|
||||||
function getCameraPositionInfo(matrix)
|
function getCameraPositionInfo(matrix) {
|
||||||
{
|
|
||||||
return [matrix.m41, matrix.m42, matrix.m43, matrix.m21, matrix.m22, matrix.m23, matrix.m31, matrix.m32, matrix.m33];
|
return [matrix.m41, matrix.m42, matrix.m43, matrix.m21, matrix.m22, matrix.m23, matrix.m31, matrix.m32, matrix.m33];
|
||||||
}
|
}
|
||||||
|
|
||||||
function startCameraEase()
|
function startCameraEase() {
|
||||||
{
|
|
||||||
easeCamera = true;
|
easeCamera = true;
|
||||||
easeStartTicks = GetTickCount(true, false);
|
easeStartTicks = GetTickCount(true, false);
|
||||||
easeDuration = 1000;
|
easeDuration = 1000;
|
||||||
@@ -350,13 +314,11 @@ function startCameraEase()
|
|||||||
[easeStartPosX, easeStartPosY, easeStartPosZ, easeStartLookX, easeStartLookY, easeStartLookZ, easeStartUpX, easeStartUpY, easeStartUpZ] = getCameraPositionInfo(matrix);
|
[easeStartPosX, easeStartPosY, easeStartPosZ, easeStartLookX, easeStartLookY, easeStartLookZ, easeStartUpX, easeStartUpY, easeStartUpZ] = getCameraPositionInfo(matrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyCameraEase(matrix)
|
function applyCameraEase(matrix) {
|
||||||
{
|
|
||||||
if (!easeCamera)
|
if (!easeCamera)
|
||||||
return matrix;
|
return matrix;
|
||||||
let ease = (GetTickCount(true, false) - easeStartTicks) / easeDuration;
|
let ease = (GetTickCount(true, false) - easeStartTicks) / easeDuration;
|
||||||
if (ease < 1)
|
if (ease < 1) {
|
||||||
{
|
|
||||||
ease = easingSinusoidalInOut(ease, 0, 1, 1);
|
ease = easingSinusoidalInOut(ease, 0, 1, 1);
|
||||||
let [newPosX, newPosY, newPosZ, newLookX, newLookY, newLookZ, newUpX, newUpY, newUpZ] = getCameraPositionInfo(matrix);
|
let [newPosX, newPosY, newPosZ, newLookX, newLookY, newLookZ, newUpX, newUpY, newUpZ] = getCameraPositionInfo(matrix);
|
||||||
let easePosX = easeStartPosX + (newPosX - easeStartPosX) * ease;
|
let easePosX = easeStartPosX + (newPosX - easeStartPosX) * ease;
|
||||||
@@ -373,8 +335,7 @@ function applyCameraEase(matrix)
|
|||||||
return matrix;
|
return matrix;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isCameraEasing()
|
function isCameraEasing() {
|
||||||
{
|
|
||||||
return easeCamera && GetTickCount(true, false) < (easeStartTicks + easeDuration);
|
return easeCamera && GetTickCount(true, false) < (easeStartTicks + easeDuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -383,14 +344,12 @@ let OldPosition = null;//2019 Lucas was here!
|
|||||||
let cameraRotZ;
|
let cameraRotZ;
|
||||||
let cameraRotY;
|
let cameraRotY;
|
||||||
|
|
||||||
function getCameraTarget()
|
function getCameraTarget() {
|
||||||
{
|
|
||||||
let playerPed = GetPlayerPed(GetCurrentPlayerIndex());
|
let playerPed = GetPlayerPed(GetCurrentPlayerIndex());
|
||||||
let vehicle = GetPedVehicle(playerPed);
|
let vehicle = GetPedVehicle(playerPed);
|
||||||
if (vehicle != null)
|
if (vehicle != null)
|
||||||
return vehicle;
|
return vehicle;
|
||||||
if (playerPed != null)
|
if (playerPed != null) {
|
||||||
{
|
|
||||||
//if (playerPed.health <= 1)//Breaks because of fade//2019 Lucas was here!
|
//if (playerPed.health <= 1)//Breaks because of fade//2019 Lucas was here!
|
||||||
// return null;
|
// return null;
|
||||||
return playerPed;
|
return playerPed;
|
||||||
@@ -398,30 +357,26 @@ function getCameraTarget()
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isRelativeToTarget(target)
|
function isRelativeToTarget(target) {
|
||||||
{
|
|
||||||
if (GetEntityType(target) == ENTITYTYPE_PED)
|
if (GetEntityType(target) == ENTITYTYPE_PED)
|
||||||
return false;
|
return false;
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
function isClipped(target)
|
function isClipped(target) {
|
||||||
{
|
|
||||||
if (GetEntityType(target) == ENTITYTYPE_PED)
|
if (GetEntityType(target) == ENTITYTYPE_PED)
|
||||||
return true;
|
return true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//2019 Lucas was here!
|
//2019 Lucas was here!
|
||||||
function ShouldReturnToRestRotation(Target)
|
function ShouldReturnToRestRotation(Target) {
|
||||||
{
|
|
||||||
if (GetEntityType(Target) == ENTITYTYPE_PED)
|
if (GetEntityType(Target) == ENTITYTYPE_PED)
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCameraRestRotation(target)
|
function getCameraRestRotation(target) {
|
||||||
{
|
|
||||||
let targetMatrix = GetPlaceableMatrix(target);
|
let targetMatrix = GetPlaceableMatrix(target);
|
||||||
let rotZ;
|
let rotZ;
|
||||||
if (isRelativeToTarget(target))
|
if (isRelativeToTarget(target))
|
||||||
@@ -432,15 +387,13 @@ function getCameraRestRotation(target)
|
|||||||
return [rotZ, rotY];
|
return [rotZ, rotY];
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetCameraRotation()
|
function resetCameraRotation() {
|
||||||
{
|
|
||||||
[cameraRotZ, cameraRotY] = getCameraRestRotation(getCameraTarget());
|
[cameraRotZ, cameraRotY] = getCameraRestRotation(getCameraTarget());
|
||||||
}
|
}
|
||||||
|
|
||||||
//2019 Lucas was here!
|
//2019 Lucas was here!
|
||||||
let DeltaTime = 0;
|
let DeltaTime = 0;
|
||||||
addEventHandler("OnProcess", (event, deltaTime) =>
|
addEventHandler("OnProcess", (event, deltaTime) => {
|
||||||
{
|
|
||||||
DeltaTime = deltaTime;
|
DeltaTime = deltaTime;
|
||||||
if (!localPlayer) {
|
if (!localPlayer) {
|
||||||
return false;
|
return false;
|
||||||
@@ -449,8 +402,7 @@ addEventHandler("OnProcess", (event, deltaTime) =>
|
|||||||
|
|
||||||
let IdleTime = 0;//2019 Lucas was here!
|
let IdleTime = 0;//2019 Lucas was here!
|
||||||
|
|
||||||
function processReturnToRestRotation()
|
function processReturnToRestRotation() {
|
||||||
{
|
|
||||||
//resetCameraRotation();//2019 Lucas was here!
|
//resetCameraRotation();//2019 Lucas was here!
|
||||||
|
|
||||||
//2019 Lucas was here!
|
//2019 Lucas was here!
|
||||||
@@ -458,15 +410,13 @@ function processReturnToRestRotation()
|
|||||||
if (!ShouldReturnToRestRotation(Target))
|
if (!ShouldReturnToRestRotation(Target))
|
||||||
return;
|
return;
|
||||||
IdleTime += DeltaTime;
|
IdleTime += DeltaTime;
|
||||||
if (IdleTime > 1.5)
|
if (IdleTime > 1.5) {
|
||||||
{
|
|
||||||
let Velocity = Target.velocity;
|
let Velocity = Target.velocity;
|
||||||
let Matrix = Target.matrix;
|
let Matrix = Target.matrix;
|
||||||
let Speed = getDotProduct(Velocity.x, Velocity.y, Velocity.z, Matrix.getElement(1 * 4 + 0), Matrix.getElement(1 * 4 + 1), Matrix.getElement(1 * 4 + 2));
|
let Speed = getDotProduct(Velocity.x, Velocity.y, Velocity.z, Matrix.getElement(1 * 4 + 0), Matrix.getElement(1 * 4 + 1), Matrix.getElement(1 * 4 + 2));
|
||||||
let AbsSpeed = Math.abs(Speed);
|
let AbsSpeed = Math.abs(Speed);
|
||||||
let Multiplier = Math.min(AbsSpeed / 0.75, 1);
|
let Multiplier = Math.min(AbsSpeed / 0.75, 1);
|
||||||
if (Multiplier != 0)
|
if (Multiplier != 0) {
|
||||||
{
|
|
||||||
let [TargetCameraRotZ2, TargetCameraRotY2] = getCameraRestRotation(Target);
|
let [TargetCameraRotZ2, TargetCameraRotY2] = getCameraRestRotation(Target);
|
||||||
if (Speed < 0)
|
if (Speed < 0)
|
||||||
TargetCameraRotZ2 += Math.PI;
|
TargetCameraRotZ2 += Math.PI;
|
||||||
@@ -477,18 +427,15 @@ function processReturnToRestRotation()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function cancelReturnToRestRotation()
|
function cancelReturnToRestRotation() {
|
||||||
{
|
|
||||||
IdleTime = 0;//2019 Lucas was here!
|
IdleTime = 0;//2019 Lucas was here!
|
||||||
}
|
}
|
||||||
|
|
||||||
let distance;
|
let distance;
|
||||||
let zIncrease;
|
let zIncrease;
|
||||||
|
|
||||||
function getCameraOffsetInfo(target)
|
function getCameraOffsetInfo(target) {
|
||||||
{
|
if (GetEntityType(target) == ENTITYTYPE_PED) {
|
||||||
if (GetEntityType(target) == ENTITYTYPE_PED)
|
|
||||||
{
|
|
||||||
let distance = 4;
|
let distance = 4;
|
||||||
let zIncrease = 0.8;
|
let zIncrease = 0.8;
|
||||||
let offsetX = 0;
|
let offsetX = 0;
|
||||||
@@ -507,8 +454,7 @@ function getCameraOffsetInfo(target)
|
|||||||
let offsetX;
|
let offsetX;
|
||||||
let offsetY;
|
let offsetY;
|
||||||
let offsetZ;
|
let offsetZ;
|
||||||
if (radius <= 3.0535011291504)
|
if (radius <= 3.0535011291504) {
|
||||||
{
|
|
||||||
minDistance = 4;
|
minDistance = 4;
|
||||||
maxDistance = 8;
|
maxDistance = 8;
|
||||||
minZIncrease = 0.5;
|
minZIncrease = 0.5;
|
||||||
@@ -516,8 +462,7 @@ function getCameraOffsetInfo(target)
|
|||||||
minRadius = 2;
|
minRadius = 2;
|
||||||
maxRadius = 3.0535011291504;
|
maxRadius = 3.0535011291504;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
minDistance = 8;
|
minDistance = 8;
|
||||||
maxDistance = 16;
|
maxDistance = 16;
|
||||||
minZIncrease = 1;
|
minZIncrease = 1;
|
||||||
@@ -533,13 +478,10 @@ function getCameraOffsetInfo(target)
|
|||||||
return [distance, zIncrease, offsetX, offsetY, offsetZ];
|
return [distance, zIncrease, offsetX, offsetY, offsetZ];
|
||||||
}
|
}
|
||||||
|
|
||||||
function update()
|
function update() {
|
||||||
{
|
|
||||||
let target = getCameraTarget();
|
let target = getCameraTarget();
|
||||||
if (target != null)
|
if (target != null) {
|
||||||
{
|
if (oldCameraTarget != target) {
|
||||||
if (oldCameraTarget != target)
|
|
||||||
{
|
|
||||||
//if (oldCameraTarget != null)//2019 Lucas was here!
|
//if (oldCameraTarget != null)//2019 Lucas was here!
|
||||||
let Position = target.position;
|
let Position = target.position;
|
||||||
if (OldPosition == null || getLength(Position.x - OldPosition.x, Position.y - OldPosition.y, Position.z - OldPosition.z) < 10)
|
if (OldPosition == null || getLength(Position.x - OldPosition.x, Position.y - OldPosition.y, Position.z - OldPosition.z) < 10)
|
||||||
@@ -550,12 +492,10 @@ function update()
|
|||||||
let [mouseSensitivityX, mouseSensitivityY] = GetMouseSensitivity();
|
let [mouseSensitivityX, mouseSensitivityY] = GetMouseSensitivity();
|
||||||
mouseSpeedX = mouseSpeedX * mouseSensitivityX * 2;
|
mouseSpeedX = mouseSpeedX * mouseSensitivityX * 2;
|
||||||
mouseSpeedY = mouseSpeedY * mouseSensitivityY * 2;
|
mouseSpeedY = mouseSpeedY * mouseSensitivityY * 2;
|
||||||
if (mouseSpeedX == 0 && mouseSpeedY == 0)
|
if (mouseSpeedX == 0 && mouseSpeedY == 0) {
|
||||||
{
|
|
||||||
processReturnToRestRotation();
|
processReturnToRestRotation();
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
cameraRotZ = cameraRotZ - mouseSpeedX;
|
cameraRotZ = cameraRotZ - mouseSpeedX;
|
||||||
cameraRotY = cameraRotY - mouseSpeedY;
|
cameraRotY = cameraRotY - mouseSpeedY;
|
||||||
cancelReturnToRestRotation();
|
cancelReturnToRestRotation();
|
||||||
@@ -581,13 +521,11 @@ function update()
|
|||||||
let offsetRotationX = createXRotationMatrix(cameraRotY);
|
let offsetRotationX = createXRotationMatrix(cameraRotY);
|
||||||
let offsetRotationZ = createZRotationMatrix(cameraRotZ);
|
let offsetRotationZ = createZRotationMatrix(cameraRotZ);
|
||||||
let cameraMatrix = createMultipliedMatrix(cameraIdentityMatrix, distanceTranslationMatrix, offsetRotationX, offsetRotationZ, targetTranslationMatrix);
|
let cameraMatrix = createMultipliedMatrix(cameraIdentityMatrix, distanceTranslationMatrix, offsetRotationX, offsetRotationZ, targetTranslationMatrix);
|
||||||
if (isRelativeToTarget(target))
|
if (isRelativeToTarget(target)) {
|
||||||
{
|
|
||||||
cameraMatrix = createMultipliedMatrix(cameraMatrix, targetMatrix);
|
cameraMatrix = createMultipliedMatrix(cameraMatrix, targetMatrix);
|
||||||
targetTranslationMatrix = createMultipliedMatrix(targetTranslationMatrix, targetMatrix);
|
targetTranslationMatrix = createMultipliedMatrix(targetTranslationMatrix, targetMatrix);
|
||||||
}
|
}
|
||||||
if (isClipped(target))
|
if (isClipped(target)) {
|
||||||
{
|
|
||||||
let startX = targetTranslationMatrix.m41;
|
let startX = targetTranslationMatrix.m41;
|
||||||
let startY = targetTranslationMatrix.m42;
|
let startY = targetTranslationMatrix.m42;
|
||||||
let startZ = targetTranslationMatrix.m43;
|
let startZ = targetTranslationMatrix.m43;
|
||||||
@@ -607,8 +545,7 @@ function update()
|
|||||||
let [positionX, positionY, positionZ, normalX, normalY, normalZ, targetEntity] = ProcessLineOfSight(startX, startY, startZ, endX, endY, endZ, checkBuildings, checkVehicles, checkPeds, checkObjects, checkDummies, checkSeeThroughStuff, ignoreSomeObjectsForCamera);
|
let [positionX, positionY, positionZ, normalX, normalY, normalZ, targetEntity] = ProcessLineOfSight(startX, startY, startZ, endX, endY, endZ, checkBuildings, checkVehicles, checkPeds, checkObjects, checkDummies, checkSeeThroughStuff, ignoreSomeObjectsForCamera);
|
||||||
if (collisionsEnabled)
|
if (collisionsEnabled)
|
||||||
SetEntityCollisionsEnabled(target, true);
|
SetEntityCollisionsEnabled(target, true);
|
||||||
if (positionX != null)
|
if (positionX != null) {
|
||||||
{
|
|
||||||
//2019 Lucas was here!
|
//2019 Lucas was here!
|
||||||
let Distance = 0.3;
|
let Distance = 0.3;
|
||||||
positionX += normalX * Distance;
|
positionX += normalX * Distance;
|
||||||
@@ -630,8 +567,7 @@ function update()
|
|||||||
return target != null;
|
return target != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
addEventHandler("OnCameraProcess", (event) =>
|
addEventHandler("OnCameraProcess", (event) => {
|
||||||
{
|
|
||||||
if (mouseCameraEnabled) {
|
if (mouseCameraEnabled) {
|
||||||
update();
|
update();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ let playerPing = {};
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initNameTagScript() {
|
function initNameTagScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.NameTag]: Initializing nametag script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.NameTag]: Initializing nametag script ...");
|
||||||
nametagFont = loadNameTagFont();
|
nametagFont = loadNameTagFont();
|
||||||
afkStatusFont = loadPausedStatusFont();
|
afkStatusFont = loadPausedStatusFont();
|
||||||
logToConsole(LOG_DEBUG, "[VRR.NameTag]: Nametag script initialized!");
|
logToConsole(LOG_DEBUG, "[AGRP.NameTag]: Nametag script initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -90,18 +90,7 @@ function deleteLocalGameElement(element) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function createGameVehicle(modelIndex, position, heading) {
|
function createGameVehicle(modelIndex, position, heading) {
|
||||||
if (getGame() != AGRP_GAME_GTA_IV) {
|
|
||||||
return game.createVehicle(getGameConfig().vehicles[getGame()][modelIndex][0], position, heading);
|
return game.createVehicle(getGameConfig().vehicles[getGame()][modelIndex][0], position, heading);
|
||||||
} else {
|
|
||||||
let modelId = getGameConfig().vehicles[getGame()][modelIndex][0];
|
|
||||||
if (natives.isModelInCdimage(modelId)) {
|
|
||||||
natives.requestModel(modelId);
|
|
||||||
natives.loadAllObjectsNow();
|
|
||||||
return natives.createCar(modelId, position, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -224,6 +213,7 @@ function setEntityData(entity, dataName, dataValue, syncToClients = true) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setVehicleEngine(vehicleId, state) {
|
function setVehicleEngine(vehicleId, state) {
|
||||||
|
//getElementFromId(vehicleId).netFlags.sendSync = state;
|
||||||
getElementFromId(vehicleId).engine = state;
|
getElementFromId(vehicleId).engine = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,16 +8,15 @@
|
|||||||
// TYPE: Client (JavaScript)
|
// TYPE: Client (JavaScript)
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initServerScript() {
|
function initNetworkEventsScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Server]: Initializing server script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.NetEvents]: Initializing server script ...");
|
||||||
addAllNetworkHandlers();
|
logToConsole(LOG_DEBUG, "[AGRP.NetEvents]: Server script initialized!");
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Server]: Server script initialized!");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function addAllNetworkHandlers() {
|
function addAllNetworkHandlers() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Server]: Adding network handlers ...");
|
logToConsole(LOG_DEBUG, "[AGRP.Server]: Adding network handlers ...");
|
||||||
|
|
||||||
// Chat Box
|
// Chat Box
|
||||||
addNetworkEventHandler("m", receiveChatBoxMessageFromServer); // Not prefixed with VRR to make it as small as possible
|
addNetworkEventHandler("m", receiveChatBoxMessageFromServer); // Not prefixed with VRR to make it as small as possible
|
||||||
@@ -49,7 +48,7 @@ function addAllNetworkHandlers() {
|
|||||||
addNetworkEventHandler("agrp.heading", setLocalPlayerHeading);
|
addNetworkEventHandler("agrp.heading", setLocalPlayerHeading);
|
||||||
addNetworkEventHandler("agrp.interior", setLocalPlayerInterior);
|
addNetworkEventHandler("agrp.interior", setLocalPlayerInterior);
|
||||||
addNetworkEventHandler("agrp.spawned", onServerSpawnedLocalPlayer);
|
addNetworkEventHandler("agrp.spawned", onServerSpawnedLocalPlayer);
|
||||||
addNetworkEventHandler("agrp.money", setLocalPlayerCash);
|
addNetworkEventHandler("agrp.money", setLocalPlayerMoney);
|
||||||
addNetworkEventHandler("agrp.armour", setLocalPlayerArmour);
|
addNetworkEventHandler("agrp.armour", setLocalPlayerArmour);
|
||||||
addNetworkEventHandler("agrp.localPlayerSkin", setLocalPlayerSkin);
|
addNetworkEventHandler("agrp.localPlayerSkin", setLocalPlayerSkin);
|
||||||
addNetworkEventHandler("agrp.pedSpeak", makeLocalPlayerPedSpeak);
|
addNetworkEventHandler("agrp.pedSpeak", makeLocalPlayerPedSpeak);
|
||||||
@@ -69,7 +68,8 @@ function addAllNetworkHandlers() {
|
|||||||
addNetworkEventHandler("agrp.veh.lights", setVehicleLights);
|
addNetworkEventHandler("agrp.veh.lights", setVehicleLights);
|
||||||
addNetworkEventHandler("agrp.veh.engine", setVehicleEngine);
|
addNetworkEventHandler("agrp.veh.engine", setVehicleEngine);
|
||||||
addNetworkEventHandler("agrp.veh.repair", repairVehicle);
|
addNetworkEventHandler("agrp.veh.repair", repairVehicle);
|
||||||
addNetworkEventHandler("agrp.cruiseControl", toggleVehicleCruiseControl);
|
addNetworkEventHandler("agrp.cruiseControl", toggleLocalVehicleCruiseControl);
|
||||||
|
addNetworkEventHandler("agrp.passenger", enterVehicleAsPassenger);
|
||||||
|
|
||||||
// Radio
|
// Radio
|
||||||
addNetworkEventHandler("agrp.radioStream", playStreamingRadio);
|
addNetworkEventHandler("agrp.radioStream", playStreamingRadio);
|
||||||
@@ -108,6 +108,12 @@ function addAllNetworkHandlers() {
|
|||||||
addNetworkEventHandler("agrp.changePassword", showChangePasswordGUI);
|
addNetworkEventHandler("agrp.changePassword", showChangePasswordGUI);
|
||||||
addNetworkEventHandler("agrp.showLocaleChooser", showLocaleChooserGUI);
|
addNetworkEventHandler("agrp.showLocaleChooser", showLocaleChooserGUI);
|
||||||
addNetworkEventHandler("agrp.guiColour", setGUIColours);
|
addNetworkEventHandler("agrp.guiColour", setGUIColours);
|
||||||
|
addNetworkEventHandler("agrp.mapChangeWarning", setMapChangeWarningState);
|
||||||
|
|
||||||
|
// 2D Rendering
|
||||||
|
addNetworkEventHandler("agrp.set2DRendering", set2DRendering);
|
||||||
|
addNetworkEventHandler("agrp.logo", setServerLogoRenderState);
|
||||||
|
addNetworkEventHandler("agrp.showItemActionDelay", showItemActionDelay);
|
||||||
|
|
||||||
// Business
|
// Business
|
||||||
addNetworkEventHandler("agrp.business", receiveBusinessFromServer);
|
addNetworkEventHandler("agrp.business", receiveBusinessFromServer);
|
||||||
@@ -122,13 +128,20 @@ function addAllNetworkHandlers() {
|
|||||||
addNetworkEventHandler("agrp.locale", setLocale);
|
addNetworkEventHandler("agrp.locale", setLocale);
|
||||||
addNetworkEventHandler("agrp.localeChooser", toggleLocaleChooserGUI);
|
addNetworkEventHandler("agrp.localeChooser", toggleLocaleChooserGUI);
|
||||||
|
|
||||||
|
// Animation
|
||||||
|
addNetworkEventHandler("agrp.anim", makePedPlayAnimation);
|
||||||
|
addNetworkEventHandler("agrp.stopAnim", makePedStopAnimation);
|
||||||
|
addNetworkEventHandler("agrp.forceAnim", forcePedAnimation);
|
||||||
|
|
||||||
|
// Nametags
|
||||||
|
addNetworkEventHandler("agrp.nametag", updatePlayerNameTag);
|
||||||
|
addNetworkEventHandler("agrp.nametagDistance", setNameTagDistance);
|
||||||
|
|
||||||
// Misc
|
// Misc
|
||||||
addNetworkEventHandler("agrp.mouseCursor", toggleMouseCursor);
|
addNetworkEventHandler("agrp.mouseCursor", toggleMouseCursor);
|
||||||
addNetworkEventHandler("agrp.mouseCamera", toggleMouseCamera);
|
addNetworkEventHandler("agrp.mouseCamera", toggleMouseCamera);
|
||||||
addNetworkEventHandler("agrp.clearPeds", clearLocalPlayerOwnedPeds);
|
addNetworkEventHandler("agrp.clearPeds", clearLocalPlayerOwnedPeds);
|
||||||
addNetworkEventHandler("agrp.clearPickups", clearLocalPlayerOwnedPickups);
|
addNetworkEventHandler("agrp.clearPickups", clearLocalPlayerOwnedPickups);
|
||||||
addNetworkEventHandler("agrp.passenger", enterVehicleAsPassenger);
|
|
||||||
addNetworkEventHandler("agrp.logo", setServerLogoRenderState);
|
|
||||||
addNetworkEventHandler("agrp.ambience", setCityAmbienceState);
|
addNetworkEventHandler("agrp.ambience", setCityAmbienceState);
|
||||||
addNetworkEventHandler("agrp.runCode", runClientCode);
|
addNetworkEventHandler("agrp.runCode", runClientCode);
|
||||||
addNetworkEventHandler("agrp.minuteDuration", setMinuteDuration);
|
addNetworkEventHandler("agrp.minuteDuration", setMinuteDuration);
|
||||||
@@ -136,26 +149,20 @@ function addAllNetworkHandlers() {
|
|||||||
addNetworkEventHandler("agrp.enterPropertyKey", setEnterPropertyKey);
|
addNetworkEventHandler("agrp.enterPropertyKey", setEnterPropertyKey);
|
||||||
addNetworkEventHandler("agrp.skinSelect", toggleSkinSelect);
|
addNetworkEventHandler("agrp.skinSelect", toggleSkinSelect);
|
||||||
addNetworkEventHandler("agrp.hotbar", updatePlayerHotBar);
|
addNetworkEventHandler("agrp.hotbar", updatePlayerHotBar);
|
||||||
addNetworkEventHandler("agrp.showItemActionDelay", showItemActionDelay);
|
|
||||||
addNetworkEventHandler("agrp.set2DRendering", set2DRendering);
|
|
||||||
addNetworkEventHandler("agrp.mouseCameraForce", setMouseCameraState);
|
addNetworkEventHandler("agrp.mouseCameraForce", setMouseCameraState);
|
||||||
addNetworkEventHandler("agrp.logLevel", setLogLevel);
|
addNetworkEventHandler("agrp.logLevel", setLogLevel);
|
||||||
addNetworkEventHandler("agrp.hideAllGUI", hideAllGUI);
|
addNetworkEventHandler("agrp.hideAllGUI", hideAllGUI);
|
||||||
addNetworkEventHandler("agrp.nametag", updatePlayerNameTag);
|
|
||||||
addNetworkEventHandler("agrp.nametagDistance", setNameTagDistance);
|
|
||||||
addNetworkEventHandler("agrp.ping", updatePlayerPing);
|
addNetworkEventHandler("agrp.ping", updatePlayerPing);
|
||||||
addNetworkEventHandler("agrp.anim", makePedPlayAnimation);
|
|
||||||
addNetworkEventHandler("agrp.stopAnim", makePedStopAnimation);
|
|
||||||
addNetworkEventHandler("agrp.forceAnim", forcePedAnimation);
|
|
||||||
addNetworkEventHandler("agrp.clientInfo", serverRequestedClientInfo);
|
addNetworkEventHandler("agrp.clientInfo", serverRequestedClientInfo);
|
||||||
addNetworkEventHandler("agrp.interiorLights", updateInteriorLightsState);
|
addNetworkEventHandler("agrp.interiorLights", updateInteriorLightsState);
|
||||||
addNetworkEventHandler("agrp.cutsceneInterior", setCutsceneInterior);
|
addNetworkEventHandler("agrp.scene", changeScene);
|
||||||
addNetworkEventHandler("agrp.syncElement", forceSyncElementProperties);
|
addNetworkEventHandler("agrp.syncElement", forceSyncElementProperties);
|
||||||
addNetworkEventHandler("agrp.elementPosition", setElementPosition);
|
addNetworkEventHandler("agrp.elementPosition", setElementPosition);
|
||||||
addNetworkEventHandler("agrp.elementCollisions", setElementCollisionsEnabled);
|
addNetworkEventHandler("agrp.elementCollisions", setElementCollisionsEnabled);
|
||||||
addNetworkEventHandler("agrp.vehBuyState", setVehiclePurchaseState);
|
addNetworkEventHandler("agrp.vehBuyState", setVehiclePurchaseState);
|
||||||
addNetworkEventHandler("agrp.holdObject", makePedHoldObject);
|
addNetworkEventHandler("agrp.holdObject", makePedHoldObject);
|
||||||
addNetworkEventHandler("agrp.profanityFilter", setProfanityFilterState);
|
addNetworkEventHandler("agrp.profanityFilter", setProfanityFilterState);
|
||||||
|
addNetworkEventHandler("agrp.currencyString", receiveCurrencyStringFromServer);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -181,7 +188,7 @@ function sendResourceStoppedSignalToServer() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function set2DRendering(hudState, labelState, smallGameMessageState, scoreboardState, hotBarState, itemActionDelayState) {
|
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})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Main] Updating render states (HUD: ${hudState}, Labels: ${labelState}, Bottom Text: ${smallGameMessageState}, Scoreboard: ${scoreboardState}, HotBar: ${hotBarState}, Item Action Delay: ${itemActionDelayState})`);
|
||||||
renderHUD = hudState;
|
renderHUD = hudState;
|
||||||
|
|
||||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
@@ -206,7 +213,7 @@ function set2DRendering(hudState, labelState, smallGameMessageState, scoreboardS
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onServerSpawnedLocalPlayer(state) {
|
function onServerSpawnedLocalPlayer(state) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Main] Setting spawned state to ${state}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Main] Setting spawned state to ${state}`);
|
||||||
isSpawned = state;
|
isSpawned = state;
|
||||||
setUpInitialGame();
|
setUpInitialGame();
|
||||||
if (state) {
|
if (state) {
|
||||||
@@ -339,7 +346,7 @@ function setLocalPlayerInfiniteRun(state) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setLocalPlayerSkin(skinId) {
|
function setLocalPlayerSkin(skinId) {
|
||||||
logToConsole(LOG_INFO, `[VRR.Server] Setting locale player skin to ${skinId}`);
|
logToConsole(LOG_INFO, `[AGRP.Server] Setting locale player skin to ${skinId}`);
|
||||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
if (natives.isModelInCdimage(skinId)) {
|
if (natives.isModelInCdimage(skinId)) {
|
||||||
natives.requestModel(skinId);
|
natives.requestModel(skinId);
|
||||||
@@ -364,12 +371,14 @@ function makePedHoldObject(pedId, modelIndex) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendLocalPlayerNetworkIdToServer() {
|
function sendLocalPlayerNetworkIdToServer() {
|
||||||
|
if (getGame() == AGRP_GAME_GTA_IV || getGame() == AGRP_GAME_GTA_IV_EFLC) {
|
||||||
sendNetworkEventToServer("agrp.playerPedId", natives.getNetworkIdFromPed(localPlayer));
|
sendNetworkEventToServer("agrp.playerPedId", natives.getNetworkIdFromPed(localPlayer));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setCutsceneInterior(cutsceneName) {
|
function changeScene(sceneName) {
|
||||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
if (cutsceneName == "") {
|
if (cutsceneName == "") {
|
||||||
natives.clearCutscene();
|
natives.clearCutscene();
|
||||||
@@ -379,6 +388,8 @@ function setCutsceneInterior(cutsceneName) {
|
|||||||
}
|
}
|
||||||
natives.initCutscene(cutsceneName);
|
natives.initCutscene(cutsceneName);
|
||||||
}
|
}
|
||||||
|
} else if (getGame() == AGRP_GAME_MAFIA_ONE) {
|
||||||
|
game.changeMap(sceneName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -436,3 +447,27 @@ function clearLocalPlayerOwnedPickups() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function receiveCurrencyStringFromServer(newCurrencyString) {
|
||||||
|
currencyString = newCurrencyString;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setMapChangeWarningState(state) {
|
||||||
|
mapChangeWarning = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function updatePlayerPing(playerName, ping) {
|
||||||
|
playerPing[playerName] = ping;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function receiveClientVariablesFromServer(clientVariablesString) {
|
||||||
|
serverData.cvars = JSON.parse(clientVariablesString);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -45,3 +45,7 @@ function playAudioFile(audioName, loop, volume) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getStreamingRadioVolumeForPosition(position1, position2) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
@@ -18,10 +18,10 @@ let scoreboardKey = SDLK_TAB;
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initScoreBoardScript() {
|
function initScoreBoardScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.ScoreBoard]: Initializing scoreboard script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.ScoreBoard]: Initializing scoreboard script ...");
|
||||||
scoreBoardTitleFont = initScoreBoardTitleFont();
|
scoreBoardTitleFont = initScoreBoardTitleFont();
|
||||||
scoreBoardListFont = initScoreBoardListFont();
|
scoreBoardListFont = initScoreBoardListFont();
|
||||||
logToConsole(LOG_DEBUG, "[VRR.ScoreBoard]: Scoreboard script initialized!");
|
logToConsole(LOG_DEBUG, "[AGRP.ScoreBoard]: Scoreboard script initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
let skinSelectMessageFontTop = null;
|
let skinSelectMessageFontTop = null;
|
||||||
let skinSelectMessageFontBottom = null;
|
let skinSelectMessageFontBottom = null;
|
||||||
let skinSelectMessageTextTop = "Skin Name";
|
let skinSelectMessageTextTop = "Skin Name";
|
||||||
let skinSelectMessageTextBottom = "Choose a skin using PAGEUP and PAGEDOWN keys. Use ENTER to finish or BACKSPACE to cancel.";
|
let skinSelectMessageTextBottom = "Choose a skin using LEFT and RIGHT arrow keys. Use ENTER to finish or BACKSPACE to cancel.";
|
||||||
let skinSelectMessageColourTop = COLOUR_YELLOW;
|
let skinSelectMessageColourTop = COLOUR_YELLOW;
|
||||||
let skinSelectMessageColourBottom = COLOUR_WHITE;
|
let skinSelectMessageColourBottom = COLOUR_WHITE;
|
||||||
|
|
||||||
@@ -24,10 +24,10 @@ let skinSelectHeading = null;
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initSkinSelectScript() {
|
function initSkinSelectScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.SkinSelect]: Initializing skin selector script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.SkinSelect]: Initializing skin selector script ...");
|
||||||
skinSelectMessageFontTop = loadSkinSelectMessageFontTop();
|
skinSelectMessageFontTop = loadSkinSelectMessageFontTop();
|
||||||
skinSelectMessageFontBottom = loadSkinSelectMessageFontBottom();
|
skinSelectMessageFontBottom = loadSkinSelectMessageFontBottom();
|
||||||
logToConsole(LOG_DEBUG, "[VRR.SkinSelect]: Skin selector script initialized!");
|
logToConsole(LOG_DEBUG, "[AGRP.SkinSelect]: Skin selector script initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -46,7 +46,7 @@ function loadSkinSelectMessageFontBottom() {
|
|||||||
|
|
||||||
function processSkinSelectKeyPress(keyCode) {
|
function processSkinSelectKeyPress(keyCode) {
|
||||||
if (usingSkinSelector) {
|
if (usingSkinSelector) {
|
||||||
if (keyCode == SDLK_LEFT || keyCode == SDLK_A) {
|
if (keyCode == getKeyIdFromParams("left") || keyCode == getKeyIdFromParams("a")) {
|
||||||
if (skinSelectorIndex >= allowedSkins.length - 1) {
|
if (skinSelectorIndex >= allowedSkins.length - 1) {
|
||||||
skinSelectorIndex = 1;
|
skinSelectorIndex = 1;
|
||||||
} else {
|
} else {
|
||||||
@@ -55,7 +55,7 @@ function processSkinSelectKeyPress(keyCode) {
|
|||||||
logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`);
|
logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`);
|
||||||
skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1];
|
skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1];
|
||||||
setLocalPlayerSkin(allowedSkins[skinSelectorIndex][0]);
|
setLocalPlayerSkin(allowedSkins[skinSelectorIndex][0]);
|
||||||
} else if (keyCode == SDLK_RIGHT || keyCode == SDLK_D) {
|
} else if (keyCode == getKeyIdFromParams("right") || keyCode == getKeyIdFromParams("d")) {
|
||||||
if (skinSelectorIndex <= 0) {
|
if (skinSelectorIndex <= 0) {
|
||||||
skinSelectorIndex = allowedSkins.length - 1;
|
skinSelectorIndex = allowedSkins.length - 1;
|
||||||
} else {
|
} else {
|
||||||
@@ -64,18 +64,21 @@ function processSkinSelectKeyPress(keyCode) {
|
|||||||
logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`);
|
logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`);
|
||||||
skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1];
|
skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1];
|
||||||
setLocalPlayerSkin(allowedSkins[skinSelectorIndex][0]);
|
setLocalPlayerSkin(allowedSkins[skinSelectorIndex][0]);
|
||||||
} else if (keyCode == SDLK_RETURN) {
|
} else if (keyCode == getKeyIdFromParams("enter")) {
|
||||||
sendNetworkEventToServer("agrp.skinSelected", skinSelectorIndex);
|
sendNetworkEventToServer("agrp.skinSelected", skinSelectorIndex);
|
||||||
toggleSkinSelect(false);
|
toggleSkinSelect(false);
|
||||||
return true;
|
return true;
|
||||||
} else if (keyCode == SDLK_BACKSPACE) {
|
} else if (keyCode == getKeyIdFromParams("backspace")) {
|
||||||
sendNetworkEventToServer("agrp.skinSelected", -1);
|
sendNetworkEventToServer("agrp.skinSelected", -1);
|
||||||
toggleSkinSelect(false);
|
toggleSkinSelect(false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getGame() <= AGRP_GAME_GTA_SA) {
|
||||||
localPlayer.heading = skinSelectHeading;
|
localPlayer.heading = skinSelectHeading;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
@@ -104,10 +107,18 @@ function toggleSkinSelect(state) {
|
|||||||
skinSelectHeading = localPlayer.heading;
|
skinSelectHeading = localPlayer.heading;
|
||||||
|
|
||||||
if (isCustomCameraSupported()) {
|
if (isCustomCameraSupported()) {
|
||||||
let tempPosition = localPlayer.position;
|
let cameraPosition = localPlayer.position;
|
||||||
tempPosition.z += 0.5;
|
let playerPosition = localPlayer.position;
|
||||||
let frontCameraPosition = getPosInFrontOfPos(tempPosition, localPlayer.heading, 3);
|
if (getGame() == AGRP_GAME_MAFIA_ONE) {
|
||||||
game.setCameraLookAt(frontCameraPosition, localPlayer.position, true);
|
cameraPosition.y += 1.5;
|
||||||
|
playerPosition.y += 1.5;
|
||||||
|
distance = 3;
|
||||||
|
} else {
|
||||||
|
cameraPosition.z += 0.5;
|
||||||
|
distance = 3;
|
||||||
|
}
|
||||||
|
let frontCameraPosition = getPosInFrontOfPos(cameraPosition, localPlayer.heading, distance);
|
||||||
|
game.setCameraLookAt(frontCameraPosition, playerPosition, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ function initClientScripts() {
|
|||||||
initNameTagScript();
|
initNameTagScript();
|
||||||
initScoreBoardScript();
|
initScoreBoardScript();
|
||||||
initMessagingScript();
|
initMessagingScript();
|
||||||
initServerScript();
|
initNetworkEventsScript();
|
||||||
initLogoScript();
|
initLogoScript();
|
||||||
initLabelScript();
|
initLabelScript();
|
||||||
initChatBoxScript();
|
initChatBoxScript();
|
||||||
@@ -21,6 +21,9 @@ function initClientScripts() {
|
|||||||
initKeyBindScript();
|
initKeyBindScript();
|
||||||
initEventScript();
|
initEventScript();
|
||||||
initSkinSelectScript();
|
initSkinSelectScript();
|
||||||
|
initCursorScript();
|
||||||
|
|
||||||
|
addAllNetworkHandlers();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ function processSync(event, deltaTime) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (streamingRadioElement) {
|
if (streamingRadioElement) {
|
||||||
streamingRadio.position = getElementPosition(streamingRadioElement.id);
|
|
||||||
//streamingRadio.volume = getStreamingRadioVolumeForPosition(streamingRadio.position);
|
//streamingRadio.volume = getStreamingRadioVolumeForPosition(streamingRadio.position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -48,25 +47,15 @@ function processSync(event, deltaTime) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setVehicleLights(vehicleId, state) {
|
function setVehicleLights(vehicleId, state) {
|
||||||
if (getGame() != AGRP_GAME_MAFIA_ONE) {
|
//if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
if (!state) {
|
// if (!state) {
|
||||||
getElementFromId(vehicleId).lightStatus = 2;
|
// natives.forceCarLights(natives.getVehicleFromNetworkId(vehicleId, 0));
|
||||||
} else {
|
// } else {
|
||||||
getElementFromId(vehicleId).lightStatus = 1;
|
// natives.forceCarLights(natives.getVehicleFromNetworkId(vehicleId, 1));
|
||||||
}
|
// }
|
||||||
} else if (getGame() == AGRP_GAME_GTA_IV) {
|
//} else {
|
||||||
if (!state) {
|
getElementFromId(vehicleId).lights = 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -84,11 +73,12 @@ function syncVehicleProperties(vehicle) {
|
|||||||
|
|
||||||
if (doesEntityDataExist(vehicle, "agrp.lights")) {
|
if (doesEntityDataExist(vehicle, "agrp.lights")) {
|
||||||
let lightStatus = getEntityData(vehicle, "agrp.lights");
|
let lightStatus = getEntityData(vehicle, "agrp.lights");
|
||||||
if (!lightStatus) {
|
vehicle.lights = lightStatus;
|
||||||
vehicle.lightStatus = 2;
|
|
||||||
} else {
|
|
||||||
vehicle.lightStatus = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (doesEntityDataExist(vehicle, "agrp.locked")) {
|
||||||
|
let lockStatus = getEntityData(vehicle, "agrp.locked");
|
||||||
|
vehicle.locked = lockStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doesEntityDataExist(vehicle, "agrp.invincible")) {
|
if (doesEntityDataExist(vehicle, "agrp.invincible")) {
|
||||||
@@ -122,7 +112,7 @@ function syncVehicleProperties(vehicle) {
|
|||||||
vehicle.setSuspensionHeight(suspensionHeight);
|
vehicle.setSuspensionHeight(suspensionHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getGame() == AGRP_GAME_GTA_SA) {
|
if (isGameFeatureSupported("vehicleUpgrades")) {
|
||||||
//let allUpgrades = getGameConfig().vehicleUpgrades[getGame()];
|
//let allUpgrades = getGameConfig().vehicleUpgrades[getGame()];
|
||||||
//for(let i in allUpgrades) {
|
//for(let i in allUpgrades) {
|
||||||
// vehicle.removeUpgrade(i);
|
// vehicle.removeUpgrade(i);
|
||||||
@@ -157,7 +147,7 @@ function syncCivilianProperties(civilian) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getGame() == AGRP_GAME_GTA_III) {
|
if (isGameFeatureSupported("pedScale")) {
|
||||||
if (doesEntityDataExist(civilian, "agrp.scale")) {
|
if (doesEntityDataExist(civilian, "agrp.scale")) {
|
||||||
let scaleFactor = getEntityData(civilian, "agrp.scale");
|
let scaleFactor = getEntityData(civilian, "agrp.scale");
|
||||||
let tempMatrix = civilian.matrix;
|
let tempMatrix = civilian.matrix;
|
||||||
@@ -176,7 +166,7 @@ function syncCivilianProperties(civilian) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getGame() == AGRP_GAME_GTA_III) {
|
if (getGame() == AGRP_GAME_GTA_SA) {
|
||||||
if (doesEntityDataExist(civilian, "agrp.walkStyle")) {
|
if (doesEntityDataExist(civilian, "agrp.walkStyle")) {
|
||||||
let walkStyle = getEntityData(civilian, "agrp.walkStyle");
|
let walkStyle = getEntityData(civilian, "agrp.walkStyle");
|
||||||
civilian.walkStyle = walkStyle;
|
civilian.walkStyle = walkStyle;
|
||||||
@@ -249,12 +239,32 @@ function syncCivilianProperties(civilian) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function syncObjectProperties(object) {
|
||||||
|
if (!areServerElementsSupported()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isGameFeatureSupported("objectScale")) {
|
||||||
|
if (doesEntityDataExist(object, "agrp.scale")) {
|
||||||
|
let scaleFactor = getEntityData(object, "agrp.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 syncPlayerProperties(player) {
|
function syncPlayerProperties(player) {
|
||||||
if (!areServerElementsSupported()) {
|
if (!areServerElementsSupported()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getGame() == AGRP_GAME_GTA_III) {
|
if (isGameFeatureSupported("pedScale")) {
|
||||||
if (doesEntityDataExist(player, "agrp.scale")) {
|
if (doesEntityDataExist(player, "agrp.scale")) {
|
||||||
let scaleFactor = getEntityData(player, "agrp.scale");
|
let scaleFactor = getEntityData(player, "agrp.scale");
|
||||||
let tempMatrix = player.matrix;
|
let tempMatrix = player.matrix;
|
||||||
@@ -367,11 +377,19 @@ function syncElementProperties(element) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isGameFeatureSupported("interior")) {
|
||||||
if (doesEntityDataExist(element, "agrp.interior")) {
|
if (doesEntityDataExist(element, "agrp.interior")) {
|
||||||
if (typeof element.interior != "undefined") {
|
if (typeof element.interior != "undefined") {
|
||||||
element.interior = getEntityData(element, "agrp.interior");
|
element.interior = getEntityData(element, "agrp.interior");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isGameFeatureSupported("toggleCollision")) {
|
||||||
|
if (doesEntityDataExist(element, "agrp.collisions")) {
|
||||||
|
element.collisionsEnabled = getEntityData(element, "agrp.collisions");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (getGame() == AGRP_GAME_MAFIA_ONE) {
|
if (getGame() == AGRP_GAME_MAFIA_ONE) {
|
||||||
switch (element.type) {
|
switch (element.type) {
|
||||||
@@ -404,6 +422,10 @@ function syncElementProperties(element) {
|
|||||||
syncPlayerProperties(element);
|
syncPlayerProperties(element);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ELEMENT_OBJECT:
|
||||||
|
syncObjectProperties(element);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
function getCurrentUnixTimeStampSquirrel() {
|
|
||||||
return time();
|
|
||||||
}
|
|
||||||
|
|
||||||
function getTimeStampOutput(timeStamp) {
|
|
||||||
local dateObj = date(timeStamp);
|
|
||||||
return dateObj.hour + ":" + dateObj.minute + ":" + dateObj.second;
|
|
||||||
}
|
|
||||||
@@ -9,18 +9,19 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setLocalPlayerFrozenState(state) {
|
function setLocalPlayerFrozenState(state) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting frozen state to ${state}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Setting frozen state to ${state}`);
|
||||||
gui.showCursor(state, !state);
|
gui.showCursor(state, !state);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setLocalPlayerControlState(controlState, cursorState = false) {
|
function setLocalPlayerControlState(controlState, cursorState = false) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting control state to ${controlState} (Cursor: ${cursorState})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Setting control state to ${controlState} (Cursor: ${cursorState})`);
|
||||||
controlsEnabled = controlState;
|
controlsEnabled = controlState;
|
||||||
|
game.setPlayerControl(controlState);
|
||||||
if (getGame() == AGRP_GAME_GTA_III || getGame() == AGRP_GAME_GTA_VC) {
|
if (getGame() == AGRP_GAME_GTA_III || getGame() == AGRP_GAME_GTA_VC) {
|
||||||
game.SET_PLAYER_CONTROL(game.GET_PLAYER_ID(), boolToInt(controlState));
|
game.SET_PLAYER_CONTROL(game.GET_PLAYER_ID(), boolToInt(controlState));
|
||||||
} else if (getGame() != AGRP_GAME_GTA_IV) {
|
} else if (getGame() <= AGRP_GAME_GTA_IV) {
|
||||||
setElementCollisionsEnabled(localPlayer, controlState);
|
setElementCollisionsEnabled(localPlayer, controlState);
|
||||||
setPedInvincible(localPlayer, true);
|
setPedInvincible(localPlayer, true);
|
||||||
}
|
}
|
||||||
@@ -28,14 +29,15 @@ function setLocalPlayerControlState(controlState, cursorState = false) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function fadeLocalCamera(state, time) {
|
function fadeLocalCamera(state, duration, colour) {
|
||||||
if (isFadeCameraSupported()) {
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Fading camera ${(state) ? "in" : "out"} for ${time}ms`);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Fading camera ${(state) ? "in" : "out"} for ${time} seconds`);
|
|
||||||
|
|
||||||
if (isFadeCameraSupported()) {
|
cameraFadeDuration = duration;
|
||||||
game.fadeCamera(state, time);
|
cameraFadeStart = sdl.ticks;
|
||||||
}
|
cameraFadeEnabled = true;
|
||||||
}
|
cameraFadeIn = state;
|
||||||
|
cameraFadeColour = colour;
|
||||||
|
cameraFadeAlpha = (state) ? 255 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -47,7 +49,7 @@ function removeLocalPlayerFromVehicle() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function restoreLocalCamera() {
|
function restoreLocalCamera() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Camera restored`);
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Camera restored`);
|
||||||
if (isGameFeatureSupported("customCamera")) {
|
if (isGameFeatureSupported("customCamera")) {
|
||||||
game.restoreCamera(true);
|
game.restoreCamera(true);
|
||||||
}
|
}
|
||||||
@@ -55,16 +57,8 @@ function restoreLocalCamera() {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function clearLocalPlayerOwnedPeds() {
|
|
||||||
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) {
|
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}]`);
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Set camera to look at [${cameraLookAt.x}, ${cameraLookAt.y}, ${cameraLookAt.z}] from [${cameraPosition.x}, ${cameraPosition.y}, ${cameraPosition.z}]`);
|
||||||
if (isCustomCameraSupported()) {
|
if (isCustomCameraSupported()) {
|
||||||
game.setCameraLookAt(cameraPosition, cameraLookAt, true);
|
game.setCameraLookAt(cameraPosition, cameraLookAt, true);
|
||||||
}
|
}
|
||||||
@@ -72,8 +66,16 @@ function setLocalCameraLookAt(cameraPosition, cameraLookAt) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function clearLocalPlayerOwnedPeds() {
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Clearing all self-owned peds ...`);
|
||||||
|
clearSelfOwnedPeds();
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities] All self-owned peds cleared`);
|
||||||
|
};
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
function setCityAmbienceState(state, clearElements = false) {
|
function setCityAmbienceState(state, clearElements = false) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Ambient civilians and traffic ${(state) ? "enabled" : "disabled"}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Ambient civilians and traffic ${(state) ? "enabled" : "disabled"}`);
|
||||||
game.setTrafficEnabled(state);
|
game.setTrafficEnabled(state);
|
||||||
|
|
||||||
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
|
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
|
||||||
@@ -133,7 +135,7 @@ function enterVehicleAsPassenger() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function giveLocalPlayerWeapon(weaponId, ammo, active) {
|
function giveLocalPlayerWeapon(weaponId, ammo, active) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Giving weapon ${weaponId} with ${ammo} ammo`);
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Giving weapon ${weaponId} with ${ammo} ammo`);
|
||||||
forceWeapon = weaponId;
|
forceWeapon = weaponId;
|
||||||
if (getGame() == AGRP_GAME_MAFIA_ONE) {
|
if (getGame() == AGRP_GAME_MAFIA_ONE) {
|
||||||
localPlayer.giveWeapon(weaponId, 0, ammo);
|
localPlayer.giveWeapon(weaponId, 0, ammo);
|
||||||
@@ -154,7 +156,7 @@ function giveLocalPlayerWeapon(weaponId, ammo, active) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function clearLocalPlayerWeapons(clearData) {
|
function clearLocalPlayerWeapons(clearData) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Clearing weapons`);
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Clearing weapons`);
|
||||||
localPlayer.clearWeapons();
|
localPlayer.clearWeapons();
|
||||||
if (clearData == true) {
|
if (clearData == true) {
|
||||||
forceWeapon = 0;
|
forceWeapon = 0;
|
||||||
@@ -172,7 +174,7 @@ function getClosestVehicle(pos) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setLocalPlayerPosition(position) {
|
function setLocalPlayerPosition(position) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting position to ${position.x}, ${position.y}, ${position.z}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Setting position to ${position.x}, ${position.y}, ${position.z}`);
|
||||||
if (typeof localPlayer.velocity != "undefined") {
|
if (typeof localPlayer.velocity != "undefined") {
|
||||||
localPlayer.velocity = toVector3(0.0, 0.0, 0.0);
|
localPlayer.velocity = toVector3(0.0, 0.0, 0.0);
|
||||||
}
|
}
|
||||||
@@ -185,7 +187,7 @@ function setLocalPlayerPosition(position) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setLocalPlayerHeading(heading) {
|
function setLocalPlayerHeading(heading) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting heading to ${heading}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Setting heading to ${heading}`);
|
||||||
if (typeof localPlayer.heading != "undefined") {
|
if (typeof localPlayer.heading != "undefined") {
|
||||||
localPlayer.heading = heading;
|
localPlayer.heading = heading;
|
||||||
}
|
}
|
||||||
@@ -194,7 +196,7 @@ function setLocalPlayerHeading(heading) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setLocalPlayerInterior(interior) {
|
function setLocalPlayerInterior(interior) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting interior to ${interior}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Setting interior to ${interior}`);
|
||||||
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
|
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
|
||||||
if (!isGTAIV()) {
|
if (!isGTAIV()) {
|
||||||
localPlayer.interior = interior;
|
localPlayer.interior = interior;
|
||||||
@@ -222,13 +224,16 @@ function setLocalPlayerInterior(interior) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setSnowState(falling, ground) {
|
function setSnowState(falling, ground, forceGround) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting falling snow to ${falling} and ground snow to ${ground}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Setting falling snow to ${falling} and ground snow to ${ground}`);
|
||||||
snowing = falling;
|
snowing = falling;
|
||||||
if (ground) {
|
//snow.force = ground;
|
||||||
forceSnowing(false);
|
//if (forceGround == true) {
|
||||||
forceSnowing(ground);
|
// forceSnowing(forceGround);
|
||||||
}
|
// groundSnow.flush();
|
||||||
|
//} else {
|
||||||
|
// snow.enabled = ground;
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -240,7 +245,7 @@ function setLocalPlayerHealth(health) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function playPedSpeech(pedName, speechId) {
|
function playPedSpeech(pedName, speechId) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Making ${pedName}'s ped talk (${speechId})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Making ${pedName}'s ped talk (${speechId})`);
|
||||||
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
|
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
|
||||||
game.SET_CHAR_SAY(int, int);
|
game.SET_CHAR_SAY(int, int);
|
||||||
}
|
}
|
||||||
@@ -249,7 +254,7 @@ function playPedSpeech(pedName, speechId) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function clearLocalPedState() {
|
function clearLocalPedState() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Clearing local ped state`);
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Clearing local ped state`);
|
||||||
localPlayer.clearObjective();
|
localPlayer.clearObjective();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,7 +268,7 @@ function getWeaponSlot(weaponId) {
|
|||||||
|
|
||||||
function setLocalPlayerDrunkEffect(amount, duration) {
|
function setLocalPlayerDrunkEffect(amount, duration) {
|
||||||
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
|
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Drunk effect set to ${amount} for ${duration} ms`);
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Drunk effect set to ${amount} for ${duration} ms`);
|
||||||
drunkEffectAmount = 0;
|
drunkEffectAmount = 0;
|
||||||
drunkEffectDurationTimer = setInterval(function () {
|
drunkEffectDurationTimer = setInterval(function () {
|
||||||
drunkEffectAmount = drunkEffectAmount;
|
drunkEffectAmount = drunkEffectAmount;
|
||||||
@@ -313,7 +318,7 @@ function clearSelfOwnedVehicles() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setMouseCameraState(state) {
|
function setMouseCameraState(state) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] ${(state) ? "Enabled" : "Disabled"} mouse camera`);
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities] ${(state) ? "Enabled" : "Disabled"} mouse camera`);
|
||||||
mouseCameraEnabled = state;
|
mouseCameraEnabled = state;
|
||||||
SetStandardControlsEnabled(!mouseCameraEnabled);
|
SetStandardControlsEnabled(!mouseCameraEnabled);
|
||||||
}
|
}
|
||||||
@@ -321,50 +326,33 @@ function setMouseCameraState(state) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function toggleMouseCursor() {
|
function toggleMouseCursor() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] ${(!gui.cursorEnabled) ? "Enabled" : "Disabled"} mouse cursor`);
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities] ${(!gui.cursorEnabled) ? "Enabled" : "Disabled"} mouse cursor`);
|
||||||
gui.showCursor(!gui.cursorEnabled, gui.cursorEnabled);
|
gui.showCursor(!gui.cursorEnabled, gui.cursorEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function toggleMouseCursor() {
|
function toggleMouseCursor() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] ${(!gui.cursorEnabled) ? "Enabled" : "Disabled"} mouse cursor`);
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities] ${(!gui.cursorEnabled) ? "Enabled" : "Disabled"} mouse cursor`);
|
||||||
setMouseCameraState(!mouseCameraEnabled);
|
setMouseCameraState(!mouseCameraEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setPlayerWeaponDamageEvent(clientName, eventType) {
|
function setPlayerWeaponDamageEvent(clientName, eventType) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Set ${clientName} damage event type to ${eventType}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Set ${clientName} damage event type to ${eventType}`);
|
||||||
weaponDamageEvent[clientName] = eventType;
|
weaponDamageEvent[clientName] = eventType;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setPlayerWeaponDamageEnabled(clientName, state) {
|
function setPlayerWeaponDamageEnabled(clientName, state) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] ${(state) ? "Enabled" : "Disabled"} damage from ${clientName}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities] ${(state) ? "Enabled" : "Disabled"} damage from ${clientName}`);
|
||||||
weaponDamageEnabled[clientName] = state;
|
weaponDamageEnabled[clientName] = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setLocalPlayerCash(amount) {
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting local player money`);
|
|
||||||
if (localPlayer == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof localPlayer.money != "undefined") {
|
|
||||||
localPlayer.money = toInteger(amount);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
|
||||||
natives.setMultiplayerHudCash(amount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function destroyAutoCreatedPickups() {
|
function destroyAutoCreatedPickups() {
|
||||||
if (typeof ELEMENT_PICKUP != "undefined") {
|
if (typeof ELEMENT_PICKUP != "undefined") {
|
||||||
getElementsByType(ELEMENT_PICKUP).forEach(function (pickup) {
|
getElementsByType(ELEMENT_PICKUP).forEach(function (pickup) {
|
||||||
@@ -411,10 +399,11 @@ function processWantedLevelReset() {
|
|||||||
|
|
||||||
function processLocalPlayerVehicleControlState() {
|
function processLocalPlayerVehicleControlState() {
|
||||||
if (areServerElementsSupported()) {
|
if (areServerElementsSupported()) {
|
||||||
if (inVehicle && localPlayer.vehicle != null) {
|
if (localPlayer.vehicle != null) {
|
||||||
if (doesEntityDataExist(localPlayer.vehicle, "agrp.engine")) {
|
if (doesEntityDataExist(localPlayer.vehicle, "agrp.engine")) {
|
||||||
if (getEntityData(localPlayer.vehicle, "agrp.engine") == false) {
|
if (getEntityData(localPlayer.vehicle, "agrp.engine") == false) {
|
||||||
localPlayer.vehicle.engine = false;
|
localPlayer.vehicle.engine = false;
|
||||||
|
//localPlayer.vehicle.netFlags.sendSync = false;
|
||||||
if (!localPlayer.vehicle.engine) {
|
if (!localPlayer.vehicle.engine) {
|
||||||
if (typeof localPlayer.vehicle.velocity != "undefined") {
|
if (typeof localPlayer.vehicle.velocity != "undefined") {
|
||||||
localPlayer.vehicle.velocity = toVector3(0.0, 0.0, 0.0);
|
localPlayer.vehicle.velocity = toVector3(0.0, 0.0, 0.0);
|
||||||
@@ -426,6 +415,8 @@ function processLocalPlayerVehicleControlState() {
|
|||||||
// localPlayer.vehicle.heading = parkedVehicleHeading;
|
// localPlayer.vehicle.heading = parkedVehicleHeading;
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
//localPlayer.vehicle.netFlags.sendSync = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -480,7 +471,7 @@ function getVehicleForNetworkEvent(vehicle) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setMinuteDuration(minuteDuration) {
|
function setMinuteDuration(minuteDuration) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting minute duration to ${minuteDuration}ms`);
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Setting minute duration to ${minuteDuration}ms`);
|
||||||
|
|
||||||
if (isTimeSupported()) {
|
if (isTimeSupported()) {
|
||||||
game.time.minuteDuration = minuteDuration;
|
game.time.minuteDuration = minuteDuration;
|
||||||
@@ -575,3 +566,55 @@ function setProfanityFilterState(state) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function processVehicleCruiseControl() {
|
||||||
|
if (localPlayer.vehicle == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!localPlayer.vehicle.isSyncer) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getLocalPlayerVehicleSeat() != 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cruiseControlEnabled) {
|
||||||
|
setVehicleSpeed(cruiseControlSpeed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getCurrencyString(amount) {
|
||||||
|
let tempString = currencyString;
|
||||||
|
tempString = tempString.replace("{AMOUNT}", toString(makeLargeNumberReadable(amount)));
|
||||||
|
return tempString;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function updateLocalPlayerMoney() {
|
||||||
|
if (localPlayer == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof localPlayer.money != "undefined") {
|
||||||
|
localPlayer.money = toInteger(localPlayerMoney);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
|
natives.setMultiplayerHudCash(localPlayerMoney);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setLocalPlayerMoney(amount) {
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Setting local player money`);
|
||||||
|
localPlayerMoney = amount;
|
||||||
|
updateLocalPlayerMoney();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -30,8 +30,8 @@ class VehicleData {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function receiveVehicleFromServer(vehicleId, networkId, position, model, colour1, colour2, colour3 = 0, colour4 = 0, locked = false, lights = false, engine = false, licensePlate = "") {
|
function receiveVehicleFromServer(vehicleId, position, model, colour1, colour2, colour3 = 0, colour4 = 0, locked = false, lights = false, engine = false, licensePlate = "") {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Vehicle] Received vehicle ${vehicleId} (${getVehicleNameFromModel(model, getGame())}) from server`);
|
logToConsole(LOG_DEBUG, `[AGRP.Vehicle] Received vehicle ${vehicleId} (${getVehicleNameFromModel(model, getGame())}) from server`);
|
||||||
|
|
||||||
if (getGame() != AGRP_GAME_GTA_IV) {
|
if (getGame() != AGRP_GAME_GTA_IV) {
|
||||||
return false;
|
return false;
|
||||||
@@ -50,18 +50,10 @@ function receiveVehicleFromServer(vehicleId, networkId, position, model, colour1
|
|||||||
vehicleData.lights = lights;
|
vehicleData.lights = lights;
|
||||||
vehicleData.locked = locked;
|
vehicleData.locked = locked;
|
||||||
vehicleData.licensePlate = "";
|
vehicleData.licensePlate = "";
|
||||||
vehicleData.networkId = networkId;
|
|
||||||
|
|
||||||
if (natives.getVehicleFromNetworkId(vehicleId.ivNetworkId) != null) {
|
let vehicle = natives.getVehicleFromNetworkId(vehicleId.ivNetworkId);
|
||||||
vehicleData.vehicle = natives.getVehicleFromNetworkId(vehicleId.ivNetworkId);
|
|
||||||
} else {
|
} else {
|
||||||
let vehicle = createGameVehicle(model, position, heading, colour1, colour2, colour3, colour4);
|
//logToConsole(LOG_DEBUG, `[AGRP.Vehicle] Vehicle ${vehicleId} doesn't exist. Adding ...`);
|
||||||
vehicleData.vehicle = vehicle;
|
|
||||||
|
|
||||||
sendNetworkEventToServer("agrp.vehicleCreated", vehicleId, natives.getNetworkIdFromVehicle(vehicle));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
//logToConsole(LOG_DEBUG, `[VRR.Vehicle] Vehicle ${vehicleId} doesn't exist. Adding ...`);
|
|
||||||
//let tempVehicleData = new VehicleData(vehicleId, name, position, blipModel, pickupModel);
|
//let tempVehicleData = new VehicleData(vehicleId, name, position, blipModel, pickupModel);
|
||||||
|
|
||||||
//vehicles.push(tempVehicleData);
|
//vehicles.push(tempVehicleData);
|
||||||
@@ -139,14 +131,13 @@ function setAllVehicleDataIndexes() {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function toggleVehicleCruiseControl(vehicle) {
|
function toggleLocalVehicleCruiseControl() {
|
||||||
if (!vehicle.isSyncer) {
|
if (!localPlayer.vehicle.isSyncer) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cruiseControlEnabled = !cruiseControlEnabled;
|
||||||
|
cruiseControlSpeed = getVehicleSpeed(vehicle);
|
||||||
cruiseControl = !cruiseControl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ class AccountData {
|
|||||||
this.ircAccount = "";
|
this.ircAccount = "";
|
||||||
this.discordAccount = 0;
|
this.discordAccount = 0;
|
||||||
this.settings = 0;
|
this.settings = 0;
|
||||||
|
this.seenActionTips = 0;
|
||||||
this.emailAddress = "";
|
this.emailAddress = "";
|
||||||
this.ipAddress = 0;
|
this.ipAddress = 0;
|
||||||
|
|
||||||
@@ -87,6 +88,7 @@ class AccountData {
|
|||||||
this.ircAccount = toInteger(dbAssoc["acct_irc"]);
|
this.ircAccount = toInteger(dbAssoc["acct_irc"]);
|
||||||
this.discordAccount = toInteger(dbAssoc["acct_discord"]);
|
this.discordAccount = toInteger(dbAssoc["acct_discord"]);
|
||||||
this.settings = toInteger(dbAssoc["acct_svr_settings"]);
|
this.settings = toInteger(dbAssoc["acct_svr_settings"]);
|
||||||
|
this.seenActionTips = toInteger(dbAssoc["acct_svr_seen_action_tips"]);
|
||||||
this.emailAddress = toString(dbAssoc["acct_email"]);
|
this.emailAddress = toString(dbAssoc["acct_email"]);
|
||||||
this.ipAddress = toString(dbAssoc["acct_ip"]);
|
this.ipAddress = toString(dbAssoc["acct_ip"]);
|
||||||
|
|
||||||
@@ -193,8 +195,8 @@ class AccountStaffNoteData {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initAccountScript() {
|
function initAccountScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Account]: Initializing account script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.Account]: Initializing account script ...");
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Account]: Account script initialized!");
|
logToConsole(LOG_DEBUG, "[AGRP.Account]: Account script initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -283,31 +285,31 @@ function toggleAccountGUICommand(command, params, client) {
|
|||||||
if (doesPlayerHaveGUIEnabled(client)) {
|
if (doesPlayerHaveGUIEnabled(client)) {
|
||||||
getPlayerData(client).accountData.settings = addBitFlag(getPlayerData(client).accountData.settings, flagValue);
|
getPlayerData(client).accountData.settings = addBitFlag(getPlayerData(client).accountData.settings, flagValue);
|
||||||
messagePlayerNormal(client, getLocaleString(client, "GUIAccountSettingToggle", `{softRed}${toUpperCase(getLocaleString(client, "Off"))}{MAINCOLOUR}`));
|
messagePlayerNormal(client, getLocaleString(client, "GUIAccountSettingToggle", `{softRed}${toUpperCase(getLocaleString(client, "Off"))}{MAINCOLOUR}`));
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} has toggled GUI for their account OFF.`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has toggled GUI for their account OFF.`);
|
||||||
} else {
|
} else {
|
||||||
getPlayerData(client).accountData.settings = removeBitFlag(getPlayerData(client).accountData.settings, flagValue);
|
getPlayerData(client).accountData.settings = removeBitFlag(getPlayerData(client).accountData.settings, flagValue);
|
||||||
messagePlayerNormal(client, getLocaleString(client, "GUIAccountSettingToggle", `{softGreen}${toUpperCase(getLocaleString(client, "On"))}{MAINCOLOUR}`));
|
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.`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has toggled GUI for their account ON.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isPlayerLoggedIn(client)) {
|
if (!isPlayerLoggedIn(client)) {
|
||||||
if (getPlayerData().accountData.databaseId != 0) {
|
if (getPlayerData().accountData.databaseId != 0) {
|
||||||
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
showPlayerLoginGUI(client);
|
showPlayerLoginGUI(client);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI`);
|
||||||
} else {
|
} else {
|
||||||
hideAllPlayerGUI(client);
|
hideAllPlayerGUI(client);
|
||||||
messagePlayerNormal(client, getLocaleString(client, "WelcomeBack", getServerName(), getPlayerName(client), "{ALTCOLOUR}/login{MAINCOLOUR}"));
|
messagePlayerNormal(client, getLocaleString(client, "WelcomeBack", getServerName(), getPlayerName(client), "{ALTCOLOUR}/login{MAINCOLOUR}"));
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled)`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled)`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
showPlayerRegistrationGUI(client);
|
showPlayerRegistrationGUI(client);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the register GUI`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register GUI`);
|
||||||
} else {
|
} else {
|
||||||
hideAllPlayerGUI(client);
|
hideAllPlayerGUI(client);
|
||||||
messagePlayerNormal(client, getLocaleString(client, "WelcomeNewPlayer", getServerName(), getPlayerName(client), "{ALTCOLOUR}/register{MAINCOLOUR}"));
|
messagePlayerNormal(client, getLocaleString(client, "WelcomeNewPlayer", getServerName(), getPlayerName(client), "{ALTCOLOUR}/register{MAINCOLOUR}"));
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the register message (GUI disabled)`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register message (GUI disabled)`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -322,11 +324,11 @@ function toggleAccountLoginAttemptNotificationsCommand(command, params, client)
|
|||||||
if (doesPlayerHaveLoginAlertsEnabled(client)) {
|
if (doesPlayerHaveLoginAlertsEnabled(client)) {
|
||||||
getPlayerData(client).accountData.settings = removeBitFlag(getPlayerData(client).accountData.settings, flagValue);
|
getPlayerData(client).accountData.settings = removeBitFlag(getPlayerData(client).accountData.settings, flagValue);
|
||||||
messagePlayerNormal(client, `⚙️ You turned ${getBoolRedGreenInlineColour(false)}OFF{MAINCOLOUR} notification by email when somebody tries to login to your account`);
|
messagePlayerNormal(client, `⚙️ You turned ${getBoolRedGreenInlineColour(false)}OFF{MAINCOLOUR} notification by email when somebody tries to login to your account`);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} has toggled the login attempt email notifications OFF for their account`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has toggled the login attempt email notifications OFF for their account`);
|
||||||
} else {
|
} else {
|
||||||
getPlayerData(client).accountData.settings = addBitFlag(getPlayerData(client).accountData.settings, flagValue);
|
getPlayerData(client).accountData.settings = addBitFlag(getPlayerData(client).accountData.settings, flagValue);
|
||||||
messagePlayerNormal(client, `⚙️ You turned ${getBoolRedGreenInlineColour(true)}ON{MAINCOLOUR} notification by email when somebody tries to login to your account`);
|
messagePlayerNormal(client, `⚙️ You turned ${getBoolRedGreenInlineColour(true)}ON{MAINCOLOUR} notification by email when somebody tries to login to your account`);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} has toggled the login attempt email notifications OFF for their account`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has toggled the login attempt email notifications OFF for their account`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -340,14 +342,14 @@ function toggleAccountServerLogoCommand(command, params, client) {
|
|||||||
if (!doesPlayerHaveLogoEnabled(client)) {
|
if (!doesPlayerHaveLogoEnabled(client)) {
|
||||||
getPlayerData(client).accountData.settings = removeBitFlag(getPlayerData(client).accountData.settings, flagValue);
|
getPlayerData(client).accountData.settings = removeBitFlag(getPlayerData(client).accountData.settings, flagValue);
|
||||||
messagePlayerSuccess(client, getLocaleString(client, "AccountServerLogoSet", `${getBoolRedGreenInlineColour(true)}${getLocaleString(client, "On")}{MAINCOLOUR}`));
|
messagePlayerSuccess(client, getLocaleString(client, "AccountServerLogoSet", `${getBoolRedGreenInlineColour(true)}${getLocaleString(client, "On")}{MAINCOLOUR}`));
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} has toggled the server logo ON for their account`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has toggled the server logo ON for their account`);
|
||||||
if (getServerConfig().showLogo) {
|
if (getServerConfig().showLogo) {
|
||||||
updatePlayerShowLogoState(client, true);
|
updatePlayerShowLogoState(client, true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
getPlayerData(client).accountData.settings = addBitFlag(getPlayerData(client).accountData.settings, flagValue);
|
getPlayerData(client).accountData.settings = addBitFlag(getPlayerData(client).accountData.settings, flagValue);
|
||||||
messagePlayerSuccess(client, getLocaleString(client, "AccountServerLogoSet", `${getBoolRedGreenInlineColour(false)}${getLocaleString(client, "Off")}{MAINCOLOUR}`));
|
messagePlayerSuccess(client, getLocaleString(client, "AccountServerLogoSet", `${getBoolRedGreenInlineColour(false)}${getLocaleString(client, "Off")}{MAINCOLOUR}`));
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} has toggled the server logo OFF for their account`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has toggled the server logo OFF for their account`);
|
||||||
updatePlayerShowLogoState(client, false);
|
updatePlayerShowLogoState(client, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -376,11 +378,11 @@ function toggleAccountTwoFactorAuthCommand(command, params, client) {
|
|||||||
if (!doesPlayerHaveTwoFactorAuthEnabled(client)) {
|
if (!doesPlayerHaveTwoFactorAuthEnabled(client)) {
|
||||||
getPlayerData(client).accountData.settings = addBitFlag(getPlayerData(client).accountData.settings, flagValue);
|
getPlayerData(client).accountData.settings = addBitFlag(getPlayerData(client).accountData.settings, flagValue);
|
||||||
messagePlayerSuccess(client, getLocaleString(client, "TwoFactorAuthSet", `${getBoolRedGreenInlineColour(true)}${getLocaleString(client, "On")}{MAINCOLOUR}`));
|
messagePlayerSuccess(client, getLocaleString(client, "TwoFactorAuthSet", `${getBoolRedGreenInlineColour(true)}${getLocaleString(client, "On")}{MAINCOLOUR}`));
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} has toggled two-factor authentication ON for their account`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has toggled two-factor authentication ON for their account`);
|
||||||
} else {
|
} else {
|
||||||
getPlayerData(client).accountData.settings = removeBitFlag(getPlayerData(client).accountData.settings, flagValue);
|
getPlayerData(client).accountData.settings = removeBitFlag(getPlayerData(client).accountData.settings, flagValue);
|
||||||
messagePlayerSuccess(client, getLocaleString(client, "TwoFactorAuthSet", `${getBoolRedGreenInlineColour(false)}${toUpperCase(getLocaleString(client, "Off"))}{MAINCOLOUR}`));
|
messagePlayerSuccess(client, getLocaleString(client, "TwoFactorAuthSet", `${getBoolRedGreenInlineColour(false)}${toUpperCase(getLocaleString(client, "Off"))}{MAINCOLOUR}`));
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} has toggled two-factor authentication OFF for their account`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has toggled two-factor authentication OFF for their account`);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -495,7 +497,7 @@ function changeAccountPasswordCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getPlayerData(client).accountData.password = hashAccountPassword(getPlayerData(client).accountData.name, params);
|
getPlayerData(client).accountData.password = hashAccountPassword(getPlayerData(client).accountData.name, params);
|
||||||
messagePlayerSuccess(client, `Your password has been changed!`);
|
messagePlayerSuccess(client, getLocaleString(client, "PasswordChanged"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -591,7 +593,7 @@ function verifyAccountEmailCommand(command, params, client) {
|
|||||||
let verificationCode = getParam(params, " ", 1);
|
let verificationCode = getParam(params, " ", 1);
|
||||||
|
|
||||||
if (isAccountEmailVerified(getPlayerData(client).accountData)) {
|
if (isAccountEmailVerified(getPlayerData(client).accountData)) {
|
||||||
messagePlayerError(client, `You already verified your email!`);
|
messagePlayerError(client, getLocaleString(client, "AccountEmailAlreadyVerified"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -644,7 +646,7 @@ function resetAccountPasswordCommand(command, params, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setAccountDiscordCommand(command, params, client) {
|
function setAccountDiscordCommand(command, params, client) {
|
||||||
messagePlayerError(client, `This command is not yet finished and will be available soon!`);
|
messagePlayerError(client, getLocaleString(client, "CommandDisabled"));
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (areParamsEmpty(params)) {
|
if (areParamsEmpty(params)) {
|
||||||
@@ -830,7 +832,7 @@ function saltAccountInfo(name, password) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loginSuccess(client) {
|
function loginSuccess(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} successfully logged in.`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} successfully logged in.`);
|
||||||
getPlayerData(client).loggedIn = true;
|
getPlayerData(client).loggedIn = true;
|
||||||
|
|
||||||
if (getPlayerData(client).loginTimeout != null) {
|
if (getPlayerData(client).loginTimeout != null) {
|
||||||
@@ -841,23 +843,23 @@ function loginSuccess(client) {
|
|||||||
updateConnectionLogOnAuth(client, getPlayerData(client).accountData.databaseId);
|
updateConnectionLogOnAuth(client, getPlayerData(client).accountData.databaseId);
|
||||||
|
|
||||||
if (doesPlayerHaveStaffPermission(client, "Developer") || doesPlayerHaveStaffPermission(client, "ManageServer")) {
|
if (doesPlayerHaveStaffPermission(client, "Developer") || doesPlayerHaveStaffPermission(client, "ManageServer")) {
|
||||||
logToConsole(LOG_WARN, `[VRR.Account] ${getPlayerDisplayForConsole(client)} has needed permissions and is being given administrator access`);
|
logToConsole(LOG_WARN, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has needed permissions and is being given administrator access`);
|
||||||
setPlayerNativeAdminState(client, true);
|
setPlayerNativeAdminState(client, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doesServerHaveTesterOnlyEnabled()) {
|
if (doesServerHaveTesterOnlyEnabled()) {
|
||||||
if (!hasBitFlag(getPlayerData(client).accountData.flags.moderation, getModerationFlagValue("IsTester"))) {
|
if (!hasBitFlag(getPlayerData(client).accountData.flags.moderation, getModerationFlagValue("IsTester"))) {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
getPlayerData(client).customDisconnectReason = "Kicked - Not a tester";
|
getPlayerData(client).customDisconnectReason = "NotATester";
|
||||||
disconnectPlayer(client);
|
disconnectPlayer(client);
|
||||||
}, 3500);
|
}, 3500);
|
||||||
|
|
||||||
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the error GUI (not a tester).`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the error GUI (not a tester).`);
|
||||||
showPlayerErrorGUI(client, getLocaleString(client, "NotATester"), getLocaleString(client, "AccessDenied"));
|
showPlayerErrorGUI(client, getLocaleString(client, "NotATester"), getLocaleString(client, "AccessDenied"));
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the "not a tester" error message (GUI disabled).`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the "not a tester" error message (GUI disabled).`);
|
||||||
messagePlayerError(client, getLocaleString(client, "NotATester"));
|
messagePlayerError(client, getLocaleString(client, "NotATester"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -868,10 +870,10 @@ function loginSuccess(client) {
|
|||||||
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
showPlayerPrompt(client, getLocaleString(client, "NoCharactersGUIMessage"), getLocaleString(client, "NoCharactersGUIWindowTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
showPlayerPrompt(client, getLocaleString(client, "NoCharactersGUIMessage"), getLocaleString(client, "NoCharactersGUIWindowTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
||||||
getPlayerData(client).promptType = AGRP_PROMPT_CREATEFIRSTCHAR;
|
getPlayerData(client).promptType = AGRP_PROMPT_CREATEFIRSTCHAR;
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the no characters prompt GUI`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the no characters prompt GUI`);
|
||||||
} else {
|
} else {
|
||||||
messagePlayerAlert(client, getLocaleString(client, "NoCharactersChatMessage", `{ALTCOLOUR}/newchar{MAINCOLOUR}`));
|
messagePlayerAlert(client, getLocaleString(client, "NoCharactersChatMessage", `{ALTCOLOUR}/newchar{MAINCOLOUR}`));
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the no characters message (GUI disabled)`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the no characters message (GUI disabled)`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
showCharacterSelectToClient(client);
|
showCharacterSelectToClient(client);
|
||||||
@@ -921,6 +923,7 @@ function saveAccountToDatabase(accountData) {
|
|||||||
|
|
||||||
let data2 = [
|
let data2 = [
|
||||||
["acct_svr_settings", (accountData.settings != NaN) ? toInteger(accountData.settings) : 0],
|
["acct_svr_settings", (accountData.settings != NaN) ? toInteger(accountData.settings) : 0],
|
||||||
|
["acct_svr_seen_action_tips", (accountData.seenActionTips != NaN) ? toInteger(accountData.seenActionTips) : 0],
|
||||||
["acct_svr_staff_title", toString(safeStaffTitle)],
|
["acct_svr_staff_title", toString(safeStaffTitle)],
|
||||||
["acct_svr_staff_flags", (accountData.flags.admin != NaN) ? toInteger(accountData.flags.admin) : 0],
|
["acct_svr_staff_flags", (accountData.flags.admin != NaN) ? toInteger(accountData.flags.admin) : 0],
|
||||||
["acct_svr_mod_flags", (accountData.flags.moderation != NaN) ? toInteger(accountData.flags.moderation) : 0],
|
["acct_svr_mod_flags", (accountData.flags.moderation != NaN) ? toInteger(accountData.flags.moderation) : 0],
|
||||||
@@ -1064,41 +1067,41 @@ function createAccount(name, password, email = "") {
|
|||||||
function checkLogin(client, password) {
|
function checkLogin(client, password) {
|
||||||
getPlayerData(client).loginAttemptsRemaining = getPlayerData(client).loginAttemptsRemaining - 1;
|
getPlayerData(client).loginAttemptsRemaining = getPlayerData(client).loginAttemptsRemaining - 1;
|
||||||
if (getPlayerData(client).loginAttemptsRemaining <= 0) {
|
if (getPlayerData(client).loginAttemptsRemaining <= 0) {
|
||||||
getPlayerData(client).customDisconnectReason = "Kicked - Failed to login";
|
getPlayerData(client).customDisconnectReason = "FailedToLogin";
|
||||||
disconnectPlayer(client);
|
disconnectPlayer(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isPlayerLoggedIn(client)) {
|
if (isPlayerLoggedIn(client)) {
|
||||||
logToConsole(LOG_WARN, `[VRR.Account] ${getPlayerDisplayForConsole(client)} attempted to login but is already logged in`);
|
logToConsole(LOG_WARN, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} attempted to login but is already logged in`);
|
||||||
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
showPlayerLoginSuccessGUI(client);
|
showPlayerLoginSuccessGUI(client);
|
||||||
} else {
|
} else {
|
||||||
messagePlayerError(client, "You are already logged in!");
|
messagePlayerError(client, getLocaleString(client, "AlreadyLoggedIn"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isPlayerRegistered(client)) {
|
if (!isPlayerRegistered(client)) {
|
||||||
logToConsole(LOG_WARN, `[VRR.Account] ${getPlayerDisplayForConsole(client)} attempted to login but is not registered`);
|
logToConsole(LOG_WARN, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} attempted to login but is not registered`);
|
||||||
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
showPlayerRegistrationGUI(client);
|
showPlayerRegistrationGUI(client);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the register GUI`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register GUI`);
|
||||||
} else {
|
} else {
|
||||||
messagePlayerError(client, "Your name is not registered! Use /register to make an account.");
|
messagePlayerError(client, "Your name is not registered! Use /register to make an account.");
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the register message (GUI disabled)`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register message (GUI disabled)`);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (areParamsEmpty(password)) {
|
if (areParamsEmpty(password)) {
|
||||||
logToConsole(LOG_WARN, `[VRR.Account] ${getPlayerDisplayForConsole(client)} attempted to login but failed (empty password). ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining`);
|
logToConsole(LOG_WARN, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} attempted to login but failed (empty password). ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining`);
|
||||||
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
showPlayerLoginFailedGUI(client, `Invalid password! ${getPlayerData(client).loginAttemptsRemaining} tries remaining.`);
|
showPlayerLoginFailedGUI(client, getLocaleString(client, "LoginFailedInvalidPassword", getPlayerData(client).loginAttemptsRemaining));
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
|
||||||
} else {
|
} else {
|
||||||
messagePlayerError(client, `You must enter a password! ${getPlayerData(client).loginAttemptsRemaining} tries remaining.`);
|
messagePlayerError(client, getLocaleString(client, "LoginFailedNoPassword", getPlayerData(client).loginAttemptsRemaining));
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled) with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled) with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disabling email login alerts for now. It hangs the server for a couple seconds. Need a way to thread it.
|
// Disabling email login alerts for now. It hangs the server for a couple seconds. Need a way to thread it.
|
||||||
@@ -1109,13 +1112,13 @@ function checkLogin(client, password) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!isAccountPasswordCorrect(getPlayerData(client).accountData, hashAccountPassword(getPlayerName(client), password))) {
|
if (!isAccountPasswordCorrect(getPlayerData(client).accountData, hashAccountPassword(getPlayerName(client), password))) {
|
||||||
logToConsole(LOG_WARN, `[VRR.Account] ${getPlayerDisplayForConsole(client)} attempted to login but failed (wrong password). ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining`);
|
logToConsole(LOG_WARN, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} attempted to login but failed (wrong password). ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining`);
|
||||||
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
showPlayerLoginFailedGUI(client, `Invalid password! ${getPlayerData(client).loginAttemptsRemaining} tries remaining.`);
|
showPlayerLoginFailedGUI(client, getLocaleString(client, "LoginFailedInvalidPassword", getPlayerData(client).loginAttemptsRemaining));
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
|
||||||
} else {
|
} else {
|
||||||
messagePlayerError(client, `Invalid password! ${getPlayerData(client).loginAttemptsRemaining} tries remaining.`);
|
messagePlayerError(client, getLocaleString(client, "LoginFailedInvalidPassword", getPlayerData(client).loginAttemptsRemaining));
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled) with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled) with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disabling email login alerts for now. It hangs the server for a couple seconds. Need a way to thread it.
|
// Disabling email login alerts for now. It hangs the server for a couple seconds. Need a way to thread it.
|
||||||
@@ -1148,7 +1151,7 @@ function checkLogin(client, password) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function checkRegistration(client, password, confirmPassword = "", emailAddress = "") {
|
function checkRegistration(client, password, confirmPassword = "", emailAddress = "") {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account]: Checking registration for ${getPlayerName(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account]: Checking registration for ${getPlayerName(client)}`);
|
||||||
|
|
||||||
if (isPlayerRegistered(client)) {
|
if (isPlayerRegistered(client)) {
|
||||||
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
@@ -1175,7 +1178,7 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress
|
|||||||
showPlayerRegistrationFailedGUI(client, getLocaleString(client, "RegistrationFailedNoPassword"));
|
showPlayerRegistrationFailedGUI(client, getLocaleString(client, "RegistrationFailedNoPassword"));
|
||||||
logToConsole(LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to create an account (password is blank)`);
|
logToConsole(LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to create an account (password is blank)`);
|
||||||
} else {
|
} else {
|
||||||
messagePlayerError(client, "The password cannot be blank!");
|
messagePlayerError(client, getLocaleString(client, "RegistrationFailedNoPassword"));
|
||||||
logToConsole(LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to create an account (password is blank)`);
|
logToConsole(LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to create an account (password is blank)`);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -1211,7 +1214,20 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress
|
|||||||
showPlayerRegistrationFailedGUI(client, getLocaleString(client, "RegistrationFailedNoPasswordWeak"));
|
showPlayerRegistrationFailedGUI(client, getLocaleString(client, "RegistrationFailedNoPasswordWeak"));
|
||||||
logToConsole(LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to create an account (password doesn't meet requirements)`);
|
logToConsole(LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to create an account (password doesn't meet requirements)`);
|
||||||
} else {
|
} else {
|
||||||
messagePlayerError(client, "Password doesn't meet requirements!");
|
messagePlayerError(client, getLocaleString(client, "PasswordNotGoodEnough"));
|
||||||
|
let passwordRequirements = []
|
||||||
|
if (getGlobalConfig().passwordRequiredCapitals > 0) {
|
||||||
|
passwordRequirements.push(getLocaleString(client, "PasswordNeedsCapitals", getGlobalConfig().passwordRequiredCapitals))
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getGlobalConfig().passwordRequiredNumbers > 0) {
|
||||||
|
passwordRequirements.push(getLocaleString(client, "PasswordNeedsNumbers", getGlobalConfig().passwordRequiredNumbers))
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getGlobalConfig().passwordRequiredSymbols > 0) {
|
||||||
|
passwordRequirements.push(getLocaleString(client, "PasswordNeedsSymbols", getGlobalConfig().passwordRequiredSymbols))
|
||||||
|
}
|
||||||
|
messagePlayerInfo(client, getLocaleString(client, "PasswordNeedsBase", passwordRequirements.join(", ")));
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1231,7 +1247,7 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress
|
|||||||
messagePlayerAlert(client, getLocaleString(client, "RegistrationFailedCreateError"));
|
messagePlayerAlert(client, getLocaleString(client, "RegistrationFailedCreateError"));
|
||||||
}
|
}
|
||||||
|
|
||||||
messagePlayerAlert(client, `${getServerName()} staff have been notified of the problem and will fix it shortly.`);
|
messagePlayerAlert(client, getLocaleString(client, "DevelopersNotified"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1251,16 +1267,16 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress
|
|||||||
|
|
||||||
if (doesServerHaveTesterOnlyEnabled() && !isPlayerATester(client)) {
|
if (doesServerHaveTesterOnlyEnabled() && !isPlayerATester(client)) {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
getPlayerData(client).customDisconnectReason = "Kicked - Not a tester";
|
getPlayerData(client).customDisconnectReason = "NotATester";
|
||||||
disconnectPlayer(client);
|
disconnectPlayer(client);
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
|
||||||
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the error GUI (not a tester).`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the error GUI (not a tester).`);
|
||||||
showPlayerErrorGUI(client, getLocaleString(client, "NotATester"), getLocaleString(client, "AccessDenied"));
|
showPlayerErrorGUI(client, getLocaleString(client, "NotATester"), getLocaleString(client, "AccessDenied"));
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the "not a tester" error message (GUI disabled).`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the "not a tester" error message (GUI disabled).`);
|
||||||
messagePlayerError(client, getLocaleString(client, "NotATester"));
|
messagePlayerError(client, getLocaleString(client, "NotATester"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1272,7 +1288,7 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress
|
|||||||
showPlayerPrompt(client, getLocaleString(client, "NoCharactersGUIMessage"), getLocaleString(client, "NoCharactersGUIWindowTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
showPlayerPrompt(client, getLocaleString(client, "NoCharactersGUIMessage"), getLocaleString(client, "NoCharactersGUIWindowTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
||||||
getPlayerData(client).promptType = AGRP_PROMPT_CREATEFIRSTCHAR;
|
getPlayerData(client).promptType = AGRP_PROMPT_CREATEFIRSTCHAR;
|
||||||
} else {
|
} else {
|
||||||
messagePlayerAlert(client, getLocaleString(client, "NoCharactersChatMessage"), `{ALTCOLOUR}/newchar{MAINCOLOUR}`);
|
messagePlayerAlert(client, getLocaleString(client, "NoCharactersChatMessage", `{ALTCOLOUR}/newchar{MAINCOLOUR}`));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1313,7 +1329,7 @@ function checkAccountResetPasswordRequest(client, inputText) {
|
|||||||
logToConsole(LOG_INFO | LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to reset their password (verification code not correct, ${getPlayerData(client).passwordResetAttemptsRemaining} attempts remaining)`);
|
logToConsole(LOG_INFO | LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to reset their password (verification code not correct, ${getPlayerData(client).passwordResetAttemptsRemaining} attempts remaining)`);
|
||||||
if (getPlayerData(client).passwordResetAttemptsRemaining <= 0) {
|
if (getPlayerData(client).passwordResetAttemptsRemaining <= 0) {
|
||||||
logToConsole(LOG_INFO | LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to reset their password (verification code not correct, no more attempts remaining, kicking ...)`);
|
logToConsole(LOG_INFO | LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to reset their password (verification code not correct, no more attempts remaining, kicking ...)`);
|
||||||
getPlayerData(client).customDisconnectReason = "Kicked - Failed to login";
|
getPlayerData(client).customDisconnectReason = "FailedToLogin";
|
||||||
disconnectPlayer(client);
|
disconnectPlayer(client);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1352,9 +1368,9 @@ function checkAccountChangePassword(client, newPassword, confirmNewPassword) {
|
|||||||
|
|
||||||
if (!doesPasswordMeetRequirements(newPassword)) {
|
if (!doesPasswordMeetRequirements(newPassword)) {
|
||||||
let passwordRequirementsString = `${needsCapitals}, ${needsNumbers}, ${needsSymbols}`;
|
let passwordRequirementsString = `${needsCapitals}, ${needsNumbers}, ${needsSymbols}`;
|
||||||
let needsCapitals = getLocaleString(client, "PasswordNeedsCapitals", "1");
|
let needsCapitals = getLocaleString(client, "PasswordNeedsCapitals", getGlobalConfig().passwordRequiredCapitals);
|
||||||
let needsNumbers = getLocaleString(client, "PasswordNeedsNumbers", "1");
|
let needsNumbers = getLocaleString(client, "PasswordNeedsNumbers", getGlobalConfig().passwordRequiredNumbers);
|
||||||
let needsSymbols = getLocaleString(client, "PasswordNeedsSymbols", "1");
|
let needsSymbols = getLocaleString(client, "PasswordNeedsSymbols", getGlobalConfig().passwordRequiredSymbols);
|
||||||
|
|
||||||
messagePlayerError(client, getLocaleString(client, "AccountPasswordNeedsImproved"));
|
messagePlayerError(client, getLocaleString(client, "AccountPasswordNeedsImproved"));
|
||||||
messagePlayerInfo(client, getLocaleString(client, "PasswordNeedsBase", passwordRequirementsString));
|
messagePlayerInfo(client, getLocaleString(client, "PasswordNeedsBase", passwordRequirementsString));
|
||||||
@@ -1391,11 +1407,11 @@ function isValidEmailAddress(emailAddress) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function saveAllPlayersToDatabase() {
|
function saveAllPlayersToDatabase() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Account]: Saving all clients to database ...");
|
logToConsole(LOG_DEBUG, "[AGRP.Account]: Saving all clients to database ...");
|
||||||
getClients().forEach(function (client) {
|
getClients().forEach(function (client) {
|
||||||
savePlayerToDatabase(client);
|
savePlayerToDatabase(client);
|
||||||
});
|
});
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Account]: All clients saved to database successfully!");
|
logToConsole(LOG_DEBUG, "[AGRP.Account]: All clients saved to database successfully!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1409,7 +1425,7 @@ function savePlayerToDatabase(client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account]: Saving client ${getPlayerName(client)} to database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account]: Saving client ${getPlayerName(client)} to database ...`);
|
||||||
saveAccountToDatabase(getPlayerData(client).accountData);
|
saveAccountToDatabase(getPlayerData(client).accountData);
|
||||||
|
|
||||||
if (getPlayerData(client).currentSubAccount != -1) {
|
if (getPlayerData(client).currentSubAccount != -1) {
|
||||||
@@ -1431,100 +1447,12 @@ function savePlayerToDatabase(client) {
|
|||||||
|
|
||||||
saveSubAccountToDatabase(getPlayerCurrentSubAccount(client));
|
saveSubAccountToDatabase(getPlayerCurrentSubAccount(client));
|
||||||
}
|
}
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account]: Saved client ${getPlayerDisplayForConsole(client)} to database successfully!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account]: Saved client ${getPlayerDisplayForConsole(client)} to database successfully!`);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initClient(client) {
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] Initializing client ${getPlayerDisplayForConsole(client)} ...`);
|
|
||||||
|
|
||||||
if (isConsole(client)) {
|
|
||||||
logToConsole(LOG_DEBUG | LOG_ERROR, `[VRR.Account] Client initialization failed for ${getPlayerDisplayForConsole(client)}! (is console client)`);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] Initializing client ${getPlayerDisplayForConsole(client)} ...`);
|
|
||||||
|
|
||||||
if (playerInitialized[client.index] == true) {
|
|
||||||
logToConsole(LOG_DEBUG | LOG_ERROR, `[VRR.Account] Client initialization failed for ${getPlayerDisplayForConsole(client)}! (already initialized)`);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
playerInitialized[client.index] = true;
|
|
||||||
|
|
||||||
//setEntityData(client, "agrp.isInitialized", true, false);
|
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] Initializing GUI for ${getPlayerDisplayForConsole(client)} ...`);
|
|
||||||
sendPlayerGUIColours(client);
|
|
||||||
sendPlayerGUIInit(client);
|
|
||||||
updatePlayerSnowState(client);
|
|
||||||
|
|
||||||
//logToConsole(LOG_DEBUG, `[VRR.Account] Showing connect camera to ${getPlayerDisplayForConsole(client)} ...`);
|
|
||||||
//showConnectCameraToPlayer(client);
|
|
||||||
|
|
||||||
messageClient(`Please wait ...`, client, getColourByName("softGreen"));
|
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] Waiting for 2.5 seconds to prevent race attack ...`);
|
|
||||||
setTimeout(function () {
|
|
||||||
if (client != null) {
|
|
||||||
clearChatBox(client);
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] Loading account for ${getPlayerDisplayForConsole(client)}`);
|
|
||||||
let tempAccountData = loadAccountFromName(getPlayerName(client), true);
|
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] Loading subaccounts for ${getPlayerDisplayForConsole(client)}`);
|
|
||||||
let tempSubAccounts = loadSubAccountsFromAccount(tempAccountData.databaseId);
|
|
||||||
|
|
||||||
getServerData().clients[getPlayerId(client)] = new ClientData(client, tempAccountData, tempSubAccounts);
|
|
||||||
|
|
||||||
getServerData().clients[getPlayerId(client)].sessionId = saveConnectionToDatabase(client);
|
|
||||||
getServerData().clients[getPlayerId(client)].connectTime = getCurrentUnixTimestamp();
|
|
||||||
requestClientInfo(client);
|
|
||||||
|
|
||||||
if (tempAccountData != false) {
|
|
||||||
sendPlayerLocaleId(client, getPlayerData(client).accountData.locale);
|
|
||||||
if (isAccountAutoIPLoginEnabled(tempAccountData) && getPlayerData(client).accountData.ipAddress == getPlayerIP(client)) {
|
|
||||||
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.`);
|
|
||||||
showPlayerLoginGUI(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(getPlayerIP(client));
|
|
||||||
// let localeId = getLocaleFromCountryISO(iso);
|
|
||||||
//}
|
|
||||||
//showSmallGameMessage(client, getLocaleString(client, "LocaleOffer", `/lang ${getLocaleData(localeId)[2]}`), getColourByName("white"), 10000, "Roboto");
|
|
||||||
}
|
|
||||||
startLoginTimeoutForPlayer(client);
|
|
||||||
playRadioStreamForPlayer(client, getServerIntroMusicURL(), true, getPlayerStreamingRadioVolume(client));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
sendPlayerLocaleId(client, 0);
|
|
||||||
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the register GUI.`);
|
|
||||||
showPlayerRegistrationGUI(client);
|
|
||||||
} else {
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the register message (GUI disabled).`);
|
|
||||||
messagePlayerNormal(client, getLocaleString(client, "WelcomeNewPlayer", getServerName(), getPlayerName(client), "/register"), getColourByName("softGreen"));
|
|
||||||
}
|
|
||||||
playRadioStreamForPlayer(client, getServerIntroMusicURL(), true, getPlayerStreamingRadioVolume(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
getServerData().clients[getPlayerId(client)].keyBinds = loadAccountKeybindsFromDatabase(getServerData().clients[getPlayerId(client)].accountData.databaseId);
|
|
||||||
sendAccountKeyBindsToClient(client);
|
|
||||||
}
|
|
||||||
}, 2500);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function saveConnectionToDatabase(client) {
|
function saveConnectionToDatabase(client) {
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
@@ -1548,7 +1476,7 @@ function createDefaultAccountServerData(accountDatabaseId) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadAccountKeybindsFromDatabase(accountDatabaseID) {
|
function loadAccountKeybindsFromDatabase(accountDatabaseID) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account]: Loading account keybinds for account ${accountDatabaseID} from database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account]: Loading account keybinds for account ${accountDatabaseID} from database ...`);
|
||||||
|
|
||||||
let tempAccountKeybinds = [];
|
let tempAccountKeybinds = [];
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
@@ -1572,7 +1500,7 @@ function loadAccountKeybindsFromDatabase(accountDatabaseID) {
|
|||||||
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
||||||
let tempAccountKeyBindData = new KeyBindData(dbAssoc);
|
let tempAccountKeyBindData = new KeyBindData(dbAssoc);
|
||||||
tempAccountKeybinds.push(tempAccountKeyBindData);
|
tempAccountKeybinds.push(tempAccountKeyBindData);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account]: Account keybind '${tempAccountKeyBindData.databaseId}' (Key ${tempAccountKeyBindData.key} '${toUpperCase(getKeyNameFromId(tempAccountKeyBindData.key))}') loaded from database successfully!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account]: Account keybind '${tempAccountKeyBindData.databaseId}' (Key ${tempAccountKeyBindData.key} '${toUpperCase(getKeyNameFromId(tempAccountKeyBindData.key))}') loaded from database successfully!`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
@@ -1581,14 +1509,14 @@ function loadAccountKeybindsFromDatabase(accountDatabaseID) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account]: ${tempAccountKeybinds.length} account keybinds for account ${accountDatabaseID} loaded from database successfully!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account]: ${tempAccountKeybinds.length} account keybinds for account ${accountDatabaseID} loaded from database successfully!`);
|
||||||
return tempAccountKeybinds;
|
return tempAccountKeybinds;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadAccountStaffNotesFromDatabase(accountDatabaseID) {
|
function loadAccountStaffNotesFromDatabase(accountDatabaseID) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account]: Loading account staff notes for account ${accountDatabaseID} from database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account]: Loading account staff notes for account ${accountDatabaseID} from database ...`);
|
||||||
|
|
||||||
let tempAccountStaffNotes = [];
|
let tempAccountStaffNotes = [];
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
@@ -1602,7 +1530,7 @@ function loadAccountStaffNotesFromDatabase(accountDatabaseID) {
|
|||||||
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
||||||
let tempAccountStaffNoteData = new AccountStaffNoteData(dbAssoc);
|
let tempAccountStaffNoteData = new AccountStaffNoteData(dbAssoc);
|
||||||
tempAccountStaffNotes.push(tempAccountStaffNoteData);
|
tempAccountStaffNotes.push(tempAccountStaffNoteData);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account]: Account staff note '${tempAccountStaffNoteData.databaseId}' loaded from database successfully!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account]: Account staff note '${tempAccountStaffNoteData.databaseId}' loaded from database successfully!`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
@@ -1610,14 +1538,14 @@ function loadAccountStaffNotesFromDatabase(accountDatabaseID) {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account]: ${tempAccountStaffNotes.length} account staff notes for account ${accountDatabaseID} loaded from database successfully!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account]: ${tempAccountStaffNotes.length} account staff notes for account ${accountDatabaseID} loaded from database successfully!`);
|
||||||
return tempAccountStaffNotes;
|
return tempAccountStaffNotes;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadAccountContactsFromDatabase(accountDatabaseID) {
|
function loadAccountContactsFromDatabase(accountDatabaseID) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account]: Loading account contacts for account ${accountDatabaseID} from database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account]: Loading account contacts for account ${accountDatabaseID} from database ...`);
|
||||||
|
|
||||||
let tempAccountContacts = [];
|
let tempAccountContacts = [];
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
@@ -1631,7 +1559,7 @@ function loadAccountContactsFromDatabase(accountDatabaseID) {
|
|||||||
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
||||||
let tempAccountContactData = new AccountContactData(dbAssoc);
|
let tempAccountContactData = new AccountContactData(dbAssoc);
|
||||||
tempAccountContacts.push(tempAccountContactData);
|
tempAccountContacts.push(tempAccountContactData);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account]: Account contact '${tempAccountContactData.databaseId}' loaded from database successfully!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account]: Account contact '${tempAccountContactData.databaseId}' loaded from database successfully!`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
@@ -1639,14 +1567,14 @@ function loadAccountContactsFromDatabase(accountDatabaseID) {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account]: ${tempAccountContacts.length} account contacts for account ${accountDatabaseID} loaded from database successfully!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account]: ${tempAccountContacts.length} account contacts for account ${accountDatabaseID} loaded from database successfully!`);
|
||||||
return tempAccountContacts;
|
return tempAccountContacts;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadAccountMessagesFromDatabase(accountDatabaseID) {
|
function loadAccountMessagesFromDatabase(accountDatabaseID) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account]: Loading account messages for account ${accountDatabaseID} from database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account]: Loading account messages for account ${accountDatabaseID} from database ...`);
|
||||||
|
|
||||||
let tempAccountMessages = [];
|
let tempAccountMessages = [];
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
@@ -1660,7 +1588,7 @@ function loadAccountMessagesFromDatabase(accountDatabaseID) {
|
|||||||
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
||||||
let tempAccountMessageData = new AccountContactData(dbAssoc);
|
let tempAccountMessageData = new AccountContactData(dbAssoc);
|
||||||
tempAccountMessages.push(tempAccountMessageData);
|
tempAccountMessages.push(tempAccountMessageData);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account]: Account contact '${tempAccountMessageData.databaseId}' loaded from database successfully!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account]: Account contact '${tempAccountMessageData.databaseId}' loaded from database successfully!`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
@@ -1668,7 +1596,7 @@ function loadAccountMessagesFromDatabase(accountDatabaseID) {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account]: ${tempAccountMessages.length} account messages for account ${accountDatabaseID} loaded from database successfully!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Account]: ${tempAccountMessages.length} account messages for account ${accountDatabaseID} loaded from database successfully!`);
|
||||||
return tempAccountMessages;
|
return tempAccountMessages;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1747,34 +1675,34 @@ function generateEmailVerificationCode() {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendEmailVerificationEmail(client, emailVerificationCode) {
|
async function sendEmailVerificationEmail(client, emailVerificationCode) {
|
||||||
let emailBodyText = getEmailConfig().bodyContent.confirmEmail;
|
let emailBodyText = getEmailConfig().bodyContent.confirmEmail;
|
||||||
emailBodyText = emailBodyText.replace("{VERIFICATIONCODE}", emailVerificationCode);
|
emailBodyText = emailBodyText.replace("{VERIFICATIONCODE}", emailVerificationCode);
|
||||||
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName());
|
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName());
|
||||||
|
|
||||||
sendEmail(getPlayerData(client).accountData.emailAddress, getPlayerData(client).accountData.name, `Confirm email on ${getServerName()}`, emailBodyText);
|
await sendEmail(getPlayerData(client).accountData.emailAddress, getPlayerData(client).accountData.name, `Confirm email on ${getServerName()}`, emailBodyText);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendPasswordResetEmail(client, verificationCode) {
|
async function sendPasswordResetEmail(client, verificationCode) {
|
||||||
let emailBodyText = getEmailConfig().bodyContent.confirmPasswordReset;
|
let emailBodyText = getEmailConfig().bodyContent.confirmPasswordReset;
|
||||||
emailBodyText = emailBodyText.replace("{VERIFICATIONCODE}", verificationCode);
|
emailBodyText = emailBodyText.replace("{VERIFICATIONCODE}", verificationCode);
|
||||||
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName());
|
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName());
|
||||||
|
|
||||||
sendEmail(getPlayerData(client).accountData.emailAddress, getPlayerData(client).accountData.name, `Reset your password on ${getServerName()}`, emailBodyText);
|
await sendEmail(getPlayerData(client).accountData.emailAddress, getPlayerData(client).accountData.name, `Reset your password on ${getServerName()}`, emailBodyText);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function verifyAccountEmail(accountData, verificationCode) {
|
async function verifyAccountEmail(accountData, verificationCode) {
|
||||||
let emailVerificationCode = generateRandomString(10);
|
let emailVerificationCode = generateRandomString(10);
|
||||||
|
|
||||||
let emailBodyText = getEmailConfig().bodyContent.confirmEmail;
|
let emailBodyText = getEmailConfig().bodyContent.confirmEmail;
|
||||||
emailBodyText = emailBodyText.replace("{VERIFICATIONCODE}", emailVerificationCode);
|
emailBodyText = emailBodyText.replace("{VERIFICATIONCODE}", emailVerificationCode);
|
||||||
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName());
|
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName());
|
||||||
|
|
||||||
sendEmail(getPlayerData(client).accountData.emailAddress, getPlayerData(client).accountData.name, `Confirm email on ${getServerName()}`, emailBodyText);
|
await sendEmail(getPlayerData(client).accountData.emailAddress, getPlayerData(client).accountData.name, `Confirm email on ${getServerName()}`, emailBodyText);
|
||||||
|
|
||||||
getPlayerData(client).accountData.emailAddress = emailAddress;
|
getPlayerData(client).accountData.emailAddress = emailAddress;
|
||||||
getPlayerData(client).accountData.emailVerificationCode = module.hashing.sha512(emailVerificationCode);
|
getPlayerData(client).accountData.emailVerificationCode = module.hashing.sha512(emailVerificationCode);
|
||||||
@@ -1782,7 +1710,7 @@ function verifyAccountEmail(accountData, verificationCode) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendAccountLoginFailedNotification(emailAddress, name, ip, game = getGame()) {
|
async function sendAccountLoginFailedNotification(emailAddress, name, ip, game = getGame()) {
|
||||||
let countryName = module.geoip.getCountryName(getGlobalConfig().geoIPCountryDatabaseFilePath, ip);
|
let countryName = module.geoip.getCountryName(getGlobalConfig().geoIPCountryDatabaseFilePath, ip);
|
||||||
let subDivisionName = module.geoip.getSubdivisionName(getGlobalConfig().geoIPCityDatabaseFilePath, ip);
|
let subDivisionName = module.geoip.getSubdivisionName(getGlobalConfig().geoIPCityDatabaseFilePath, ip);
|
||||||
let cityName = module.geoip.getCityName(getGlobalConfig().geoIPCityDatabaseFilePath, ip);
|
let cityName = module.geoip.getCityName(getGlobalConfig().geoIPCityDatabaseFilePath, ip);
|
||||||
@@ -1794,13 +1722,13 @@ function sendAccountLoginFailedNotification(emailAddress, name, ip, game = getGa
|
|||||||
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName());
|
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName());
|
||||||
emailBodyText = emailBodyText.replace("{TIMESTAMP}", new Date().toLocaleString('en-US'));
|
emailBodyText = emailBodyText.replace("{TIMESTAMP}", new Date().toLocaleString('en-US'));
|
||||||
|
|
||||||
sendEmail(emailAddress, name, `Login failed on ${getServerName()}`, emailBodyText);
|
await sendEmail(emailAddress, name, `Login failed on ${getServerName()}`, emailBodyText);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendAccountLoginSuccessNotification(emailAddress, name, ip, game = getGame()) {
|
async function sendAccountLoginSuccessNotification(emailAddress, name, ip, game = getGame()) {
|
||||||
let countryName = module.geoip.getCountryName(getGlobalConfig().geoIPCountryDatabaseFilePath, ip);
|
let countryName = module.geoip.getCountryName(getGlobalConfig().geoIPCountryDatabaseFilePath, ip);
|
||||||
let subDivisionName = module.geoip.getSubdivisionName(getGlobalConfig().geoIPCityDatabaseFilePath, ip);
|
let subDivisionName = module.geoip.getSubdivisionName(getGlobalConfig().geoIPCityDatabaseFilePath, ip);
|
||||||
let cityName = module.geoip.getCityName(getGlobalConfig().geoIPCityDatabaseFilePath, ip);
|
let cityName = module.geoip.getCityName(getGlobalConfig().geoIPCityDatabaseFilePath, ip);
|
||||||
@@ -1812,7 +1740,7 @@ function sendAccountLoginSuccessNotification(emailAddress, name, ip, game = getG
|
|||||||
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName());
|
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName());
|
||||||
emailBodyText = emailBodyText.replace("{TIMESTAMP}", new Date().toLocaleString('en-US'));
|
emailBodyText = emailBodyText.replace("{TIMESTAMP}", new Date().toLocaleString('en-US'));
|
||||||
|
|
||||||
sendEmail(emailAddress, name, `Login successful on ${getServerName()}`, emailBodyText);
|
await sendEmail(emailAddress, name, `Login successful on ${getServerName()}`, emailBodyText);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1845,7 +1773,7 @@ function checkPlayerTwoFactorAuthentication(client, authCode) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getPlayerData(client).customDisconnectReason = "Kicked - Failed to login";
|
getPlayerData(client).customDisconnectReason = "FailedToLogin";
|
||||||
disconnectPlayer(client);
|
disconnectPlayer(client);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1858,13 +1786,13 @@ function isPlayerATester(client) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendAccountTwoFactorAuthCode(emailAddress, name, twoFactorAuthCode) {
|
async function sendAccountTwoFactorAuthCode(emailAddress, name, twoFactorAuthCode) {
|
||||||
let emailBodyText = getEmailConfig().bodyContent.twoFactorAuthentication;
|
let emailBodyText = getEmailConfig().bodyContent.twoFactorAuthentication;
|
||||||
emailBodyText = emailBodyText.replace("{2FACODE}", twoFactorAuthCode);
|
emailBodyText = emailBodyText.replace("{2FACODE}", twoFactorAuthCode);
|
||||||
emailBodyText = emailBodyText.replace("{GAMENAME}", getGameName(getGame()));
|
emailBodyText = emailBodyText.replace("{GAMENAME}", getGameName(getGame()));
|
||||||
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName());
|
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName());
|
||||||
|
|
||||||
sendEmail(emailAddress, name, `Login code for ${getServerName()}`, emailBodyText);
|
await sendEmail(emailAddress, name, `Login code for ${getServerName()}`, emailBodyText);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1873,7 +1801,7 @@ function sendAccountTwoFactorAuthCode(emailAddress, name, twoFactorAuthCode) {
|
|||||||
function startLoginTimeoutForPlayer(client) {
|
function startLoginTimeoutForPlayer(client) {
|
||||||
getPlayerData(client).loginTimeout = setTimeout(function () {
|
getPlayerData(client).loginTimeout = setTimeout(function () {
|
||||||
if (isPlayerLoggedIn(client) == false) {
|
if (isPlayerLoggedIn(client) == false) {
|
||||||
getPlayerData(client).customDisconnectReason = "Kicked - Login timeout";
|
getPlayerData(client).customDisconnectReason = "FailedToLogin";
|
||||||
disconnectPlayer(client);
|
disconnectPlayer(client);
|
||||||
}
|
}
|
||||||
}, getGlobalConfig().loginTimeout);
|
}, getGlobalConfig().loginTimeout);
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initAnimationScript() {
|
function initAnimationScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Animation]: Initializing animation script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.Animation]: Initializing animation script ...");
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Animation]: Animation script initialized!");
|
logToConsole(LOG_DEBUG, "[AGRP.Animation]: Animation script initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -44,7 +44,9 @@ function playPlayerAnimationCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
messagePlayerTip(client, getLocaleString(client, "AnimationStopCommandTip", "{ALTCOLOUR}/stopanim{MAINCOLOUR}"));
|
if (hasPlayerSeenActionTip(client, "AnimationStop")) {
|
||||||
|
messagePlayerTip(client, getGroupedLocaleString(client, "ActionTips", "AnimationStop", "{ALTCOLOUR}/stopanim{MAINCOLOUR}"));
|
||||||
|
}
|
||||||
makePlayerPlayAnimation(client, animationSlot, animationPositionOffset);
|
makePlayerPlayAnimation(client, animationSlot, animationPositionOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,6 +68,8 @@ function stopPlayerAnimationCommand(command, params, client) {
|
|||||||
getPlayerData(client).animationForced = false;
|
getPlayerData(client).animationForced = false;
|
||||||
|
|
||||||
//setPlayerMouseCameraState(client, false);
|
//setPlayerMouseCameraState(client, false);
|
||||||
|
|
||||||
|
markPlayerActionTipSeen(client, "AnimationStop");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -98,7 +102,7 @@ function makePlayerPlayAnimation(client, animationSlot, offsetPosition = 1) {
|
|||||||
getPlayerData(client).animationForced = false;
|
getPlayerData(client).animationForced = false;
|
||||||
|
|
||||||
makePedPlayAnimation(getPlayerPed(client), animationSlot, offsetPosition);
|
makePedPlayAnimation(getPlayerPed(client), animationSlot, offsetPosition);
|
||||||
setEntityData(getPlayerPed(client), "agrp.anim", animationSlot, true);
|
//setEntityData(getPlayerPed(client), "agrp.anim", animationSlot, true);
|
||||||
//if(getAnimationData(animationSlot)[9] != AGRP_ANIMMOVE_NONE) {
|
//if(getAnimationData(animationSlot)[9] != AGRP_ANIMMOVE_NONE) {
|
||||||
// if(getGame() < AGRP_GAME_GTA_SA) {
|
// if(getGame() < AGRP_GAME_GTA_SA) {
|
||||||
// setPlayerMouseCameraState(client, true);
|
// setPlayerMouseCameraState(client, true);
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initAntiCheatScript() {
|
function initAntiCheatScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.AntiCheat]: Initializing anticheat script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.AntiCheat]: Initializing anticheat script ...");
|
||||||
logToConsole(LOG_DEBUG, "[VRR.AntiCheat]: Anticheat script initialized!");
|
logToConsole(LOG_DEBUG, "[AGRP.AntiCheat]: Anticheat script initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ class BanData {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initBanScript() {
|
function initBanScript() {
|
||||||
logToConsole(LOG_INFO, "[VRR.Ban]: Initializing ban script ...");
|
logToConsole(LOG_INFO, "[AGRP.Ban]: Initializing ban script ...");
|
||||||
logToConsole(LOG_INFO, "[VRR.Ban]: Ban script initialized!");
|
logToConsole(LOG_INFO, "[AGRP.Ban]: Ban script initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -66,12 +66,12 @@ function accountBanCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_WARN, `[VRR.Ban]: ${getPlayerDisplayForConsole(targetClient)} (${getPlayerData(targetClient).accountData.name}) account was banned by ${getPlayerDisplayForConsole(client)}. Reason: ${reason}`);
|
logToConsole(LOG_WARN, `[AGRP.Ban]: ${getPlayerDisplayForConsole(targetClient)} (${getPlayerData(targetClient).accountData.name}) account was banned by ${getPlayerDisplayForConsole(client)}. Reason: ${reason}`);
|
||||||
|
|
||||||
announceAdminAction(`PlayerAccountBanned`, `{ALTCOLOUR}${getPlayerName(targetClient)}{MAINCOLOUR}`);
|
announceAdminAction(`PlayerAccountBanned`, `{ALTCOLOUR}${getPlayerName(targetClient)}{MAINCOLOUR}`);
|
||||||
banAccount(getPlayerData(targetClient).accountData.databaseId, getPlayerData(client).accountData.databaseId, reason);
|
banAccount(getPlayerData(targetClient).accountData.databaseId, getPlayerData(client).accountData.databaseId, reason);
|
||||||
|
|
||||||
getPlayerData(targetClient).customDisconnectReason = `Banned - ${reason}`;
|
getPlayerData(targetClient).customDisconnectReason = "Banned";
|
||||||
disconnectPlayer(targetClient);
|
disconnectPlayer(targetClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,12 +98,12 @@ function subAccountBanCommand(command, params, client, fromDiscord) {
|
|||||||
return false;
|
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, `[AGRP.Ban]: ${getPlayerDisplayForConsole(targetClient)} (${getPlayerData(targetClient).accountData.name})'s subaccount was banned by ${getPlayerDisplayForConsole(client)}. Reason: ${reason}`);
|
||||||
|
|
||||||
announceAdminAction(`PlayerCharacterBanned`, `{ALTCOLOUR}${getPlayerName(targetClient)}{MAINCOLOUR}`);
|
announceAdminAction(`PlayerCharacterBanned`, `{ALTCOLOUR}${getPlayerName(targetClient)}{MAINCOLOUR}`);
|
||||||
banSubAccount(getPlayerData(targetClient).currentSubAccountData.databaseId, getPlayerData(client).accountData.databaseId, reason);
|
banSubAccount(getPlayerData(targetClient).currentSubAccountData.databaseId, getPlayerData(client).accountData.databaseId, reason);
|
||||||
|
|
||||||
getPlayerData(targetClient).customDisconnectReason = `Banned - ${reason}`;
|
getPlayerData(targetClient).customDisconnectReason = "Banned";
|
||||||
disconnectPlayer(targetClient);
|
disconnectPlayer(targetClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ function ipBanCommand(command, params, client, fromDiscord) {
|
|||||||
announceAdminAction(`PlayerIPBanned`, `{ALTCOLOUR}${getPlayerName(targetClient)}{MAINCOLOUR}`);
|
announceAdminAction(`PlayerIPBanned`, `{ALTCOLOUR}${getPlayerName(targetClient)}{MAINCOLOUR}`);
|
||||||
banIPAddress(getPlayerIP(targetClient), getPlayerData(client).accountData.databaseId, reason);
|
banIPAddress(getPlayerIP(targetClient), getPlayerData(client).accountData.databaseId, reason);
|
||||||
|
|
||||||
getPlayerData(targetClient).customDisconnectReason = `IP Banned - ${reason}`;
|
getPlayerData(targetClient).customDisconnectReason = "Banned";
|
||||||
serverBanIP(getPlayerIP(targetClient));
|
serverBanIP(getPlayerIP(targetClient));
|
||||||
disconnectPlayer(targetClient);
|
disconnectPlayer(targetClient);
|
||||||
}
|
}
|
||||||
@@ -165,7 +165,7 @@ function subNetBanCommand(command, params, client, fromDiscord) {
|
|||||||
announceAdminAction(`PlayerSubNetBanned`, `{ALTCOLOUR}${getPlayerName(client)}{MAINCOLOUR}`);
|
announceAdminAction(`PlayerSubNetBanned`, `{ALTCOLOUR}${getPlayerName(client)}{MAINCOLOUR}`);
|
||||||
banSubNet(getPlayerIP(targetClient), getSubNet(getPlayerIP(targetClient), octetAmount), getPlayerData(client).accountData.databaseId, reason);
|
banSubNet(getPlayerIP(targetClient), getSubNet(getPlayerIP(targetClient), octetAmount), getPlayerData(client).accountData.databaseId, reason);
|
||||||
|
|
||||||
getPlayerData(client).customDisconnectReason = `IP Subnet Banned - ${reason}`;
|
getPlayerData(client).customDisconnectReason = "Banned";
|
||||||
serverBanIP(getPlayerIP(targetClient));
|
serverBanIP(getPlayerIP(targetClient));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ let serverBitFlags = {
|
|||||||
accountSettingsFlags: {},
|
accountSettingsFlags: {},
|
||||||
subAccountSettingsFlags: {},
|
subAccountSettingsFlags: {},
|
||||||
accountFlags: {},
|
accountFlags: {},
|
||||||
seenHelpTipsFlags: {},
|
seenActionTipsFlags: {},
|
||||||
npcTriggerTypeFlags: {},
|
npcTriggerTypeFlags: {},
|
||||||
npcTriggerConditionTypesFlags: {},
|
npcTriggerConditionTypesFlags: {},
|
||||||
npcTriggerResponseTypeFlags: {},
|
npcTriggerResponseTypeFlags: {},
|
||||||
@@ -240,12 +240,28 @@ let serverBitFlagKeys = {
|
|||||||
"EnterProperty",
|
"EnterProperty",
|
||||||
"SearchArea",
|
"SearchArea",
|
||||||
],
|
],
|
||||||
seenHelpTipsKeys: [
|
seenActionTipsKeys: [
|
||||||
"None",
|
"None",
|
||||||
"VehicleEngineOffWhenEntering",
|
"VehicleEngineOffWhenEntering",
|
||||||
"VehicleLockedAfterEntryAttempt",
|
"VehicleLockedAfterEntryAttempt",
|
||||||
"ShowItemsAfterPurchase",
|
"ShowItemsAfterPurchase",
|
||||||
"BuyCommandAfterEnterBusiness",
|
"BuyCommandAfterEnterBusiness",
|
||||||
|
"UseItemKeyAfterEquipping",
|
||||||
|
"UseItemKeyAfterEquippingWalkieTalkie",
|
||||||
|
"RadioCommandAfterEnablingWalkieTalkie",
|
||||||
|
"ReplyToDirectMessage",
|
||||||
|
"UseItemKeyAmmoAfterEquippingWeapon",
|
||||||
|
"AnimationStop",
|
||||||
|
"JobEquipmentInventory",
|
||||||
|
"ViewInventory",
|
||||||
|
"VehicleRepairItemUsage",
|
||||||
|
"VehicleColourItemUsage",
|
||||||
|
"VehiclePartItemUsage",
|
||||||
|
"AmmoClipItemUsage",
|
||||||
|
"GenericItemUsage",
|
||||||
|
"EnterJobVehicleForRoute",
|
||||||
|
"JobLocations",
|
||||||
|
"JobRouteStart",
|
||||||
],
|
],
|
||||||
jobRankKeys: [
|
jobRankKeys: [
|
||||||
"None",
|
"None",
|
||||||
@@ -265,7 +281,7 @@ let serverBitFlagKeys = {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initBitFlagScript() {
|
function initBitFlagScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.BitFlag]: Initializing bit flag script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.BitFlag]: Initializing bit flag script ...");
|
||||||
serverBitFlags.staffFlags = createBitFlagTable(serverBitFlagKeys.staffFlagKeys);
|
serverBitFlags.staffFlags = createBitFlagTable(serverBitFlagKeys.staffFlagKeys);
|
||||||
serverBitFlags.moderationFlags = createBitFlagTable(serverBitFlagKeys.moderationFlagKeys);
|
serverBitFlags.moderationFlags = createBitFlagTable(serverBitFlagKeys.moderationFlagKeys);
|
||||||
serverBitFlags.accountSettingsFlags = createBitFlagTable(serverBitFlagKeys.accountSettingsFlagKeys);
|
serverBitFlags.accountSettingsFlags = createBitFlagTable(serverBitFlagKeys.accountSettingsFlagKeys);
|
||||||
@@ -277,9 +293,9 @@ function initBitFlagScript() {
|
|||||||
serverBitFlags.npcTriggerTypes = createBitFlagTable(serverBitFlagKeys.npcTriggerTypeKeys);
|
serverBitFlags.npcTriggerTypes = createBitFlagTable(serverBitFlagKeys.npcTriggerTypeKeys);
|
||||||
serverBitFlags.npcTriggerConditionTypes = createBitFlagTable(serverBitFlagKeys.npcTriggerConditionTypeKeys);
|
serverBitFlags.npcTriggerConditionTypes = createBitFlagTable(serverBitFlagKeys.npcTriggerConditionTypeKeys);
|
||||||
serverBitFlags.npcTriggerResponseTypes = createBitFlagTable(serverBitFlagKeys.npcTriggerResponseTypeKeys);
|
serverBitFlags.npcTriggerResponseTypes = createBitFlagTable(serverBitFlagKeys.npcTriggerResponseTypeKeys);
|
||||||
serverBitFlags.seenHelpTips = createBitFlagTable(serverBitFlagKeys.seenHelpTipsKeys);
|
serverBitFlags.seenActionTips = createBitFlagTable(serverBitFlagKeys.seenActionTipsKeys);
|
||||||
serverBitFlags.jobRankFlags = createBitFlagTable(serverBitFlagKeys.jobRankKeys);
|
serverBitFlags.jobRankFlags = createBitFlagTable(serverBitFlagKeys.jobRankKeys);
|
||||||
logToConsole(LOG_INFO, "[VRR.BitFlag]: Bit flag script initialized successfully!");
|
logToConsole(LOG_INFO, "[AGRP.BitFlag]: Bit flag script initialized successfully!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -443,6 +459,20 @@ function getClanDiscordWebhookValue(flagName) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getSeenActionTipsValue(flagName) {
|
||||||
|
if (flagName == "All") {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof serverBitFlags.seenActionTips[flagName] == "undefined") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return serverBitFlags.seenActionTips[flagName];
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
function givePlayerStaffFlag(client, flagName) {
|
function givePlayerStaffFlag(client, flagName) {
|
||||||
if (!getStaffFlagValue(flagName)) {
|
if (!getStaffFlagValue(flagName)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ class BusinessData {
|
|||||||
this.needsSaved = false;
|
this.needsSaved = false;
|
||||||
this.interiorLights = true;
|
this.interiorLights = true;
|
||||||
this.type = AGRP_BIZ_TYPE_NONE;
|
this.type = AGRP_BIZ_TYPE_NONE;
|
||||||
|
this.propertyType = AGRP_PROPERTY_TYPE_BUSINESS;
|
||||||
|
|
||||||
this.floorItemCache = [];
|
this.floorItemCache = [];
|
||||||
this.storageItemCache = [];
|
this.storageItemCache = [];
|
||||||
@@ -73,6 +74,7 @@ class BusinessData {
|
|||||||
this.entranceBlipModel = -1;
|
this.entranceBlipModel = -1;
|
||||||
this.entrancePickup = null;
|
this.entrancePickup = null;
|
||||||
this.entranceBlip = null;
|
this.entranceBlip = null;
|
||||||
|
this.entranceScene = "";
|
||||||
|
|
||||||
this.exitPosition = false;
|
this.exitPosition = false;
|
||||||
this.exitRotation = 0.0;
|
this.exitRotation = 0.0;
|
||||||
@@ -82,6 +84,7 @@ class BusinessData {
|
|||||||
this.exitBlipModel = -1;
|
this.exitBlipModel = -1;
|
||||||
this.exitPickup = null;
|
this.exitPickup = null;
|
||||||
this.exitBlip = null;
|
this.exitBlip = null;
|
||||||
|
this.exitScene = "";
|
||||||
|
|
||||||
this.entranceFee = 0;
|
this.entranceFee = 0;
|
||||||
this.till = 0;
|
this.till = 0;
|
||||||
@@ -89,6 +92,8 @@ class BusinessData {
|
|||||||
this.streamingRadioStation = 0;
|
this.streamingRadioStation = 0;
|
||||||
//this.streamingRadioStationIndex = -1;
|
//this.streamingRadioStationIndex = -1;
|
||||||
|
|
||||||
|
this.paintBallPlayers = [];
|
||||||
|
|
||||||
this.labelHelpType = AGRP_PROPLABEL_INFO_NONE;
|
this.labelHelpType = AGRP_PROPLABEL_INFO_NONE;
|
||||||
|
|
||||||
if (dbAssoc) {
|
if (dbAssoc) {
|
||||||
@@ -108,6 +113,7 @@ class BusinessData {
|
|||||||
this.entranceDimension = toInteger(dbAssoc["biz_entrance_vw"]);
|
this.entranceDimension = toInteger(dbAssoc["biz_entrance_vw"]);
|
||||||
this.entrancePickupModel = toInteger(dbAssoc["biz_entrance_pickup"]);
|
this.entrancePickupModel = toInteger(dbAssoc["biz_entrance_pickup"]);
|
||||||
this.entranceBlipModel = toInteger(dbAssoc["biz_entrance_blip"]);
|
this.entranceBlipModel = toInteger(dbAssoc["biz_entrance_blip"]);
|
||||||
|
this.entranceScene = toString(dbAssoc["biz_entrance_scene"]);
|
||||||
|
|
||||||
this.exitPosition = toVector3(dbAssoc["biz_exit_pos_x"], dbAssoc["biz_exit_pos_y"], dbAssoc["biz_exit_pos_z"]);
|
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"]);
|
this.exitRotation = toInteger(dbAssoc["biz_exit_rot_z"]);
|
||||||
@@ -115,6 +121,7 @@ class BusinessData {
|
|||||||
this.exitDimension = toInteger(dbAssoc["biz_exit_vw"]);
|
this.exitDimension = toInteger(dbAssoc["biz_exit_vw"]);
|
||||||
this.exitPickupModel = toInteger(dbAssoc["biz_exit_pickup"]);
|
this.exitPickupModel = toInteger(dbAssoc["biz_exit_pickup"]);
|
||||||
this.exitBlipModel = toInteger(dbAssoc["biz_exit_blip"]);
|
this.exitBlipModel = toInteger(dbAssoc["biz_exit_blip"]);
|
||||||
|
this.exitScene = toString(dbAssoc["biz_exit_scene"]);
|
||||||
|
|
||||||
this.entranceFee = toInteger(dbAssoc["biz_entrance_fee"]);
|
this.entranceFee = toInteger(dbAssoc["biz_entrance_fee"]);
|
||||||
this.till = toInteger(dbAssoc["biz_till"]);
|
this.till = toInteger(dbAssoc["biz_till"]);
|
||||||
@@ -182,8 +189,8 @@ class BusinessGameScriptData {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initBusinessScript() {
|
function initBusinessScript() {
|
||||||
logToConsole(LOG_INFO, "[VRR.Business]: Initializing business script ...");
|
logToConsole(LOG_INFO, "[AGRP.Business]: Initializing business script ...");
|
||||||
logToConsole(LOG_INFO, "[VRR.Business]: Business script initialized successfully!");
|
logToConsole(LOG_INFO, "[AGRP.Business]: Business script initialized successfully!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,7 +204,7 @@ function loadBusinessFromId(businessId) {
|
|||||||
if (dbQuery) {
|
if (dbQuery) {
|
||||||
let dbAssoc = fetchQueryAssoc(dbQuery);
|
let dbAssoc = fetchQueryAssoc(dbQuery);
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
return new BusinessData(dbAssoc);
|
return new BusinessData(dbAssoc[0]);
|
||||||
}
|
}
|
||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
@@ -207,39 +214,33 @@ function loadBusinessFromId(businessId) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadBusinessesFromDatabase() {
|
async function loadBusinessesFromDatabase() {
|
||||||
logToConsole(LOG_INFO, "[VRR.Business]: Loading businesses from database ...");
|
logToConsole(LOG_INFO, "[AGRP.Business]: Loading businesses from database ...");
|
||||||
|
|
||||||
let tempBusinesses = [];
|
let tempBusinesses = [];
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
let dbQuery = null;
|
let dbAssoc = [];
|
||||||
let dbAssoc;
|
|
||||||
|
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
dbQuery = queryDatabase(dbConnection, `SELECT * FROM biz_main WHERE biz_deleted = 0 AND biz_server = ${getServerId()}`);
|
dbAssoc = await fetchQueryAssoc(dbConnection, `SELECT * FROM biz_main WHERE biz_server = ${getServerId()}`);
|
||||||
if (dbQuery) {
|
for (let i in dbAssoc) {
|
||||||
if (dbQuery.numRows > 0) {
|
let tempBusinessData = new BusinessData(dbAssoc[i]);
|
||||||
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
|
||||||
let tempBusinessData = new BusinessData(dbAssoc);
|
|
||||||
tempBusinessData.locations = loadBusinessLocationsFromDatabase(tempBusinessData.databaseId);
|
tempBusinessData.locations = loadBusinessLocationsFromDatabase(tempBusinessData.databaseId);
|
||||||
//tempBusinessData.gameScripts = loadBusinessGameScriptsFromDatabase(tempBusinessData.databaseId);
|
//tempBusinessData.gameScripts = loadBusinessGameScriptsFromDatabase(tempBusinessData.databaseId);
|
||||||
tempBusinesses.push(tempBusinessData);
|
tempBusinesses.push(tempBusinessData);
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Business]: Business '${tempBusinessData.name}' (ID ${tempBusinessData.databaseId}) loaded from database successfully!`);
|
logToConsole(LOG_VERBOSE, `[VRR.Business]: Business '${tempBusinessData.name}' (ID ${tempBusinessData.databaseId}) loaded from database successfully!`);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
freeDatabaseQuery(dbQuery);
|
|
||||||
}
|
|
||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_INFO, `[VRR.Business]: ${tempBusinesses.length} businesses loaded from database successfully!`);
|
logToConsole(LOG_INFO, `[AGRP.Business]: ${tempBusinesses.length} businesses loaded from database successfully!`);
|
||||||
return tempBusinesses;
|
return tempBusinesses;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadBusinessLocationsFromDatabase(businessId) {
|
async function loadBusinessLocationsFromDatabase(businessId) {
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Business]: Loading business locations for business ${businessId} from database ...`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Business]: Loading business locations for business ${businessId} from database ...`);
|
||||||
|
|
||||||
let tempBusinessLocations = [];
|
let tempBusinessLocations = [];
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
@@ -249,21 +250,16 @@ function loadBusinessLocationsFromDatabase(businessId) {
|
|||||||
|
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
dbQueryString = `SELECT * FROM biz_loc WHERE biz_loc_biz = ${businessId}`;
|
dbQueryString = `SELECT * FROM biz_loc WHERE biz_loc_biz = ${businessId}`;
|
||||||
dbQuery = queryDatabase(dbConnection, dbQueryString);
|
dbAssoc = await fetchQueryAssoc(dbConnection, dbQueryString);
|
||||||
if (dbQuery) {
|
for (let i in dbAssoc) {
|
||||||
if (dbQuery.numRows > 0) {
|
let tempBusinessLocationData = new BusinessLocationData(dbAssoc[i]);
|
||||||
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
|
||||||
let tempBusinessLocationData = new BusinessLocationData(dbAssoc);
|
|
||||||
tempBusinessLocations.push(tempBusinessLocationData);
|
tempBusinessLocations.push(tempBusinessLocationData);
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Business]: Location '${tempBusinessLocationData.name}' loaded from database successfully!`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Business]: Location '${tempBusinessLocationData.name}' loaded from database successfully!`);
|
||||||
}
|
|
||||||
}
|
|
||||||
freeDatabaseQuery(dbQuery);
|
|
||||||
}
|
}
|
||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Business]: ${tempBusinessLocations.length} location for business ${businessId} loaded from database successfully!`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Business]: ${tempBusinessLocations.length} location for business ${businessId} loaded from database successfully!`);
|
||||||
return tempBusinessLocations;
|
return tempBusinessLocations;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -271,7 +267,7 @@ function loadBusinessLocationsFromDatabase(businessId) {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
function loadBusinessGameScriptsFromDatabase(businessId) {
|
function loadBusinessGameScriptsFromDatabase(businessId) {
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Business]: Loading business game scripts for business ${businessId} from database ...`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Business]: Loading business game scripts for business ${businessId} from database ...`);
|
||||||
|
|
||||||
let tempBusinessGameScripts = [];
|
let tempBusinessGameScripts = [];
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
@@ -287,7 +283,7 @@ function loadBusinessGameScriptsFromDatabase(businessId) {
|
|||||||
while(dbAssoc = fetchQueryAssoc(dbQuery)) {
|
while(dbAssoc = fetchQueryAssoc(dbQuery)) {
|
||||||
let tempBusinessGameScriptData = new BusinessGameScriptData(dbAssoc);
|
let tempBusinessGameScriptData = new BusinessGameScriptData(dbAssoc);
|
||||||
tempBusinessGameScripts.push(tempBusinessGameScriptData);
|
tempBusinessGameScripts.push(tempBusinessGameScriptData);
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Business]: Game script '${tempBusinessGameScriptData.name}' loaded from database successfully!`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Business]: Game script '${tempBusinessGameScriptData.name}' loaded from database successfully!`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
@@ -295,7 +291,7 @@ function loadBusinessGameScriptsFromDatabase(businessId) {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Business]: ${tempBusinessGameScripts.length} game scripts for business ${businessId} loaded from database successfully!`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Business]: ${tempBusinessGameScripts.length} game scripts for business ${businessId} loaded from database successfully!`);
|
||||||
return tempBusinessGameScripts;
|
return tempBusinessGameScripts;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
@@ -312,9 +308,17 @@ function loadBusinessGameScriptsFromDatabase(businessId) {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function createBusinessCommand(command, params, client) {
|
function createBusinessCommand(command, params, client) {
|
||||||
createBusiness(params, getPlayerPosition(client), toVector3(0.0, 0.0, 0.0), getGameConfig().pickupModels[getGame()].Business, -1, getPlayerInterior(client), getPlayerDimension(client), getPlayerData(client).interiorCutscene);
|
createBusiness(
|
||||||
|
params,
|
||||||
|
getPlayerPosition(client),
|
||||||
|
toVector3(0.0, 0.0, 0.0),
|
||||||
|
(isGameFeatureSupported("pickup")) ? getGameConfig().pickupModels[getGame()].Business : -1,
|
||||||
|
-1,
|
||||||
|
getPlayerInterior(client),
|
||||||
|
getPlayerDimension(client),
|
||||||
|
getPlayerData(client).interiorScene);
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} created business: {businessBlue}${params}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} created business: {businessBlue}${params}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -349,12 +353,12 @@ function createBusinessLocationCommand(command, params, client) {
|
|||||||
let tempBusinessLocationData = createBusinessLocation(locationType, businessId);
|
let tempBusinessLocationData = createBusinessLocation(locationType, businessId);
|
||||||
getServerData().businesses[businessId].push(tempBusinessLocationData);
|
getServerData().businesses[businessId].push(tempBusinessLocationData);
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} created location {businessBlue}${params}{MAINCOLOUR} for business {businessBlue}${tempBusinessData.name}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} created location {businessBlue}${params}{MAINCOLOUR} for business {businessBlue}${tempBusinessData.name}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function createBusiness(name, entrancePosition, exitPosition, entrancePickupModel = -1, entranceBlipModel = -1, entranceInterior = 0, entranceDimension = 0, entranceCutscene = -1) {
|
function createBusiness(name, entrancePosition, exitPosition, entrancePickupModel = -1, entranceBlipModel = -1, entranceInterior = 0, entranceDimension = 0, entranceScene = -1) {
|
||||||
let tempBusinessData = new BusinessData(false);
|
let tempBusinessData = new BusinessData(false);
|
||||||
tempBusinessData.name = name;
|
tempBusinessData.name = name;
|
||||||
|
|
||||||
@@ -364,7 +368,7 @@ function createBusiness(name, entrancePosition, exitPosition, entrancePickupMode
|
|||||||
tempBusinessData.entranceBlipModel = entranceBlipModel;
|
tempBusinessData.entranceBlipModel = entranceBlipModel;
|
||||||
tempBusinessData.entranceInterior = entranceInterior;
|
tempBusinessData.entranceInterior = entranceInterior;
|
||||||
tempBusinessData.entranceDimension = entranceDimension;
|
tempBusinessData.entranceDimension = entranceDimension;
|
||||||
tempBusinessData.entranceCutscene = entranceCutscene;
|
tempBusinessData.entranceScene = entranceScene;
|
||||||
|
|
||||||
tempBusinessData.exitPosition = exitPosition;
|
tempBusinessData.exitPosition = exitPosition;
|
||||||
tempBusinessData.exitRotation = 0.0;
|
tempBusinessData.exitRotation = 0.0;
|
||||||
@@ -372,7 +376,7 @@ function createBusiness(name, entrancePosition, exitPosition, entrancePickupMode
|
|||||||
tempBusinessData.exitBlipModel = -1;
|
tempBusinessData.exitBlipModel = -1;
|
||||||
tempBusinessData.exitInterior = 0;
|
tempBusinessData.exitInterior = 0;
|
||||||
tempBusinessData.exitDimension = 0;
|
tempBusinessData.exitDimension = 0;
|
||||||
tempBusinessData.exitCutscene = -1;
|
tempBusinessData.exitScene = -1;
|
||||||
|
|
||||||
tempBusinessData.needsSaved = true;
|
tempBusinessData.needsSaved = true;
|
||||||
let businessId = getServerData().businesses.push(tempBusinessData);
|
let businessId = getServerData().businesses.push(tempBusinessData);
|
||||||
@@ -409,7 +413,7 @@ function deleteBusinessCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
deleteBusiness(businessId, getPlayerData(client).accountData.databaseId);
|
deleteBusiness(businessId, getPlayerData(client).accountData.databaseId);
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} deleted business {businessBlue}${getBusinessData(businessId).name}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} deleted business {businessBlue}${getBusinessData(businessId).name}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -459,7 +463,7 @@ function setBusinessNameCommand(command, params, client) {
|
|||||||
getBusinessData(businessId).name = newBusinessName;
|
getBusinessData(businessId).name = newBusinessName;
|
||||||
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.name", getBusinessData(businessId).name, true);
|
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.name", getBusinessData(businessId).name, true);
|
||||||
getBusinessData(businessId).needsSaved = true;
|
getBusinessData(businessId).needsSaved = true;
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} renamed business {businessBlue}${oldBusinessName}{MAINCOLOUR} to {businessBlue}${newBusinessName}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} renamed business {businessBlue}${oldBusinessName}{MAINCOLOUR} to {businessBlue}${newBusinessName}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -582,8 +586,9 @@ function setBusinessClanCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Use confirm prompt
|
||||||
showPlayerPrompt(client, getLocaleString(client, "SetBusinessClanConfirmMessage"), getLocaleString(client, "SetBusinessClanConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
showPlayerPrompt(client, getLocaleString(client, "SetBusinessClanConfirmMessage"), getLocaleString(client, "SetBusinessClanConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
||||||
getPlayerData(client).promptType = AGRP_PROMPT_BIZGIVETOCLAN;
|
getPlayerData(client).promptType = AGRP_PROMPT_GIVEBIZTOCLAN;
|
||||||
|
|
||||||
//getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_CLAN;
|
//getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_CLAN;
|
||||||
//getBusinessData(businessId).ownerId = getClanData(clanId).databaseId;
|
//getBusinessData(businessId).ownerId = getClanData(clanId).databaseId;
|
||||||
@@ -847,7 +852,8 @@ function setBusinessEntranceFeeCommand(command, params, client) {
|
|||||||
|
|
||||||
getBusinessData(businessId).entranceFee = entranceFee;
|
getBusinessData(businessId).entranceFee = entranceFee;
|
||||||
getBusinessData(businessId).needsSaved = true;
|
getBusinessData(businessId).needsSaved = true;
|
||||||
messagePlayerSuccess(client, `{MAINCOLOUR}You set business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} entrance fee to [#AAAAAAA]$${entranceFee}`);
|
updateBusinessPickupLabelData(businessId);
|
||||||
|
messagePlayerSuccess(client, `{MAINCOLOUR}You set business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} entrance fee to {ALTCOLOUR}${getCurrencyString(entranceFee)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -940,14 +946,14 @@ function getBusinessInfoCommand(command, params, client) {
|
|||||||
[`ID`, `${businessData.index}/${businessData.databaseId}`],
|
[`ID`, `${businessData.index}/${businessData.databaseId}`],
|
||||||
[`Owner`, `${ownerName} (${getBusinessOwnerTypeText(businessData.ownerType)})`],
|
[`Owner`, `${ownerName} (${getBusinessOwnerTypeText(businessData.ownerType)})`],
|
||||||
[`Locked`, `${getLockedUnlockedFromBool(businessData.locked)}`],
|
[`Locked`, `${getLockedUnlockedFromBool(businessData.locked)}`],
|
||||||
[`BuyPrice`, `$${businessData.buyPrice}`],
|
[`BuyPrice`, `${getCurrencyString(businessData.buyPrice)}`],
|
||||||
//[`RentPrice`, `${businessData.rentPrice}`],
|
//[`RentPrice`, `${businessData.rentPrice}`],
|
||||||
[`HasInterior`, `${getYesNoFromBool(businessData.hasInterior)}`],
|
[`HasInterior`, `${getYesNoFromBool(businessData.hasInterior)}`],
|
||||||
[`CustomInterior`, `${getYesNoFromBool(businessData.customInterior)}`],
|
[`CustomInterior`, `${getYesNoFromBool(businessData.customInterior)}`],
|
||||||
[`HasBuyableItems`, `${getYesNoFromBool(doesBusinessHaveAnyItemsToBuy(businessId))}`],
|
[`HasBuyableItems`, `${getYesNoFromBool(doesBusinessHaveAnyItemsToBuy(businessId))}`],
|
||||||
[`EntranceFee`, `$${businessData.entranceFee}`],
|
[`EntranceFee`, `${getCurrencyString(businessData.entranceFee)}`],
|
||||||
[`InteriorLights`, `${getOnOffFromBool(businessData.interiorLights)}`],
|
[`InteriorLights`, `${getOnOffFromBool(businessData.interiorLights)}`],
|
||||||
[`Balance`, `$${businessData.till}`],
|
[`Balance`, `${getCurrencyString(businessData.till)}`],
|
||||||
[`RadioStation`, `${businessData.streamingRadioStation}`],
|
[`RadioStation`, `${businessData.streamingRadioStation}`],
|
||||||
[`LabelHelpType`, `${businessData.labelHelpType}`],
|
[`LabelHelpType`, `${businessData.labelHelpType}`],
|
||||||
];
|
];
|
||||||
@@ -1012,6 +1018,11 @@ function getBusinessStorageItemsCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!canPlayerManageBusiness(client, businessId)) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "CantModifyBusiness"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
showBusinessStorageInventoryToPlayer(client, businessId);
|
showBusinessStorageInventoryToPlayer(client, businessId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1057,7 +1068,7 @@ function setBusinessPickupCommand(command, params, client) {
|
|||||||
|
|
||||||
getBusinessData(businessId).needsSaved = true;
|
getBusinessData(businessId).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} pickup display to {ALTCOLOUR}${typeParam}!`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} pickup to {ALTCOLOUR}${typeParam}!`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1091,10 +1102,11 @@ function setBusinessInteriorTypeCommand(command, params, client) {
|
|||||||
getBusinessData(businessId).exitDimension = 0;
|
getBusinessData(businessId).exitDimension = 0;
|
||||||
getBusinessData(businessId).exitInterior = -1;
|
getBusinessData(businessId).exitInterior = -1;
|
||||||
getBusinessData(businessId).hasInterior = false;
|
getBusinessData(businessId).hasInterior = false;
|
||||||
getBusinessData(businessId).interiorCutscene = "";
|
getBusinessData(businessId).entranceScene = "";
|
||||||
|
getBusinessData(businessId).exitScene = "";
|
||||||
getBusinessData(businessId).exitPickupModel = -1;
|
getBusinessData(businessId).exitPickupModel = -1;
|
||||||
getBusinessData(businessId).customInterior = false;
|
getBusinessData(businessId).customInterior = false;
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} removed business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} interior`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} removed business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} interior`, true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1113,10 +1125,17 @@ function setBusinessInteriorTypeCommand(command, params, client) {
|
|||||||
getBusinessData(businessId).exitPosition = getGameConfig().interiors[getGame()][typeParam][0];
|
getBusinessData(businessId).exitPosition = getGameConfig().interiors[getGame()][typeParam][0];
|
||||||
getBusinessData(businessId).exitInterior = getGameConfig().interiors[getGame()][typeParam][1];
|
getBusinessData(businessId).exitInterior = getGameConfig().interiors[getGame()][typeParam][1];
|
||||||
getBusinessData(businessId).exitDimension = getBusinessData(businessId).databaseId + getGlobalConfig().businessDimensionStart;
|
getBusinessData(businessId).exitDimension = getBusinessData(businessId).databaseId + getGlobalConfig().businessDimensionStart;
|
||||||
getBusinessData(businessId).exitPickupModel = getGameConfig().pickupModels[getGame()].Exit;
|
getBusinessData(businessId).exitPickupModel = (isGameFeatureSupported("pickup")) ? getGameConfig().pickupModels[getGame()].Exit : -1;
|
||||||
getBusinessData(businessId).hasInterior = true;
|
getBusinessData(businessId).hasInterior = true;
|
||||||
getBusinessData(businessId).customInterior = getGameConfig().interiors[getGame()][typeParam][2];
|
getBusinessData(businessId).customInterior = getGameConfig().interiors[getGame()][typeParam][2];
|
||||||
getBusinessData(businessId).interiorCutscene = getGameConfig().interiors[getGame()][typeParam][3];
|
|
||||||
|
if (isGameFeatureSupported("interiorScene")) {
|
||||||
|
if (isMainWorldScene(getPlayerData(client).scene)) {
|
||||||
|
getBusinessData(businessId).exitScene = getGameConfig().mainWorldScene[getGame()];
|
||||||
|
} else {
|
||||||
|
getBusinessData(businessId).exitScene = getGameConfig().interiors[getGame()][typeParam][3];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//deleteBusinessExitPickup(businessId);
|
//deleteBusinessExitPickup(businessId);
|
||||||
@@ -1128,7 +1147,7 @@ function setBusinessInteriorTypeCommand(command, params, client) {
|
|||||||
|
|
||||||
getBusinessData(businessId).needsSaved = true;
|
getBusinessData(businessId).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} interior type to {ALTCOLOUR}${typeParam}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} interior type to {ALTCOLOUR}${typeParam}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1175,7 +1194,7 @@ function addBusinessPropertyTemplateEntities(command, params, client) {
|
|||||||
getBusinessData(businessId).exitPickupModel = getGameConfig().pickupModels[getGame()].Exit;
|
getBusinessData(businessId).exitPickupModel = getGameConfig().pickupModels[getGame()].Exit;
|
||||||
getBusinessData(businessId).hasInterior = true;
|
getBusinessData(businessId).hasInterior = true;
|
||||||
getBusinessData(businessId).customInterior = getGameConfig().interiors[getGame()][typeParam][2];
|
getBusinessData(businessId).customInterior = getGameConfig().interiors[getGame()][typeParam][2];
|
||||||
getBusinessData(businessId).interiorCutscene = getGameConfig().interiors[getGame()][typeParam][3];
|
getBusinessData(businessId).interiorScene = getGameConfig().interiors[getGame()][typeParam][3];
|
||||||
}
|
}
|
||||||
|
|
||||||
//deleteBusinessExitPickup(businessId);
|
//deleteBusinessExitPickup(businessId);
|
||||||
@@ -1187,7 +1206,7 @@ function addBusinessPropertyTemplateEntities(command, params, client) {
|
|||||||
|
|
||||||
getBusinessData(businessId).needsSaved = true;
|
getBusinessData(businessId).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} interior type to {ALTCOLOUR}${typeParam}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} property template to {ALTCOLOUR}${typeParam}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1232,7 +1251,7 @@ function setBusinessBlipCommand(command, params, client) {
|
|||||||
resetBusinessBlips(businessId);
|
resetBusinessBlips(businessId);
|
||||||
getBusinessData(businessId).needsSaved = true;
|
getBusinessData(businessId).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} blip display to {ALTCOLOUR}${typeParam}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} blip to {ALTCOLOUR}${typeParam}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1283,7 +1302,7 @@ function giveDefaultItemsToBusinessCommand(command, params, client) {
|
|||||||
|
|
||||||
cacheBusinessItems(businessId);
|
cacheBusinessItems(businessId);
|
||||||
updateBusinessPickupLabelData(businessId);
|
updateBusinessPickupLabelData(businessId);
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} gave business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} the default items for ${toLowerCase(typeParam)}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} gave business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} the default items for ${typeParam}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1308,7 +1327,7 @@ function setBusinessDealershipCommand(command, params, client) {
|
|||||||
getBusinessData(businessId).labelHelpType == AGRP_PROPLABEL_INFO_ENTERVEHICLE;
|
getBusinessData(businessId).labelHelpType == AGRP_PROPLABEL_INFO_ENTERVEHICLE;
|
||||||
getBusinessData(businessId).type = AGRP_BIZ_TYPE_DEALERSHIP;
|
getBusinessData(businessId).type = AGRP_BIZ_TYPE_DEALERSHIP;
|
||||||
updateBusinessPickupLabelData(businessId);
|
updateBusinessPickupLabelData(businessId);
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set the business type of {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} to dealership`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set the type of business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} to dealership`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1337,7 +1356,7 @@ function deleteBusinessFloorItemsCommand(command, params, client) {
|
|||||||
|
|
||||||
cacheBusinessItems(businessId);
|
cacheBusinessItems(businessId);
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} deleted all on-sale items for business {businessBlue}${getBusinessData(businessId).name}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} deleted all on-sale items for business {businessBlue}${getBusinessData(businessId).name}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1366,7 +1385,7 @@ function deleteBusinessStorageItemsCommand(command, params, client) {
|
|||||||
|
|
||||||
cacheBusinessItems(businessId);
|
cacheBusinessItems(businessId);
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} deleted all stored items for business {businessBlue}${getBusinessData(businessId).name}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} deleted all storage items for business {businessBlue}${getBusinessData(businessId).name}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1409,7 +1428,7 @@ function withdrawFromBusinessCommand(command, params, client) {
|
|||||||
updatePlayerCash(client);
|
updatePlayerCash(client);
|
||||||
getBusinessData(businessId).needsSaved = true;
|
getBusinessData(businessId).needsSaved = true;
|
||||||
|
|
||||||
messagePlayerSuccess(client, `You withdrew $${amount} from business {businessBlue}${getBusinessData(businessId).name} till`);
|
messagePlayerSuccess(client, `You withdrew ${getCurrencyString(amount)} from business {businessBlue}${getBusinessData(businessId).name} till`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1451,7 +1470,7 @@ function setBusinessBuyPriceCommand(command, params, client) {
|
|||||||
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.price", getBusinessData(businessId).buyPrice, true);
|
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.price", getBusinessData(businessId).buyPrice, true);
|
||||||
|
|
||||||
getBusinessData(businessId).needsSaved = true;
|
getBusinessData(businessId).needsSaved = true;
|
||||||
messagePlayerSuccess(client, `{MAINCOLOUR}You set business {businessBlue}${getBusinessData(businessId).name}'s {MAINCOLOUR}for-sale price to {ALTCOLOUR}$${makeLargeNumberReadable(amount)}`);
|
messagePlayerSuccess(client, `{MAINCOLOUR}You set business {businessBlue}${getBusinessData(businessId).name}'s{MAINCOLOUR} for-sale price to {ALTCOLOUR}${getCurrencyString(amount)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1486,7 +1505,7 @@ function depositIntoBusinessCommand(command, params, client) {
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
if (getPlayerCurrentSubAccount(client).cash < amount) {
|
if (getPlayerCurrentSubAccount(client).cash < amount) {
|
||||||
messagePlayerError(client, `You don't have that much money! You only have $${getPlayerCurrentSubAccount(client).cash}`);
|
messagePlayerError(client, `You don't have that much money! You only have ${getCurrencyString(getPlayerCurrentSubAccount(client).cash)}`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1495,7 +1514,7 @@ function depositIntoBusinessCommand(command, params, client) {
|
|||||||
updatePlayerCash(client);
|
updatePlayerCash(client);
|
||||||
|
|
||||||
getBusinessData(businessId).needsSaved = true;
|
getBusinessData(businessId).needsSaved = true;
|
||||||
messagePlayerSuccess(client, `You deposited $${amount} into business {businessBlue}${getBusinessData(businessId).name} {MAINCOLOUR}till`);
|
messagePlayerSuccess(client, `You deposited ${getCurrencyString(amount)} into business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} till`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1524,17 +1543,17 @@ function orderItemForBusinessCommand(command, params, client) {
|
|||||||
let itemType = getItemTypeFromParams(splitParams.slice(0, -2).join(" "));
|
let itemType = getItemTypeFromParams(splitParams.slice(0, -2).join(" "));
|
||||||
|
|
||||||
if (!getItemTypeData(itemType)) {
|
if (!getItemTypeData(itemType)) {
|
||||||
messagePlayerError(client, `Invalid item type name or ID!`);
|
messagePlayerError(client, getLocaleString(client, "InvalidItemType"));
|
||||||
messagePlayerInfo(client, `Use {ALTCOLOUR}/itemtypes{MAINCOLOUR} for a list of items`);
|
messagePlayerInfo(client, `Use {ALTCOLOUR}/itemtypes{MAINCOLOUR} for a list of items`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
let pricePerItem = getOrderPriceForItemType(itemType);
|
let pricePerItem = getOrderPriceForItemType(itemType);
|
||||||
|
|
||||||
let amount = toInteger(splitParams.slice(-2, -1)) || 1;
|
let amount = toInteger(splitParams.slice(-2, -1)) || 1;
|
||||||
let value = toInteger(splitParams.slice(-1)) || getItemTypeData(itemType).capacity;
|
let value = getItemTypeData(itemType).orderValue;
|
||||||
let businessId = getPlayerBusiness(client);
|
let businessId = getPlayerBusiness(client);
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Business] ${getPlayerDisplayForConsole(client)} is ordering ${amount} ${splitParams.slice(0, -2).join(" ")} (${value})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Business] ${getPlayerDisplayForConsole(client)} is ordering ${amount} ${splitParams.slice(0, -2).join(" ")}`);
|
||||||
|
|
||||||
if (!getBusinessData(businessId)) {
|
if (!getBusinessData(businessId)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidBusiness"));
|
messagePlayerError(client, getLocaleString(client, "InvalidBusiness"));
|
||||||
@@ -1552,11 +1571,10 @@ function orderItemForBusinessCommand(command, params, client) {
|
|||||||
getPlayerData(client).businessOrderAmount = amount;
|
getPlayerData(client).businessOrderAmount = amount;
|
||||||
getPlayerData(client).businessOrderBusiness = businessId;
|
getPlayerData(client).businessOrderBusiness = businessId;
|
||||||
getPlayerData(client).businessOrderItem = itemType;
|
getPlayerData(client).businessOrderItem = itemType;
|
||||||
getPlayerData(client).businessOrderValue = value;
|
|
||||||
getPlayerData(client).businessOrderCost = orderTotalCost;
|
getPlayerData(client).businessOrderCost = orderTotalCost;
|
||||||
|
|
||||||
getBusinessData(businessId).needsSaved = true;
|
getBusinessData(businessId).needsSaved = true;
|
||||||
showPlayerPrompt(client, `Ordering ${amount} ${getPluralForm(getItemTypeData(itemType).name)} (${getItemValueDisplay(itemType, value)}) at $${makeLargeNumberReadable(pricePerItem)} each will cost a total of $${makeLargeNumberReadable(orderTotalCost)}`, "Business Order Cost");
|
showPlayerPrompt(client, `Ordering ${amount} ${getPluralForm(getItemTypeData(itemType).name)} will cost a total of ${getCurrencyString(orderTotalCost)}`, "Business Order Cost");
|
||||||
getPlayerData(client).promptType = AGRP_PROMPT_BIZORDER;
|
getPlayerData(client).promptType = AGRP_PROMPT_BIZORDER;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1574,13 +1592,13 @@ function orderItemForBusinessCommand(command, params, client) {
|
|||||||
function orderItemForBusiness(businessId, itemType, amount) {
|
function orderItemForBusiness(businessId, itemType, amount) {
|
||||||
if (getBusinessData(businessId).till < orderTotalCost) {
|
if (getBusinessData(businessId).till < orderTotalCost) {
|
||||||
let neededAmount = orderTotalCost - getBusinessData(businessId).till;
|
let neededAmount = orderTotalCost - getBusinessData(businessId).till;
|
||||||
//messagePlayerError(client, `The business doesn't have enough money (needs {ALTCOLOUR}$${neededAmount} {MAINCOLOUR}more)! Use {ALTCOLOUR}/bizdeposit {MAINCOLOUR}to add money to the business.`);
|
//messagePlayerError(client, `The business doesn't have enough money (needs {ALTCOLOUR}${getCurrencyString(neededAmount)} {MAINCOLOUR}more)! Use {ALTCOLOUR}/bizdeposit {MAINCOLOUR}to add money to the business.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
getBusinessData(businessId).till -= orderTotalCost;
|
getBusinessData(businessId).till -= orderTotalCost;
|
||||||
addToBusinessInventory(businessId, itemType, amount);
|
addToBusinessInventory(businessId, itemType, amount);
|
||||||
//messagePlayerSuccess(client, `You ordered ${amount} ${getPluralForm(getItemTypeData(itemType).name)} (${getItemValueDisplay(itemType, value)}) at $${getItemTypeData(itemType).orderPrice} each for business {businessBlue}${getBusinessData(businessId).name}`);
|
//messagePlayerSuccess(client, `You ordered ${amount} ${getPluralForm(getItemTypeData(itemType).name)} (${getItemValueDisplay(itemType, value)}) at ${getCurrencyString(getItemTypeData(itemType).orderPrice)} each for business {businessBlue}${getBusinessData(businessId).name}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1611,7 +1629,7 @@ function viewBusinessTillAmountCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
messagePlayerSuccess(client, `Business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} till has {ALTCOLOUR}$${getBusinessData(businessId).till}`);
|
messagePlayerSuccess(client, `Business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} till has {ALTCOLOUR}${getCurrencyString(getBusinessData(businessId).till)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1644,7 +1662,7 @@ function buyBusinessCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
showPlayerPrompt(client, getLocaleString(client, "BuyBusinessConfirmMessage"), getLocaleString(client, "BuyBusinessConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
showPlayerPrompt(client, getLocaleString(client, "BuyBusinessConfirmMessage"), getLocaleString(client, "BuyBusinessConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
||||||
getPlayerData(client).promptType = AGRP_PROMPT_BIZBUY;
|
getPlayerData(client).promptType = AGRP_PROMPT_BUYBIZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1684,7 +1702,7 @@ function moveBusinessEntranceCommand(command, params, client) {
|
|||||||
|
|
||||||
getBusinessData(businessId).needsSaved = true;
|
getBusinessData(businessId).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} moved business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} entrance to their position`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} moved business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} entrance to their position`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1722,7 +1740,7 @@ function moveBusinessExitCommand(command, params, client) {
|
|||||||
|
|
||||||
getBusinessData(businessId).needsSaved = true;
|
getBusinessData(businessId).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} moved business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR}exit to their position`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} moved business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} exit to their position`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1874,7 +1892,7 @@ function saveBusinessToDatabase(businessId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Business]: Saving business '${tempBusinessData.name}' to database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Business]: Saving business '${tempBusinessData.name}' to database ...`);
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let safeBusinessName = escapeDatabaseString(dbConnection, tempBusinessData.name);
|
let safeBusinessName = escapeDatabaseString(dbConnection, tempBusinessData.name);
|
||||||
@@ -1895,7 +1913,7 @@ function saveBusinessToDatabase(businessId) {
|
|||||||
["biz_entrance_vw", tempBusinessData.entranceDimension],
|
["biz_entrance_vw", tempBusinessData.entranceDimension],
|
||||||
["biz_entrance_pickup", tempBusinessData.entrancePickupModel],
|
["biz_entrance_pickup", tempBusinessData.entrancePickupModel],
|
||||||
["biz_entrance_blip", tempBusinessData.entranceBlipModel],
|
["biz_entrance_blip", tempBusinessData.entranceBlipModel],
|
||||||
//["biz_entrance_cutscene", tempBusinessData.entranceCutscene],
|
["biz_entrance_scene", tempBusinessData.entranceScene],
|
||||||
["biz_exit_pos_x", tempBusinessData.exitPosition.x],
|
["biz_exit_pos_x", tempBusinessData.exitPosition.x],
|
||||||
["biz_exit_pos_y", tempBusinessData.exitPosition.y],
|
["biz_exit_pos_y", tempBusinessData.exitPosition.y],
|
||||||
["biz_exit_pos_z", tempBusinessData.exitPosition.z],
|
["biz_exit_pos_z", tempBusinessData.exitPosition.z],
|
||||||
@@ -1904,11 +1922,11 @@ function saveBusinessToDatabase(businessId) {
|
|||||||
["biz_exit_vw", tempBusinessData.exitDimension],
|
["biz_exit_vw", tempBusinessData.exitDimension],
|
||||||
["biz_exit_pickup", tempBusinessData.exitPickupModel],
|
["biz_exit_pickup", tempBusinessData.exitPickupModel],
|
||||||
["biz_exit_blip", tempBusinessData.exitBlipModel],
|
["biz_exit_blip", tempBusinessData.exitBlipModel],
|
||||||
//["biz_exit_cutscene", tempBusinessData.exitCutscene],
|
["biz_exit_scene", tempBusinessData.exitScene],
|
||||||
["biz_has_interior", boolToInt(tempBusinessData.hasInterior)],
|
["biz_has_interior", boolToInt(tempBusinessData.hasInterior)],
|
||||||
["biz_interior_lights", boolToInt(tempBusinessData.interiorLights)],
|
["biz_interior_lights", boolToInt(tempBusinessData.interiorLights)],
|
||||||
["biz_label_help_type", tempBusinessData.labelHelpType],
|
["biz_label_help_type", tempBusinessData.labelHelpType],
|
||||||
["biz_radio_station", toInteger(tempBusinessData.streamingRadioStation)],
|
["biz_radio_station", (getRadioStationData(tempBusinessData.streamingRadioStationIndex) != false) ? toInteger(getRadioStationData(tempBusinessData.streamingRadioStationIndex).databaseId) : -1],
|
||||||
["biz_custom_interior", boolToInt(tempBusinessData.customInterior)],
|
["biz_custom_interior", boolToInt(tempBusinessData.customInterior)],
|
||||||
["biz_buy_price", tempBusinessData.buyPrice],
|
["biz_buy_price", tempBusinessData.buyPrice],
|
||||||
//["biz_rent_price", tempBusinessData.rentPrice],
|
//["biz_rent_price", tempBusinessData.rentPrice],
|
||||||
@@ -1930,7 +1948,7 @@ function saveBusinessToDatabase(businessId) {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Business]: Saved business '${tempBusinessData.name}' to database!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Business]: Saved business '${tempBusinessData.name}' to database!`);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1948,10 +1966,6 @@ function createAllBusinessPickups() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isGameFeatureSupported("pickup")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let i in getServerData().businesses) {
|
for (let i in getServerData().businesses) {
|
||||||
createBusinessEntrancePickup(i);
|
createBusinessEntrancePickup(i);
|
||||||
createBusinessExitPickup(i);
|
createBusinessExitPickup(i);
|
||||||
@@ -1994,38 +2008,34 @@ function createAllBusinessBlips() {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function createBusinessEntrancePickup(businessId) {
|
function createBusinessEntrancePickup(businessId) {
|
||||||
if (!areServerElementsSupported()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!getServerConfig().createBusinessPickups) {
|
if (!getServerConfig().createBusinessPickups) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isGameFeatureSupported("pickup")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
let businessData = getBusinessData(businessId);
|
let businessData = getBusinessData(businessId);
|
||||||
|
|
||||||
//if(businessData.hasInterior) {
|
//if(businessData.hasInterior) {
|
||||||
// return false;
|
// return false;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating entrance pickup for business ${businessData.name}`);
|
||||||
|
|
||||||
|
if (areServerElementsSupported() && getGame() != AGRP_GAME_MAFIA_ONE && getGame() != AGRP_GAME_GTA_IV) {
|
||||||
|
let entrancePickup = null;
|
||||||
|
if (isGameFeatureSupported("pickup")) {
|
||||||
|
let pickupModelId = getGameConfig().pickupModels[getGame()].Business;
|
||||||
|
|
||||||
if (businessData.entrancePickupModel == -1) {
|
if (businessData.entrancePickupModel == -1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let pickupModelId = getGameConfig().pickupModels[getGame()].Business;
|
|
||||||
|
|
||||||
if (businessData.entrancePickupModel != 0) {
|
if (businessData.entrancePickupModel != 0) {
|
||||||
pickupModelId = businessData.entrancePickupModel;
|
pickupModelId = businessData.entrancePickupModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Job]: Creating entrance pickup for business ${businessData.name} (model ${pickupModelId})`);
|
entrancePickup = createGamePickup(pickupModelId, businessData.entrancePosition, getGameConfig().pickupTypes[getGame()].business);
|
||||||
|
}
|
||||||
|
|
||||||
if (areServerElementsSupported()) {
|
|
||||||
let entrancePickup = createGamePickup(pickupModelId, businessData.entrancePosition, getGameConfig().pickupTypes[getGame()].business);
|
|
||||||
if (entrancePickup != null) {
|
if (entrancePickup != null) {
|
||||||
if (businessData.entranceDimension != -1) {
|
if (businessData.entranceDimension != -1) {
|
||||||
setElementDimension(entrancePickup, businessData.entranceDimension);
|
setElementDimension(entrancePickup, businessData.entranceDimension);
|
||||||
@@ -2044,14 +2054,9 @@ function createBusinessEntrancePickup(businessId) {
|
|||||||
getBusinessData(businessId).entrancePickup = entrancePickup;
|
getBusinessData(businessId).entrancePickup = entrancePickup;
|
||||||
updateBusinessPickupLabelData(businessId);
|
updateBusinessPickupLabelData(businessId);
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
let pickupModelId = getGameConfig().pickupModels[getGame()].Business;
|
|
||||||
|
|
||||||
if (businessData.entrancePickupModel != 0) {
|
updateBusinessPickupLabelData(businessId);
|
||||||
pickupModelId = businessData.entrancePickupModel;
|
|
||||||
}
|
|
||||||
sendBusinessToPlayer(null, businessId, businessData.name, businessData.entrancePosition, blipModelId, pickupModelId, businessData.hasInterior, doesBusinessHaveAnyItemsToBuy(businessId));
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -2066,10 +2071,6 @@ function createBusinessEntrancePickup(businessId) {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function createBusinessEntranceBlip(businessId) {
|
function createBusinessEntranceBlip(businessId) {
|
||||||
if (!areServerElementsSupported()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!getServerConfig().createBusinessBlips) {
|
if (!getServerConfig().createBusinessBlips) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -2094,9 +2095,9 @@ function createBusinessEntranceBlip(businessId) {
|
|||||||
blipModelId = businessData.entranceBlipModel;
|
blipModelId = businessData.entranceBlipModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Job]: Creating entrance blip for business ${businessData.name} (model ${blipModelId})`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating entrance blip for business ${businessData.name} (model ${blipModelId})`);
|
||||||
|
|
||||||
if (areServerElementsSupported()) {
|
if (areServerElementsSupported() && getGame() != AGRP_GAME_MAFIA_ONE && getGame() != AGRP_GAME_GTA_IV) {
|
||||||
let entranceBlip = createGameBlip(businessData.entrancePosition, blipModelId, 1, getColourByType("businessBlue"));
|
let entranceBlip = createGameBlip(businessData.entrancePosition, blipModelId, 1, getColourByType("businessBlue"));
|
||||||
if (entranceBlip != null) {
|
if (entranceBlip != null) {
|
||||||
if (businessData.entranceDimension != -1) {
|
if (businessData.entranceDimension != -1) {
|
||||||
@@ -2136,10 +2137,6 @@ function createBusinessExitPickup(businessId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isGameFeatureSupported("pickup")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
let businessData = getBusinessData(businessId);
|
let businessData = getBusinessData(businessId);
|
||||||
|
|
||||||
//if(!businessData.hasInterior) {
|
//if(!businessData.hasInterior) {
|
||||||
@@ -2150,15 +2147,19 @@ function createBusinessExitPickup(businessId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating exit pickup for business ${businessData.name}`);
|
||||||
|
|
||||||
|
let exitPickup = null;
|
||||||
|
if (isGameFeatureSupported("pickup")) {
|
||||||
let pickupModelId = getGameConfig().pickupModels[getGame()].Exit;
|
let pickupModelId = getGameConfig().pickupModels[getGame()].Exit;
|
||||||
|
|
||||||
if (businessData.exitPickupModel != 0) {
|
if (businessData.exitPickupModel != 0) {
|
||||||
pickupModelId = businessData.exitPickupModel;
|
pickupModelId = businessData.exitPickupModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Job]: Creating exit pickup for business ${businessData.name} (model ${pickupModelId})`);
|
exitPickup = createGamePickup(pickupModelId, businessData.exitPosition, getGameConfig().pickupTypes[getGame()].business);
|
||||||
|
}
|
||||||
|
|
||||||
let exitPickup = createGamePickup(pickupModelId, businessData.exitPosition, getGameConfig().pickupTypes[getGame()].business);
|
|
||||||
if (exitPickup != null) {
|
if (exitPickup != null) {
|
||||||
if (businessData.exitDimension != -1) {
|
if (businessData.exitDimension != -1) {
|
||||||
setElementDimension(exitPickup, businessData.exitDimension);
|
setElementDimension(exitPickup, businessData.exitDimension);
|
||||||
@@ -2177,6 +2178,7 @@ function createBusinessExitPickup(businessId) {
|
|||||||
getBusinessData(businessId).exitPickup = exitPickup;
|
getBusinessData(businessId).exitPickup = exitPickup;
|
||||||
updateBusinessPickupLabelData(businessId);
|
updateBusinessPickupLabelData(businessId);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -2217,7 +2219,7 @@ function createBusinessExitBlip(businessId) {
|
|||||||
blipModelId = businessData.exitBlipModel;
|
blipModelId = businessData.exitBlipModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Job]: Creating exit blip for business ${businessData.name} (model ${blipModelId})`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating exit blip for business ${businessData.name} (model ${blipModelId})`);
|
||||||
|
|
||||||
let exitBlip = createGameBlip(businessData.exitPosition, blipModelId, 1, getColourByName("businessBlue"));
|
let exitBlip = createGameBlip(businessData.exitPosition, blipModelId, 1, getColourByName("businessBlue"));
|
||||||
if (exitBlip != null) {
|
if (exitBlip != null) {
|
||||||
@@ -2281,13 +2283,15 @@ function deleteBusiness(businessId, whoDeleted = 0) {
|
|||||||
* @return {Boolean} Whether or not the players were forced to exit
|
* @return {Boolean} Whether or not the players were forced to exit
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function removePlayersFromBusiness(businessId) {
|
function removePlayersFromBusiness(businessIndex) {
|
||||||
getClients().forEach(function (client) {
|
getClients().forEach(function (client) {
|
||||||
if (doesBusinessHaveInterior(businessId)) {
|
if (doesBusinessHaveInterior(businessIndex)) {
|
||||||
if (getPlayerBusiness(client) == businessId) {
|
if (getPlayerBusiness(client) == businessIndex) {
|
||||||
|
if (getPlayerInterior(client) == getBusinessData(businessIndex).exitInterior && getPlayerDimension(client) == getBusinessData(businessIndex).exitDimension) {
|
||||||
exitBusiness(client);
|
exitBusiness(client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -2402,10 +2406,6 @@ function deleteBusinessEntrancePickup(businessId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isGameFeatureSupported("pickup")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getBusinessData(businessId).entrancePickup != null) {
|
if (getBusinessData(businessId).entrancePickup != null) {
|
||||||
//removeFromWorld(getBusinessData(businessId).entrancePickup);
|
//removeFromWorld(getBusinessData(businessId).entrancePickup);
|
||||||
deleteGameElement(getBusinessData(businessId).entrancePickup);
|
deleteGameElement(getBusinessData(businessId).entrancePickup);
|
||||||
@@ -2429,10 +2429,6 @@ function deleteBusinessExitPickup(businessId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isGameFeatureSupported("pickup")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getBusinessData(businessId).exitPickup != null) {
|
if (getBusinessData(businessId).exitPickup != null) {
|
||||||
//removeFromWorld(getBusinessData(businessId).exitPickup);
|
//removeFromWorld(getBusinessData(businessId).exitPickup);
|
||||||
deleteGameElement(getBusinessData(businessId).exitPickup);
|
deleteGameElement(getBusinessData(businessId).exitPickup);
|
||||||
@@ -2668,14 +2664,18 @@ function buyFromBusinessCommand(command, params, client) {
|
|||||||
//messagePlayerSuccess(client, `You bought ${amount} {ALTCOLOUR}${itemName} {MAINCOLOUR}for ${totalCost} ${priceEach}`);
|
//messagePlayerSuccess(client, `You bought ${amount} {ALTCOLOUR}${itemName} {MAINCOLOUR}for ${totalCost} ${priceEach}`);
|
||||||
meActionToNearbyPlayers(client, `buys a ${itemName}`);
|
meActionToNearbyPlayers(client, `buys a ${itemName}`);
|
||||||
|
|
||||||
|
if (!hasPlayerSeenActionTip(client, "ViewInventory")) {
|
||||||
if (doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand("inv")) {
|
if (doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand("inv")) {
|
||||||
let keyData = getPlayerKeyBindForCommand("inv");
|
let keyData = getPlayerKeyBindForCommand("inv");
|
||||||
messagePlayerNewbieTip(client, getLocaleString(client, "ViewInventoryKeyPressTip", `{ALTCOLOUR}${getKeyNameFromId(keyData.key)}{MAINCOLOUR}`));
|
messagePlayerActionTip(client, getGroupedLocaleString(client, "ActionTips", "ViewInventory", `{ALTCOLOUR}${getKeyNameFromId(keyData.key)}{MAINCOLOUR}`));
|
||||||
} else {
|
} else {
|
||||||
messagePlayerNewbieTip(client, getLocaleString(client, "ViewInventoryCommandTip", `{ALTCOLOUR}/inv{MAINCOLOUR}`));
|
messagePlayerActionTip(client, getGroupedLocaleString(client, "ActionTips", "ViewInventory", `{ALTCOLOUR}/inv{MAINCOLOUR}`));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
markPlayerActionTipSeen(client, "ViewInventory");
|
||||||
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2716,7 +2716,7 @@ function setBusinessItemSellPriceCommand(command, params, client) {
|
|||||||
|
|
||||||
getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).buyPrice = newPrice;
|
getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).buyPrice = newPrice;
|
||||||
|
|
||||||
messagePlayerSuccess(client, `You changed the price of the {ALTCOLOUR}${getItemTypeData(getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).itemTypeIndex).name}'s {MAINCOLOUR}in slot {ALTCOLOUR}${itemSlot} {MAINCOLOUR}from $${makeLargeNumberReadable(oldPrice)} to $${makeLargeNumberReadable(newprice)}`);
|
messagePlayerSuccess(client, `You changed the price of the {ALTCOLOUR}${getItemTypeData(getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).itemTypeIndex).name}'s {MAINCOLOUR}in slot {ALTCOLOUR}${itemSlot} {MAINCOLOUR}from ${getCurrencyString(oldPrice)} to ${getCurrencyString(newprice)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -2825,11 +2825,11 @@ function getBusinessFloorFirstFreeItemSlot(businessId) {
|
|||||||
|
|
||||||
// Caches all items for all businesses
|
// Caches all items for all businesses
|
||||||
function cacheAllBusinessItems() {
|
function cacheAllBusinessItems() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Business] Caching all business items ...");
|
logToConsole(LOG_DEBUG, "[AGRP.Business] Caching all business items ...");
|
||||||
for (let i in getServerData().businesses) {
|
for (let i in getServerData().businesses) {
|
||||||
cacheBusinessItems(i);
|
cacheBusinessItems(i);
|
||||||
}
|
}
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Business] Cached all business items successfully!");
|
logToConsole(LOG_DEBUG, "[AGRP.Business] Cached all business items successfully!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -2840,11 +2840,11 @@ function cacheBusinessItems(businessId) {
|
|||||||
clearArray(getBusinessData(businessId).storageItemCache);
|
clearArray(getBusinessData(businessId).storageItemCache);
|
||||||
|
|
||||||
//let businessData = getBusinessData(businessId);
|
//let businessData = getBusinessData(businessId);
|
||||||
//logToConsole(LOG_VERBOSE, `[VRR.Business] Caching business items for business ${businessId} (${businessData.name}) ...`);
|
//logToConsole(LOG_VERBOSE, `[AGRP.Business] Caching business items for business ${businessId} (${businessData.name}) ...`);
|
||||||
//getBusinessData(businessId).floorItemCache = getServerData().items.filter(item => item.ownerType == AGRP_ITEM_OWNER_BIZFLOOR && item.ownerId == businessData.databaseId).map(i => i.index);
|
//getBusinessData(businessId).floorItemCache = getServerData().items.filter(item => item.ownerType == AGRP_ITEM_OWNER_BIZFLOOR && item.ownerId == businessData.databaseId).map(i => i.index);
|
||||||
//getBusinessData(businessId).storageItemCache = getServerData().items.filter(item => item.ownerType == AGRP_ITEM_OWNER_BIZSTORAGE && item.ownerId == businessData.databaseId);
|
//getBusinessData(businessId).storageItemCache = getServerData().items.filter(item => item.ownerType == AGRP_ITEM_OWNER_BIZSTORAGE && item.ownerId == businessData.databaseId);
|
||||||
|
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Business] Caching business items for business ${businessId} (${getBusinessData(businessId).name}) ...`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Business] Caching business items for business ${businessId} (${getBusinessData(businessId).name}) ...`);
|
||||||
for (let i in getServerData().items) {
|
for (let i in getServerData().items) {
|
||||||
if (getItemData(i).ownerType == AGRP_ITEM_OWNER_BIZFLOOR && getItemData(i).ownerId == getBusinessData(businessId).databaseId) {
|
if (getItemData(i).ownerType == AGRP_ITEM_OWNER_BIZFLOOR && getItemData(i).ownerId == getBusinessData(businessId).databaseId) {
|
||||||
getBusinessData(businessId).floorItemCache.push(i);
|
getBusinessData(businessId).floorItemCache.push(i);
|
||||||
@@ -2853,7 +2853,7 @@ function cacheBusinessItems(businessId) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Business] Successfully cached ${getBusinessData(businessId).floorItemCache.length} floor items and ${getBusinessData(businessId).storageItemCache} storage items for business ${businessId} (${getBusinessData(businessId).name})!`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Business] Successfully cached ${getBusinessData(businessId).floorItemCache.length} floor items and ${getBusinessData(businessId).storageItemCache} storage items for business ${businessId} (${getBusinessData(businessId).name})!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -2867,7 +2867,8 @@ function getBusinessIdFromDatabaseId(databaseId) {
|
|||||||
|
|
||||||
// Updates all pickup data for a business by businessId
|
// Updates all pickup data for a business by businessId
|
||||||
function updateBusinessPickupLabelData(businessId) {
|
function updateBusinessPickupLabelData(businessId) {
|
||||||
if (!areServerElementsSupported()) {
|
if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE || getGame() == AGRP_GAME_GTA_IV) {
|
||||||
|
sendBusinessToPlayer(null, businessId, getBusinessData(businessId).name, getBusinessData(businessId).entrancePosition, getBusinessEntranceBlipModelForNetworkEvent(businessId), getBusinessEntrancePickupModelForNetworkEvent(businessId), getBusinessData(businessId).buyPrice, getBusinessData(businessId).rentPrice, getBusinessData(businessId).hasInterior, getBusinessData(businessId).locked, doesBusinessHaveAnyItemsToBuy(businessId));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2916,6 +2917,7 @@ function updateBusinessPickupLabelData(businessId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.price", getBusinessData(businessId).buyPrice, true);
|
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.price", getBusinessData(businessId).buyPrice, true);
|
||||||
|
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.fee", getBusinessData(businessId).entranceFee, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3201,3 +3203,33 @@ function doesBusinessHaveBuyableItemOfUseType(businessId, useType) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getBusinessEntranceBlipModelForNetworkEvent(businessIndex) {
|
||||||
|
let blipModelId = -1;
|
||||||
|
if (isGameFeatureSupported("blip")) {
|
||||||
|
blipModelId = getGameConfig().blipSprites[getGame()].Business;
|
||||||
|
|
||||||
|
if (getBusinessData(businessIndex).entranceBlipModel != 0) {
|
||||||
|
blipModelId = getBusinessData(businessIndex).entranceBlipModel;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return blipModelId;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getBusinessEntrancePickupModelForNetworkEvent(businessIndex) {
|
||||||
|
let pickupModelId = -1;
|
||||||
|
if (isGameFeatureSupported("pickup")) {
|
||||||
|
pickupModelId = getGameConfig().pickupModels[getGame()].Business;
|
||||||
|
|
||||||
|
if (getBusinessData(businessIndex).entrancePickupModel != 0) {
|
||||||
|
pickupModelId = getBusinessData(businessIndex).entrancePickupModel;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return pickupModelId;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -118,20 +118,7 @@ function blackJackHitCommand(command, params, client) {
|
|||||||
|
|
||||||
hand.push(deck.pop());
|
hand.push(deck.pop());
|
||||||
|
|
||||||
let tempHandValue = 0;
|
let tempHandValue = getValueOfBlackJackHand(hand);
|
||||||
|
|
||||||
for (let i in hand) {
|
|
||||||
if (hand[i].value == 1) {
|
|
||||||
|
|
||||||
if ((tempHandValue + 11) > 21) {
|
|
||||||
tempHandValue += 1;
|
|
||||||
} else {
|
|
||||||
tempHandValue += 11;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
tempHandValue += hand[i].value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (handValue > 21) {
|
if (handValue > 21) {
|
||||||
playerBustBlackJack(client);
|
playerBustBlackJack(client);
|
||||||
@@ -155,14 +142,6 @@ function blackJackStandCommand(command, params, client) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function blackJackHit(hand, deck) {
|
|
||||||
|
|
||||||
|
|
||||||
return handValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function dealPlayerBlackJackHand(deck, players) {
|
function dealPlayerBlackJackHand(deck, players) {
|
||||||
// Alternate handing cards to each player, 2 cards each
|
// Alternate handing cards to each player, 2 cards each
|
||||||
for (var i = 0; i < 2; i++) {
|
for (var i = 0; i < 2; i++) {
|
||||||
@@ -175,3 +154,22 @@ function dealPlayerBlackJackHand(deck, players) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function calculateValueOfBlackJackHand(hand) {
|
||||||
|
let tempHandValue = 0;
|
||||||
|
|
||||||
|
for (let i in hand) {
|
||||||
|
if (hand[i].value == 1) {
|
||||||
|
|
||||||
|
if ((tempHandValue + 11) > 21) {
|
||||||
|
tempHandValue += 1;
|
||||||
|
} else {
|
||||||
|
tempHandValue += 11;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
tempHandValue += hand[i].value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -9,8 +9,8 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initChatScript() {
|
function initChatScript() {
|
||||||
logToConsole(LOG_INFO, "[VRR.Chat]: Initializing chat script ...");
|
logToConsole(LOG_INFO, "[AGRP.Chat]: Initializing chat script ...");
|
||||||
logToConsole(LOG_INFO, "[VRR.Chat]: Chat script initialized successfully!");
|
logToConsole(LOG_INFO, "[AGRP.Chat]: Chat script initialized successfully!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,7 +174,14 @@ function adminChatCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
messageAdmins(`{jobYellow}[Admin Chat] {ALTCOLOUR}${getPlayerName(client)}: ${params}`);
|
let clients = getClients();
|
||||||
|
for (let i in clients) {
|
||||||
|
if (doesPlayerHaveStaffPermission(clients[i], getStaffFlagValue("BasicModeration"))) {
|
||||||
|
messagePlayerAdminChat(clients[i], client, params);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
messageDiscordAdminChannel(`${getPlayerData(client).accountData.staffTitle} ${getPlayerData(client).accountData.name}: ${messageText}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -217,7 +224,10 @@ function privateMessageCommand(command, params, client) {
|
|||||||
|
|
||||||
getPlayerData(targetClient).privateMessageReplyTo = client;
|
getPlayerData(targetClient).privateMessageReplyTo = client;
|
||||||
messagePlayerPrivateMessage(targetClient, client, messageText);
|
messagePlayerPrivateMessage(targetClient, client, messageText);
|
||||||
messagePlayerTip(client, getLocaleString(client, "PrivateMessageReplyCommandTip", "{ALTCOLOUR}/reply{MAINCOLOUR}"))
|
|
||||||
|
if (!hasPlayerSeenActionTip(targetClient, "ReplyToDirectMessage")) {
|
||||||
|
messagePlayerTip(targetClient, getGroupedLocaleString(targetClient, "ActionTips", "ReplyToDirectMessage", "{ALTCOLOUR}/reply{MAINCOLOUR}"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -240,6 +250,8 @@ function replyToLastPrivateMessageCommand(command, params, client) {
|
|||||||
|
|
||||||
getPlayerData(targetClient).privateMessageReplyTo = client;
|
getPlayerData(targetClient).privateMessageReplyTo = client;
|
||||||
messagePlayerPrivateMessage(targetClient, client, messageText);
|
messagePlayerPrivateMessage(targetClient, client, messageText);
|
||||||
|
|
||||||
|
markPlayerActionTipSeen(client, "ReplyToDirectMessage");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -110,15 +110,15 @@ class ClanMemberData {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initClanScript() {
|
function initClanScript() {
|
||||||
logToConsole(LOG_INFO, "[VRR.Clan]: Initializing clans script ...");
|
logToConsole(LOG_INFO, "[AGRP.Clan]: Initializing clans script ...");
|
||||||
logToConsole(LOG_INFO, "[VRR.Clan]: Clan script initialized successfully!");
|
logToConsole(LOG_INFO, "[AGRP.Clan]: Clan script initialized successfully!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadClansFromDatabase() {
|
function loadClansFromDatabase() {
|
||||||
logToConsole(LOG_INFO, "[VRR.Clan]: Loading clans from database ...");
|
logToConsole(LOG_INFO, "[AGRP.Clan]: Loading clans from database ...");
|
||||||
|
|
||||||
let tempClans = [];
|
let tempClans = [];
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
@@ -133,7 +133,7 @@ function loadClansFromDatabase() {
|
|||||||
//tempClanData.members = loadClanMembersFromDatabase(tempClanData.databaseId);
|
//tempClanData.members = loadClanMembersFromDatabase(tempClanData.databaseId);
|
||||||
tempClanData.ranks = loadClanRanksFromDatabase(tempClanData.databaseId);
|
tempClanData.ranks = loadClanRanksFromDatabase(tempClanData.databaseId);
|
||||||
tempClans.push(tempClanData);
|
tempClans.push(tempClanData);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Clan]: Clan '${tempClanData.name}' loaded from database successfully!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Clan]: Clan '${tempClanData.name}' loaded from database successfully!`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
@@ -141,14 +141,14 @@ function loadClansFromDatabase() {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_INFO, `[VRR.Clan]: ${tempClans.length} clans loaded from database successfully!`);
|
logToConsole(LOG_INFO, `[AGRP.Clan]: ${tempClans.length} clans loaded from database successfully!`);
|
||||||
return tempClans;
|
return tempClans;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadClanMembersFromDatabase() {
|
function loadClanMembersFromDatabase() {
|
||||||
logToConsole(LOG_INFO, "[VRR.Clan]: Loading clans from database ...");
|
logToConsole(LOG_INFO, "[AGRP.Clan]: Loading clans from database ...");
|
||||||
|
|
||||||
let tempClans = [];
|
let tempClans = [];
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
@@ -161,7 +161,7 @@ function loadClanMembersFromDatabase() {
|
|||||||
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
||||||
let tempClanData = new ClanData(dbAssoc);
|
let tempClanData = new ClanData(dbAssoc);
|
||||||
tempClans.push(tempClanData);
|
tempClans.push(tempClanData);
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Clan]: Clan '${tempClanData.name}' loaded from database successfully!`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Clan]: Clan '${tempClanData.name}' loaded from database successfully!`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
@@ -169,14 +169,14 @@ function loadClanMembersFromDatabase() {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_INFO, `[VRR.Clan]: ${tempClans.length} clans loaded from database successfully!`);
|
logToConsole(LOG_INFO, `[AGRP.Clan]: ${tempClans.length} clans loaded from database successfully!`);
|
||||||
return tempClans;
|
return tempClans;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadClanRanksFromDatabase(clanDatabaseId) {
|
function loadClanRanksFromDatabase(clanDatabaseId) {
|
||||||
logToConsole(LOG_INFO, `[VRR.Clan]: Loading ranks for clan ${clanDatabaseId} from database ...`);
|
logToConsole(LOG_INFO, `[AGRP.Clan]: Loading ranks for clan ${clanDatabaseId} from database ...`);
|
||||||
|
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
let dbAssoc;
|
let dbAssoc;
|
||||||
@@ -189,7 +189,7 @@ function loadClanRanksFromDatabase(clanDatabaseId) {
|
|||||||
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
||||||
let tempClanRankData = new ClanRankData(dbAssoc);
|
let tempClanRankData = new ClanRankData(dbAssoc);
|
||||||
tempClanRanks.push(tempClanRankData);
|
tempClanRanks.push(tempClanRankData);
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Clan]: Clan rank '${tempClanRankData.name}' loaded from database successfully!`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Clan]: Clan rank '${tempClanRankData.name}' loaded from database successfully!`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
@@ -197,7 +197,7 @@ function loadClanRanksFromDatabase(clanDatabaseId) {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_INFO, `[VRR.Clan]: Loaded ranks for clan ${clanDatabaseId} from database successfully!`);
|
logToConsole(LOG_INFO, `[AGRP.Clan]: Loaded ranks for clan ${clanDatabaseId} from database successfully!`);
|
||||||
return tempClanRanks;
|
return tempClanRanks;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1292,10 +1292,10 @@ function setClanRankTitle(clanId, rankId, title) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function saveAllClansToDatabase() {
|
function saveAllClansToDatabase() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Clan]: Saving all server clans to database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Clan]: Saving all server clans to database ...`);
|
||||||
|
|
||||||
if (getServerConfig().devServer) {
|
if (getServerConfig().devServer) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Clan]: Aborting save all clans to database, dev server is enabled.`);
|
logToConsole(LOG_DEBUG, `[AGRP.Clan]: Aborting save all clans to database, dev server is enabled.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1303,7 +1303,7 @@ function saveAllClansToDatabase() {
|
|||||||
saveClanToDatabase(i);
|
saveClanToDatabase(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_INFO, `[VRR.Clan]: Saved all server clans to database`);
|
logToConsole(LOG_INFO, `[AGRP.Clan]: Saved all server clans to database`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -17,13 +17,12 @@ const AGRP_RETURNTO_TYPE_SKINSELECT = 2; // "Return to" data is from sk
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @class Representing extra data for a client
|
* @class Representing extra data for a client
|
||||||
|
* @property {AccountData} accountData
|
||||||
|
* @property {Array.<SubAccountData>} subAccounts
|
||||||
*/
|
*/
|
||||||
class ClientData {
|
class ClientData {
|
||||||
constructor(client, accountData, subAccounts) {
|
constructor(client, accountData, subAccounts) {
|
||||||
/** @member {AccountData} accountData */
|
|
||||||
this.accountData = accountData;
|
this.accountData = accountData;
|
||||||
|
|
||||||
/** @member {Array.<SubAccountData>} subAccounts */
|
|
||||||
this.subAccounts = subAccounts; // Characters
|
this.subAccounts = subAccounts; // Characters
|
||||||
|
|
||||||
// General Info
|
// General Info
|
||||||
@@ -116,7 +115,7 @@ class ClientData {
|
|||||||
|
|
||||||
// Misc
|
// Misc
|
||||||
this.changingCharacterName = false;
|
this.changingCharacterName = false;
|
||||||
this.currentPickup = false;
|
this.currentPickup = null;
|
||||||
this.usingSkinSelect = false;
|
this.usingSkinSelect = false;
|
||||||
this.keyBinds = [];
|
this.keyBinds = [];
|
||||||
this.incomingDamageMultiplier = 1;
|
this.incomingDamageMultiplier = 1;
|
||||||
@@ -126,12 +125,14 @@ class ClientData {
|
|||||||
this.locale = 0;
|
this.locale = 0;
|
||||||
this.enteringVehicle = null;
|
this.enteringVehicle = null;
|
||||||
this.customDisconnectReason = "";
|
this.customDisconnectReason = "";
|
||||||
this.interiorCutscene = -1;
|
this.scene = "";
|
||||||
this.playerBlip = null;
|
this.playerBlip = null;
|
||||||
this.alcoholLevel = 0;
|
this.alcoholLevel = 0;
|
||||||
this.pedState = AGRP_PEDSTATE_NONE;
|
this.pedState = AGRP_PEDSTATE_NONE;
|
||||||
this.promptType = AGRP_PROMPT_NONE;
|
this.promptType = AGRP_PROMPT_NONE;
|
||||||
this.privateMessageReplyTo = null;
|
this.privateMessageReplyTo = null;
|
||||||
|
this.enteringExitingProperty = null;
|
||||||
|
this.inProperty = null;
|
||||||
|
|
||||||
// Paintball
|
// Paintball
|
||||||
this.inPaintBall = false;
|
this.inPaintBall = false;
|
||||||
@@ -155,14 +156,14 @@ class ClientData {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initClientScript() {
|
function initClientScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Client]: Initializing client script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.Client]: Initializing client script ...");
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Client]: Client script initialized!");
|
logToConsole(LOG_DEBUG, "[AGRP.Client]: Client script initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function resetClientStuff(client) {
|
function resetClientStuff(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Resetting client data for ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Resetting client data for ${getPlayerDisplayForConsole(client)}`);
|
||||||
|
|
||||||
if (!getPlayerData(client)) {
|
if (!getPlayerData(client)) {
|
||||||
return false;
|
return false;
|
||||||
@@ -172,24 +173,128 @@ function resetClientStuff(client) {
|
|||||||
stopJobRoute(client, false, false);
|
stopJobRoute(client, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isPlayerWorking(client)) {
|
||||||
|
stopWorking(client);
|
||||||
|
}
|
||||||
|
|
||||||
if (getPlayerData(client).rentingVehicle) {
|
if (getPlayerData(client).rentingVehicle) {
|
||||||
stopRentingVehicle(client);
|
stopRentingVehicle(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isPlayerInPaintBall(client)) {
|
||||||
|
stopPaintBall(client);
|
||||||
|
}
|
||||||
|
|
||||||
|
//if (isPlayerFishing(client)) {
|
||||||
|
// stopFishing(client);
|
||||||
|
//}
|
||||||
|
|
||||||
deleteJobItems(client);
|
deleteJobItems(client);
|
||||||
deletePaintBallItems(client);
|
deletePaintBallItems(client);
|
||||||
//deletePlayerTemporaryLockerItems(client);
|
//deletePlayerTemporaryLockerItems(client);
|
||||||
|
|
||||||
getPlayerData(client).lastVehicle = null;
|
//getPlayerData(client).lastVehicle = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function kickAllClients() {
|
function kickAllClients() {
|
||||||
getClients().forEach((client) => {
|
getClients().forEach((client) => {
|
||||||
getPlayerData(client).customDisconnectReason = `Kicked - All clients are being disconnected`;
|
getPlayerData(client).customDisconnectReason = "ServerRestarting";
|
||||||
disconnectPlayer(client);
|
disconnectPlayer(client);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function initClient(client) {
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Account] Initializing client ${getPlayerDisplayForConsole(client)} ...`);
|
||||||
|
|
||||||
|
if (isConsole(client)) {
|
||||||
|
logToConsole(LOG_DEBUG | LOG_ERROR, `[AGRP.Account] Client initialization failed for ${getPlayerDisplayForConsole(client)}! (is console client)`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (playerInitialized[client.index] == true) {
|
||||||
|
logToConsole(LOG_DEBUG | LOG_ERROR, `[AGRP.Account] Client initialization failed for ${getPlayerDisplayForConsole(client)}! (already initialized)`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
playerInitialized[client.index] = true;
|
||||||
|
|
||||||
|
//setEntityData(client, "agrp.isInitialized", true, false);
|
||||||
|
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Account] Initializing GUI for ${getPlayerDisplayForConsole(client)} ...`);
|
||||||
|
sendPlayerCurrencyString(client);
|
||||||
|
sendPlayerGUIColours(client);
|
||||||
|
sendPlayerGUIInit(client);
|
||||||
|
updatePlayerSnowState(client, getServerConfig().groundSnow);
|
||||||
|
|
||||||
|
//logToConsole(LOG_DEBUG, `[AGRP.Account] Showing connect camera to ${getPlayerDisplayForConsole(client)} ...`);
|
||||||
|
//showConnectCameraToPlayer(client);
|
||||||
|
|
||||||
|
messageClient(`Please wait ...`, client, getColourByName("softGreen"));
|
||||||
|
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Account] Waiting for 2.5 seconds to prevent race attack ...`);
|
||||||
|
setTimeout(function () {
|
||||||
|
if (client != null) {
|
||||||
|
clearChatBox(client);
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Account] Loading account for ${getPlayerDisplayForConsole(client)}`);
|
||||||
|
let tempAccountData = loadAccountFromName(getPlayerName(client), true);
|
||||||
|
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Account] Loading subaccounts for ${getPlayerDisplayForConsole(client)}`);
|
||||||
|
let tempSubAccounts = loadSubAccountsFromAccount(tempAccountData.databaseId);
|
||||||
|
|
||||||
|
getServerData().clients[getPlayerId(client)] = new ClientData(client, tempAccountData, tempSubAccounts);
|
||||||
|
|
||||||
|
getServerData().clients[getPlayerId(client)].sessionId = saveConnectionToDatabase(client);
|
||||||
|
getServerData().clients[getPlayerId(client)].connectTime = getCurrentUnixTimestamp();
|
||||||
|
requestClientInfo(client);
|
||||||
|
|
||||||
|
if (tempAccountData != false) {
|
||||||
|
sendPlayerLocaleId(client, getPlayerData(client).accountData.locale);
|
||||||
|
if (isAccountAutoIPLoginEnabled(tempAccountData) && getPlayerData(client).accountData.ipAddress == getPlayerIP(client)) {
|
||||||
|
messagePlayerAlert(client, getLocaleString(client, "AutoLoggedInIP"));
|
||||||
|
loginSuccess(client);
|
||||||
|
playRadioStreamForPlayer(client, getServerIntroMusicURL(), true, getPlayerStreamingRadioVolume(client));
|
||||||
|
} else {
|
||||||
|
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI.`);
|
||||||
|
showPlayerLoginGUI(client);
|
||||||
|
} else {
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.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(getGlobalConfig().geoIPCountryDatabaseFilePath, getPlayerIP(client));
|
||||||
|
let localeId = getLocaleFromCountryISO(iso);
|
||||||
|
|
||||||
|
if (localeId != 0) {
|
||||||
|
if (getLocaleData(localeId).enabled) {
|
||||||
|
messagePlayerTip(client, getLanguageLocaleString(localeId, "LocaleOffer", `/lang ${getLocaleData(localeId).isoCode}`), getColourByName("white"), 10000, "Roboto");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
startLoginTimeoutForPlayer(client);
|
||||||
|
playRadioStreamForPlayer(client, getServerIntroMusicURL(), true, getPlayerStreamingRadioVolume(client));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
sendPlayerLocaleId(client, 0);
|
||||||
|
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register GUI.`);
|
||||||
|
showPlayerRegistrationGUI(client);
|
||||||
|
} else {
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register message (GUI disabled).`);
|
||||||
|
messagePlayerNormal(client, getLocaleString(client, "WelcomeNewPlayer", getServerName(), getPlayerName(client), "/register"), getColourByName("softGreen"));
|
||||||
|
}
|
||||||
|
playRadioStreamForPlayer(client, getServerIntroMusicURL(), true, getPlayerStreamingRadioVolume(client));
|
||||||
|
}
|
||||||
|
|
||||||
|
getServerData().clients[getPlayerId(client)].keyBinds = loadAccountKeybindsFromDatabase(getServerData().clients[getPlayerId(client)].accountData.databaseId);
|
||||||
|
sendAccountKeyBindsToClient(client);
|
||||||
|
}
|
||||||
|
}, 2500);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -44,8 +44,8 @@ let serverCommands = [];
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initCommandScript() {
|
function initCommandScript() {
|
||||||
logToConsole(LOG_INFO, "[VRR.Command]: Initializing commands script ...");
|
logToConsole(LOG_INFO, "[AGRP.Command]: Initializing commands script ...");
|
||||||
logToConsole(LOG_INFO, "[VRR.Command]: Initialized commands script!");
|
logToConsole(LOG_INFO, "[AGRP.Command]: Initialized commands script!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -77,9 +77,12 @@ function loadCommands() {
|
|||||||
new CommandData("chattimestamps", toggleChatBoxTimeStampsCommand, "", getStaffFlagValue("None"), true, false, "Turns on/off timestamps in the chatbox"),
|
new CommandData("chattimestamps", toggleChatBoxTimeStampsCommand, "", getStaffFlagValue("None"), true, false, "Turns on/off timestamps in the chatbox"),
|
||||||
new CommandData("chattime", toggleChatBoxTimeStampsCommand, "", getStaffFlagValue("None"), true, false, "Turns on/off timestamps in the chatbox"),
|
new CommandData("chattime", toggleChatBoxTimeStampsCommand, "", getStaffFlagValue("None"), true, false, "Turns on/off timestamps in the chatbox"),
|
||||||
new CommandData("chattimes", toggleChatBoxTimeStampsCommand, "", getStaffFlagValue("None"), true, false, "Turns on/off timestamps in the chatbox"),
|
new CommandData("chattimes", toggleChatBoxTimeStampsCommand, "", getStaffFlagValue("None"), true, false, "Turns on/off timestamps in the chatbox"),
|
||||||
|
new CommandData("chattimestamps", toggleChatBoxTimeStampsCommand, "", getStaffFlagValue("None"), true, false, "Turns on/off timestamps in the chatbox"),
|
||||||
new CommandData("chatfilter", toggleAccountProfanityFilterCommand, "", getStaffFlagValue("None"), true, false, "Turns on/off profanity filter"),
|
new CommandData("chatfilter", toggleAccountProfanityFilterCommand, "", getStaffFlagValue("None"), true, false, "Turns on/off profanity filter"),
|
||||||
new CommandData("chatemoji", toggleAccountReplaceEmojiCommand, "", getStaffFlagValue("None"), true, false, "Turns on/off automatic emoji"),
|
new CommandData("chatemoji", toggleAccountReplaceEmojiCommand, "", getStaffFlagValue("None"), true, false, "Turns on/off automatic emoji"),
|
||||||
new CommandData("emoji", toggleAccountReplaceEmojiCommand, "", getStaffFlagValue("None"), true, false, "Turns on/off automatic emoji"),
|
new CommandData("emoji", toggleAccountReplaceEmojiCommand, "", getStaffFlagValue("None"), true, false, "Turns on/off automatic emoji"),
|
||||||
|
//new CommandData("resetkeybinds", resetKeyBindsCommand, "", getStaffFlagValue("None"), true, false, "Resets all your keybinds to default"),
|
||||||
|
//new CommandData("copykeybinds", copyKeyBindsToServerCommand, "<server id>", getStaffFlagValue("None"), true, false, "Copies all your current keybinds to another server"),
|
||||||
//new CommandData("noblood", toggleAccountHideBloodCommand, "", getStaffFlagValue("None"), true, false, "Turns on/off blood in-game"),
|
//new CommandData("noblood", toggleAccountHideBloodCommand, "", getStaffFlagValue("None"), true, false, "Turns on/off blood in-game"),
|
||||||
],
|
],
|
||||||
ammunation: [],
|
ammunation: [],
|
||||||
@@ -137,7 +140,7 @@ function loadCommands() {
|
|||||||
new CommandData("bizpickup", setBusinessPickupCommand, "<type name/model id>", getStaffFlagValue("ManageBusinesses"), true, true, "Sets the business pickup display"),
|
new CommandData("bizpickup", setBusinessPickupCommand, "<type name/model id>", getStaffFlagValue("ManageBusinesses"), true, true, "Sets the business pickup display"),
|
||||||
new CommandData("bizinfo", getBusinessInfoCommand, "[business id]", getStaffFlagValue("None"), true, true, "Shows business information"),
|
new CommandData("bizinfo", getBusinessInfoCommand, "[business id]", getStaffFlagValue("None"), true, true, "Shows business information"),
|
||||||
new CommandData("bizflooritems", getBusinessFloorItemsCommand, "[business id]", getStaffFlagValue("None"), true, true, "Shows all business floor items (for sale) to a player"),
|
new CommandData("bizflooritems", getBusinessFloorItemsCommand, "[business id]", getStaffFlagValue("None"), true, true, "Shows all business floor items (for sale) to a player"),
|
||||||
new CommandData("bizflooritems", getBusinessStorageItemsCommand, "[business id]", getStaffFlagValue("None"), true, true, "Shows all business storage items (i.e. back room) to a player"),
|
new CommandData("bizstorageitems", getBusinessStorageItemsCommand, "[business id]", getStaffFlagValue("None"), true, true, "Shows all business storage items (i.e. back room) to a player"),
|
||||||
new CommandData("bizentrance", moveBusinessEntranceCommand, "", getStaffFlagValue("ManageBusinesses"), true, true, "Moves the entrance (exterior point) of the business"),
|
new CommandData("bizentrance", moveBusinessEntranceCommand, "", getStaffFlagValue("ManageBusinesses"), true, true, "Moves the entrance (exterior point) of the business"),
|
||||||
new CommandData("bizexit", moveBusinessExitCommand, "", getStaffFlagValue("ManageBusinesses"), true, true, "Moves the exit (interior point) of the business"),
|
new CommandData("bizexit", moveBusinessExitCommand, "", getStaffFlagValue("ManageBusinesses"), true, true, "Moves the exit (interior point) of the business"),
|
||||||
new CommandData("bizinttype", setBusinessInteriorTypeCommand, "<interior template name/business id>", getStaffFlagValue("ManageBusinesses"), true, true, "Changes the business interior"),
|
new CommandData("bizinttype", setBusinessInteriorTypeCommand, "<interior template name/business id>", getStaffFlagValue("ManageBusinesses"), true, true, "Changes the business interior"),
|
||||||
@@ -160,9 +163,6 @@ function loadCommands() {
|
|||||||
new CommandData("clanchat", clanChatCommand, "<message>", getStaffFlagValue("None"), true, false, "Sends an OOC chat message to members in your clan"),
|
new CommandData("clanchat", clanChatCommand, "<message>", getStaffFlagValue("None"), true, false, "Sends an OOC chat message to members in your clan"),
|
||||||
new CommandData("clan", clanChatCommand, "<message>", getStaffFlagValue("None"), true, false, "Sends an OOC chat message to members in your clan"),
|
new CommandData("clan", clanChatCommand, "<message>", getStaffFlagValue("None"), true, false, "Sends an OOC chat message to members in your clan"),
|
||||||
new CommandData("c", clanChatCommand, "<message>", getStaffFlagValue("None"), true, false, "Sends an OOC chat message to members in your clan"),
|
new CommandData("c", clanChatCommand, "<message>", getStaffFlagValue("None"), true, false, "Sends an OOC chat message to members in your clan"),
|
||||||
new CommandData("adminchat", adminChatCommand, "<message>", getStaffFlagValue("BasicModeration"), true, true, "Sends an OOC chat message to other admins"),
|
|
||||||
new CommandData("a", adminChatCommand, "<message>", getStaffFlagValue("BasicModeration"), true, true, "Sends an OOC chat message to other admins"),
|
|
||||||
new CommandData("achat", adminChatCommand, "<message>", getStaffFlagValue("BasicModeration"), true, true, "Sends an OOC chat message to other admins"),
|
|
||||||
new CommandData("m", megaphoneChatCommand, "<message>", getStaffFlagValue("None"), true, true, "Shouts a message over a megaphone (portable bullhorn/loudspeaker)"),
|
new CommandData("m", megaphoneChatCommand, "<message>", getStaffFlagValue("None"), true, true, "Shouts a message over a megaphone (portable bullhorn/loudspeaker)"),
|
||||||
new CommandData("pm", privateMessageCommand, "<player name/id> <message>", getStaffFlagValue("None"), true, true, "Sends a private message to a player"),
|
new CommandData("pm", privateMessageCommand, "<player name/id> <message>", getStaffFlagValue("None"), true, true, "Sends a private message to a player"),
|
||||||
new CommandData("dm", privateMessageCommand, "<player name/id> <message>", getStaffFlagValue("None"), true, true, "Sends a private message to a player"),
|
new CommandData("dm", privateMessageCommand, "<player name/id> <message>", getStaffFlagValue("None"), true, true, "Sends a private message to a player"),
|
||||||
@@ -355,6 +355,7 @@ function loadCommands() {
|
|||||||
new CommandData("itemtypeorderprice", setItemTypeOrderPriceCommand, "<item type> <order price>", getStaffFlagValue("ManageItems"), true, false, "Sets an item type's order price (base price when ordering for a business"),
|
new CommandData("itemtypeorderprice", setItemTypeOrderPriceCommand, "<item type> <order price>", getStaffFlagValue("ManageItems"), true, false, "Sets an item type's order price (base price when ordering for a business"),
|
||||||
new CommandData("itemtyperiskmult", setItemTypeRiskMultiplierCommand, "<item type> <risk multiplier>", getStaffFlagValue("ManageItems"), true, false, "Sets an item type's risk multiplayer (higher value for more dangerous or rare illegal items)"),
|
new CommandData("itemtyperiskmult", setItemTypeRiskMultiplierCommand, "<item type> <risk multiplier>", getStaffFlagValue("ManageItems"), true, false, "Sets an item type's risk multiplayer (higher value for more dangerous or rare illegal items)"),
|
||||||
new CommandData("itemtypeenabled", toggleItemTypeEnabledCommand, "<item type>", getStaffFlagValue("ManageItems"), true, false, "Toggles an item type on or off (if off, any items with that type can't be interacted with)"),
|
new CommandData("itemtypeenabled", toggleItemTypeEnabledCommand, "<item type>", getStaffFlagValue("ManageItems"), true, false, "Toggles an item type on or off (if off, any items with that type can't be interacted with)"),
|
||||||
|
new CommandData("itemtypedropmodel", setItemTypeDropModelCommand, "<item type> <object name/id>", getStaffFlagValue("ManageItems"), true, false, "Sets the drop model for the object of an item type when dropped"),
|
||||||
new CommandData("itemtypedroppos", setItemTypeDropPositionCommand, "<item type> [x] [y] [z]", getStaffFlagValue("ManageItems"), true, false, "Sets the offset position for the object of an item type when dropped"),
|
new CommandData("itemtypedroppos", setItemTypeDropPositionCommand, "<item type> [x] [y] [z]", getStaffFlagValue("ManageItems"), true, false, "Sets the offset position for the object of an item type when dropped"),
|
||||||
new CommandData("itemtypedroprot", setItemTypeDropRotationCommand, "<item type> [x] [y] [z]", getStaffFlagValue("ManageItems"), true, false, "Sets the rotation for the object of an item type when dropped"),
|
new CommandData("itemtypedroprot", setItemTypeDropRotationCommand, "<item type> [x] [y] [z]", getStaffFlagValue("ManageItems"), true, false, "Sets the rotation for the object of an item type when dropped"),
|
||||||
new CommandData("itemtypedropscale", setItemTypeDropScaleCommand, "<item type> [x] [y] [z]", getStaffFlagValue("ManageItems"), true, false, "Sets the scale for the object of an item type when dropped"),
|
new CommandData("itemtypedropscale", setItemTypeDropScaleCommand, "<item type> [x] [y] [z]", getStaffFlagValue("ManageItems"), true, false, "Sets the scale for the object of an item type when dropped"),
|
||||||
@@ -362,7 +363,7 @@ function loadCommands() {
|
|||||||
new CommandData("itemtypemaxval", setItemTypeMaxValueCommand, "<item type> <max value>", getStaffFlagValue("ManageItems"), true, false, "Sets the maximum value an item type can have"),
|
new CommandData("itemtypemaxval", setItemTypeMaxValueCommand, "<item type> <max value>", getStaffFlagValue("ManageItems"), true, false, "Sets the maximum value an item type can have"),
|
||||||
new CommandData("itemtypeorderval", setItemTypeOrderValueCommand, "<item type> <order value>", getStaffFlagValue("ManageItems"), true, false, "Sets the initial value of an item type when ordered by a business"),
|
new CommandData("itemtypeorderval", setItemTypeOrderValueCommand, "<item type> <order value>", getStaffFlagValue("ManageItems"), true, false, "Sets the initial value of an item type when ordered by a business"),
|
||||||
new CommandData("itemtypesize", setItemTypeSizeCommand, "<item type> <order value>", getStaffFlagValue("ManageItems"), true, false, "Sets the item type's size"),
|
new CommandData("itemtypesize", setItemTypeSizeCommand, "<item type> <order value>", getStaffFlagValue("ManageItems"), true, false, "Sets the item type's size"),
|
||||||
new CommandData("itemtypecapacity", setItemTypeSizeCommand, "<item type> <order value>", getStaffFlagValue("ManageItems"), true, false, "Sets an item type's capacity (how much it can hold)"),
|
new CommandData("itemtypecapacity", setItemTypeCapacityCommand, "<item type> <order value>", getStaffFlagValue("ManageItems"), true, false, "Sets an item type's capacity (how much it can hold)"),
|
||||||
|
|
||||||
new CommandData("delplritem", deleteItemInPlayerInventoryCommand, "<player name/id> <item slot>", getStaffFlagValue("ManageItems"), true, false, "Removes an item by slot from a player's personal inventory"),
|
new CommandData("delplritem", deleteItemInPlayerInventoryCommand, "<player name/id> <item slot>", getStaffFlagValue("ManageItems"), true, false, "Removes an item by slot from a player's personal inventory"),
|
||||||
new CommandData("delplritems", deleteAllItemsInPlayerInventoryCommand, "<player name/id>", getStaffFlagValue("ManageItems"), true, false, "Removes all items from a player's personal inventory"),
|
new CommandData("delplritems", deleteAllItemsInPlayerInventoryCommand, "<player name/id>", getStaffFlagValue("ManageItems"), true, false, "Removes all items from a player's personal inventory"),
|
||||||
@@ -461,6 +462,7 @@ function loadCommands() {
|
|||||||
new CommandData("idea", submitIdeaCommand, "<message>", getStaffFlagValue("None"), true, true, "Sends an suggestion/idea to the developers"),
|
new CommandData("idea", submitIdeaCommand, "<message>", getStaffFlagValue("None"), true, true, "Sends an suggestion/idea to the developers"),
|
||||||
new CommandData("bug", submitBugReportCommand, "<message>", getStaffFlagValue("None"), true, true, "Submits a bug report"),
|
new CommandData("bug", submitBugReportCommand, "<message>", getStaffFlagValue("None"), true, true, "Submits a bug report"),
|
||||||
new CommandData("enter", enterExitPropertyCommand, "", getStaffFlagValue("None"), true, true, "Enters or exists a house/business"),
|
new CommandData("enter", enterExitPropertyCommand, "", getStaffFlagValue("None"), true, true, "Enters or exists a house/business"),
|
||||||
|
new CommandData("exit", enterExitPropertyCommand, "", getStaffFlagValue("None"), true, true, "Enters or exists a house/business"),
|
||||||
new CommandData("cursor", toggleMouseCursorCommand, "", getStaffFlagValue("None"), true, false, "Toggles cursor visibility"),
|
new CommandData("cursor", toggleMouseCursorCommand, "", getStaffFlagValue("None"), true, false, "Toggles cursor visibility"),
|
||||||
new CommandData("mousecam", toggleMouseCameraCommand, "", getStaffFlagValue("None"), true, false, "Toggles vehicle mouse camera for games that don't have it"),
|
new CommandData("mousecam", toggleMouseCameraCommand, "", getStaffFlagValue("None"), true, false, "Toggles vehicle mouse camera for games that don't have it"),
|
||||||
new CommandData("yes", playerPromptAnswerYesCommand, "", getStaffFlagValue("None"), true, false, "Answers a prompt with YES"),
|
new CommandData("yes", playerPromptAnswerYesCommand, "", getStaffFlagValue("None"), true, false, "Answers a prompt with YES"),
|
||||||
@@ -514,6 +516,9 @@ function loadCommands() {
|
|||||||
],
|
],
|
||||||
security: [],
|
security: [],
|
||||||
staff: [
|
staff: [
|
||||||
|
new CommandData("adminchat", adminChatCommand, "<message>", getStaffFlagValue("BasicModeration"), true, true, "Sends an OOC chat message to other admins"),
|
||||||
|
new CommandData("a", adminChatCommand, "<message>", getStaffFlagValue("BasicModeration"), true, true, "Sends an OOC chat message to other admins"),
|
||||||
|
new CommandData("achat", adminChatCommand, "<message>", getStaffFlagValue("BasicModeration"), true, true, "Sends an OOC chat message to other admins"),
|
||||||
new CommandData("kick", kickClientCommand, "<player name/id> [reason]", getStaffFlagValue("BasicModeration"), true, true, "Kicks a player from the server"),
|
new CommandData("kick", kickClientCommand, "<player name/id> [reason]", getStaffFlagValue("BasicModeration"), true, true, "Kicks a player from the server"),
|
||||||
new CommandData("mute", muteClientCommand, "<player name/id> [reason]", getStaffFlagValue("BasicModeration"), true, true, "Mutes a player, preventing them from using any chat."),
|
new CommandData("mute", muteClientCommand, "<player name/id> [reason]", getStaffFlagValue("BasicModeration"), true, true, "Mutes a player, preventing them from using any chat."),
|
||||||
new CommandData("freeze", freezeClientCommand, "<player name/id> [reason]", getStaffFlagValue("BasicModeration"), true, true, "Freeze a player, preventing them from moving."),
|
new CommandData("freeze", freezeClientCommand, "<player name/id> [reason]", getStaffFlagValue("BasicModeration"), true, true, "Freeze a player, preventing them from moving."),
|
||||||
@@ -590,6 +595,7 @@ function loadCommands() {
|
|||||||
new CommandData("biz", getPlayerCurrentBusinessCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Gets which business a player is at/in"),
|
new CommandData("biz", getPlayerCurrentBusinessCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Gets which business a player is at/in"),
|
||||||
new CommandData("business", getPlayerCurrentBusinessCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Gets which business a player is at/in"),
|
new CommandData("business", getPlayerCurrentBusinessCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Gets which business a player is at/in"),
|
||||||
new CommandData("house", getPlayerCurrentHouseCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Gets which house a player is at/in"),
|
new CommandData("house", getPlayerCurrentHouseCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Gets which house a player is at/in"),
|
||||||
|
//new CommandData("clearchat", clearChatCommand, "", getStaffFlagValue("None"), true, true, "Clears the chat"),
|
||||||
],
|
],
|
||||||
startup: [],
|
startup: [],
|
||||||
subAccount: [
|
subAccount: [
|
||||||
@@ -632,7 +638,7 @@ function loadCommands() {
|
|||||||
new CommandData("vehowner", setVehicleOwnerCommand, "<player id/name>", getStaffFlagValue("ManageVehicles"), true, true),
|
new CommandData("vehowner", setVehicleOwnerCommand, "<player id/name>", getStaffFlagValue("ManageVehicles"), true, true),
|
||||||
new CommandData("vehpublic", setVehiclePublicCommand, "", getStaffFlagValue("ManageVehicles"), true, true),
|
new CommandData("vehpublic", setVehiclePublicCommand, "", getStaffFlagValue("ManageVehicles"), true, true),
|
||||||
new CommandData("vehclan", setVehicleClanCommand, "<clan id/name>", getStaffFlagValue(""), true, true),
|
new CommandData("vehclan", setVehicleClanCommand, "<clan id/name>", getStaffFlagValue(""), true, true),
|
||||||
new CommandData("vehbiz", setVehicleToBusinessCommand, "", getStaffFlagValue(""), true, true),
|
new CommandData("vehbiz", setVehicleBusinessCommand, "", getStaffFlagValue(""), true, true),
|
||||||
new CommandData("vehjob", setVehicleJobCommand, "[job id/name]", getStaffFlagValue("ManageVehicles"), true, true),
|
new CommandData("vehjob", setVehicleJobCommand, "[job id/name]", getStaffFlagValue("ManageVehicles"), true, true),
|
||||||
new CommandData("vehdelowner", removeVehicleOwnerCommand, "", getStaffFlagValue("ManageVehicles"), true, true),
|
new CommandData("vehdelowner", removeVehicleOwnerCommand, "", getStaffFlagValue("ManageVehicles"), true, true),
|
||||||
new CommandData("vehrank", setVehicleRankCommand, "<rank id/name>", getStaffFlagValue("None"), true, true),
|
new CommandData("vehrank", setVehicleRankCommand, "<rank id/name>", getStaffFlagValue("None"), true, true),
|
||||||
@@ -688,7 +694,6 @@ function loadCommands() {
|
|||||||
new CommandData("vehiclerepair", vehicleAdminRepairCommand, "", getStaffFlagValue("None"), true, true, "Repairs your vehicle"),
|
new CommandData("vehiclerepair", vehicleAdminRepairCommand, "", getStaffFlagValue("None"), true, true, "Repairs your vehicle"),
|
||||||
new CommandData("repairveh", vehicleAdminRepairCommand, "", getStaffFlagValue("None"), true, true, "Repairs your vehicle"),
|
new CommandData("repairveh", vehicleAdminRepairCommand, "", getStaffFlagValue("None"), true, true, "Repairs your vehicle"),
|
||||||
new CommandData("repairvehicle", vehicleAdminRepairCommand, "", getStaffFlagValue("None"), true, true, "Repairs your vehicle"),
|
new CommandData("repairvehicle", vehicleAdminRepairCommand, "", getStaffFlagValue("None"), true, true, "Repairs your vehicle"),
|
||||||
|
|
||||||
new CommandData("passenger", enterVehicleAsPassengerCommand, "", getStaffFlagValue("None"), true, true, "Enters a vehicle as passenger"),
|
new CommandData("passenger", enterVehicleAsPassengerCommand, "", getStaffFlagValue("None"), true, true, "Enters a vehicle as passenger"),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
@@ -703,7 +708,7 @@ function addAllCommandHandlers() {
|
|||||||
let commands = getCommands();
|
let commands = getCommands();
|
||||||
for (let i in commands) {
|
for (let i in commands) {
|
||||||
for (let j in commands[i]) {
|
for (let j in commands[i]) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Command] Adding command handler for ${i} - ${commands[i][j].command}`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Command] Adding command handler for ${i} - ${commands[i][j].command}`);
|
||||||
addCommandHandler(commands[i][j].command, processPlayerCommand);
|
addCommandHandler(commands[i][j].command, processPlayerCommand);
|
||||||
commandCount++;
|
commandCount++;
|
||||||
}
|
}
|
||||||
@@ -712,11 +717,14 @@ function addAllCommandHandlers() {
|
|||||||
removeCommandHandler("help");
|
removeCommandHandler("help");
|
||||||
addCommandHandler("help", helpCommand);
|
addCommandHandler("help", helpCommand);
|
||||||
|
|
||||||
logToConsole(LOG_INFO, `[VRR.Command] ${commandCount} command handlers added!`);
|
logToConsole(LOG_INFO, `[AGRP.Command] ${commandCount} command handlers added!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {CommandData} command
|
||||||
|
*/
|
||||||
function getCommand(command) {
|
function getCommand(command) {
|
||||||
let commandGroups = getCommands()
|
let commandGroups = getCommands()
|
||||||
for (let i in commandGroups) {
|
for (let i in commandGroups) {
|
||||||
@@ -733,6 +741,9 @@ function getCommand(command) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {CommandData} command
|
||||||
|
*/
|
||||||
function getCommandData(command) {
|
function getCommandData(command) {
|
||||||
return getCommand(command);
|
return getCommand(command);
|
||||||
}
|
}
|
||||||
@@ -789,7 +800,7 @@ function disableCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getCommand(params).enabled = false;
|
getCommand(params).enabled = false;
|
||||||
messagePlayerSuccess(client, `Command {ALTCOLOUR}/${params} {MAINCOLOUR}has been disabled!`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} disabled the {ALTCOLOUR}${params}{MAINCOLOUR} command!`, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -809,7 +820,7 @@ function enableCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getCommand(params).enabled = true;
|
getCommand(params).enabled = true;
|
||||||
messagePlayerSuccess(client, `Command {ALTCOLOUR}/${params} {MAINCOLOUR}has been enabled!`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} enabled the {ALTCOLOUR}${params}{MAINCOLOUR} command!`, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -832,7 +843,7 @@ function disableAllCommandsByType(command, params, client) {
|
|||||||
getServerData().commands[params][i].enabled = false;
|
getServerData().commands[params][i].enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
messagePlayerSuccess(client, `{clanOrange}All {ALTCOLOUR}${params} {MAINCOLOUR}commands have been disabled!`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} disabled all {ALTCOLOUR}${params}{MAINCOLOUR} commands!`, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -855,7 +866,7 @@ function enableAllCommandsByType(command, params, client) {
|
|||||||
getServerData().commands[params][i].enabled = true;
|
getServerData().commands[params][i].enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
messagePlayerSuccess(client, `{clanOrange}All {ALTCOLOUR}${params} {MAINCOLOUR}commands have been enabled!`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} enabled all {ALTCOLOUR}${params}{MAINCOLOUR} commands!`, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -880,7 +891,7 @@ function processPlayerCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!doesCommandExist(toLowerCase(command))) {
|
if (!doesCommandExist(toLowerCase(command))) {
|
||||||
logToConsole(LOG_WARN, `[VRR.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (invalid command): /${command} ${paramsDisplay}`);
|
logToConsole(LOG_WARN, `[AGRP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (invalid command): /${command} ${paramsDisplay}`);
|
||||||
|
|
||||||
let possibleCommand = getCommandFromParams(command);
|
let possibleCommand = getCommandFromParams(command);
|
||||||
if (possibleCommand != false && doesPlayerHaveStaffPermission(client, getCommandRequiredPermissions(toLowerCase(possibleCommand.command)))) {
|
if (possibleCommand != false && doesPlayerHaveStaffPermission(client, getCommandRequiredPermissions(toLowerCase(possibleCommand.command)))) {
|
||||||
@@ -892,7 +903,7 @@ function processPlayerCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!commandData.enabled) {
|
if (!commandData.enabled) {
|
||||||
logToConsole(LOG_WARN, `[VRR.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (command is disabled): /${command} ${paramsDisplay}`);
|
logToConsole(LOG_WARN, `[AGRP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (command is disabled): /${command} ${paramsDisplay}`);
|
||||||
messagePlayerError(client, `The command {ALTCOLOUR}/${command}{MAINCOLOUR} is disabled!`);
|
messagePlayerError(client, `The command {ALTCOLOUR}/${command}{MAINCOLOUR} is disabled!`);
|
||||||
messagePlayerError(client, getLocaleString(client, "CommandDisabled", `{ALTCOLOUR}/${command}{MAINCOLOUR}`));
|
messagePlayerError(client, getLocaleString(client, "CommandDisabled", `{ALTCOLOUR}/${command}{MAINCOLOUR}`));
|
||||||
return false;
|
return false;
|
||||||
@@ -900,7 +911,7 @@ function processPlayerCommand(command, params, client) {
|
|||||||
|
|
||||||
if (doesCommandRequireLogin(toLowerCase(command))) {
|
if (doesCommandRequireLogin(toLowerCase(command))) {
|
||||||
if (!isPlayerLoggedIn(client)) {
|
if (!isPlayerLoggedIn(client)) {
|
||||||
logToConsole(LOG_WARN, `[VRR.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (requires login first): /${command} ${paramsDisplay}`);
|
logToConsole(LOG_WARN, `[AGRP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (requires login first): /${command} ${paramsDisplay}`);
|
||||||
messagePlayerError(client, getLocaleString(client, "CommandRequiresLogin", `{ALTCOLOUR}/${command}{MAINCOLOUR}`));
|
messagePlayerError(client, getLocaleString(client, "CommandRequiresLogin", `{ALTCOLOUR}/${command}{MAINCOLOUR}`));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -908,7 +919,7 @@ function processPlayerCommand(command, params, client) {
|
|||||||
|
|
||||||
if (isClientFromDiscord(client)) {
|
if (isClientFromDiscord(client)) {
|
||||||
if (!isCommandAllowedOnDiscord(command)) {
|
if (!isCommandAllowedOnDiscord(command)) {
|
||||||
logToConsole(LOG_WARN, `[VRR.Command] ${getPlayerDisplayForConsole(client)} attempted to use command from discord, but failed (not available on discord): /${command} ${paramsDisplay}`);
|
logToConsole(LOG_WARN, `[AGRP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command from discord, but failed (not available on discord): /${command} ${paramsDisplay}`);
|
||||||
messagePlayerError(client, `The {ALTCOLOUR}/${command}{MAINCOLOUR} command isn't available on discord!`);
|
messagePlayerError(client, `The {ALTCOLOUR}/${command}{MAINCOLOUR} command isn't available on discord!`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -916,13 +927,13 @@ function processPlayerCommand(command, params, client) {
|
|||||||
|
|
||||||
if (!isConsole(client)) {
|
if (!isConsole(client)) {
|
||||||
if (!doesPlayerHaveStaffPermission(client, getCommandRequiredPermissions(toLowerCase(command)))) {
|
if (!doesPlayerHaveStaffPermission(client, getCommandRequiredPermissions(toLowerCase(command)))) {
|
||||||
logToConsole(LOG_WARN, `[VRR.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (no permission): /${command} ${paramsDisplay}`);
|
logToConsole(LOG_WARN, `[AGRP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (no permission): /${command} ${paramsDisplay}`);
|
||||||
messagePlayerError(client, getLocaleString(client, "CommandNoPermissions", `{ALTCOLOUR}/${toLowerCase(command)}{MAINCOLOUR}`));
|
messagePlayerError(client, getLocaleString(client, "CommandNoPermissions", `{ALTCOLOUR}/${toLowerCase(command)}{MAINCOLOUR}`));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Command] ${getPlayerDisplayForConsole(client)} used command: /${command} ${paramsDisplay}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Command] ${getPlayerDisplayForConsole(client)} used command: /${command} ${paramsDisplay}`);
|
||||||
commandData.handlerFunction(toLowerCase(command), params, client);
|
commandData.handlerFunction(toLowerCase(command), params, client);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1027,10 +1038,10 @@ function cacheAllCommandsAliases() {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getCommandAliasesNames(command) {
|
function getCommandAliasesNames(commandData) {
|
||||||
let commandAliases = [];
|
let commandAliases = [];
|
||||||
for (let i in command.aliases) {
|
for (let i in commandData.aliases) {
|
||||||
commandAliases.push(command.aliases[i].name);
|
commandAliases.push(commandData.aliases[i].name);
|
||||||
}
|
}
|
||||||
|
|
||||||
return commandAliases;
|
return commandAliases;
|
||||||
|
|||||||
@@ -126,8 +126,8 @@ class ServerConfigData {
|
|||||||
this.discordBotToken = intToBool(dbAssoc["svr_discord_bot_token"]);
|
this.discordBotToken = intToBool(dbAssoc["svr_discord_bot_token"]);
|
||||||
this.introMusicURL = dbAssoc["svr_intro_music"];
|
this.introMusicURL = dbAssoc["svr_intro_music"];
|
||||||
|
|
||||||
//this.useRealTime = intToBool(toInteger(dbAssoc["svr_real_time_enabled"]));
|
this.useRealTime = intToBool(toInteger(dbAssoc["svr_real_time_enabled"]));
|
||||||
//this.realTimeZone = dbAssoc["svr_real_time_timezone"];
|
this.realTimeZone = dbAssoc["svr_real_time_timezone"];
|
||||||
|
|
||||||
this.discord = {
|
this.discord = {
|
||||||
sendEvents: intToBool(dbAssoc["svr_discord_send_events"]),
|
sendEvents: intToBool(dbAssoc["svr_discord_send_events"]),
|
||||||
@@ -194,8 +194,8 @@ let globalConfig = {
|
|||||||
subAccountNameAllowedCharacters: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
subAccountNameAllowedCharacters: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
||||||
emailValidationRegex: /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/,
|
emailValidationRegex: /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/,
|
||||||
itemActionDelayExtraTimeout: 1000,
|
itemActionDelayExtraTimeout: 1000,
|
||||||
geoIPCountryDatabaseFilePath: "geoip-country.mmdb",
|
geoIPCountryDatabaseFilePath: "modules/geoip/geoip-country.mmdb",
|
||||||
geoIPCityDatabaseFilePath: "geoip-city.mmdb",
|
geoIPCityDatabaseFilePath: "modules/geoip/geoip-city.mmdb",
|
||||||
randomTipInterval: 600000,
|
randomTipInterval: 600000,
|
||||||
weaponEquippableTypes: [
|
weaponEquippableTypes: [
|
||||||
AGRP_ITEM_USE_TYPE_WEAPON,
|
AGRP_ITEM_USE_TYPE_WEAPON,
|
||||||
@@ -246,86 +246,83 @@ let globalConfig = {
|
|||||||
fishingCastMaxStrength: 100,
|
fishingCastMaxStrength: 100,
|
||||||
fishingCastMinStrength: 30,
|
fishingCastMinStrength: 30,
|
||||||
jobRouteLocationSphereRadius: 3,
|
jobRouteLocationSphereRadius: 3,
|
||||||
|
monthlyChanceOfSnow: [90, 50, 10, 0, 0, 0, 0, 0, 0, 0, 50, 90],
|
||||||
};
|
};
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initConfigScript() {
|
function initConfigScript() {
|
||||||
logToConsole(LOG_INFO, "[VRR.Config]: Initializing config script ...");
|
logToConsole(LOG_INFO, "[AGRP.Config]: Initializing config script ...");
|
||||||
logToConsole(LOG_INFO, "[VRR.Config]: Config script initialized!");
|
logToConsole(LOG_INFO, "[AGRP.Config]: Config script initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadGlobalConfig() {
|
function loadGlobalConfig() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Config] Loading global configuration ...");
|
logToConsole(LOG_DEBUG, "[AGRP.Config] Loading global configuration ...");
|
||||||
try {
|
try {
|
||||||
getGlobalConfig().database = loadDatabaseConfig();
|
getGlobalConfig().database = loadDatabaseConfig();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logToConsole(LOG_ERROR, `[VRR.Config] Failed to load global configuration. Error: ${error}`);
|
logToConsole(LOG_ERROR, `[AGRP.Config] Failed to load global configuration. Error: ${error}`);
|
||||||
thisResource.stop();
|
thisResource.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
getGlobalConfig().economy = loadEconomyConfig();
|
getGlobalConfig().economy = loadEconomyConfig();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logToConsole(LOG_ERROR, `[VRR.Config] Failed to load economy configuration. Error: ${error}`);
|
logToConsole(LOG_ERROR, `[AGRP.Config] Failed to load economy configuration. Error: ${error}`);
|
||||||
thisResource.stop();
|
thisResource.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
getGlobalConfig().locale = loadLocaleConfig();
|
getGlobalConfig().locale = loadLocaleConfig();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logToConsole(LOG_ERROR, `[VRR.Config] Failed to load locale configuration. Error: ${error}`);
|
logToConsole(LOG_ERROR, `[AGRP.Config] Failed to load locale configuration. Error: ${error}`);
|
||||||
thisResource.stop();
|
thisResource.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
getGlobalConfig().accents = loadAccentConfig();
|
getGlobalConfig().accents = loadAccentConfig();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logToConsole(LOG_ERROR, `[VRR.Config] Failed to load accent configuration. Error: ${error}`);
|
logToConsole(LOG_ERROR, `[AGRP.Config] Failed to load accent configuration. Error: ${error}`);
|
||||||
thisResource.stop();
|
thisResource.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
getGlobalConfig().discord = loadDiscordConfig();
|
getGlobalConfig().discord = loadDiscordConfig();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logToConsole(LOG_ERROR, `[VRR.Config] Failed to load discord configuration. Error: ${error}`);
|
logToConsole(LOG_ERROR, `[AGRP.Config] Failed to load discord configuration. Error: ${error}`);
|
||||||
thisResource.stop();
|
thisResource.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
getGlobalConfig().keyBind = loadKeyBindConfig();
|
getGlobalConfig().keyBind = loadKeyBindConfig();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logToConsole(LOG_ERROR, `[VRR.Config] Failed to load keybind configuration. Error: ${error}`);
|
logToConsole(LOG_ERROR, `[AGRP.Config] Failed to load keybind configuration. Error: ${error}`);
|
||||||
thisResource.stop();
|
thisResource.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
getGlobalConfig().email = loadEmailConfig();
|
getGlobalConfig().email = loadEmailConfig();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logToConsole(LOG_ERROR, `[VRR.Config] Failed to load email configuration. Error: ${error}`);
|
logToConsole(LOG_ERROR, `[AGRP.Config] Failed to load email configuration. Error: ${error}`);
|
||||||
thisResource.stop();
|
thisResource.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Config] Loaded global configuration successfully!");
|
logToConsole(LOG_DEBUG, "[AGRP.Config] Loaded global configuration successfully!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadServerConfigFromGameAndPort(gameId, port) {
|
async function loadServerConfigFromGameAndPort(gameId, port) {
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let dbQueryString = `SELECT * FROM svr_main WHERE svr_game = ${gameId} AND svr_port = ${port} LIMIT 1;`;
|
let dbQueryString = `SELECT * FROM svr_main WHERE svr_game = ${gameId} AND svr_port = ${port} LIMIT 1;`;
|
||||||
let dbQuery = queryDatabase(dbConnection, dbQueryString);
|
let dbAssoc = await fetchQueryAssoc(dbConnection, dbQueryString);
|
||||||
if (dbQuery) {
|
if (dbAssoc.length > 0) {
|
||||||
if (dbQuery.numRows > 0) {
|
let tempServerConfigData = new ServerConfigData(dbAssoc[0]);
|
||||||
let dbAssoc = fetchQueryAssoc(dbQuery);
|
|
||||||
let tempServerConfigData = new ServerConfigData(dbAssoc);
|
|
||||||
freeDatabaseQuery(dbQuery);
|
|
||||||
return tempServerConfigData;
|
return tempServerConfigData;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -333,19 +330,16 @@ function loadServerConfigFromGameAndPort(gameId, port) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadServerConfigFromGame(gameId) {
|
async function loadServerConfigFromGame(gameId) {
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let dbQueryString = `SELECT * FROM svr_main WHERE svr_game = ${gameId} LIMIT 1;`;
|
let dbQueryString = `SELECT * FROM svr_main WHERE svr_game = ${gameId} LIMIT 1;`;
|
||||||
let dbQuery = queryDatabase(dbConnection, dbQueryString);
|
let dbAssocArray = await fetchQueryAssoc(dbConnection, dbQueryString);
|
||||||
if (dbQuery) {
|
logToConsole(LOG_DEBUG | LOG_WARN, `${dbAssocArray[0]}`);
|
||||||
if (dbQuery.numRows > 0) {
|
if (dbAssocArray.length > 0) {
|
||||||
let dbAssoc = fetchQueryAssoc(dbQuery);
|
let tempServerConfigData = new ServerConfigData(dbAssocArray[0]);
|
||||||
let tempServerConfigData = new ServerConfigData(dbAssoc);
|
|
||||||
freeDatabaseQuery(dbQuery);
|
|
||||||
return tempServerConfigData;
|
return tempServerConfigData;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -353,38 +347,36 @@ function loadServerConfigFromGame(gameId) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadServerConfigFromId(tempServerId) {
|
async function loadServerConfigFromId(tempServerId) {
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let dbQueryString = `SELECT * FROM svr_main WHERE svr_id = ${tempServerId} LIMIT 1;`;
|
let dbQueryString = `SELECT * FROM svr_main WHERE svr_id = ${tempServerId} LIMIT 1;`;
|
||||||
let dbQuery = queryDatabase(dbConnection, dbQueryString);
|
let dbAssoc = await fetchQueryAssoc(dbConnection, dbQueryString);
|
||||||
if (dbQuery) {
|
if (dbAssoc.length > 0) {
|
||||||
if (dbQuery.numRows > 0) {
|
let tempServerConfigData = new ServerConfigData(dbAssoc[0]);
|
||||||
let dbAssoc = fetchQueryAssoc(dbQuery);
|
|
||||||
let tempServerConfigData = new ServerConfigData(dbAssoc);
|
|
||||||
freeDatabaseQuery(dbQuery);
|
|
||||||
return tempServerConfigData;
|
return tempServerConfigData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function applyConfigToServer(tempServerConfig) {
|
function applyConfigToServer(tempServerConfig) {
|
||||||
logToConsole(LOG_INFO, "[VRR.Config]: Applying server config ...");
|
logToConsole(LOG_INFO, "[AGRP.Config]: Applying server config ...");
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Config]: Server config applied successfully!");
|
logToConsole(LOG_DEBUG, "[AGRP.Config]: Server config applied successfully!");
|
||||||
|
|
||||||
if (isTimeSupported()) {
|
updateServerGameTime();
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Config]: Setting time to to ${tempServerConfig.hour}:${tempServerConfig.minute} with minute duration of ${tempServerConfig.minuteDuration}`);
|
|
||||||
setGameTime(tempServerConfig.hour, tempServerConfig.minute, tempServerConfig.minuteDuration);
|
//if (isTimeSupported()) {
|
||||||
}
|
// logToConsole(LOG_DEBUG, `[AGRP.Config]: Setting time to to ${tempServerConfig.hour}:${tempServerConfig.minute} with minute duration of ${tempServerConfig.minuteDuration}`);
|
||||||
|
// setGameTime(tempServerConfig.hour, tempServerConfig.minute, tempServerConfig.minuteDuration);
|
||||||
|
//}
|
||||||
|
|
||||||
if (isWeatherSupported()) {
|
if (isWeatherSupported()) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Config]: Setting weather to ${tempServerConfig.weather}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Config]: Setting weather to ${tempServerConfig.weather}`);
|
||||||
game.forceWeather(tempServerConfig.weather);
|
game.forceWeather(getWeatherData(tempServerConfig.weather).weatherId);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateServerRules();
|
updateServerRules();
|
||||||
@@ -393,7 +385,7 @@ function applyConfigToServer(tempServerConfig) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function saveServerConfigToDatabase() {
|
function saveServerConfigToDatabase() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Config]: Saving server ${getServerConfig().databaseId} configuration to database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Config]: Saving server ${getServerConfig().databaseId} configuration to database ...`);
|
||||||
if (getServerConfig().needsSaved) {
|
if (getServerConfig().needsSaved) {
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
@@ -457,7 +449,7 @@ function saveServerConfigToDatabase() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Config]: Server ${getServerConfig().databaseId} configuration saved to database!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Config]: Server ${getServerConfig().databaseId} configuration saved to database!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -580,19 +572,19 @@ function setWeatherCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let weatherId = getWeatherFromParams(getParam(params, " ", 1));
|
let weatherIndex = getWeatherFromParams(getParam(params, " ", 1));
|
||||||
|
|
||||||
if (!weatherId) {
|
if (!getWeatherData(weatherIndex)) {
|
||||||
messagePlayerError(client, `That weather ID or name is invalid!`);
|
messagePlayerError(client, `That weather ID or name is invalid!`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
game.forceWeather(toInteger(weatherId));
|
game.forceWeather(getWeatherData(weatherIndex).weatherId);
|
||||||
getServerConfig().weather = weatherId;
|
getServerConfig().weather = weatherIndex;
|
||||||
|
|
||||||
getServerConfig().needsSaved = true;
|
getServerConfig().needsSaved = true;
|
||||||
|
|
||||||
announceAdminAction("ServerWeatherSet", getPlayerName(client), getGameConfig().weatherNames[getGame()][toInteger(weatherId)]);
|
announceAdminAction("ServerWeatherSet", getPlayerName(client), getWeatherData(weatherIndex).name);
|
||||||
updateServerRules();
|
updateServerRules();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -931,7 +923,7 @@ function reloadEmailConfigurationCommand(command, params, client) {
|
|||||||
*/
|
*/
|
||||||
function reloadDatabaseConfigurationCommand(command, params, client) {
|
function reloadDatabaseConfigurationCommand(command, params, client) {
|
||||||
if (getDatabaseConfig().usePersistentConnection && isDatabaseConnected(persistentDatabaseConnection)) {
|
if (getDatabaseConfig().usePersistentConnection && isDatabaseConnected(persistentDatabaseConnection)) {
|
||||||
logToConsole(LOG_WARN, `[VRR.Database] Closing persistent database connection`);
|
logToConsole(LOG_WARN, `[AGRP.Database] Closing persistent database connection`);
|
||||||
persistentDatabaseConnection.close();
|
persistentDatabaseConnection.close();
|
||||||
persistentDatabaseConnection = null;
|
persistentDatabaseConnection = null;
|
||||||
}
|
}
|
||||||
@@ -979,8 +971,8 @@ function getServerIntroMusicURL() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadLocaleConfig() {
|
function loadLocaleConfig() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Config] Loading locale configuration");
|
logToConsole(LOG_DEBUG, "[AGRP.Config] Loading locale configuration");
|
||||||
let localeConfig = JSON.parse(loadTextFile(`config/locale.json`));
|
let localeConfig = JSON.parse(getContentsOfTextFile(`config/locale.json`));
|
||||||
if (localeConfig != null) {
|
if (localeConfig != null) {
|
||||||
return localeConfig;
|
return localeConfig;
|
||||||
}
|
}
|
||||||
@@ -989,8 +981,8 @@ function loadLocaleConfig() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadEconomyConfig() {
|
function loadEconomyConfig() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Config] Loading economy configuration");
|
logToConsole(LOG_DEBUG, "[AGRP.Config] Loading economy configuration");
|
||||||
let economyConfig = JSON.parse(loadTextFile(`config/economy.json`));
|
let economyConfig = JSON.parse(getContentsOfTextFile(`config/economy.json`));
|
||||||
if (economyConfig != null) {
|
if (economyConfig != null) {
|
||||||
return economyConfig;
|
return economyConfig;
|
||||||
}
|
}
|
||||||
@@ -999,8 +991,8 @@ function loadEconomyConfig() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadAccentConfig() {
|
function loadAccentConfig() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Config] Loading accents configuration");
|
logToConsole(LOG_DEBUG, "[AGRP.Config] Loading accents configuration");
|
||||||
let accentConfig = JSON.parse(loadTextFile(`config/accents.json`));
|
let accentConfig = JSON.parse(getContentsOfTextFile(`config/accents.json`));
|
||||||
if (accentConfig != null) {
|
if (accentConfig != null) {
|
||||||
return accentConfig;
|
return accentConfig;
|
||||||
}
|
}
|
||||||
@@ -1009,8 +1001,8 @@ function loadAccentConfig() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadDiscordConfig() {
|
function loadDiscordConfig() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Config] Loading discord configuration");
|
logToConsole(LOG_DEBUG, "[AGRP.Config] Loading discord configuration");
|
||||||
let discordConfig = JSON.parse(loadTextFile(`config/discord.json`));
|
let discordConfig = JSON.parse(getContentsOfTextFile(`config/discord.json`));
|
||||||
if (discordConfig != null) {
|
if (discordConfig != null) {
|
||||||
return discordConfig;
|
return discordConfig;
|
||||||
}
|
}
|
||||||
@@ -1020,8 +1012,8 @@ function loadDiscordConfig() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadDatabaseConfig() {
|
function loadDatabaseConfig() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Config] Loading database configuration");
|
logToConsole(LOG_DEBUG, "[AGRP.Config] Loading database configuration");
|
||||||
let databaseConfig = JSON.parse(loadTextFile("config/database.json"));
|
let databaseConfig = JSON.parse(getContentsOfTextFile("config/database.json"));
|
||||||
if (databaseConfig != null) {
|
if (databaseConfig != null) {
|
||||||
return databaseConfig;
|
return databaseConfig;
|
||||||
}
|
}
|
||||||
@@ -1031,8 +1023,8 @@ function loadDatabaseConfig() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadKeyBindConfig() {
|
function loadKeyBindConfig() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Config] Loading keybind configuration");
|
logToConsole(LOG_DEBUG, "[AGRP.Config] Loading keybind configuration");
|
||||||
let keyBindConfig = JSON.parse(loadTextFile("config/keybind.json"));
|
let keyBindConfig = JSON.parse(getContentsOfTextFile("config/keybind.json"));
|
||||||
if (keyBindConfig != null) {
|
if (keyBindConfig != null) {
|
||||||
return keyBindConfig;
|
return keyBindConfig;
|
||||||
}
|
}
|
||||||
@@ -1042,8 +1034,8 @@ function loadKeyBindConfig() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadEmailConfig() {
|
function loadEmailConfig() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Config] Loading email configuration");
|
logToConsole(LOG_DEBUG, "[AGRP.Config] Loading email configuration");
|
||||||
let emailConfig = JSON.parse(loadTextFile("config/email.json"));
|
let emailConfig = JSON.parse(getContentsOfTextFile("config/email.json"));
|
||||||
if (emailConfig != null) {
|
if (emailConfig != null) {
|
||||||
return emailConfig;
|
return emailConfig;
|
||||||
}
|
}
|
||||||
@@ -1125,20 +1117,25 @@ function getDatabaseConfig() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadServerConfig() {
|
function loadServerConfig() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Config] Loading server configuration");
|
logToConsole(LOG_DEBUG, "[AGRP.Config] Loading server configuration");
|
||||||
try {
|
|
||||||
if (toInteger(server.getCVar("agrp_devserver")) == 1) {
|
if (toInteger(server.getCVar("agrp_devserver")) == 1) {
|
||||||
serverConfig = loadServerConfigFromGame(getGame());
|
serverConfig = loadServerConfigFromGame(getGame());
|
||||||
|
|
||||||
|
if (serverConfig == false) {
|
||||||
|
logToConsole(LOG_ERROR, `[AGRP.Config] Could not load server configuration for game ${getGame()}`);
|
||||||
|
server.shutdown();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
serverConfig = loadServerConfigFromGameAndPort(getGame(), getServerPort());
|
serverConfig = loadServerConfigFromGameAndPort(getGame(), getServerPort());
|
||||||
|
|
||||||
|
if (serverConfig == false) {
|
||||||
|
logToConsole(LOG_ERROR, `[AGRP.Config] Could not load server configuration for game ${getGame()} and port ${getServerPort()}`);
|
||||||
|
server.shutdown();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
//logToConsole(LOG_DEBUG | LOG_WARN, `Server ID: ${serverConfig.databaseId}`);
|
||||||
logToConsole(LOG_ERROR, `[VRR.Config] Could not load server configuration for game ${getGame()} and port ${getServerPort}`);
|
|
||||||
thisResource.stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG | LOG_WARN, `Server ID: ${serverConfig.databaseId}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -8,9 +8,9 @@
|
|||||||
// TYPE: Server (JavaScript)
|
// TYPE: Server (JavaScript)
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
let scriptVersion = "1.2";
|
let scriptVersion = "1.3";
|
||||||
let serverStartTime = 0;
|
let serverStartTime = 0;
|
||||||
let logLevel = LOG_INFO | LOG_DEBUG | LOG_VERBOSE; // LOG_ERROR|LOG_WARN;
|
let logLevel = LOG_INFO | LOG_ERROR | LOG_WARN;
|
||||||
|
|
||||||
let playerResourceReady = new Array(server.maxClients).fill(false);
|
let playerResourceReady = new Array(server.maxClients).fill(false);
|
||||||
let playerResourceStarted = new Array(server.maxClients).fill(false);
|
let playerResourceStarted = new Array(server.maxClients).fill(false);
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ let persistentDatabaseConnection = null;
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initDatabaseScript() {
|
function initDatabaseScript() {
|
||||||
logToConsole(LOG_INFO, "[VRR.Database]: Initializing database script ...");
|
logToConsole(LOG_INFO, "[AGRP.Database]: Initializing database script ...");
|
||||||
logToConsole(LOG_INFO, "[VRR.Database]: Database script initialized successfully!");
|
logToConsole(LOG_INFO, "[AGRP.Database]: Database script initialized successfully!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initDeveloperScript() {
|
function initDeveloperScript() {
|
||||||
logToConsole(LOG_INFO, "[VRR.Developer]: Initializing developer script ...");
|
logToConsole(LOG_INFO, "[AGRP.Developer]: Initializing developer script ...");
|
||||||
|
|
||||||
// Use GTAC command handlers for these since they need to be available on console
|
// Use GTAC command handlers for these since they need to be available on console
|
||||||
//addCommandHandler("sc", executeServerCodeCommand);
|
//addCommandHandler("sc", executeServerCodeCommand);
|
||||||
@@ -18,7 +18,7 @@ function initDeveloperScript() {
|
|||||||
//addCommandHandler("allcmd", simulateCommandForAllPlayersCommand);
|
//addCommandHandler("allcmd", simulateCommandForAllPlayersCommand);
|
||||||
//addCommandHandler("addloglvl", setServerLogLevelCommand);
|
//addCommandHandler("addloglvl", setServerLogLevelCommand);
|
||||||
|
|
||||||
logToConsole(LOG_INFO, "[VRR.Developer]: Developer script initialized successfully!");
|
logToConsole(LOG_INFO, "[AGRP.Developer]: Developer script initialized successfully!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -441,22 +441,16 @@ function testErrorGUICommand(command, params, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function saveServerDataCommand(command, params, client) {
|
function saveServerDataCommand(command, params, client) {
|
||||||
messageAdmins(`{adminOrange}Vortrex{MAINCOLOUR} has forced a manual save of all data. Initiating ...`);
|
messageAdmins(`{adminOrange}Vortrex{MAINCOLOUR} has forced a manual save of all data. Initiating ...`, true);
|
||||||
saveServerDataToDatabase();
|
saveServerDataToDatabase();
|
||||||
messageAdmins(`{MAINCOLOUR}All server data saved to database successfully!`);
|
messageAdmins(`{MAINCOLOUR}All server data saved to database successfully!`, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function testEmailCommand(command, params, client) {
|
async function testEmailCommand(command, params, client) {
|
||||||
try {
|
sendEmail(params, "Player", "Test email", "Just testing the email system for the server!");
|
||||||
messagePlayerAlert(client, `Sending test email to ${params}`);
|
|
||||||
sendEmail(params, "Player", "Test email", "Just testing the SMTP module for the server!");
|
|
||||||
} catch (error) {
|
|
||||||
messagePlayerError(client, "The email could not be sent! Error: ${error}");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ const AGRP_DISCORD_WEBHOOK_ADMIN = 2;
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initDiscordScript() {
|
function initDiscordScript() {
|
||||||
logToConsole(LOG_INFO, "[VRR.Discord]: Initializing discord script ...");
|
logToConsole(LOG_INFO, "[AGRP.Discord]: Initializing discord script ...");
|
||||||
logToConsole(LOG_INFO, "[VRR.Discord]: Discord script initialized successfully!");
|
logToConsole(LOG_INFO, "[AGRP.Discord]: Discord script initialized successfully!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -184,7 +184,7 @@ function triggerDiscordWebHook(messageString, serverId = getServerId(), type = A
|
|||||||
}
|
}
|
||||||
|
|
||||||
let tempURL = getGlobalConfig().discord.webhook.webhookBaseURL;
|
let tempURL = getGlobalConfig().discord.webhook.webhookBaseURL;
|
||||||
tempURL = tempURL.replace("{0}", encodeURI(messageString));
|
tempURL = tempURL.replace("{0}", encodeURIComponent(messageString));
|
||||||
tempURL = tempURL.replace("{1}", serverId);
|
tempURL = tempURL.replace("{1}", serverId);
|
||||||
tempURL = tempURL.replace("{2}", type);
|
tempURL = tempURL.replace("{2}", type);
|
||||||
tempURL = tempURL.replace("{3}", getGlobalConfig().discord.webhook.pass);
|
tempURL = tempURL.replace("{3}", getGlobalConfig().discord.webhook.pass);
|
||||||
@@ -211,7 +211,7 @@ function triggerClanDiscordWebHook(clanIndex, messageString) {
|
|||||||
let webhookURL = getClanData(clanIndex).discordWebhookURL;
|
let webhookURL = getClanData(clanIndex).discordWebhookURL;
|
||||||
|
|
||||||
let tempURL = getGlobalConfig().discord.webhook.webhookBaseURL;
|
let tempURL = getGlobalConfig().discord.webhook.webhookBaseURL;
|
||||||
tempURL = tempURL.replace("{0}", encodeURI(messageString));
|
tempURL = tempURL.replace("{0}", encodeURIComponent(messageString));
|
||||||
tempURL = tempURL.replace("{1}", serverId);
|
tempURL = tempURL.replace("{1}", serverId);
|
||||||
tempURL = tempURL.replace("{2}", type);
|
tempURL = tempURL.replace("{2}", type);
|
||||||
tempURL = tempURL.replace("{3}", getGlobalConfig().discord.webhook.pass);
|
tempURL = tempURL.replace("{3}", getGlobalConfig().discord.webhook.pass);
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initEconomyScript() {
|
function initEconomyScript() {
|
||||||
logToConsole(LOG_INFO, "[VRR.Economy]: Initializing economy script ...");
|
logToConsole(LOG_INFO, "[AGRP.Economy]: Initializing economy script ...");
|
||||||
logToConsole(LOG_INFO, "[VRR.Economy]: Economy script initialized successfully!");
|
logToConsole(LOG_INFO, "[AGRP.Economy]: Economy script initialized successfully!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -47,15 +47,15 @@ function playerPayDay(client) {
|
|||||||
let netIncome = Math.round(grossIncome - incomeTaxAmount);
|
let netIncome = Math.round(grossIncome - incomeTaxAmount);
|
||||||
|
|
||||||
messagePlayerAlert(client, "== Payday! =============================");
|
messagePlayerAlert(client, "== Payday! =============================");
|
||||||
messagePlayerInfo(client, `Paycheck: {ALTCOLOUR}$${grossIncome}`);
|
messagePlayerInfo(client, `Paycheck: {ALTCOLOUR}${getCurrencyString(grossIncome)}`);
|
||||||
messagePlayerInfo(client, `Taxes: {ALTCOLOUR}$${incomeTaxAmount}`);
|
messagePlayerInfo(client, `Taxes: {ALTCOLOUR}${getCurrencyString(incomeTaxAmount)}`);
|
||||||
messagePlayerInfo(client, `You receive: {ALTCOLOUR}$${netIncome}`);
|
messagePlayerInfo(client, `You receive: {ALTCOLOUR}${getCurrencyString(netIncome)}`);
|
||||||
if (netIncome < incomeTaxAmount) {
|
if (netIncome < incomeTaxAmount) {
|
||||||
let totalCash = getPlayerCash(client);
|
let totalCash = getPlayerCash(client);
|
||||||
let canPayNow = totalCash + netIncome;
|
let canPayNow = totalCash + netIncome;
|
||||||
if (incomeTaxAmount <= canPayNow) {
|
if (incomeTaxAmount <= canPayNow) {
|
||||||
takePlayerCash(client, canPayNow);
|
takePlayerCash(client, canPayNow);
|
||||||
messagePlayerInfo(client, `{orange}${getLocaleString(client, "RemainingTaxPaidInCash", `{ALTCOLOUR}${canPayNow}{MAINCOLOUR}`)}`);
|
messagePlayerInfo(client, `{orange}${getLocaleString(client, "RemainingTaxPaidInCash", `{ALTCOLOUR}${getCurrencyString(canPayNow)}{MAINCOLOUR}`)}`);
|
||||||
messagePlayerAlert(client, `{orange}${getLocaleString(client, "LostMoneyFromTaxes")}`);
|
messagePlayerAlert(client, `{orange}${getLocaleString(client, "LostMoneyFromTaxes")}`);
|
||||||
messagePlayerAlert(client, `{orange}${getLocaleString(client, "NextPaycheckRepossessionWarning")}`);
|
messagePlayerAlert(client, `{orange}${getLocaleString(client, "NextPaycheckRepossessionWarning")}`);
|
||||||
} else {
|
} else {
|
||||||
@@ -141,14 +141,14 @@ function setPayDayBonusMultiplier(command, params, client) {
|
|||||||
function taxInfoCommand(command, params, client) {
|
function taxInfoCommand(command, params, client) {
|
||||||
let wealth = calculateWealth(client);
|
let wealth = calculateWealth(client);
|
||||||
let tax = calculateIncomeTax(wealth);
|
let tax = calculateIncomeTax(wealth);
|
||||||
messagePlayerInfo(client, `Your tax on payday is: $${tax}. Use {ALTCOLOUR}/help tax {MAINCOLOUR}for more information.`);
|
messagePlayerInfo(client, getLocaleString(client, "YourTax", `{ALTCOLOUR}${getCurrencyString(tax)}{MAINCOLOUR}`, `{ALTCOLOUR}/help tax{MAINCOLOUR}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function wealthInfoCommand(command, params, client) {
|
function wealthInfoCommand(command, params, client) {
|
||||||
let wealth = calculateWealth(client);
|
let wealth = calculateWealth(client);
|
||||||
messagePlayerInfo(client, `Your wealth is: {ALTCOLOUR}$${wealth}{MAINCOLOUR}. Use {ALTCOLOUR}/help wealth {MAINCOLOUR}for more information.`);
|
messagePlayerInfo(client, getLocaleString(client, "YourWealth", `{ALTCOLOUR}${getCurrencyString(wealth)}{MAINCOLOUR}`, `{ALTCOLOUR}/help wealth{MAINCOLOUR}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -214,3 +214,11 @@ function isDoubleBonusActive() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getCurrencyString(amount) {
|
||||||
|
let tempString = getGlobalConfig().economy.currencyString;
|
||||||
|
tempString = tempString.replace("{AMOUNT}", toString(makeLargeNumberReadable(amount)));
|
||||||
|
return tempString;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -8,14 +8,23 @@
|
|||||||
// TYPE: Server (JavaScript)
|
// TYPE: Server (JavaScript)
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
// Email Methods
|
||||||
|
const AGRP_EMAIL_METHOD_NONE = 0; // None
|
||||||
|
const AGRP_EMAIL_METHOD_SMTP_MODULE = "smtp"; // Use SMTP module
|
||||||
|
const AGRP_EMAIL_METHOD_GET_REQUEST = "http"; // Use HTTP request (httpGet to custom PHP page)
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
function initEmailScript() {
|
function initEmailScript() {
|
||||||
logToConsole(LOG_INFO, "[VRR.Email]: Initializing email script ...");
|
logToConsole(LOG_INFO, "[AGRP.Email]: Initializing email script ...");
|
||||||
logToConsole(LOG_INFO, "[VRR.Email]: Email script initialized successfully!");
|
logToConsole(LOG_INFO, "[AGRP.Email]: Email script initialized successfully!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
async function sendEmail(toEmail, toName, subject, body) {
|
async function sendEmail(toEmail, toName, subject, body) {
|
||||||
|
switch (getEmailConfig().method) {
|
||||||
|
case AGRP_EMAIL_METHOD_SMTP_MODULE:
|
||||||
if (!checkForSMTPModule()) {
|
if (!checkForSMTPModule()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -35,6 +44,32 @@ async function sendEmail(toEmail, toName, subject, body) {
|
|||||||
getEmailConfig().smtp.fromName
|
getEmailConfig().smtp.fromName
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
break;
|
||||||
|
|
||||||
|
case AGRP_EMAIL_METHOD_GET_REQUEST:
|
||||||
|
let tempURL = getEmailConfig().http.baseURL;
|
||||||
|
tempURL = tempURL.replace("{0}", encodeURIComponent(getEmailConfig().http.password));
|
||||||
|
tempURL = tempURL.replace("{1}", encodeURIComponent(toEmail));
|
||||||
|
tempURL = tempURL.replace("{2}", encodeURIComponent(toName));
|
||||||
|
tempURL = tempURL.replace("{3}", encodeURIComponent(subject));
|
||||||
|
tempURL = tempURL.replace("{4}", encodeURIComponent(body));
|
||||||
|
|
||||||
|
httpGet(
|
||||||
|
tempURL,
|
||||||
|
"",
|
||||||
|
function (data) {
|
||||||
|
|
||||||
|
},
|
||||||
|
function (data) {
|
||||||
|
}
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -9,9 +9,9 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initEventScript() {
|
function initEventScript() {
|
||||||
logToConsole(LOG_INFO, "[VRR.Event]: Initializing event script ...");
|
logToConsole(LOG_INFO, "[AGRP.Event]: Initializing event script ...");
|
||||||
addAllEventHandlers();
|
addAllEventHandlers();
|
||||||
logToConsole(LOG_INFO, "[VRR.Event]: Event script initialized!");
|
logToConsole(LOG_INFO, "[AGRP.Event]: Event script initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -28,17 +28,21 @@ function addAllEventHandlers() {
|
|||||||
addEventHandler("onElementStreamIn", onElementStreamIn);
|
addEventHandler("onElementStreamIn", onElementStreamIn);
|
||||||
addEventHandler("onElementStreamOut", onElementStreamOut);
|
addEventHandler("onElementStreamOut", onElementStreamOut);
|
||||||
addEventHandler("onPedSpawn", onPedSpawn);
|
addEventHandler("onPedSpawn", onPedSpawn);
|
||||||
|
addEventHandler("OnPickupPickedUp", onPedPickupPickedUp);
|
||||||
addEventHandler("onPedEnteredVehicleEx", onPedEnteredVehicle);
|
addEventHandler("onPedEnteredVehicleEx", onPedEnteredVehicle);
|
||||||
addEventHandler("onPedExitedVehicleEx", onPedExitedVehicle);
|
addEventHandler("onPedExitedVehicleEx", onPedExitedVehicle);
|
||||||
addEventHandler("onPedEnteredSphereEx", onPedEnteredSphere);
|
addEventHandler("onPedEnteredSphereEx", onPedEnteredSphere);
|
||||||
addEventHandler("onPedExitedSphereEx", onPedExitedSphere);
|
addEventHandler("onPedExitedSphereEx", onPedExitedSphere);
|
||||||
addEventHandler("OnPickupPickedUp", onPedPickupPickedUp);
|
|
||||||
|
if (getGame() == AGRP_GAME_MAFIA_ONE) {
|
||||||
|
addEventHandler("onPedFall", onPedFall);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onPlayerConnect(event, ipAddress, port) {
|
function onPlayerConnect(event, ipAddress, port) {
|
||||||
logToConsole(LOG_INFO, `[VRR.Event] Client connecting (IP: ${ipAddress})`);
|
logToConsole(LOG_INFO, `[AGRP.Event] onPlayerConnect - Client connecting (IP: ${ipAddress})`);
|
||||||
//if(isIpAddressBanned(ipAddress)) {
|
//if(isIpAddressBanned(ipAddress)) {
|
||||||
// messagePlayerError(client, "You are banned from this server!");
|
// messagePlayerError(client, "You are banned from this server!");
|
||||||
// return false;
|
// return false;
|
||||||
@@ -48,15 +52,14 @@ function onPlayerConnect(event, ipAddress, port) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onPlayerJoin(event, client) {
|
function onPlayerJoin(event, client) {
|
||||||
logToConsole(LOG_INFO, `[VRR.Event] Client ${getPlayerName(client)}[${getPlayerId(client)}] joining from ${getPlayerIP(client)}`);
|
logToConsole(LOG_INFO, `[AGRP.Event] onPlayerJoin - Client ${getPlayerDisplayForConsole(client)} joining from ${getPlayerIP(client)}`);
|
||||||
|
|
||||||
//if (isFadeCameraSupported()) {
|
playerResourceReady[getPlayerId(client)] = false;
|
||||||
// fadeCamera(client, true, 1.0);
|
playerResourceStarted[getPlayerId(client)] = false;
|
||||||
//}
|
playerInitialized[getPlayerId(client)] = false;
|
||||||
|
playerGUIReady[getPlayerId(client)] = false;
|
||||||
|
|
||||||
//if(isCustomCameraSupported()) {
|
getServerData().clients[getPlayerId(client)] = null;
|
||||||
// showConnectCameraToPlayer(client);
|
|
||||||
//}
|
|
||||||
|
|
||||||
let messageText = `👋 ${getPlayerName(client)} is connecting to the server ...`;
|
let messageText = `👋 ${getPlayerName(client)} is connecting to the server ...`;
|
||||||
messageDiscordEventChannel(messageText);
|
messageDiscordEventChannel(messageText);
|
||||||
@@ -65,13 +68,12 @@ function onPlayerJoin(event, client) {
|
|||||||
for (let i in clients) {
|
for (let i in clients) {
|
||||||
messagePlayerNormal(clients[i], getLocaleString(clients[i], "PlayerConnecting", getPlayerName(client)));
|
messagePlayerNormal(clients[i], getLocaleString(clients[i], "PlayerConnecting", getPlayerName(client)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//messageDiscordEventChannel(`👋 ${getPlayerDisplayForConsole(client)} has joined the server.`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onPlayerJoined(event, client) {
|
function onPlayerJoined(event, client) {
|
||||||
|
logToConsole(LOG_INFO, `[AGRP.Event] onPlayerJoined - Client ${getPlayerDisplayForConsole(client)} joined from ${getPlayerIP(client)}`);
|
||||||
//initClient(client);
|
//initClient(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,37 +101,23 @@ function onElementStreamOut(event, element, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onPlayerQuit(event, client, quitReasonId) {
|
function onPlayerQuit(event, client, quitReasonId) {
|
||||||
logToConsole(LOG_INFO, `👋 Client ${getPlayerDisplayForConsole(client)} disconnected (${disconnectReasons[quitReasonId]}[${quitReasonId}])`);
|
let disconnectName = disconnectReasons[quitReasonId];
|
||||||
updateConnectionLogOnQuit(client, quitReasonId);
|
|
||||||
|
let reasonTextEnglish = getLanguageGroupedLocaleString(englishLocale, "DisconnectReasons", disconnectName);
|
||||||
|
let clientName = getPlayerName(client);
|
||||||
|
|
||||||
let reasonText = disconnectReasons[quitReasonId];
|
|
||||||
if (getPlayerData(client) != false) {
|
if (getPlayerData(client) != false) {
|
||||||
if (getPlayerData(client).customDisconnectReason != "") {
|
if (getPlayerData(client).customDisconnectReason != "") {
|
||||||
reasonText = getPlayerData(client).customDisconnectReason;
|
disconnectName = getPlayerData(client).customDisconnectReason;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//messagePlayerNormal(null, `👋 ${getPlayerName(client)} has left the server (${reasonText})`, getColourByName("softYellow"));
|
updateConnectionLogOnQuit(client, disconnectName);
|
||||||
|
|
||||||
//if (isPlayerFishing(client)) {
|
resetClientStuff(client);
|
||||||
// stopFishing(client);
|
|
||||||
//}
|
|
||||||
|
|
||||||
if (isPlayerInPaintBall(client)) {
|
|
||||||
stopPaintBall(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isPlayerOnJobRoute(client)) {
|
|
||||||
stopJobRoute(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isPlayerWorking(client)) {
|
|
||||||
stopWorking(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isPlayerLoggedIn(client)) {
|
if (isPlayerLoggedIn(client)) {
|
||||||
savePlayerToDatabase(client);
|
savePlayerToDatabase(client);
|
||||||
resetClientStuff(client);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getPlayerData(client).loginTimeout != null) {
|
if (getPlayerData(client).loginTimeout != null) {
|
||||||
@@ -141,13 +129,15 @@ function onPlayerQuit(event, client, quitReasonId) {
|
|||||||
playerInitialized[client.index] = false;
|
playerInitialized[client.index] = false;
|
||||||
playerGUIReady[client.index] = false;
|
playerGUIReady[client.index] = false;
|
||||||
|
|
||||||
messageDiscordEventChannel(`👋 ${getPlayerName(client)} has left the server (${reasonText})`);
|
|
||||||
getClients().forEach(forClient => {
|
|
||||||
let reasonText = getGroupedLocaleString(forClient, "DisconnectReasons", quitReasonId);
|
|
||||||
messagePlayerNormal(forClient, getLocaleString(forClient, "PlayerLeftServer", getPlayerName(client), reasonText));
|
|
||||||
});
|
|
||||||
|
|
||||||
getServerData().clients[getPlayerId(client)] = null;
|
getServerData().clients[getPlayerId(client)] = null;
|
||||||
|
|
||||||
|
logToConsole(LOG_INFO, `👋 Client ${getPlayerDisplayForConsole(client)} disconnected (quitReasonId - ${reasonTextEnglish})`);
|
||||||
|
//messageDiscordEventChannel(`👋 ${clientName} has left the server (${reasonTextEnglish})`);
|
||||||
|
messageDiscordEventChannel(`👋 ${getLanguageLocaleString(englishLocale, "PlayerLeftServer", clientName, reasonTextEnglish)}`);
|
||||||
|
|
||||||
|
getClients().filter(c => c != client).forEach(forClient => {
|
||||||
|
messagePlayerNormal(forClient, getLocaleString(forClient, "PlayerLeftServer", clientName, getGroupedLocaleString(forClient, "DisconnectReasons", disconnectName)));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -215,28 +205,23 @@ function onPedExitingVehicle(event, ped, vehicle) {
|
|||||||
let client = getClientFromPlayerElement(ped);
|
let client = getClientFromPlayerElement(ped);
|
||||||
getPlayerData(client).pedState = AGRP_PEDSTATE_EXITINGVEHICLE;
|
getPlayerData(client).pedState = AGRP_PEDSTATE_EXITINGVEHICLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!getVehicleData(vehicle).spawnLocked) {
|
|
||||||
getVehicleData(vehicle).spawnPosition = getVehiclePosition(vehicle);
|
|
||||||
getVehicleData(vehicle).spawnRotation = getVehicleHeading(vehicle);
|
|
||||||
getVehicleData(vehicle).needsSaved = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onResourceStart(event, resource) {
|
function onResourceStart(event, resource) {
|
||||||
logToConsole(LOG_WARN, `[VRR.Event] Resource ${resource.name} started!`);
|
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Resource ${resource.name} started!`);
|
||||||
|
|
||||||
//if(resource != thisResource) {
|
if (resource == thisResource) {
|
||||||
//messageAdmins(`{MAINCOLOUR}Resource {ALTCOLOUR}${resource.name}{MAINCOLOUR} started!`);
|
//messageAdmins(`{MAINCOLOUR}Resource {ALTCOLOUR}${resource.name}{MAINCOLOUR} started!`);
|
||||||
//}
|
messageDiscordEventChannel(`✅ Server is starting up!`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onResourceStop(event, resource) {
|
function onResourceStop(event, resource) {
|
||||||
logToConsole(LOG_WARN, `[VRR.Event] Resource ${resource.name} stopped!`);
|
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Resource ${resource.name} stopped!`);
|
||||||
|
|
||||||
//if(resource != thisResource) {
|
//if(resource != thisResource) {
|
||||||
// messageAdmins(`{MAINCOLOUR}Resource {ALTCOLOUR}${resource.name}{MAINCOLOUR} stopped!`);
|
// messageAdmins(`{MAINCOLOUR}Resource {ALTCOLOUR}${resource.name}{MAINCOLOUR} stopped!`);
|
||||||
@@ -247,14 +232,17 @@ function onResourceStop(event, resource) {
|
|||||||
saveServerDataToDatabase();
|
saveServerDataToDatabase();
|
||||||
disconnectFromDatabase(persistentDatabaseConnection, true);
|
disconnectFromDatabase(persistentDatabaseConnection, true);
|
||||||
collectAllGarbage();
|
collectAllGarbage();
|
||||||
|
|
||||||
|
messageDiscordEventChannel(`⛔ Server is shutting down!`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onPedEnteredSphere(event, ped, sphere) {
|
function onPedEnteredSphere(event, ped, sphere) {
|
||||||
if (ped.isType(ELEMENT_PLAYER)) {
|
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} entered sphere ${sphere.id}!`);
|
||||||
let client = getClientFromPlayerElement(ped);
|
//if (ped.isType(ELEMENT_PLAYER)) {
|
||||||
|
// let client = getClientFromPlayerElement(ped);
|
||||||
|
|
||||||
// Handled client-side since server spheres aren't showing on GTAC atm (bug)
|
// Handled client-side since server spheres aren't showing on GTAC atm (bug)
|
||||||
//if (isPlayerOnJobRoute(client)) {
|
//if (isPlayerOnJobRoute(client)) {
|
||||||
@@ -262,12 +250,13 @@ function onPedEnteredSphere(event, ped, sphere) {
|
|||||||
// playerArrivedAtJobRouteLocation(client);
|
// playerArrivedAtJobRouteLocation(client);
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onPedExitedSphere(event, ped, sphere) {
|
function onPedExitedSphere(event, ped, sphere) {
|
||||||
|
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} exited sphere ${sphere.id}!`);
|
||||||
//if (ped.isType(ELEMENT_PLAYER)) {
|
//if (ped.isType(ELEMENT_PLAYER)) {
|
||||||
// let client = getClientFromPlayerElement(ped);
|
// let client = getClientFromPlayerElement(ped);
|
||||||
//}
|
//}
|
||||||
@@ -276,6 +265,8 @@ function onPedExitedSphere(event, ped, sphere) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onPedPickupPickedUp(event, ped, pickup) {
|
function onPedPickupPickedUp(event, ped, pickup) {
|
||||||
|
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} picked up pickup ${pickup.id}!`);
|
||||||
|
|
||||||
if (ped.isType(ELEMENT_PLAYER)) {
|
if (ped.isType(ELEMENT_PLAYER)) {
|
||||||
let client = getClientFromPlayerElement(ped);
|
let client = getClientFromPlayerElement(ped);
|
||||||
|
|
||||||
@@ -289,7 +280,10 @@ function onPedPickupPickedUp(event, ped, pickup) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
/*
|
||||||
function onPedWasted(event, ped, killerPed, weapon, pedPiece) {
|
function onPedWasted(event, ped, killerPed, weapon, pedPiece) {
|
||||||
|
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} wasted by ped ${killerPed.id}!`);
|
||||||
|
|
||||||
if (ped.isType(ELEMENT_PLAYER)) {
|
if (ped.isType(ELEMENT_PLAYER)) {
|
||||||
let killerClient = null;
|
let killerClient = null;
|
||||||
if (killerPed != null && killerPed.type == ELEMENT_PLAYER) {
|
if (killerPed != null && killerPed.type == ELEMENT_PLAYER) {
|
||||||
@@ -298,10 +292,13 @@ function onPedWasted(event, ped, killerPed, weapon, pedPiece) {
|
|||||||
onPlayerWasted(getClientFromPlayerElement(ped), killerClient, weapon, pedPiece);
|
onPlayerWasted(getClientFromPlayerElement(ped), killerClient, weapon, pedPiece);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onPlayerDeath(client, killer, weapon, pedPiece) {
|
function onPlayerDeath(client, killer, weapon, pedPiece) {
|
||||||
|
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Player ${getPlayerDisplayForConsole(client)} died!`);
|
||||||
|
|
||||||
logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} died.`);
|
logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} died.`);
|
||||||
getPlayerData(client).pedState = AGRP_PEDSTATE_DEAD;
|
getPlayerData(client).pedState = AGRP_PEDSTATE_DEAD;
|
||||||
updatePlayerSpawnedState(client, false);
|
updatePlayerSpawnedState(client, false);
|
||||||
@@ -393,74 +390,81 @@ function onPlayerDeath(client, killer, weapon, pedPiece) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onPedSpawn(ped) {
|
function onPedSpawn(ped) {
|
||||||
if (ped.type == ELEMENT_PLAYER) {
|
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} spawned!`);
|
||||||
//setTimeout(onPlayerSpawn, 250, ped);
|
|
||||||
onPlayerSpawn();
|
//if (ped.type == ELEMENT_PLAYER) {
|
||||||
}
|
// if (getGame() != AGRP_GAME_MAFIA_ONE) {
|
||||||
|
// //setTimeout(onPlayerSpawn, 250, getClientFromPlayerElement(ped));
|
||||||
|
// //onPlayerSpawn(getClientFromPlayerElement(ped));
|
||||||
|
// }
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
async function onPlayerSpawn(client) {
|
async function onPlayerSpawn(client) {
|
||||||
//logToConsole(LOG_DEBUG, `[VRR.Event] Checking for ${getPlayerDisplayForConsole(client)}'s player ped`);
|
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Player ${getPlayerDisplayForConsole(client)} spawned!`);
|
||||||
|
//logToConsole(LOG_DEBUG, `[AGRP.Event] Checking for ${getPlayerDisplayForConsole(client)}'s player ped`);
|
||||||
//if(getPlayerPed(client) == null) {
|
//if(getPlayerPed(client) == null) {
|
||||||
// logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)}'s player element not set yet. Rechecking ...`);
|
// logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)}'s player element not set yet. Rechecking ...`);
|
||||||
// setTimeout(onPlayerSpawn, 500, client);
|
// setTimeout(onPlayerSpawn, 500, client);
|
||||||
// return false;
|
// return false;
|
||||||
//}
|
//}
|
||||||
//logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)}'s player ped is valid. Continuing spawn processing ...`);
|
//logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)}'s player ped is valid. Continuing spawn processing ...`);
|
||||||
|
|
||||||
if (areServerElementsSupported()) {
|
if (areServerElementsSupported()) {
|
||||||
await waitUntil(() => client != null && getPlayerPed(client) != null);
|
await waitUntil(() => client != null && getPlayerPed(client) != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
//logToConsole(LOG_DEBUG, `[VRR.Event] Checking ${getPlayerDisplayForConsole(client)}'s player data`);
|
stopRadioStreamForPlayer(client);
|
||||||
|
|
||||||
|
//logToConsole(LOG_DEBUG, `[AGRP.Event] Checking ${getPlayerDisplayForConsole(client)}'s player data`);
|
||||||
if (!getPlayerData(client)) {
|
if (!getPlayerData(client)) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)}'s player data is invalid. Kicking them from server.`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)}'s player data is invalid. Kicking them from server.`);
|
||||||
getPlayerData(targetClient).customDisconnectReason = `Kicked - Spawn bug. Data invalid.`;
|
getPlayerData(targetClient).customDisconnectReason = "Desync";
|
||||||
disconnectPlayer(client);
|
disconnectPlayer(client);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//logToConsole(LOG_DEBUG, `[VRR.Event] Checking ${getPlayerDisplayForConsole(client)}'s login status`);
|
//logToConsole(LOG_DEBUG, `[AGRP.Event] Checking ${getPlayerDisplayForConsole(client)}'s login status`);
|
||||||
if (!isPlayerLoggedIn(client)) {
|
if (!isPlayerLoggedIn(client)) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)} is NOT logged in. Despawning their player.`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)} is NOT logged in. Despawning their player.`);
|
||||||
getPlayerData(targetClient).customDisconnectReason = `Kicked - Tried to force spawn without logging in.`;
|
getPlayerData(targetClient).customDisconnectReason = "Desync";
|
||||||
disconnectPlayer(client);
|
disconnectPlayer(client);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//logToConsole(LOG_DEBUG, `[VRR.Event] Checking ${getPlayerDisplayForConsole(client)}'s selected character status`);
|
//logToConsole(LOG_DEBUG, `[AGRP.Event] Checking ${getPlayerDisplayForConsole(client)}'s selected character status`);
|
||||||
if (getPlayerData(client).currentSubAccount == -1) {
|
if (getPlayerData(client).currentSubAccount == -1) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)} has NOT selected a character. Despawning their player.`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)} has NOT selected a character. Despawning their player.`);
|
||||||
getPlayerData(targetClient).customDisconnectReason = `Kicked - Tried to force spawn without selecting a character.`;
|
getPlayerData(targetClient).customDisconnectReason = "Desync";
|
||||||
disconnectPlayer(client);
|
disconnectPlayer(client);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)}'s player data is valid. Continuing spawn processing ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)}'s player data is valid. Continuing spawn processing ...`);
|
||||||
|
|
||||||
if (isGameFeatureSupported("pedScale")) {
|
if (isGameFeatureSupported("pedScale")) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped scale (${getPlayerCurrentSubAccount(client).pedScale})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped scale (${getPlayerCurrentSubAccount(client).pedScale})`);
|
||||||
setEntityData(getPlayerPed(client), "agrp.scale", getPlayerCurrentSubAccount(client).pedScale, true);
|
setEntityData(getPlayerPed(client), "agrp.scale", getPlayerCurrentSubAccount(client).pedScale, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (isPlayerSwitchingCharacter(client) || isPlayerCreatingCharacter(client)) {
|
//if (isPlayerSwitchingCharacter(client) || isPlayerCreatingCharacter(client)) {
|
||||||
// logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)}'s ped is being used for character selection/creation. No further spawn processing needed'`);
|
// logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)}'s ped is being used for character selection/creation. No further spawn processing needed'`);
|
||||||
// return false;
|
// return false;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
if (isCustomCameraSupported() && getGame() != AGRP_GAME_GTA_IV && getGame() != AGRP_GAME_GTA_IV_EFLC) {
|
if (isCustomCameraSupported()) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Restoring ${getPlayerDisplayForConsole(client)}'s camera`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Restoring ${getPlayerDisplayForConsole(client)}'s camera`);
|
||||||
restorePlayerCamera(client);
|
restorePlayerCamera(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (areServerElementsSupported()) {
|
if (areServerElementsSupported()) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Storing ${getPlayerDisplayForConsole(client)} ped in client data `);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Storing ${getPlayerDisplayForConsole(client)} ped in client data `);
|
||||||
getPlayerData(client).ped = getPlayerPed(client);
|
getPlayerData(client).ped = getPlayerPed(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Sending ${getPlayerDisplayForConsole(client)} the 'now playing as' message`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Sending ${getPlayerDisplayForConsole(client)} the 'now playing as' message`);
|
||||||
messagePlayerAlert(client, `You are now playing as: {businessBlue}${getCharacterFullName(client)}`, getColourByName("white"));
|
messagePlayerAlert(client, `You are now playing as: {businessBlue}${getCharacterFullName(client)}`, getColourByName("white"));
|
||||||
//messagePlayerNormal(client, "This server is in early development and may restart at any time for updates.", getColourByName("orange"));
|
//messagePlayerNormal(client, "This server is in early development and may restart at any time for updates.", getColourByName("orange"));
|
||||||
//messagePlayerNormal(client, "Please report any bugs using /bug and suggestions using /idea", getColourByName("yellow"));
|
//messagePlayerNormal(client, "Please report any bugs using /bug and suggestions using /idea", getColourByName("yellow"));
|
||||||
@@ -474,68 +478,74 @@ async function onPlayerSpawn(client) {
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
if (isGameFeatureSupported("interior")) {
|
if (isGameFeatureSupported("interior")) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Setting player interior for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).interior}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting player interior for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).interior}`);
|
||||||
setPlayerInterior(client, getPlayerCurrentSubAccount(client).interior);
|
setPlayerInterior(client, getPlayerCurrentSubAccount(client).interior);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Setting player dimension for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).dimension}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting player dimension for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).dimension}`);
|
||||||
setPlayerDimension(client, getPlayerCurrentSubAccount(client).dimension);
|
setPlayerDimension(client, getPlayerCurrentSubAccount(client).dimension);
|
||||||
|
|
||||||
//if(getPlayerCurrentSubAccount(client).interior != 0 || getPlayerCurrentSubAccount(client).dimension != 0) {
|
//if(getPlayerCurrentSubAccount(client).interior != 0 || getPlayerCurrentSubAccount(client).dimension != 0) {
|
||||||
// updateAllInteriorVehiclesForPlayer(client, getPlayerCurrentSubAccount(client).interior, getPlayerCurrentSubAccount(client).dimension);
|
// updateAllInteriorVehiclesForPlayer(client, getPlayerCurrentSubAccount(client).interior, getPlayerCurrentSubAccount(client).dimension);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Setting player health for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).health}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting player health for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).health}`);
|
||||||
setPlayerHealth(client, getPlayerCurrentSubAccount(client).health);
|
setPlayerHealth(client, getPlayerCurrentSubAccount(client).health);
|
||||||
|
|
||||||
if (isGameFeatureSupported("pedArmour")) {
|
if (isGameFeatureSupported("pedArmour")) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Setting player armour for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).armour}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting player armour for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).armour}`);
|
||||||
setPlayerArmour(client, getPlayerCurrentSubAccount(client).armour);
|
setPlayerArmour(client, getPlayerCurrentSubAccount(client).armour);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Sending ${getPlayerDisplayForConsole(client)}'s job type to their client (${getJobIndexFromDatabaseId(getPlayerCurrentSubAccount(client))})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Sending ${getPlayerDisplayForConsole(client)}'s job type to their client (${getJobIndexFromDatabaseId(getPlayerCurrentSubAccount(client))})`);
|
||||||
sendPlayerJobType(client, getPlayerCurrentSubAccount(client).job);
|
sendPlayerJobType(client, getPlayerCurrentSubAccount(client).job);
|
||||||
|
|
||||||
if (isGameFeatureSupported("rendering2D")) {
|
if (isGameFeatureSupported("rendering2D")) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Enabling all rendering states for ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Enabling all rendering states for ${getPlayerDisplayForConsole(client)}`);
|
||||||
setPlayer2DRendering(client, true, true, true, true, true, true);
|
setPlayer2DRendering(client, true, true, true, true, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isGameFeatureSupported("snow")) {
|
//if (isGameFeatureSupported("snow")) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Sending snow states to ${getPlayerDisplayForConsole(client)}`);
|
// logToConsole(LOG_DEBUG, `[AGRP.Event] Sending snow states to ${getPlayerDisplayForConsole(client)}`);
|
||||||
updatePlayerSnowState(client);
|
// updatePlayerSnowState(client, true);
|
||||||
}
|
//}
|
||||||
|
|
||||||
if (areServerElementsSupported() && isGameFeatureSupported("walkStyle")) {
|
if (areServerElementsSupported() && isGameFeatureSupported("walkStyle")) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Setting player walking style for ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting player walking style for ${getPlayerDisplayForConsole(client)}`);
|
||||||
setEntityData(getPlayerPed(client), "agrp.walkStyle", getPlayerCurrentSubAccount(client).walkStyle, true);
|
setEntityData(getPlayerPed(client), "agrp.walkStyle", getPlayerCurrentSubAccount(client).walkStyle, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isGameFeatureSupported("fightStyle")) {
|
if (isGameFeatureSupported("fightStyle")) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Setting player fighting style for ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting player fighting style for ${getPlayerDisplayForConsole(client)}`);
|
||||||
setPlayerFightStyle(client, getPlayerCurrentSubAccount(client).fightStyle);
|
setPlayerFightStyle(client, getPlayerCurrentSubAccount(client).fightStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isGameFeatureSupported("rendering2D")) {
|
if (isGameFeatureSupported("rendering2D")) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Updating logo state for ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Updating logo state for ${getPlayerDisplayForConsole(client)}`);
|
||||||
updatePlayerShowLogoState(client, (getServerConfig().showLogo && doesPlayerHaveLogoEnabled(client)));
|
updatePlayerShowLogoState(client, (getServerConfig().showLogo && doesPlayerHaveLogoEnabled(client)));
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Caching ${getPlayerDisplayForConsole(client)}'s hotbar items`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Caching ${getPlayerDisplayForConsole(client)}'s hotbar items`);
|
||||||
cachePlayerHotBarItems(client);
|
cachePlayerHotBarItems(client);
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Syncing ${getPlayerDisplayForConsole(client)}'s hotbar`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Syncing ${getPlayerDisplayForConsole(client)}'s hotbar`);
|
||||||
updatePlayerHotBar(client);
|
updatePlayerHotBar(client);
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Setting ${getPlayerDisplayForConsole(client)}'s switchchar state to false`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting ${getPlayerDisplayForConsole(client)}'s switchchar state to false`);
|
||||||
getPlayerData(client).switchingCharacter = false;
|
getPlayerData(client).switchingCharacter = false;
|
||||||
|
|
||||||
if (!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "enter")) {
|
if (!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "enter")) {
|
||||||
let keyId = getPlayerKeyBindForCommand(client, "enter");
|
let keyId = getPlayerKeyBindForCommand(client, "enter");
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Sending custom enter property key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Sending custom enter property key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendPlayerEnterPropertyKey(client, keyId.key);
|
sendPlayerEnterPropertyKey(client, keyId.key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sendPlayerChatBoxTimeStampsState(client, isPlayerAccountSettingEnabled(client, "ChatBoxTimestamps"));
|
||||||
|
sendPlayerChatEmojiState(client, isPlayerAccountSettingEnabled(client, "ChatEmoji"));
|
||||||
|
sendPlayerProfanityFilterState(client, isPlayerAccountSettingEnabled(client, "ProfanityFilter"));
|
||||||
|
sendPlayerChatScrollLines(client, getPlayerData(client).accountData.chatScrollLines);
|
||||||
|
//sendPlayerGlobalKeyBindsState(client, !isPlayerAccountSettingEnabled(client, "NoKeyBinds"));
|
||||||
|
|
||||||
//if(isGTAIV()) {
|
//if(isGTAIV()) {
|
||||||
// setEntityData(getPlayerPed(client), "agrp.bodyPartHair", getPlayerCurrentSubAccount(client).bodyParts.hair, true);
|
// setEntityData(getPlayerPed(client), "agrp.bodyPartHair", getPlayerCurrentSubAccount(client).bodyParts.hair, true);
|
||||||
// setEntityData(getPlayerPed(client), "agrp.bodyPartHead", getPlayerCurrentSubAccount(client).bodyParts.head, true);
|
// setEntityData(getPlayerPed(client), "agrp.bodyPartHead", getPlayerCurrentSubAccount(client).bodyParts.head, true);
|
||||||
@@ -557,7 +567,7 @@ async function onPlayerSpawn(client) {
|
|||||||
//sendPlayerPedPartsAndProps(client);
|
//sendPlayerPedPartsAndProps(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped state to ready`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped state to ready`);
|
||||||
getPlayerData(client).pedState = AGRP_PEDSTATE_READY;
|
getPlayerData(client).pedState = AGRP_PEDSTATE_READY;
|
||||||
|
|
||||||
if (areServerElementsSupported()) {
|
if (areServerElementsSupported()) {
|
||||||
@@ -567,23 +577,29 @@ async function onPlayerSpawn(client) {
|
|||||||
//}, 1000);
|
//}, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Syncing ${getPlayerDisplayForConsole(client)}'s cash ${getPlayerCurrentSubAccount(client).cash}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Syncing ${getPlayerDisplayForConsole(client)}'s cash ${getPlayerCurrentSubAccount(client).cash}`);
|
||||||
updatePlayerCash(client);
|
updatePlayerCash(client);
|
||||||
|
|
||||||
if (isGameFeatureSupported("customNametag")) {
|
if (isGameFeatureSupported("customNametag")) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Sending player nametag distance to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Sending player nametag distance to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNameTagDistanceToClient(client, getServerConfig().nameTagDistance);
|
sendNameTagDistanceToClient(client, getServerConfig().nameTagDistance);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!areServerElementsSupported()) {
|
if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE || getGame() == AGRP_GAME_GTA_IV) {
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Sending properties, jobs, and vehicles to ${getPlayerDisplayForConsole(client)} (no server elements)`);
|
||||||
sendAllBusinessesToPlayer(client);
|
sendAllBusinessesToPlayer(client);
|
||||||
sendAllHousesToPlayer(client);
|
sendAllHousesToPlayer(client);
|
||||||
//sendAllJobsToPlayer(client);
|
if (getGame() != AGRP_GAME_GTA_IV) {
|
||||||
//sendAllVehiclesToPlayer(client);
|
sendAllJobsToPlayer(client);
|
||||||
|
}
|
||||||
requestPlayerPedNetworkId(client);
|
requestPlayerPedNetworkId(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Updating spawned state for ${getPlayerDisplayForConsole(client)} to true`);
|
if (!areServerElementsSupported()) {
|
||||||
|
sendAllVehiclesToPlayer(client);
|
||||||
|
}
|
||||||
|
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Updating spawned state for ${getPlayerDisplayForConsole(client)} to true`);
|
||||||
updatePlayerSpawnedState(client, true);
|
updatePlayerSpawnedState(client, true);
|
||||||
|
|
||||||
getPlayerData(client).payDayTickStart = sdl.ticks;
|
getPlayerData(client).payDayTickStart = sdl.ticks;
|
||||||
@@ -591,14 +607,29 @@ async function onPlayerSpawn(client) {
|
|||||||
// Locales are handled via resource files now. No need to send anymore, but kept in case revert is needed.
|
// Locales are handled via resource files now. No need to send anymore, but kept in case revert is needed.
|
||||||
//sendPlayerLocaleStrings(client);
|
//sendPlayerLocaleStrings(client);
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Updating all player name tags`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Updating all player name tags`);
|
||||||
updateAllPlayerNameTags();
|
updateAllPlayerNameTags();
|
||||||
|
|
||||||
setPlayerWeaponDamageEvent(client, AGRP_WEAPON_DAMAGE_EVENT_NORMAL);
|
setPlayerWeaponDamageEvent(client, AGRP_WEAPON_DAMAGE_EVENT_NORMAL);
|
||||||
|
|
||||||
|
if (doesPlayerHaveGUIEnabled(client) && getServerConfig().useGUI == true) {
|
||||||
|
if (checkForGeoIPModule()) {
|
||||||
|
let iso = getPlayerCountryISOCode(client);
|
||||||
|
let localeId = getLocaleFromCountryISO(iso);
|
||||||
|
|
||||||
|
if (localeId != 0) {
|
||||||
|
if (getLocaleData(localeId).enabled) {
|
||||||
|
messagePlayerTip(client, getLanguageLocaleString(localeId, "LocaleOffer", `/lang ${getLocaleData(localeId).isoCode}`), getColourByName("white"), 10000, "Roboto");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (areServerElementsSupported()) {
|
if (areServerElementsSupported()) {
|
||||||
if (getGlobalConfig().playerStreamInDistance == -1 || getGlobalConfig().playerStreamOutDistance == -1) {
|
if (getGlobalConfig().playerStreamInDistance == -1 || getGlobalConfig().playerStreamOutDistance == -1) {
|
||||||
getPlayerPed(client).netFlags.distanceStreaming = false;
|
//getPlayerPed(client).netFlags.distanceStreaming = false;
|
||||||
|
setElementStreamInDistance(getPlayerPed(client), 99999);
|
||||||
|
setElementStreamOutDistance(getPlayerPed(client), 99999);
|
||||||
} else {
|
} else {
|
||||||
setElementStreamInDistance(getPlayerPed(client), getServerConfig().playerStreamInDistance);
|
setElementStreamInDistance(getPlayerPed(client), getServerConfig().playerStreamInDistance);
|
||||||
setElementStreamOutDistance(getPlayerPed(client), getServerConfig().playerStreamOutDistance);
|
setElementStreamOutDistance(getPlayerPed(client), getServerConfig().playerStreamOutDistance);
|
||||||
@@ -609,7 +640,7 @@ async function onPlayerSpawn(client) {
|
|||||||
|
|
||||||
// Radio stuff must be last thing sent to client because it hangs the client for a second, which blocks processing of other incoming packets
|
// Radio stuff must be last thing sent to client because it hangs the client for a second, which blocks processing of other incoming packets
|
||||||
// Start playing business/house radio if in one
|
// Start playing business/house radio if in one
|
||||||
if (getPlayerCurrentSubAccount(client).interior != getGameConfig().mainWorldInterior[getGame()] || getPlayerCurrentSubAccount(client).dimension != getGameConfig().mainWorldDimension[getGame()]) {
|
if (getPlayerDimension(client) != getGameConfig().mainWorldDimension[getGame()]) {
|
||||||
let businessId = getPlayerBusiness(client);
|
let businessId = getPlayerBusiness(client);
|
||||||
let houseId = getPlayerHouse(client);
|
let houseId = getPlayerHouse(client);
|
||||||
if (businessId != -1) {
|
if (businessId != -1) {
|
||||||
@@ -623,8 +654,6 @@ async function onPlayerSpawn(client) {
|
|||||||
} else {
|
} else {
|
||||||
stopRadioStreamForPlayer(client);
|
stopRadioStreamForPlayer(client);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
stopRadioStreamForPlayer(client);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
messageDiscordEventChannel(`🧍 ${getPlayerName(client)} spawned as ${getCharacterFullName(client)}`);
|
messageDiscordEventChannel(`🧍 ${getPlayerName(client)} spawned as ${getCharacterFullName(client)}`);
|
||||||
@@ -632,7 +661,11 @@ async function onPlayerSpawn(client) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
// Only used for MP mods without an "add command handler" ability
|
||||||
|
// Not bound on GTA Connected or RageMP
|
||||||
function onPlayerCommand(event, client, command, params) {
|
function onPlayerCommand(event, client, command, params) {
|
||||||
|
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Player used command ${command}!`);
|
||||||
|
|
||||||
if (!doesCommandExist(command)) {
|
if (!doesCommandExist(command)) {
|
||||||
processPlayerCommand(command, params, client);
|
processPlayerCommand(command, params, client);
|
||||||
}
|
}
|
||||||
@@ -641,11 +674,23 @@ function onPlayerCommand(event, client, command, params) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onPedExitedVehicle(event, ped, vehicle, seat) {
|
function onPedExitedVehicle(event, ped, vehicle, seat) {
|
||||||
|
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} exited vehicle ${vehicle.id} from seat ${seat}!`);
|
||||||
|
|
||||||
|
if (getVehicleData(vehicle) == false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (ped.isType(ELEMENT_PLAYER)) {
|
if (ped.isType(ELEMENT_PLAYER)) {
|
||||||
let client = getClientFromPlayerElement(ped);
|
let client = getClientFromPlayerElement(ped);
|
||||||
if (client != null) {
|
if (client != null) {
|
||||||
getPlayerData(client).pedState = AGRP_PEDSTATE_READY;
|
getPlayerData(client).pedState = AGRP_PEDSTATE_READY;
|
||||||
|
|
||||||
|
if (getVehicleData(vehicle).spawnLocked == false && canPlayerManageVehicle(client, vehicle) == true) {
|
||||||
|
getVehicleData(vehicle).spawnPosition = getVehiclePosition(vehicle);
|
||||||
|
getVehicleData(vehicle).spawnRotation = getVehicleHeading(vehicle);
|
||||||
|
getVehicleData(vehicle).needsSaved = true;
|
||||||
|
}
|
||||||
|
|
||||||
stopRadioStreamForPlayer(client);
|
stopRadioStreamForPlayer(client);
|
||||||
|
|
||||||
if (!getVehicleData(vehicle)) {
|
if (!getVehicleData(vehicle)) {
|
||||||
@@ -662,7 +707,7 @@ function onPedExitedVehicle(event, ped, vehicle, seat) {
|
|||||||
|
|
||||||
getVehicleData(vehicle).lastActiveTime = getCurrentUnixTimestamp();
|
getVehicleData(vehicle).lastActiveTime = getCurrentUnixTimestamp();
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)} exited a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("agrp.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)} exited a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("agrp.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -670,6 +715,8 @@ function onPedExitedVehicle(event, ped, vehicle, seat) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onPedEnteredVehicle(event, ped, vehicle, seat) {
|
function onPedEnteredVehicle(event, ped, vehicle, seat) {
|
||||||
|
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} entered vehicle ${vehicle.id} in seat ${seat}!`);
|
||||||
|
|
||||||
if (ped.isType(ELEMENT_PLAYER)) {
|
if (ped.isType(ELEMENT_PLAYER)) {
|
||||||
let client = getClientFromPlayerElement(ped);
|
let client = getClientFromPlayerElement(ped);
|
||||||
if (client != null) {
|
if (client != null) {
|
||||||
@@ -677,31 +724,29 @@ function onPedEnteredVehicle(event, ped, vehicle, seat) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
|
||||||
vehicle = getVehicleFromIVNetworkId(clientVehicle);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!getVehicleData(vehicle)) {
|
if (!getVehicleData(vehicle)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)} entered a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("agrp.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)} entered a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("agrp.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`);
|
||||||
|
|
||||||
getPlayerData(client).lastVehicle = vehicle;
|
getPlayerData(client).lastVehicle = vehicle;
|
||||||
getVehicleData(vehicle).lastActiveTime = getCurrentUnixTimestamp();
|
getVehicleData(vehicle).lastActiveTime = getCurrentUnixTimestamp();
|
||||||
|
|
||||||
if (getPlayerVehicleSeat(client) == AGRP_VEHSEAT_DRIVER) {
|
if (seat == AGRP_VEHSEAT_DRIVER) {
|
||||||
vehicle.engine = getVehicleData(vehicle).engine;
|
vehicle.engine = getVehicleData(vehicle).engine;
|
||||||
|
setEntityData(vehicle, "agrp.engine", getVehicleData(vehicle).engine, true);
|
||||||
|
//vehicle.netFlags.sendSync = getVehicleData(vehicle).engine;
|
||||||
|
|
||||||
if (getVehicleData(vehicle).buyPrice > 0) {
|
if (getVehicleData(vehicle).buyPrice > 0) {
|
||||||
messagePlayerAlert(client, getLocaleString(client, "VehicleForSale", getVehicleName(vehicle), `{ALTCOLOUR}$${makeLargeNumberReadable(getVehicleData(vehicle).buyPrice)}{MAINCOLOUR}`, `{ALTCOLOUR}/vehbuy{MAINCOLOUR}`));
|
messagePlayerAlert(client, getLocaleString(client, "VehicleForSale", getVehicleName(vehicle), `{ALTCOLOUR}${getCurrencyString(getVehicleData(vehicle).buyPrice)}{MAINCOLOUR}`, `{ALTCOLOUR}/vehbuy{MAINCOLOUR}`));
|
||||||
resetVehiclePosition(vehicle);
|
resetVehiclePosition(vehicle);
|
||||||
} else if (getVehicleData(vehicle).rentPrice > 0) {
|
} else if (getVehicleData(vehicle).rentPrice > 0) {
|
||||||
if (getVehicleData(vehicle).rentedBy != client) {
|
if (getVehicleData(vehicle).rentedBy != client) {
|
||||||
messagePlayerAlert(client, getLocaleString(client, "VehicleForRent", getVehicleName(vehicle), `{ALTCOLOUR}$${makeLargeNumberReadable(getVehicleData(vehicle).rentPrice)}{MAINCOLOUR}`, `{ALTCOLOUR}/vehrent{MAINCOLOUR}`));
|
messagePlayerAlert(client, getLocaleString(client, "VehicleForRent", getVehicleName(vehicle), `{ALTCOLOUR}${getCurrencyString(getVehicleData(vehicle).rentPrice)}{MAINCOLOUR}`, `{ALTCOLOUR}/vehrent{MAINCOLOUR}`));
|
||||||
resetVehiclePosition(vehicle);
|
resetVehiclePosition(vehicle);
|
||||||
} else {
|
} else {
|
||||||
messagePlayerAlert(client, getLocaleString(client, "CurrentlyRentingThisVehicle", `{vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR}`, `{ALTCOLOUR}$${makeLargeNumberReadable(getVehicleData(vehicle).rentPrice)}`, `{ALTCOLOUR}/stoprent{MAINCOLOUR}`));
|
messagePlayerAlert(client, getLocaleString(client, "CurrentlyRentingThisVehicle", `{vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR}`, `{ALTCOLOUR}${getCurrencyString(getVehicleData(vehicle).rentPrice)}`, `{ALTCOLOUR}/stoprent{MAINCOLOUR}`));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let ownerName = "Nobody";
|
let ownerName = "Nobody";
|
||||||
@@ -725,7 +770,7 @@ function onPedEnteredVehicle(event, ped, vehicle, seat) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case AGRP_VEHOWNER_BIZ:
|
case AGRP_VEHOWNER_BIZ:
|
||||||
ownerName = getBusinessData(getVehicleData(vehicle).ownerId).name;
|
ownerName = getBusinessData(getBusinessIdFromDatabaseId(getVehicleData(vehicle).ownerId)).name;
|
||||||
ownerType = getLocaleString(client, "Business");
|
ownerType = getLocaleString(client, "Business");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -757,7 +802,9 @@ function onPedEnteredVehicle(event, ped, vehicle, seat) {
|
|||||||
if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_JOB) {
|
if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_JOB) {
|
||||||
if (getVehicleData(vehicle).ownerId == getPlayerCurrentSubAccount(client).job) {
|
if (getVehicleData(vehicle).ownerId == getPlayerCurrentSubAccount(client).job) {
|
||||||
getPlayerCurrentSubAccount(client).lastJobVehicle = vehicle;
|
getPlayerCurrentSubAccount(client).lastJobVehicle = vehicle;
|
||||||
messagePlayerInfo(client, `Use /startroute to start working in this vehicle`);
|
if (!hasPlayerSeenActionTip(client, "JobRouteStart")) {
|
||||||
|
messagePlayerInfo(client, getGroupedLocaleString(client, "ActionTips", "JobRouteStart", `{ALTCOLOUR}/startroute{MAINCOLOUR}`));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -784,10 +831,15 @@ function onPedEnteredVehicle(event, ped, vehicle, seat) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onPedEnteringVehicle(event, ped, vehicle, seat) {
|
function onPedEnteringVehicle(event, ped, vehicle, seat) {
|
||||||
|
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} is entering vehicle ${vehicle.id} in seat ${seat}!`);
|
||||||
|
|
||||||
if (ped.isType(ELEMENT_PLAYER)) {
|
if (ped.isType(ELEMENT_PLAYER)) {
|
||||||
let client = getClientFromPlayerElement(ped);
|
let client = getClientFromPlayerElement(ped);
|
||||||
if (client != null) {
|
if (client != null) {
|
||||||
|
if (seat == AGRP_VEHSEAT_DRIVER) {
|
||||||
|
//vehicle.netFlags.sendSync = getVehicleData(vehicle).engine;
|
||||||
|
}
|
||||||
|
onPlayerEnteringVehicle(client, vehicle, seat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -795,12 +847,40 @@ function onPedEnteringVehicle(event, ped, vehicle, seat) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onPedExitingVehicle(event, ped, vehicle, seat) {
|
function onPedExitingVehicle(event, ped, vehicle, seat) {
|
||||||
|
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} is exiting vehicle ${vehicle.id} in seat ${seat}!`);
|
||||||
|
|
||||||
if (ped.isType(ELEMENT_PLAYER)) {
|
if (ped.isType(ELEMENT_PLAYER)) {
|
||||||
let client = getClientFromPlayerElement(ped);
|
let client = getClientFromPlayerElement(ped);
|
||||||
if (client != null) {
|
if (client != null) {
|
||||||
|
if (seat == AGRP_VEHSEAT_DRIVER) {
|
||||||
|
//vehicle.netFlags.sendSync = getVehicleData(vehicle).engine;
|
||||||
|
}
|
||||||
onPlayerExitingVehicle(client, vehicle, seat);
|
onPlayerExitingVehicle(client, vehicle, seat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function onPlayerEnteringVehicle(client, vehicle, seat) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function onPlayerExitingVehicle(client, vehicle, seat) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function onPedFall(ped) {
|
||||||
|
if (ped.isType(ELEMENT_PLAYER)) {
|
||||||
|
let client = getClientFromPlayerElement(ped);
|
||||||
|
if (client != null) {
|
||||||
|
processPlayerDeath(client);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -87,8 +87,8 @@ let fishingParticleEffects = {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initFishingScript() {
|
function initFishingScript() {
|
||||||
logToConsole(LOG_INFO, "[VRR.Fishing]: Initializing fishing script ...");
|
logToConsole(LOG_INFO, "[AGRP.Fishing]: Initializing fishing script ...");
|
||||||
logToConsole(LOG_INFO, "[VRR.Fishing]: Fishing script initialized successfully!");
|
logToConsole(LOG_INFO, "[AGRP.Fishing]: Fishing script initialized successfully!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ class GateData {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initGateScript() {
|
function initGateScript() {
|
||||||
logToConsole(LOG_INFO, `[VRR.Gate]: Initializing gate script ...`);
|
logToConsole(LOG_INFO, `[AGRP.Gate]: Initializing gate script ...`);
|
||||||
logToConsole(LOG_INFO, `[VRR.Gate]: Gate script initialized successfully!`);
|
logToConsole(LOG_INFO, `[AGRP.Gate]: Gate script initialized successfully!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -194,7 +194,7 @@ function saveGateToDatabase(gateId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Gate]: Saving gate ${tempGateData.databaseId} to database ...`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Gate]: Saving gate ${tempGateData.databaseId} to database ...`);
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let safeGateName = escapeDatabaseString(tempGateData.name);
|
let safeGateName = escapeDatabaseString(tempGateData.name);
|
||||||
@@ -228,7 +228,7 @@ function saveGateToDatabase(gateId) {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Gate]: Saved gate ${gateDataId} to database!`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Gate]: Saved gate ${gateDataId} to database!`);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -236,7 +236,7 @@ function saveGateToDatabase(gateId) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadGatesFromDatabase() {
|
function loadGatesFromDatabase() {
|
||||||
logToConsole(LOG_INFO, "[VRR.Gate]: Loading gates from database ...");
|
logToConsole(LOG_INFO, "[AGRP.Gate]: Loading gates from database ...");
|
||||||
|
|
||||||
let tempGates = [];
|
let tempGates = [];
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
@@ -249,7 +249,7 @@ function loadGatesFromDatabase() {
|
|||||||
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
||||||
let tempGateData = new GateData(dbAssoc);
|
let tempGateData = new GateData(dbAssoc);
|
||||||
tempGates.push(tempGateData);
|
tempGates.push(tempGateData);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Gate]: Gate '${tempGateData.name}' loaded from database successfully!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Gate]: Gate '${tempGateData.name}' loaded from database successfully!`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
@@ -257,7 +257,7 @@ function loadGatesFromDatabase() {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_INFO, `[VRR.Gate]: ${tempGates.length} gates loaded from database successfully!`);
|
logToConsole(LOG_INFO, `[AGRP.Gate]: ${tempGates.length} gates loaded from database successfully!`);
|
||||||
return tempGates;
|
return tempGates;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,280 +8,21 @@
|
|||||||
// TYPE: Server (JavaScript)
|
// TYPE: Server (JavaScript)
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
// Prompts (used for client GUI prompt responses)
|
|
||||||
const AGRP_PROMPT_NONE = 0;
|
|
||||||
const AGRP_PROMPT_CREATEFIRSTCHAR = 1;
|
|
||||||
const AGRP_PROMPT_BIZORDER = 2;
|
|
||||||
const AGRP_PROMPT_GIVEVEHTOCLAN = 3;
|
|
||||||
const AGRP_PROMPT_GIVEBIZTOCLAN = 4;
|
|
||||||
const AGRP_PROMPT_GIVEHOUSETOCLAN = 5;
|
|
||||||
const AGRP_PROMPT_BUYBIZ = 6;
|
|
||||||
const AGRP_PROMPT_BUYHOUSE = 7;
|
|
||||||
const AGRP_PROMPT_RESETKEYBINDS = 8;
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function initGUIScript() {
|
function initGUIScript() {
|
||||||
logToConsole(LOG_INFO, "[VRR.GUI]: Initializing GUI script ...");
|
logToConsole(LOG_INFO, "[AGRP.GUI]: Initializing GUI script ...");
|
||||||
logToConsole(LOG_INFO, "[VRR.GUI]: GUI script initialized successfully!");
|
logToConsole(LOG_INFO, "[AGRP.GUI]: GUI script initialized successfully!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function playerPromptAnswerNo(client) {
|
function doesPlayerUseGUI(client) {
|
||||||
if (getPlayerData(client).promptType == AGRP_PROMPT_NONE) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} answered NO to their prompt (${getPlayerData(client).promptType})`);
|
|
||||||
|
|
||||||
switch (getPlayerData(client).promptType) {
|
|
||||||
case AGRP_PROMPT_CREATEFIRSTCHAR:
|
|
||||||
logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} chose not to create a first character. Kicking them from the server ...`);
|
|
||||||
showPlayerErrorGUI(client, "You don't have a character to play. Goodbye!", "No Characters");
|
|
||||||
getPlayerData(targetClient).customDisconnectReason = `Kicked - Didn't create a character`;
|
|
||||||
setTimeout(function () { disconnectPlayer(client); }, 5000);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case AGRP_PROMPT_BIZORDER:
|
|
||||||
if (getPlayerData(client).businessOrderAmount > 0) {
|
|
||||||
if (canPlayerUseGUI(client)) {
|
|
||||||
showPlayerErrorGUI(client, "You canceled the order.", "Business Order Canceled");
|
|
||||||
} else {
|
|
||||||
logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} canceled the order of ${getPlayerData(client).businessOrderAmount} ${getPlayerData(client).businessOrderItem} at ${getPlayerData(client).businessOrderCost / getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness)}`);
|
|
||||||
messagePlayerError(client, "You canceled the order!");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
showPlayerErrorGUI(client, "You aren't ordering anything for a business!", "Business Order Canceled");
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
getPlayerData(client).promptType = AGRP_PROMPT_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function playerPromptAnswerYes(client) {
|
|
||||||
if (getPlayerData(client).promptType == AGRP_PROMPT_NONE) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} answered YES to their prompt (${getPlayerData(client).promptType})`);
|
|
||||||
|
|
||||||
switch (getPlayerData(client).promptType) {
|
|
||||||
case AGRP_PROMPT_CREATEFIRSTCHAR: {
|
|
||||||
showPlayerNewCharacterGUI(client);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case AGRP_PROMPT_BIZORDER: {
|
|
||||||
if (getPlayerData(client).businessOrderAmount > 0) {
|
|
||||||
if (getBusinessData(getPlayerData(client).businessOrderBusiness).till < getPlayerData(client).businessOrderCost) {
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} failed to order ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} at ${getPlayerData(client).businessOrderCost / getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness).name} (Reason: Not enough money in business till)`);
|
|
||||||
showPlayerErrorGUI(client, "This business doesn't have enough money! Deposit some using /bizdeposit", "Business Order Canceled");
|
|
||||||
getPlayerData(client).businessOrderAmount = 0;
|
|
||||||
getPlayerData(client).businessOrderBusiness = false;
|
|
||||||
getPlayerData(client).businessOrderItem = -1;
|
|
||||||
getPlayerData(client).businessOrderValue = -1;
|
|
||||||
} else {
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} successfully ordered ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} at ${getPlayerData(client).businessOrderCost / getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness).name}`);
|
|
||||||
showPlayerInfoGUI(client, `You ordered ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} (${getItemValueDisplay(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue)}) for ${getPlayerData(client).businessOrderCost}!`, "Business Order Successful");
|
|
||||||
createItem(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue, AGRP_ITEM_OWNER_BIZFLOOR, getBusinessData(getPlayerData(client).businessOrderBusiness).databaseId, getPlayerData(client).businessOrderAmount);
|
|
||||||
cacheBusinessItems(getPlayerData(client).businessOrderBusiness);
|
|
||||||
getBusinessData(getPlayerData(client).businessOrderBusiness).till -= getPlayerData(client).businessOrderCost;
|
|
||||||
updateBusinessPickupLabelData(getPlayerData(client).businessOrderBusiness);
|
|
||||||
getPlayerData(client).businessOrderAmount = 0;
|
|
||||||
getPlayerData(client).businessOrderBusiness = false;
|
|
||||||
getPlayerData(client).businessOrderItem = -1;
|
|
||||||
getPlayerData(client).businessOrderValue = -1;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
showPlayerErrorGUI(client, ``, `Business Order Canceled`);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case AGRP_PROMPT_GIVEVEHTOCLAN: {
|
|
||||||
if (!isPlayerInAnyVehicle(client)) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "MustBeInVehicle"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!getVehicleData(getPlayerVehicle(client))) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "RandomVehicleCommandsDisabled"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getVehicleData(getPlayerVehicle(client)).ownerType != AGRP_VEHOWNER_PLAYER) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "MustOwnVehicle"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getVehicleData(getPlayerVehicle(client)).ownerId != getPlayerCurrentSubAccount(client).databaseId) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "MustOwnVehicle"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
getVehicleData(getPlayerVehicle(client)).ownerType = AGRP_VEHOWNER_CLAN;
|
|
||||||
getVehicleData(getPlayerVehicle(client)).ownerId = getPlayerCurrentSubAccount(client).clan;
|
|
||||||
messagePlayerSuccess(client, getLocaleString(client, "GaveVehicleToClan", getVehicleName(getPlayerVehicle(client))));
|
|
||||||
//messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} {MAINCOLOUR}set their {vehiclePurple}${getVehicleName(vehicle)} {MAINCOLOUR}owner to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan`);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case AGRP_PROMPT_GIVEHOUSETOCLAN: {
|
|
||||||
let houseId = getPlayerHouse(client);
|
|
||||||
if (!houseId) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidHouse"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getHouseData(houseId).ownerType != AGRP_VEHOWNER_PLAYER) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "MustOwnHouse"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getHouseData(houseId).ownerId != getPlayerCurrentSubAccount(client).databaseId) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "MustOwnHouse"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_CLAN;
|
|
||||||
getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(client).clan;
|
|
||||||
messagePlayerSuccess(client, getLocaleString(client, "GaveHouseToClan"));
|
|
||||||
//messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} {MAINCOLOUR}set their {vehiclePurple}${getVehicleName(vehicle)} {MAINCOLOUR}owner to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan`);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case AGRP_PROMPT_GIVEBIZTOCLAN: {
|
|
||||||
let businessId = getPlayerBusiness(client);
|
|
||||||
if (!businessId) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidBusiness"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getBusinessData(businessId).ownerType != AGRP_VEHOWNER_PLAYER) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "MustOwnBusiness"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getBusinessData(businessId).ownerId != getPlayerCurrentSubAccount(client).databaseId) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "MustOwnBusiness"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_CLAN;
|
|
||||||
getBusinessData(businessId).ownerId = getPlayerCurrentSubAccount(client).clan;
|
|
||||||
messagePlayerSuccess(client, getLocaleString(client, "GaveBusinessToClan"));
|
|
||||||
//messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} {MAINCOLOUR}set their {vehiclePurple}${getVehicleName(vehicle)} {MAINCOLOUR}owner to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan`);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case AGRP_PROMPT_BUYHOUSE: {
|
|
||||||
let houseId = getPlayerHouse(client);
|
|
||||||
if (!houseId) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidHouse"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getHouseData(houseId).buyPrice <= 0) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "HouseNotForSale"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getPlayerCurrentSubAccount(client).cash < getHouseData(houseId).buyPrice) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "HousePurchaseNotEnoughMoney"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_PLAYER;
|
|
||||||
getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(client).databaseId;
|
|
||||||
getHouseData(houseId).buyPrice = 0;
|
|
||||||
getHouseData(houseId).needsSaved = true;
|
|
||||||
updateHousePickupLabelData(houseId);
|
|
||||||
|
|
||||||
messageDiscordEventChannel(`🏘️ ${getCharacterFullName(client)} is now the owner of *${getHouseData(houseId).description}*!`);
|
|
||||||
messagePlayerSuccess(client, `🏘️ You are now the owner of {houseGreen}${getHouseData(houseId).description}`);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case AGRP_PROMPT_BUYBIZ: {
|
|
||||||
let businessId = getPlayerBusiness(client);
|
|
||||||
if (!businessId) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidBusiness"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getBusinessData(businessId).buyPrice <= 0) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "BusinessNotForSale"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getPlayerCurrentSubAccount(client).cash < getBusinessData(businessId).buyPrice) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "BusinessPurchaseNotEnoughMoney"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_PLAYER;
|
|
||||||
getBusinessData(businessId).ownerId = getPlayerCurrentSubAccount(client).databaseId;
|
|
||||||
getBusinessData(businessId).buyPrice = 0;
|
|
||||||
getBusinessData(businessId).needsSaved = true;
|
|
||||||
updateBusinessPickupLabelData(businessId);
|
|
||||||
|
|
||||||
messageDiscordEventChannel(`🏢 ${getCharacterFullName(client)} is now the owner of *${getBusinessData(businessId).name}*!`);
|
|
||||||
messagePlayerSuccess(client, `🏢 You are now the owner of {businessBlue}${getBusinessData(businessId).name}`);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case AGRP_PROMPT_RESETKEYBINDS: {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case AGRP_PROMPT_COPYKEYBINDSTOSERVER: {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default: {
|
|
||||||
submitBugReport(client, `[AUTOMATED REPORT] Unknown prompt type: ${getPlayerData(client).promptType}`);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
getPlayerData(client).promptType = AGRP_PROMPT_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function canPlayerUseGUI(client) {
|
|
||||||
return (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client));
|
return (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function playerPromptAnswerYesCommand(command, params, client) {
|
|
||||||
playerPromptAnswerYes(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function playerPromptAnswerNoCommand(command, params, client) {
|
|
||||||
playerPromptAnswerNo(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function playerToggledGUI(client) {
|
function playerToggledGUI(client) {
|
||||||
toggleAccountGUICommand("gui", "", client);
|
toggleAccountGUICommand("gui", "", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showPlayerTwoFactorAuthenticationGUI(client) {
|
|
||||||
sendNetworkEventToPlayer("agrp.2fa", client);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
@@ -9,8 +9,8 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initHelpScript() {
|
function initHelpScript() {
|
||||||
logToConsole(LOG_INFO, `[VRR.Help]: Initializing help script ...`);
|
logToConsole(LOG_INFO, `[AGRP.Help]: Initializing help script ...`);
|
||||||
logToConsole(LOG_INFO, `[VRR.Help]: Help script initialized successfully!`);
|
logToConsole(LOG_INFO, `[AGRP.Help]: Help script initialized successfully!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -204,9 +204,9 @@ function showAccountHelpMessage(client) {
|
|||||||
function showVehicleHelpMessage(client) {
|
function showVehicleHelpMessage(client) {
|
||||||
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderVehicleHelp")));
|
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderVehicleHelp")));
|
||||||
|
|
||||||
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleHelp", 0, `{ALTCOLOUR}/info dealership{MAINCOLOUR}`));
|
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleHelp", 0));
|
||||||
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleHelp", 1, `{ALTCOLOUR}/lock, /engine, /lights, /trunk, /rentveh, /buyveh, /rentprice, /buyprice{MAINCOLOUR}`));
|
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleHelp", 1, `{ALTCOLOUR}/info dealership{MAINCOLOUR}`));
|
||||||
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleHelp", 2));
|
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleHelp", 2, `{ALTCOLOUR}/lock, /engine, /lights, /trunk, /rentveh, /buyveh, /rentprice, /buyprice{MAINCOLOUR}`));
|
||||||
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleHelp", 3, `{ALTCOLOUR}/info mechanic{MAINCOLOUR}`));
|
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleHelp", 3, `{ALTCOLOUR}/info mechanic{MAINCOLOUR}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -216,8 +216,8 @@ function showVehicleDealershipHelpMessage(client) {
|
|||||||
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderVehicleDealershipHelp")));
|
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderVehicleDealershipHelp")));
|
||||||
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleDealershipHelp", 0, `{ALTCOLOUR}/gps{MAINCOLOUR}`));
|
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleDealershipHelp", 0, `{ALTCOLOUR}/gps{MAINCOLOUR}`));
|
||||||
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleDealershipHelp", 1));
|
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleDealershipHelp", 1));
|
||||||
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleDealershipHelp", 1, `{ALTCOLOUR}/buyveh{MAINCOLOUR}`));
|
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleDealershipHelp", 2, `{ALTCOLOUR}/buyveh{MAINCOLOUR}`));
|
||||||
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleDealershipHelp", 2));
|
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleDealershipHelp", 3));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -348,22 +348,23 @@ function showCommandHelpMessage(client, commandName) {
|
|||||||
commandName = commandName.slice(1);
|
commandName = commandName.slice(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
let command = getCommandData(commandName);
|
let commandData = getCommandData(commandName);
|
||||||
let aliases = getCommandAliasesNames(command);
|
let aliases = getCommandAliasesNames(commandData);
|
||||||
|
|
||||||
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderCommandInfo", commandName)));
|
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderCommandInfo", commandName)));
|
||||||
messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Description: ${command.helpDescription}`);
|
messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Description: ${commandData.helpDescription}`);
|
||||||
|
messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Usage: /${commandData.command} ${commandData.syntaxString}`);
|
||||||
|
|
||||||
if (aliases.length > 0) {
|
if (aliases.length > 0) {
|
||||||
messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Aliases: ${aliases.join(", ")}`);
|
messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Aliases: ${aliases.map(alias => `/${alias.command}`).join(", ")}`);
|
||||||
} else {
|
} else {
|
||||||
messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Aliases: (None)`);
|
messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Aliases: (None)`);
|
||||||
}
|
}
|
||||||
|
|
||||||
//messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Usable on Discord: ${getYesNoFromBool(command.allowOnDiscord)}`);
|
//messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Usable on Discord: ${getYesNoFromBool(commandData.allowOnDiscord)}`);
|
||||||
|
|
||||||
//if(doesPlayerHaveStaffPermission(client, getStaffFlagValue("BasicModeration"))) {
|
//if(doesPlayerHaveStaffPermission(client, getStaffFlagValue("BasicModeration"))) {
|
||||||
// messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Usable on Discord: ${getYesNoFromBool(command.allowOnDiscord)}`);
|
// messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Usable on Discord: ${getYesNoFromBool(commandData.allowOnDiscord)}`);
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -399,3 +400,23 @@ function helpGetSkinCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function hasPlayerSeenActionTip(client, seenActionTipFlagName) {
|
||||||
|
let seenActionTipFlagValue = getSeenActionTipsValue(seenActionTipFlagName);
|
||||||
|
|
||||||
|
if (hasBitFlag(getPlayerData(client).accountData.seenActionTips, seenActionTipFlagValue)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function markPlayerActionTipSeen(client, seenActionTipFlagName) {
|
||||||
|
let seenActionTipFlagValue = getSeenActionTipsValue(seenActionTipFlagName);
|
||||||
|
|
||||||
|
getPlayerData(client).accountData.seenActionTips = addBitFlag(getPlayerData(client).accountData.seenActionTips, seenActionTipFlagValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -42,6 +42,7 @@ class HouseData {
|
|||||||
this.index = -1;
|
this.index = -1;
|
||||||
this.needsSaved = false;
|
this.needsSaved = false;
|
||||||
this.interiorLights = true;
|
this.interiorLights = true;
|
||||||
|
this.propertyType = AGRP_PROPERTY_TYPE_HOUSE;
|
||||||
|
|
||||||
this.itemCache = [];
|
this.itemCache = [];
|
||||||
this.locations = [];
|
this.locations = [];
|
||||||
@@ -55,6 +56,7 @@ class HouseData {
|
|||||||
this.entranceBlipModel = -1;
|
this.entranceBlipModel = -1;
|
||||||
this.entrancePickup = null;
|
this.entrancePickup = null;
|
||||||
this.entranceBlip = null;
|
this.entranceBlip = null;
|
||||||
|
this.entranceScene = "";
|
||||||
|
|
||||||
this.exitPosition = false;
|
this.exitPosition = false;
|
||||||
this.exitRotation = 0.0;
|
this.exitRotation = 0.0;
|
||||||
@@ -64,6 +66,7 @@ class HouseData {
|
|||||||
this.exitBlipModel = -1;
|
this.exitBlipModel = -1;
|
||||||
this.exitPickup = null;
|
this.exitPickup = null;
|
||||||
this.exitBlip = null;
|
this.exitBlip = null;
|
||||||
|
this.exitScene = "";
|
||||||
|
|
||||||
this.streamingRadioStation = 0;
|
this.streamingRadioStation = 0;
|
||||||
this.streamingRadioStationIndex = -1;
|
this.streamingRadioStationIndex = -1;
|
||||||
@@ -86,6 +89,7 @@ class HouseData {
|
|||||||
this.entranceDimension = toInteger(dbAssoc["house_entrance_vw"]);
|
this.entranceDimension = toInteger(dbAssoc["house_entrance_vw"]);
|
||||||
this.entrancePickupModel = toInteger(dbAssoc["house_entrance_pickup"]);
|
this.entrancePickupModel = toInteger(dbAssoc["house_entrance_pickup"]);
|
||||||
this.entranceBlipModel = toInteger(dbAssoc["house_entrance_blip"]);
|
this.entranceBlipModel = toInteger(dbAssoc["house_entrance_blip"]);
|
||||||
|
this.entranceScene = toString(dbAssoc["house_entrance_scene"]);
|
||||||
|
|
||||||
this.exitPosition = toVector3(toFloat(dbAssoc["house_exit_pos_x"]), toFloat(dbAssoc["house_exit_pos_y"]), toFloat(dbAssoc["house_exit_pos_z"]));
|
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"]);
|
this.exitRotation = toFloat(dbAssoc["house_exit_rot_z"]);
|
||||||
@@ -93,6 +97,7 @@ class HouseData {
|
|||||||
this.exitDimension = toInteger(dbAssoc["house_exit_vw"]);
|
this.exitDimension = toInteger(dbAssoc["house_exit_vw"]);
|
||||||
this.exitPickupModel = toInteger(dbAssoc["house_exit_pickup"]);
|
this.exitPickupModel = toInteger(dbAssoc["house_exit_pickup"]);
|
||||||
this.exitBlipModel = toInteger(dbAssoc["house_exit_blip"]);
|
this.exitBlipModel = toInteger(dbAssoc["house_exit_blip"]);
|
||||||
|
this.exitScene = toString(dbAssoc["house_exit_scene"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -163,15 +168,15 @@ class HouseGameScriptData {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initHouseScript() {
|
function initHouseScript() {
|
||||||
logToConsole(LOG_INFO, "[VRR.House]: Initializing house script ...");
|
logToConsole(LOG_INFO, "[AGRP.House]: Initializing house script ...");
|
||||||
logToConsole(LOG_INFO, "[VRR.House]: House script initialized successfully!");
|
logToConsole(LOG_INFO, "[AGRP.House]: House script initialized successfully!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadHousesFromDatabase() {
|
function loadHousesFromDatabase() {
|
||||||
logToConsole(LOG_INFO, "[VRR.House]: Loading houses from database ...");
|
logToConsole(LOG_INFO, "[AGRP.House]: Loading houses from database ...");
|
||||||
let tempHouses = [];
|
let tempHouses = [];
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
let dbAssoc;
|
let dbAssoc;
|
||||||
@@ -183,14 +188,14 @@ function loadHousesFromDatabase() {
|
|||||||
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
||||||
let tempHouseData = new HouseData(dbAssoc);
|
let tempHouseData = new HouseData(dbAssoc);
|
||||||
tempHouses.push(tempHouseData);
|
tempHouses.push(tempHouseData);
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.House]: House '${tempHouseData.description}' (ID ${tempHouseData.databaseId}) loaded!`);
|
logToConsole(LOG_VERBOSE, `[AGRP.House]: House '${tempHouseData.description}' (ID ${tempHouseData.databaseId}) loaded!`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
}
|
}
|
||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
logToConsole(LOG_INFO, `[VRR.House]: ${tempHouses.length} houses loaded from database successfully!`);
|
logToConsole(LOG_INFO, `[AGRP.House]: ${tempHouses.length} houses loaded from database successfully!`);
|
||||||
return tempHouses;
|
return tempHouses;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,8 +216,8 @@ function createHouseCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
createHouse(params, getPlayerPosition(client), toVector3(0.0, 0.0, 0.0), getGameConfig().pickupModels[getGame()].House, -1, getPlayerInterior(client), getPlayerDimension(client), getPlayerData(client).interiorCutscene);
|
createHouse(params, getPlayerPosition(client), toVector3(0.0, 0.0, 0.0), getGameConfig().pickupModels[getGame()].House, -1, getPlayerInterior(client), getPlayerDimension(client), getPlayerData(client).interiorScene);
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} created house: {houseGreen}${params}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} created house: {houseGreen}${params}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -270,7 +275,7 @@ function setHouseDescriptionCommand(command, params, client) {
|
|||||||
|
|
||||||
getHouseData(houseId).needsSaved = true;
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} renamed house {houseGreen}${oldDescription}{MAINCOLOUR} to {houseGreen}${getHouseData(houseId).description}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} renamed house {houseGreen}${oldDescription}{MAINCOLOUR} to {houseGreen}${getHouseData(houseId).description}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -305,11 +310,12 @@ function setHouseOwnerCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getHouseData(houseId).needsSaved = true;
|
|
||||||
|
|
||||||
getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_PLAYER;
|
getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_PLAYER;
|
||||||
getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(newHouseOwner).databaseId;
|
getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(newHouseOwner).databaseId;
|
||||||
messagePlayerSuccess(`{MAINCOLOUR}You gave house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} to {ALTCOLOUR}${newHouseOwner.name}`);
|
|
||||||
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} gave house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} to {ALTCOLOUR}${getCharacterFullName(newHouseOwner)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -340,7 +346,7 @@ function removeHouseOwnerCommand(command, params, client) {
|
|||||||
getHouseData(houseId).ownerId = -1;
|
getHouseData(houseId).ownerId = -1;
|
||||||
getHouseData(houseId).needsSaved = true;
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
messagePlayerSuccess(client, `{MAINCOLOUR}You removed house {houseGreen}${getHouseData(houseId).description}'s{MAINCOLOUR} owner`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} removed house {houseGreen}${getHouseData(houseId).description}'s{MAINCOLOUR} owner`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -380,7 +386,7 @@ function setHouseClanCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
showPlayerPrompt(client, getLocaleString(client, "SetHouseClanConfirmMessage"), getLocaleString(client, "SetHouseClanConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
showPlayerPrompt(client, getLocaleString(client, "SetHouseClanConfirmMessage"), getLocaleString(client, "SetHouseClanConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
||||||
getPlayerData(client).promptType = AGRP_PROMPT_HOUSEGIVETOCLAN;
|
getPlayerData(client).promptType = AGRP_PROMPT_GIVEHOUSETOCLAN;
|
||||||
|
|
||||||
//messagePlayerSuccess(`{MAINCOLOUR}You gave house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan!`);
|
//messagePlayerSuccess(`{MAINCOLOUR}You gave house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan!`);
|
||||||
}
|
}
|
||||||
@@ -463,7 +469,7 @@ function setHousePickupCommand(command, params, client) {
|
|||||||
|
|
||||||
getHouseData(houseId).needsSaved = true;
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} pickup display to {ALTCOLOUR}${toLowerCase(typeParam)}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} pickup to {ALTCOLOUR}${toLowerCase(typeParam)}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -499,7 +505,7 @@ function setHouseInteriorTypeCommand(command, params, client) {
|
|||||||
tempHouseLocation.exitInterior = -1;
|
tempHouseLocation.exitInterior = -1;
|
||||||
getHouseData(houseId).exitPickupModel = -1;
|
getHouseData(houseId).exitPickupModel = -1;
|
||||||
getHouseData(houseId).hasInterior = false;
|
getHouseData(houseId).hasInterior = false;
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} removed house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} interior`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} removed house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} interior`, true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -529,7 +535,7 @@ function setHouseInteriorTypeCommand(command, params, client) {
|
|||||||
|
|
||||||
getHouseData(houseId).needsSaved = true;
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} interior type to {ALTCOLOUR}${toLowerCase(typeParam)}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} interior type to {ALTCOLOUR}${typeParam}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -580,7 +586,7 @@ function setHouseBlipCommand(command, params, client) {
|
|||||||
resetHouseBlips(houseId);
|
resetHouseBlips(houseId);
|
||||||
getHouseData(houseId).needsSaved = true;
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} blip display to {ALTCOLOUR}${toLowerCase(typeParam)}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} blip to {ALTCOLOUR}${toLowerCase(typeParam)}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -616,7 +622,7 @@ function moveHouseEntranceCommand(command, params, client) {
|
|||||||
|
|
||||||
getHouseData(houseId).needsSaved = true;
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} moved house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} entrance to their position`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} moved house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} entrance to their position`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -656,7 +662,7 @@ function moveHouseExitCommand(command, params, client) {
|
|||||||
|
|
||||||
getHouseData(houseId).needsSaved = true;
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} moved house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} exit to their position`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} moved house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} exit to their position`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -692,8 +698,13 @@ function deleteHouseCommand(command, params, client) {
|
|||||||
* @return {bool} Whether or not the house was successfully deleted
|
* @return {bool} Whether or not the house was successfully deleted
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function deleteHouse(houseId, whoDeleted = 0) {
|
function deleteHouse(houseIndex, whoDeleted = 0) {
|
||||||
let tempHouseData = getServerData().houses[houseId];
|
if (!getHouseData(houseIndex)) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "InvalidHouse"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
let tempHouseData = getServerData().houses[houseIndex];
|
||||||
|
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
let dbQuery = null;
|
let dbQuery = null;
|
||||||
@@ -706,15 +717,15 @@ function deleteHouse(houseId, whoDeleted = 0) {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteHouseEntrancePickup(houseId);
|
deleteHouseEntrancePickup(houseIndex);
|
||||||
deleteHouseExitPickup(houseId);
|
deleteHouseExitPickup(houseIndex);
|
||||||
|
|
||||||
deleteHouseEntranceBlip(houseId);
|
deleteHouseEntranceBlip(houseIndex);
|
||||||
deleteHouseExitBlip(houseId);
|
deleteHouseExitBlip(houseIndex);
|
||||||
|
|
||||||
removePlayersFromHouse(houseId);
|
removePlayersFromHouse(houseIndex);
|
||||||
|
|
||||||
getServerData().houses.splice(houseId, 1);
|
getServerData().houses.splice(houseIndex, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -739,13 +750,15 @@ function removePlayerFromHouse(client) {
|
|||||||
* @return {Boolean} Whether or not the players were forced to exit
|
* @return {Boolean} Whether or not the players were forced to exit
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function removePlayersFromHouse(houseId) {
|
function removePlayersFromHouse(houseIndex) {
|
||||||
getClients().forEach(function (client) {
|
getClients().forEach(function (client) {
|
||||||
if (doesHouseHaveInterior(houseId)) {
|
if (doesHouseHaveInterior(houseIndex)) {
|
||||||
if (getPlayerHouse(client) == houseId) {
|
if (getPlayerHouse(client) == houseIndex) {
|
||||||
|
if (getPlayerInterior(client) == getHouseData(houseIndex).exitInterior && getPlayerDimension(client) == getHouseData(houseIndex).exitDimension) {
|
||||||
exitHouse(client);
|
exitHouse(client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -761,7 +774,7 @@ function removePlayersFromHouse(houseId) {
|
|||||||
* @return {bool} Whether or not the player was successfully removed from the house
|
* @return {bool} Whether or not the player was successfully removed from the house
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function createHouse(description, entrancePosition, exitPosition, entrancePickupModel = -1, entranceBlipModel = -1, entranceInterior = 0, entranceDimension = 0, entranceCutscene = -1) {
|
function createHouse(description, entrancePosition, exitPosition, entrancePickupModel = -1, entranceBlipModel = -1, entranceInterior = 0, entranceDimension = 0, entranceScene = -1) {
|
||||||
let tempHouseData = new HouseData(false);
|
let tempHouseData = new HouseData(false);
|
||||||
tempHouseData.description = description;
|
tempHouseData.description = description;
|
||||||
|
|
||||||
@@ -771,7 +784,7 @@ function createHouse(description, entrancePosition, exitPosition, entrancePickup
|
|||||||
tempHouseData.entranceBlipModel = entranceBlipModel;
|
tempHouseData.entranceBlipModel = entranceBlipModel;
|
||||||
tempHouseData.entranceInterior = entranceInterior;
|
tempHouseData.entranceInterior = entranceInterior;
|
||||||
tempHouseData.entranceDimension = entranceDimension;
|
tempHouseData.entranceDimension = entranceDimension;
|
||||||
tempHouseData.entranceCutscene = entranceCutscene;
|
tempHouseData.entranceScene = entranceScene;
|
||||||
|
|
||||||
tempHouseData.exitPosition = exitPosition;
|
tempHouseData.exitPosition = exitPosition;
|
||||||
tempHouseData.exitRotation = 0.0;
|
tempHouseData.exitRotation = 0.0;
|
||||||
@@ -779,7 +792,7 @@ function createHouse(description, entrancePosition, exitPosition, entrancePickup
|
|||||||
tempHouseData.exitBlipModel = -1;
|
tempHouseData.exitBlipModel = -1;
|
||||||
tempHouseData.exitInterior = 0;
|
tempHouseData.exitInterior = 0;
|
||||||
tempHouseData.exitDimension = 0;
|
tempHouseData.exitDimension = 0;
|
||||||
tempHouseData.exitCutscene = -1;
|
tempHouseData.exitScene = -1;
|
||||||
|
|
||||||
tempHouseData.needsSaved = true;
|
tempHouseData.needsSaved = true;
|
||||||
|
|
||||||
@@ -867,9 +880,9 @@ function getPlayerHouse(client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function saveAllHousesToDatabase() {
|
function saveAllHousesToDatabase() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.House]: Saving all server houses to database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.House]: Saving all server houses to database ...`);
|
||||||
if (getServerConfig().devServer) {
|
if (getServerConfig().devServer) {
|
||||||
logToConsole(LOG_DEBUG | LOG_WARN, `[VRR.House]: Aborting save all houses to database, dev server is enabled.`);
|
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.House]: Aborting save all houses to database, dev server is enabled.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -878,7 +891,7 @@ function saveAllHousesToDatabase() {
|
|||||||
saveHouseToDatabase(i);
|
saveHouseToDatabase(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logToConsole(LOG_INFO, `[VRR.House]: Saved all server houses to database`);
|
logToConsole(LOG_INFO, `[AGRP.House]: Saved all server houses to database`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -890,7 +903,7 @@ function saveHouseToDatabase(houseId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.House]: Saving house '${tempHouseData.description}' to database ...`);
|
logToConsole(LOG_VERBOSE, `[AGRP.House]: Saving house '${tempHouseData.description}' to database ...`);
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let safeHouseDescription = escapeDatabaseString(dbConnection, tempHouseData.description);
|
let safeHouseDescription = escapeDatabaseString(dbConnection, tempHouseData.description);
|
||||||
@@ -910,7 +923,7 @@ function saveHouseToDatabase(houseId) {
|
|||||||
["house_entrance_vw", tempHouseData.entranceDimension],
|
["house_entrance_vw", tempHouseData.entranceDimension],
|
||||||
["house_entrance_pickup", tempHouseData.entrancePickupModel],
|
["house_entrance_pickup", tempHouseData.entrancePickupModel],
|
||||||
["house_entrance_blip", tempHouseData.entranceBlipModel],
|
["house_entrance_blip", tempHouseData.entranceBlipModel],
|
||||||
//["house_entrance_cutscene", tempHouseData.entranceCutscene],
|
["house_entrance_scene", tempHouseData.entranceScene],
|
||||||
["house_exit_pos_x", tempHouseData.exitPosition.x],
|
["house_exit_pos_x", tempHouseData.exitPosition.x],
|
||||||
["house_exit_pos_y", tempHouseData.exitPosition.y],
|
["house_exit_pos_y", tempHouseData.exitPosition.y],
|
||||||
["house_exit_pos_z", tempHouseData.exitPosition.z],
|
["house_exit_pos_z", tempHouseData.exitPosition.z],
|
||||||
@@ -919,13 +932,13 @@ function saveHouseToDatabase(houseId) {
|
|||||||
["house_exit_vw", tempHouseData.exitDimension],
|
["house_exit_vw", tempHouseData.exitDimension],
|
||||||
["house_exit_pickup", tempHouseData.exitPickupModel],
|
["house_exit_pickup", tempHouseData.exitPickupModel],
|
||||||
["house_exit_blip", tempHouseData.exitBlipModel],
|
["house_exit_blip", tempHouseData.exitBlipModel],
|
||||||
//["house_exit_cutscene", tempHouseData.exitCutscene],
|
["house_exit_scene", tempHouseData.exitScene],
|
||||||
["house_buy_price", tempHouseData.buyPrice],
|
["house_buy_price", tempHouseData.buyPrice],
|
||||||
["house_rent_price", tempHouseData.rentPrice],
|
["house_rent_price", tempHouseData.rentPrice],
|
||||||
["house_has_interior", boolToInt(tempHouseData.hasInterior)],
|
["house_has_interior", boolToInt(tempHouseData.hasInterior)],
|
||||||
["house_interior_lights", boolToInt(tempHouseData.interiorLights)],
|
["house_interior_lights", boolToInt(tempHouseData.interiorLights)],
|
||||||
["house_custom_interior", boolToInt(tempHouseData.customInterior)],
|
["house_custom_interior", boolToInt(tempHouseData.customInterior)],
|
||||||
["house_radio_station", boolToInt(tempHouseData.streamingRadioStation)],
|
["house_radio_station", (getRadioStationData(tempHouseData.streamingRadioStationIndex) != false) ? getRadioStationData(tempHouseData.streamingRadioStationIndex) : -1],
|
||||||
];
|
];
|
||||||
|
|
||||||
let dbQuery = null;
|
let dbQuery = null;
|
||||||
@@ -944,7 +957,7 @@ function saveHouseToDatabase(houseId) {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.House]: Saved house '${tempHouseData.description}' to database!`);
|
logToConsole(LOG_VERBOSE, `[AGRP.House]: Saved house '${tempHouseData.description}' to database!`);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -958,7 +971,7 @@ function saveHouseLocationToDatabase(houseId, locationId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.House]: Saving house location ${locationId} for house ${houseId} to database ...`);
|
logToConsole(LOG_VERBOSE, `[AGRP.House]: Saving house location ${locationId} for house ${houseId} to database ...`);
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let data = [
|
let data = [
|
||||||
@@ -999,7 +1012,7 @@ function saveHouseLocationToDatabase(houseId, locationId) {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.House]: Saved location ${locationId} for house ${houseId} to database`);
|
logToConsole(LOG_VERBOSE, `[AGRP.House]: Saved location ${locationId} for house ${houseId} to database`);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1029,10 +1042,6 @@ function createHouseEntrancePickup(houseId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isGameFeatureSupported("pickup")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!getHouseData(houseId)) {
|
if (!getHouseData(houseId)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1047,14 +1056,20 @@ function createHouseEntrancePickup(houseId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (areServerElementsSupported() && getGame() != AGRP_GAME_MAFIA_ONE && getGame() != AGRP_GAME_GTA_IV) {
|
||||||
|
let entrancePickup = null;
|
||||||
|
if (isGameFeatureSupported("pickup")) {
|
||||||
let pickupModelId = getGameConfig().pickupModels[getGame()].House;
|
let pickupModelId = getGameConfig().pickupModels[getGame()].House;
|
||||||
|
|
||||||
if (getServerData().houses[houseId].entrancePickupModel != 0) {
|
if (getServerData().houses[houseId].entrancePickupModel != 0) {
|
||||||
pickupModelId = getHouseData(houseId).entrancePickupModel;
|
pickupModelId = getHouseData(houseId).entrancePickupModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (areServerElementsSupported()) {
|
entrancePickup = createGamePickup(pickupModelId, houseData.entrancePosition, getGameConfig().pickupTypes[getGame()].house);
|
||||||
let entrancePickup = createGamePickup(pickupModelId, getHouseData(houseId).entrancePosition, getGameConfig().pickupTypes[getGame()].house);
|
} else if (isGameFeatureSupported("dummyElement")) {
|
||||||
|
entrancePickup = createGameDummyElement(houseData.exitPosition);
|
||||||
|
}
|
||||||
|
|
||||||
if (entrancePickup != null) {
|
if (entrancePickup != null) {
|
||||||
setElementOnAllDimensions(entrancePickup, false);
|
setElementOnAllDimensions(entrancePickup, false);
|
||||||
setElementDimension(entrancePickup, getHouseData(houseId).entranceDimension);
|
setElementDimension(entrancePickup, getHouseData(houseId).entranceDimension);
|
||||||
@@ -1065,13 +1080,6 @@ function createHouseEntrancePickup(houseId) {
|
|||||||
getHouseData(houseId).entrancePickup = entrancePickup;
|
getHouseData(houseId).entrancePickup = entrancePickup;
|
||||||
updateHousePickupLabelData(houseId);
|
updateHousePickupLabelData(houseId);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
let pickupModelId = getGameConfig().pickupModels[getGame()].House;
|
|
||||||
|
|
||||||
if (houseData.entrancePickupModel != 0) {
|
|
||||||
pickupModelId = houseData.entrancePickupModel;
|
|
||||||
}
|
|
||||||
sendHouseToPlayer(null, houseId, houseId.description, houseId.entrancePosition, blipModelId, pickupModelId, houseId.hasInterior);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1143,10 +1151,6 @@ function createHouseExitPickup(houseId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isGameFeatureSupported("pickup")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!getHouseData(houseId)) {
|
if (!getHouseData(houseId)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1161,13 +1165,19 @@ function createHouseExitPickup(houseId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let exitPickup = null;
|
||||||
|
if (isGameFeatureSupported("pickup")) {
|
||||||
let pickupModelId = getGameConfig().pickupModels[getGame()].Exit;
|
let pickupModelId = getGameConfig().pickupModels[getGame()].Exit;
|
||||||
|
|
||||||
if (getServerData().houses[houseId].exitPickupModel != 0) {
|
if (getServerData().houses[houseId].exitPickupModel != 0) {
|
||||||
pickupModelId = houseData.exitPickupModel;
|
pickupModelId = houseData.exitPickupModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
let exitPickup = createGamePickup(pickupModelId, houseData.exitPosition, getGameConfig().pickupTypes[getGame()].house);
|
exitPickup = createGamePickup(pickupModelId, houseData.exitPosition, getGameConfig().pickupTypes[getGame()].house);
|
||||||
|
} else if (isGameFeatureSupported("dummyElement")) {
|
||||||
|
//exitPickup = createGameDummyElement(houseData.exitPosition);
|
||||||
|
}
|
||||||
|
|
||||||
if (exitPickup != null) {
|
if (exitPickup != null) {
|
||||||
setElementDimension(exitPickup, houseData.exitDimension);
|
setElementDimension(exitPickup, houseData.exitDimension);
|
||||||
setElementOnAllDimensions(exitPickup, false);
|
setElementOnAllDimensions(exitPickup, false);
|
||||||
@@ -1377,7 +1387,7 @@ function setHouseBuyPriceCommand(command, params, client) {
|
|||||||
getHouseData(houseId).buyPrice = amount;
|
getHouseData(houseId).buyPrice = amount;
|
||||||
getHouseData(houseId).needsSaved = true;
|
getHouseData(houseId).needsSaved = true;
|
||||||
updateHousePickupLabelData(houseId);
|
updateHousePickupLabelData(houseId);
|
||||||
messagePlayerSuccess(client, `{MAINCOLOUR}You set house {houseGreen}${getHouseData(houseId).description}'s{MAINCOLOUR} for-sale price to {ALTCOLOUR}$${makeLargeNumberReadable(amount)}`);
|
messagePlayerSuccess(client, `{MAINCOLOUR}You set house {houseGreen}${getHouseData(houseId).description}'s{MAINCOLOUR} for-sale price to {ALTCOLOUR}${getCurrencyString(amount)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1415,7 +1425,7 @@ function setHouseRentPriceCommand(command, params, client) {
|
|||||||
getHouseData(houseId).rentPrice = amount;
|
getHouseData(houseId).rentPrice = amount;
|
||||||
getHouseData(houseId).needsSaved = true;
|
getHouseData(houseId).needsSaved = true;
|
||||||
updateHousePickupLabelData(houseId);
|
updateHousePickupLabelData(houseId);
|
||||||
messagePlayerSuccess(client, `{MAINCOLOUR}You set house {houseGreen}${getHouseData(houseId).description}'s{MAINCOLOUR} rent price to {ALTCOLOUR}$${makeLargeNumberReadable(amount)}`);
|
messagePlayerSuccess(client, `{MAINCOLOUR}You set house {houseGreen}${getHouseData(houseId).description}'s{MAINCOLOUR} rent price to {ALTCOLOUR}${getCurrencyString(amount)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1447,8 +1457,8 @@ function buyHouseCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getPlayerData(client).promptType = AGRP_PROMPT_BUYHOUSE;
|
||||||
showPlayerPrompt(client, getLocaleString(client, "BuyHouseConfirmMessage"), getLocaleString(client, "BuyHouseConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
showPlayerPrompt(client, getLocaleString(client, "BuyHouseConfirmMessage"), getLocaleString(client, "BuyHouseConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
||||||
getPlayerData(client).promptType = AGRP_PROMPT_HOUSEBUY;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1771,7 +1781,8 @@ function getHouseFromParams(params) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function updateHousePickupLabelData(houseId) {
|
function updateHousePickupLabelData(houseId) {
|
||||||
if (!areServerElementsSupported()) {
|
if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE || getGame() == AGRP_GAME_GTA_IV) {
|
||||||
|
sendHouseToPlayer(null, houseId, getHouseData(houseId).description, getHouseData(houseId).entrancePosition, getHouseEntranceBlipModelForNetworkEvent(houseId), getHouseEntrancePickupModelForNetworkEvent(houseId), getHouseData(houseId).buyPrice, getHouseData(houseId).rentPrice, getHouseData(houseId).hasInterior, getHouseData(houseId).locked);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1783,16 +1794,16 @@ function updateHousePickupLabelData(houseId) {
|
|||||||
setEntityData(houseData.entrancePickup, "agrp.label.type", AGRP_LABEL_HOUSE, true);
|
setEntityData(houseData.entrancePickup, "agrp.label.type", AGRP_LABEL_HOUSE, true);
|
||||||
setEntityData(houseData.entrancePickup, "agrp.label.name", houseData.description, true);
|
setEntityData(houseData.entrancePickup, "agrp.label.name", houseData.description, true);
|
||||||
setEntityData(houseData.entrancePickup, "agrp.label.locked", houseData.locked, true);
|
setEntityData(houseData.entrancePickup, "agrp.label.locked", houseData.locked, true);
|
||||||
if (houseData.buyPrice > 0) {
|
|
||||||
setEntityData(houseData.entrancePickup, "agrp.label.price", houseData.buyPrice, true);
|
setEntityData(houseData.entrancePickup, "agrp.label.price", houseData.buyPrice, true);
|
||||||
setEntityData(houseData.entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_BUYHOUSE, true);
|
|
||||||
} else {
|
|
||||||
if (houseData.rentPrice > 0) {
|
|
||||||
setEntityData(houseData.entrancePickup, "agrp.label.rentprice", houseData.rentPrice, true);
|
setEntityData(houseData.entrancePickup, "agrp.label.rentprice", houseData.rentPrice, true);
|
||||||
|
setEntityData(houseData.entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTER, true);
|
||||||
|
|
||||||
|
if (houseData.buyPrice > 0) {
|
||||||
|
setEntityData(houseData.entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_BUYHOUSE, true);
|
||||||
|
} else if (houseData.rentPrice > 0) {
|
||||||
setEntityData(houseData.entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_RENTHOUSE, true);
|
setEntityData(houseData.entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_RENTHOUSE, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (houseData.exitPickup != null) {
|
if (houseData.exitPickup != null) {
|
||||||
setEntityData(houseData.exitPickup, "agrp.owner.type", AGRP_PICKUP_HOUSE_EXIT, false);
|
setEntityData(houseData.exitPickup, "agrp.owner.type", AGRP_PICKUP_HOUSE_EXIT, false);
|
||||||
@@ -1853,3 +1864,33 @@ function isPlayerInAnyHouse(client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getHouseEntranceBlipModelForNetworkEvent(houseIndex) {
|
||||||
|
let blipModelId = -1;
|
||||||
|
if (isGameFeatureSupported("blip")) {
|
||||||
|
blipModelId = getGameConfig().blipSprites[getGame()].House;
|
||||||
|
|
||||||
|
if (getHouseData(houseIndex).entranceBlipModel != 0) {
|
||||||
|
blipModelId = getHouseData(houseIndex).entranceBlipModel;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return blipModelId;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getHouseEntrancePickupModelForNetworkEvent(houseIndex) {
|
||||||
|
let pickupModelId = -1;
|
||||||
|
if (isGameFeatureSupported("pickup")) {
|
||||||
|
pickupModelId = getGameConfig().pickupModels[getGame()].House;
|
||||||
|
|
||||||
|
if (getHouseData(houseIndex).entrancePickupModel != 0) {
|
||||||
|
pickupModelId = getHouseData(houseIndex).entrancePickupModel;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return pickupModelId;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
86
scripts/server/index.js
Normal file
86
scripts/server/index.js
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
// Shared Scripts
|
||||||
|
require("shared/const.js");
|
||||||
|
require("shared/utilities.js");
|
||||||
|
require("shared/gamedata.js");
|
||||||
|
|
||||||
|
// Multiplayer Mod (Wrapped Natives)
|
||||||
|
require("native/ragemp.js");
|
||||||
|
|
||||||
|
// Server Scripts
|
||||||
|
require("class.js");
|
||||||
|
require("accent.js");
|
||||||
|
require("account.js");
|
||||||
|
require("animation.js");
|
||||||
|
require("anticheat.js");
|
||||||
|
require("ban.js");
|
||||||
|
require("bitflag.js");
|
||||||
|
require("business.js");
|
||||||
|
require("chat.js");
|
||||||
|
require("clan.js");
|
||||||
|
require("client.js");
|
||||||
|
require("colour.js");
|
||||||
|
require("const.js");
|
||||||
|
require("database.js");
|
||||||
|
require("developer.js");
|
||||||
|
require("discord.js");
|
||||||
|
require("economy.js");
|
||||||
|
require("email.js");
|
||||||
|
require("event.js");
|
||||||
|
require("fishing.js");
|
||||||
|
require("gui.js");
|
||||||
|
require("help.js");
|
||||||
|
require("house.js");
|
||||||
|
require("item.js");
|
||||||
|
require("job.js");
|
||||||
|
require("keybind.js");
|
||||||
|
require("locale.js");
|
||||||
|
require("messaging.js");
|
||||||
|
require("misc.js");
|
||||||
|
require("npc.js");
|
||||||
|
require("staff.js");
|
||||||
|
require("race.js");
|
||||||
|
require("radio.js");
|
||||||
|
require("security.js");
|
||||||
|
require("subaccount.js");
|
||||||
|
require("timers.js");
|
||||||
|
require("trigger.js");
|
||||||
|
require("utilities.js");
|
||||||
|
require("vehicle.js");
|
||||||
|
require("config.js");
|
||||||
|
require("core.js");
|
||||||
|
require("command.js");
|
||||||
|
|
||||||
|
// Server Business Scripts
|
||||||
|
require("business/bakery.js");
|
||||||
|
require("business/bar.js");
|
||||||
|
require("business/burger.js");
|
||||||
|
require("business/clothing.js");
|
||||||
|
require("business/club.js");
|
||||||
|
require("business/fuel.js");
|
||||||
|
require("business/mechanic.js");
|
||||||
|
require("business/pizza.js");
|
||||||
|
require("business/restaurant.js");
|
||||||
|
require("business/vehicle.js");
|
||||||
|
require("business/weapon.js");
|
||||||
|
|
||||||
|
// Server Job Scripts
|
||||||
|
require("job/bus.js");
|
||||||
|
require("job/drug.js");
|
||||||
|
require("job/fire.js");
|
||||||
|
require("job/garbage.js");
|
||||||
|
require("job/medic.js");
|
||||||
|
require("job/police.js");
|
||||||
|
require("job/taxi.js");
|
||||||
|
require("job/weapon.js");
|
||||||
|
|
||||||
|
// Server Item Scripts
|
||||||
|
require("item/food.js");
|
||||||
|
require("item/drink.js");
|
||||||
|
require("item/walkie-talkie.js");
|
||||||
|
require("item/phone.js");
|
||||||
|
require("item/handcuff.js");
|
||||||
|
require("item/rope.js");
|
||||||
|
require("item/tazer.js");
|
||||||
|
|
||||||
|
// Startup
|
||||||
|
require("startup.js");
|
||||||
@@ -281,59 +281,51 @@ let itemRecipes = [
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initItemScript() {
|
function initItemScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Item]: Initializing item script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.Item]: Initializing item script ...");
|
||||||
logToConsole(LOG_INFO, "[VRR.Item]: Item script initialized successfully!");
|
logToConsole(LOG_INFO, "[AGRP.Item]: Item script initialized successfully!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadItemsFromDatabase() {
|
async function loadItemsFromDatabase() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Item]: Loading items from database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Item]: Loading items from database ...`);
|
||||||
let tempItems = [];
|
let tempItems = [];
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
let dbFetchAssoc;
|
|
||||||
|
let dbAssoc;
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let dbQuery = queryDatabase(dbConnection, `SELECT * FROM item_main WHERE item_deleted = 0 AND item_server = ${getServerId()}`);
|
let dbQueryString = `SELECT * FROM item_main WHERE item_server = ${getServerId()}`;
|
||||||
if (dbQuery) {
|
dbAssoc = await fetchQueryAssoc(dbConnection, dbQueryString);
|
||||||
if (dbQuery.numRows > 0) {
|
for (let i in dbAssoc) {
|
||||||
while (dbFetchAssoc = fetchQueryAssoc(dbQuery)) {
|
let tempItemData = new ItemData(dbAssoc[i]);
|
||||||
let tempItemData = new ItemData(dbFetchAssoc);
|
|
||||||
tempItems.push(tempItemData);
|
tempItems.push(tempItemData);
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Item]: Loaded item ${tempItemData.databaseId} (type ${tempItemData.itemType})} from database`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
freeDatabaseQuery(dbQuery);
|
|
||||||
}
|
}
|
||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Item]: Loaded ${tempItems.length} items from database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Item]: Loaded ${tempItems.length} items from database ...`);
|
||||||
return tempItems;
|
return tempItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadItemTypesFromDatabase() {
|
async function loadItemTypesFromDatabase() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Item]: Loading item types from database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Item]: Loading item types from database ...`);
|
||||||
let tempItemTypes = [];
|
let tempItemTypes = [];
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
let dbFetchAssoc;
|
let dbAssoc;
|
||||||
|
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let dbQuery = queryDatabase(dbConnection, `SELECT * FROM item_type WHERE item_type_deleted = 0 AND item_type_enabled = 1 AND item_type_server = ${getServerId()}`);
|
let dbQueryString = `SELECT * FROM item_type WHERE item_type_enabled = 1 AND item_type_server = ${getServerId()}`;
|
||||||
if (dbQuery) {
|
dbAssoc = await fetchQueryAssoc(dbConnection, dbQueryString);
|
||||||
if (getQueryNumRows(dbQuery) > 0) {
|
for (let i in dbAssoc) {
|
||||||
while (dbFetchAssoc = fetchQueryAssoc(dbQuery)) {
|
let tempItemTypeData = new ItemTypeData(dbAssoc[i]);
|
||||||
let tempItemTypeData = new ItemTypeData(dbFetchAssoc);
|
|
||||||
tempItemTypes.push(tempItemTypeData);
|
tempItemTypes.push(tempItemTypeData);
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Item]: Loaded item type ${tempItemTypeData.name} (id ${tempItemTypeData.databaseId}} from database`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
freeDatabaseQuery(dbQuery);
|
|
||||||
}
|
}
|
||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Item]: Loaded ${tempItemTypes.length} item types from database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Item]: Loaded ${tempItemTypes.length} item types from database ...`);
|
||||||
return tempItemTypes;
|
return tempItemTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -381,7 +373,10 @@ function createGroundItemObject(itemId) {
|
|||||||
setElementRotation(getItemData(itemId).object, getItemTypeData(getItemData(itemId).itemTypeIndex).dropRotation);
|
setElementRotation(getItemData(itemId).object, getItemTypeData(getItemData(itemId).itemTypeIndex).dropRotation);
|
||||||
setElementOnAllDimensions(getItemData(itemId).object, false);
|
setElementOnAllDimensions(getItemData(itemId).object, false);
|
||||||
setElementDimension(getItemData(itemId).object, getItemData(itemId).dimension);
|
setElementDimension(getItemData(itemId).object, getItemData(itemId).dimension);
|
||||||
//setEntityData(getItemData(itemId).object, "agrp.scale", getItemTypeData(getItemData(itemId).itemTypeIndex).dropScale, true);
|
setElementInterior(getItemData(itemId).object, getItemData(itemId).interior);
|
||||||
|
setEntityData(getItemData(itemId).object, "agrp.scale", getItemTypeData(getItemData(itemId).itemTypeIndex).dropScale, true);
|
||||||
|
setEntityData(getItemData(itemId).object, "agrp.collisions", false, true);
|
||||||
|
forcePlayerToSyncElementProperties(null, getItemData(itemId).object);
|
||||||
addToWorld(getItemData(itemId).object);
|
addToWorld(getItemData(itemId).object);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -492,13 +487,13 @@ function useItemCommand(command, params, client) {
|
|||||||
let itemId = getPlayerData(client).hotBarItems[hotBarSlot];
|
let itemId = getPlayerData(client).hotBarItems[hotBarSlot];
|
||||||
|
|
||||||
if (!getItemData(itemId)) {
|
if (!getItemData(itemId)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "UseItemBug"));
|
messagePlayerError(client, getLocaleString(client, "UseItemBugged"));
|
||||||
submitBugReport(client, `(AUTOMATED REPORT) Use Item: Getting item data for item ${itemId} in player hotbar slot ${hotBarSlot} (cache ${getPlayerData(client).hotBarItems[hotBarSlot]}) returned false.`);
|
submitBugReport(client, `(AUTOMATED REPORT) Use Item: Getting item data for item ${itemId} in player hotbar slot ${hotBarSlot} (cache ${getPlayerData(client).hotBarItems[hotBarSlot]}) returned false.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!getItemTypeData(getItemData(itemId).itemTypeIndex)) {
|
if (!getItemTypeData(getItemData(itemId).itemTypeIndex)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "UseItemBug"));
|
messagePlayerError(client, getLocaleString(client, "UseItemBugged"));
|
||||||
submitBugReport(client, `(AUTOMATED REPORT) Use Item: Getting item type ${getItemData(itemId).itemType} data for item ${itemId}/${getItemData(itemId).databaseId} in player hotbar slot ${hotBarSlot} (cache ${getPlayerData(client).hotBarItems[hotBarSlot]}) returned false.`);
|
submitBugReport(client, `(AUTOMATED REPORT) Use Item: Getting item type ${getItemData(itemId).itemType} data for item ${itemId}/${getItemData(itemId).databaseId} in player hotbar slot ${hotBarSlot} (cache ${getPlayerData(client).hotBarItems[hotBarSlot]}) returned false.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -699,7 +694,7 @@ function dropItemCommand(command, params, client) {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function putItemCommand(command, params, client) {
|
function putItemCommand(command, params, client) {
|
||||||
clearPlayerItemActionState(client);
|
//clearPlayerItemActionState(client);
|
||||||
|
|
||||||
let hotBarSlot = toInteger(params);
|
let hotBarSlot = toInteger(params);
|
||||||
|
|
||||||
@@ -742,6 +737,8 @@ function putItemCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clearPlayerItemActionState(client);
|
||||||
|
|
||||||
if (getItemTypeData(getItemData(itemId).itemTypeIndex).putAnimationIndex != -1 && !isPlayerInAnyVehicle(client)) {
|
if (getItemTypeData(getItemData(itemId).itemTypeIndex).putAnimationIndex != -1 && !isPlayerInAnyVehicle(client)) {
|
||||||
forcePlayerPlayAnimation(client, getItemTypeData(getItemData(itemId).itemTypeIndex).putAnimationIndex, 0.0);
|
forcePlayerPlayAnimation(client, getItemTypeData(getItemData(itemId).itemTypeIndex).putAnimationIndex, 0.0);
|
||||||
}
|
}
|
||||||
@@ -827,7 +824,7 @@ function createItemTypeCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let itemTypeIndex = createItemType(params);
|
let itemTypeIndex = createItemType(params);
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} created new item {ALTCOLOUR}${params}. {MAINCOLOUR}ID: ${itemTypeIndex}/${getItemTypeData(itemTypeIndex).databaseId}!`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} created new item type: {ALTCOLOUR}${params}. {MAINCOLOUR}ID: ${itemTypeIndex}/${getItemTypeData(itemTypeIndex).databaseId}!`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -847,6 +844,7 @@ function setItemTypeDropModelCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
||||||
let modelIndex = getObjectModelIndexFromParams(splitParams.slice(-1).join(" "));
|
let modelIndex = getObjectModelIndexFromParams(splitParams.slice(-1).join(" "));
|
||||||
|
|
||||||
@@ -857,7 +855,7 @@ function setItemTypeDropModelCommand(command, params, client) {
|
|||||||
|
|
||||||
getItemTypeData(itemTypeIndex).dropModel = modelIndex;
|
getItemTypeData(itemTypeIndex).dropModel = modelIndex;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}'s{MAINCOLOUR} dropped object model index to ${modelIndex}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}'s{MAINCOLOUR} dropped object model index to ${modelIndex}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -877,6 +875,7 @@ function setItemTypeOrderPriceCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
||||||
let orderPrice = splitParams[splitParams.length - 1];
|
let orderPrice = splitParams[splitParams.length - 1];
|
||||||
|
|
||||||
@@ -887,7 +886,7 @@ function setItemTypeOrderPriceCommand(command, params, client) {
|
|||||||
|
|
||||||
getItemTypeData(itemTypeIndex).orderPrice = orderPrice;
|
getItemTypeData(itemTypeIndex).orderPrice = orderPrice;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} base price to {ALTCOLOUR}$${orderPrice}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} base price to {ALTCOLOUR}${getCurrencyString(orderPrice)}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -907,6 +906,7 @@ function setItemTypeOrderValueCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
||||||
let orderValue = splitParams[splitParams.length - 1];
|
let orderValue = splitParams[splitParams.length - 1];
|
||||||
|
|
||||||
@@ -917,7 +917,7 @@ function setItemTypeOrderValueCommand(command, params, client) {
|
|||||||
|
|
||||||
getItemTypeData(itemTypeIndex).orderValue = orderValue;
|
getItemTypeData(itemTypeIndex).orderValue = orderValue;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} order value to {ALTCOLOUR}${orderValue}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} order value to {ALTCOLOUR}${orderValue}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -937,6 +937,7 @@ function setItemTypeRiskMultiplierCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
||||||
let riskMultiplier = splitParams[splitParams.length - 1];
|
let riskMultiplier = splitParams[splitParams.length - 1];
|
||||||
|
|
||||||
@@ -945,9 +946,9 @@ function setItemTypeRiskMultiplierCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
getItemTypeData(itemTypeIndex).riskMultiplier = riskMultiplier;
|
getItemTypeData(itemTypeIndex).riskMultiplier = riskMultiplier / 100;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} risk multiplier to {ALTCOLOUR}${riskMultiplier}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} risk multiplier to {ALTCOLOUR}${riskMultiplier}%`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -976,7 +977,7 @@ function toggleItemTypeEnabledCommand(command, params, client) {
|
|||||||
|
|
||||||
getItemTypeData(itemTypeIndex).enabled = !getItemTypeData(itemTypeIndex).enabled;
|
getItemTypeData(itemTypeIndex).enabled = !getItemTypeData(itemTypeIndex).enabled;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} ${getEnabledDisabledFromBool(getItemTypeData(itemTypeIndex).enabled)} item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} ${getEnabledDisabledFromBool(getItemTypeData(itemTypeIndex).enabled)} item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -996,6 +997,7 @@ function setItemTypeUseTypeCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
||||||
let useType = splitParams[splitParams.length - 1];
|
let useType = splitParams[splitParams.length - 1];
|
||||||
|
|
||||||
@@ -1006,7 +1008,7 @@ function setItemTypeUseTypeCommand(command, params, client) {
|
|||||||
|
|
||||||
getItemTypeData(itemTypeIndex).useType = useType;
|
getItemTypeData(itemTypeIndex).useType = useType;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} use type to {ALTCOLOUR}${useType}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} use type to {ALTCOLOUR}${useType}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1026,6 +1028,7 @@ function setItemTypeUseValueCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
||||||
let useValue = splitParams[splitParams.length - 1];
|
let useValue = splitParams[splitParams.length - 1];
|
||||||
|
|
||||||
@@ -1036,7 +1039,7 @@ function setItemTypeUseValueCommand(command, params, client) {
|
|||||||
|
|
||||||
getItemTypeData(itemTypeIndex).useValue = useValue;
|
getItemTypeData(itemTypeIndex).useValue = useValue;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} use value to {ALTCOLOUR}${useValue}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} use value to {ALTCOLOUR}${useValue}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1056,17 +1059,23 @@ function setItemTypeDropFrontDistanceCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
||||||
let dropFrontDistance = splitParams.slice(-1);
|
let dropFrontDistance = splitParams.slice(-1) || 0.0;
|
||||||
|
|
||||||
if (!getItemTypeData(itemTypeIndex)) {
|
if (!getItemTypeData(itemTypeIndex)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidItemType"));
|
messagePlayerError(client, getLocaleString(client, "InvalidItemType"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isNaN(dropFrontDistance)) {
|
||||||
|
messagePlayerError(client, `The distance must be a number!`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
getItemTypeData(itemTypeIndex).dropFrontDistance = dropFrontDistance;
|
getItemTypeData(itemTypeIndex).dropFrontDistance = dropFrontDistance;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} drop front distance to {ALTCOLOUR}${dropFrontDistance}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} drop front distance to {ALTCOLOUR}${dropFrontDistance.toFixed(2)}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1086,6 +1095,7 @@ function setItemTypeDropPositionCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
||||||
let x = splitParams.slice(-3, -2) || 0.0;
|
let x = splitParams.slice(-3, -2) || 0.0;
|
||||||
let y = splitParams.slice(-2, -1) || 0.0;
|
let y = splitParams.slice(-2, -1) || 0.0;
|
||||||
@@ -1096,11 +1106,16 @@ function setItemTypeDropPositionCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isNaN(x) || isNaN(y) || isNaN(z)) {
|
||||||
|
messagePlayerError(client, `The positions must be numbers!`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
let dropPosition = toVector3(x, y, z);
|
let dropPosition = toVector3(x, y, z);
|
||||||
|
|
||||||
getItemTypeData(itemTypeIndex).dropPosition = dropPosition;
|
getItemTypeData(itemTypeIndex).dropPosition = dropPosition;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} drop position offset to {ALTCOLOUR}${dropPosition.x}, ${dropPosition.y}, ${dropPosition.z}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} drop position offset to {ALTCOLOUR}${dropPosition.x.toFixed(2)}, ${dropPosition.y.toFixed(2)}, ${dropPosition.z.toFixed(2)}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1120,6 +1135,7 @@ function setItemTypeDropRotationCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
||||||
let x = splitParams.slice(-3, -2) || 0.0;
|
let x = splitParams.slice(-3, -2) || 0.0;
|
||||||
let y = splitParams.slice(-2, -1) || 0.0;
|
let y = splitParams.slice(-2, -1) || 0.0;
|
||||||
@@ -1130,11 +1146,16 @@ function setItemTypeDropRotationCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isNaN(x) || isNaN(y) || isNaN(z)) {
|
||||||
|
messagePlayerError(client, `The positions must be numbers!`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
let dropRotation = toVector3(x, y, z);
|
let dropRotation = toVector3(x, y, z);
|
||||||
|
|
||||||
getItemTypeData(itemTypeIndex).dropRotation = dropRotation;
|
getItemTypeData(itemTypeIndex).dropRotation = dropRotation;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} drop rotation to {ALTCOLOUR}${dropRotation.x}, ${dropRotation.y}, ${dropRotation.z}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} drop rotation to {ALTCOLOUR}${dropRotation.x.toFixed(2)}, ${dropRotation.y.toFixed(2)}, ${dropRotation.z.toFixed(2)}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1154,6 +1175,7 @@ function setItemTypeDropScaleCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
||||||
let x = splitParams.slice(-3, -2) || 1.0;
|
let x = splitParams.slice(-3, -2) || 1.0;
|
||||||
let y = splitParams.slice(-2, -1) || 1.0;
|
let y = splitParams.slice(-2, -1) || 1.0;
|
||||||
@@ -1164,11 +1186,16 @@ function setItemTypeDropScaleCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isNaN(x) || isNaN(y) || isNaN(z)) {
|
||||||
|
messagePlayerError(client, `The positions must be numbers!`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
let dropScale = toVector3(x, y, z);
|
let dropScale = toVector3(x, y, z);
|
||||||
|
|
||||||
getItemTypeData(itemTypeIndex).dropScale = dropScale;
|
getItemTypeData(itemTypeIndex).dropScale = dropScale;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} drop scale to {ALTCOLOUR}${dropScale.x}, ${dropScale.y}, ${dropScale.z}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} drop scale to {ALTCOLOUR}${dropScale.x.toFixed(2)}, ${dropScale.y.toFixed(2)}, ${dropScale.z.toFixed(2)}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1188,6 +1215,7 @@ function setItemTypeDemandMultiplierCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
||||||
let demandMultiplier = splitParams.slice(-1) || 100;
|
let demandMultiplier = splitParams.slice(-1) || 100;
|
||||||
|
|
||||||
@@ -1196,9 +1224,14 @@ function setItemTypeDemandMultiplierCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
getItemTypeData(itemTypeIndex).demandMultiplier = demandMultiplayer / 100;
|
if (isNaN(demandMultiplier)) {
|
||||||
|
messagePlayerError(client, `The demand multiplier must be numbers!`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
getItemTypeData(itemTypeIndex).demandMultiplier = demandMultiplier / 100;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} demand multiplier to {ALTCOLOUR}${demandMultiplier}%`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} demand multiplier to {ALTCOLOUR}${demandMultiplier}%`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1218,6 +1251,7 @@ function setItemTypeMaxValueCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
||||||
let maxValue = splitParams.slice(-1) || 100;
|
let maxValue = splitParams.slice(-1) || 100;
|
||||||
|
|
||||||
@@ -1226,9 +1260,14 @@ function setItemTypeMaxValueCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isNaN(maxValue)) {
|
||||||
|
messagePlayerError(client, `The max value must be numbers!`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
getItemTypeData(itemTypeIndex).maxValue = maxValue;
|
getItemTypeData(itemTypeIndex).maxValue = maxValue;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} max value to {ALTCOLOUR}${maxValue}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} max value to {ALTCOLOUR}${maxValue}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1248,6 +1287,7 @@ function setItemTypeSizeCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
||||||
let size = splitParams.slice(-1) || 100;
|
let size = splitParams.slice(-1) || 100;
|
||||||
|
|
||||||
@@ -1256,9 +1296,14 @@ function setItemTypeSizeCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isNaN(size)) {
|
||||||
|
messagePlayerError(client, `The size must be numbers!`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
getItemTypeData(itemTypeIndex).size = size;
|
getItemTypeData(itemTypeIndex).size = size;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} size to {ALTCOLOUR}${size}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} size to {ALTCOLOUR}${size}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1278,6 +1323,7 @@ function setItemTypeCapacityCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
||||||
let capacity = splitParams.slice(-1) || 100;
|
let capacity = splitParams.slice(-1) || 100;
|
||||||
|
|
||||||
@@ -1286,9 +1332,14 @@ function setItemTypeCapacityCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isNaN(capacity)) {
|
||||||
|
messagePlayerError(client, `The capacity must be numbers!`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
getItemTypeData(itemTypeIndex).capacity = capacity;
|
getItemTypeData(itemTypeIndex).capacity = capacity;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} capacity to {ALTCOLOUR}${capacity}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} capacity to {ALTCOLOUR}${capacity}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1297,7 +1348,7 @@ function playerUseItem(client, hotBarSlot) {
|
|||||||
let itemIndex = getPlayerData(client).hotBarItems[hotBarSlot];
|
let itemIndex = getPlayerData(client).hotBarItems[hotBarSlot];
|
||||||
|
|
||||||
if (itemIndex == -1) {
|
if (itemIndex == -1) {
|
||||||
logToConsole(LOG_DEBUG | LOG_WARN, `[VRR.Item] ${getPlayerDisplayForConsole(client)} tried to use an empty hotbar slot ${hotBarSlot}`);
|
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.Item] ${getPlayerDisplayForConsole(client)} tried to use an empty hotbar slot ${hotBarSlot}`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1311,7 +1362,9 @@ function playerUseItem(client, hotBarSlot) {
|
|||||||
let itemTypeData = getItemTypeData(itemData.itemTypeIndex);
|
let itemTypeData = getItemTypeData(itemData.itemTypeIndex);
|
||||||
let hotBarItems = getPlayerData(client).hotBarItems;
|
let hotBarItems = getPlayerData(client).hotBarItems;
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Item] ${getPlayerDisplayForConsole(client)} used a ${itemTypeData.name} (use type ${itemTypeData.useType} - ${typeof itemTypeData.useType}) item (ID: ${itemData.index}/${itemData.databaseId}, TypeID: ${itemTypeData.index}/${itemTypeData.databaseId})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Item] ${getPlayerDisplayForConsole(client)} used a ${itemTypeData.name} (use type ${itemTypeData.useType} - ${typeof itemTypeData.useType}) item (ID: ${itemData.index}/${itemData.databaseId}, TypeID: ${itemTypeData.index}/${itemTypeData.databaseId})`);
|
||||||
|
|
||||||
|
markPlayerActionTipSeen(client, "UseItemKeyAfterEquipping");
|
||||||
|
|
||||||
switch (toInteger(itemTypeData.useType)) {
|
switch (toInteger(itemTypeData.useType)) {
|
||||||
case AGRP_ITEM_USE_TYPE_SKIN: {
|
case AGRP_ITEM_USE_TYPE_SKIN: {
|
||||||
@@ -1335,6 +1388,8 @@ function playerUseItem(client, hotBarSlot) {
|
|||||||
itemData.value = itemData.value + ammoItemData.value;
|
itemData.value = itemData.value + ammoItemData.value;
|
||||||
deleteItem(hotBarItems[i]);
|
deleteItem(hotBarItems[i]);
|
||||||
meActionToNearbyPlayers(client, `loads some ammo into their ${itemTypeData.name}`);
|
meActionToNearbyPlayers(client, `loads some ammo into their ${itemTypeData.name}`);
|
||||||
|
|
||||||
|
markPlayerActionTipSeen(client, "AmmoClipItemUsage");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1441,7 +1496,7 @@ function playerUseItem(client, hotBarSlot) {
|
|||||||
meActionToNearbyPlayers(client, `takes their key and removes the handcuffs from ${getCharacterFullName(closestPlayer)}`);
|
meActionToNearbyPlayers(client, `takes their key and removes the handcuffs from ${getCharacterFullName(closestPlayer)}`);
|
||||||
} else {
|
} else {
|
||||||
if (!isPlayerSurrendered(closestPlayer)) {
|
if (!isPlayerSurrendered(closestPlayer)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "PlayerNotSurrenderedHandcuffed", getCharacterFullName(closestPlayer)));
|
messagePlayerError(client, getLocaleString(client, "PlayerNotSurrenderedHandcuff", getCharacterFullName(closestPlayer)));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1461,8 +1516,10 @@ function playerUseItem(client, hotBarSlot) {
|
|||||||
if (itemData.value <= 0) {
|
if (itemData.value <= 0) {
|
||||||
destroyItem(itemIndex);
|
destroyItem(itemIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
markPlayerActionTipSeen(client, "VehicleRepairItemUsage");
|
||||||
} else {
|
} else {
|
||||||
messagePlayerError(client, getLocaleString(client, "VehicleRepairFailedTooFar"));
|
messagePlayerError(client, getLocaleString(client, "VehicleFailedTooFar"));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1472,6 +1529,9 @@ function playerUseItem(client, hotBarSlot) {
|
|||||||
if (getDistance(getPlayerPosition(client), getVehiclePosition(vehicle)) <= getGlobalConfig().vehicleRepairDistance) {
|
if (getDistance(getPlayerPosition(client), getVehiclePosition(vehicle)) <= getGlobalConfig().vehicleRepairDistance) {
|
||||||
meActionToNearbyPlayers(client, `takes their upgrade kit and adds a ${itemTypeData.name} to the vehicle.`);
|
meActionToNearbyPlayers(client, `takes their upgrade kit and adds a ${itemTypeData.name} to the vehicle.`);
|
||||||
addVehicleUpgrade(vehicle, itemTypeData.useId);
|
addVehicleUpgrade(vehicle, itemTypeData.useId);
|
||||||
|
markPlayerActionTipSeen(client, "VehiclePartItemUsage");
|
||||||
|
} else {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "VehicleTooFar"));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1490,13 +1550,17 @@ function playerUseItem(client, hotBarSlot) {
|
|||||||
if (getDistance(getPlayerPosition(client), getVehiclePosition(vehicle)) <= getGlobalConfig().vehicleRepairDistance) {
|
if (getDistance(getPlayerPosition(client), getVehiclePosition(vehicle)) <= getGlobalConfig().vehicleRepairDistance) {
|
||||||
if (itemData.useId == 1) {
|
if (itemData.useId == 1) {
|
||||||
meActionToNearbyPlayers(client, `takes their vehicle colour kit and changes the primary colour of the vehicle.`);
|
meActionToNearbyPlayers(client, `takes their vehicle colour kit and changes the primary colour of the vehicle.`);
|
||||||
vehicle.colour1 = itemData.value;
|
setVehicleColours(vehicle, getVehicleData(vehicle).colour1, itemData.value);
|
||||||
|
markPlayerActionTipSeen(client, "VehicleColourItemUsage");
|
||||||
} else {
|
} else {
|
||||||
if (itemTypeData.useId == 1) {
|
if (itemTypeData.useId == 1) {
|
||||||
meActionToNearbyPlayers(client, `takes their vehicle colour kit and changes the secondary colour of the vehicle.`);
|
meActionToNearbyPlayers(client, `takes their vehicle colour kit and changes the secondary colour of the vehicle.`);
|
||||||
vehicle.colour2 = itemData.value;
|
setVehicleColours(vehicle, getVehicleData(vehicle).colour1, itemData.value);
|
||||||
|
markPlayerActionTipSeen(client, "VehicleColourItemUsage");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "VehicleTooFar"));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1519,16 +1583,22 @@ function playerUseItem(client, hotBarSlot) {
|
|||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (getDistance(getPlayerPosition(client), getFuelPumpData(fuelPump).position) <= getGlobalConfig().vehicleRepairDistance) {
|
if (getDistance(getPlayerPosition(client), getFuelPumpData(fuelPump).position) <= getGlobalConfig().fuelPumpUseDistance) {
|
||||||
if (itemData.useId == 1) {
|
|
||||||
meActionToNearbyPlayers(client, `takes their vehicle colour kit and changes the primary colour of the vehicle.`);
|
if (itemData.amount < 100) {
|
||||||
vehicle.colour1 = itemTypeData.value;
|
let amountToFull = 100 - itemData.amount;
|
||||||
|
let totalCost = getFuelPumpData(fuelPump).pricePerUnit * amountToFull;
|
||||||
|
if (getPlayerCurrentSubAccount(client).cash >= totalCost) {
|
||||||
|
meActionToNearbyPlayers(client, `refills their fuel can`);
|
||||||
|
getItemData(itemIndex).amount = 100;
|
||||||
|
takePlayerCash(client, totalCost);
|
||||||
} else {
|
} else {
|
||||||
if (itemData.useId == 1) {
|
messagePlayerError(client, getLocaleString(client, "NotEnoughCashNeedAmountMore", `{ALTCOLOUR}${getCurrencyString(totalCost - getPlayerCurrentSubAccount(client).cash)}{MAINCOLOUR}`));
|
||||||
meActionToNearbyPlayers(client, `takes their vehicle colour kit and changes the secondary colour of the vehicle.`);
|
|
||||||
vehicle.colour2 = itemData.value;
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
messagePlayerError(client, "Your fuel can is already full!");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1537,6 +1607,12 @@ function playerUseItem(client, hotBarSlot) {
|
|||||||
case AGRP_ITEM_USE_TYPE_WALKIETALKIE: {
|
case AGRP_ITEM_USE_TYPE_WALKIETALKIE: {
|
||||||
itemData.enabled = !itemData.enabled;
|
itemData.enabled = !itemData.enabled;
|
||||||
meActionToNearbyPlayers(client, `turns ${toLowerCase(getOnOffFromBool(itemData.enabled))} their walkie-talkie`);
|
meActionToNearbyPlayers(client, `turns ${toLowerCase(getOnOffFromBool(itemData.enabled))} their walkie-talkie`);
|
||||||
|
|
||||||
|
if (itemData.enabled) {
|
||||||
|
if (!hasPlayerSeenActionTip(client, "RadioCommandAfterEnablingWalkieTalkie")) {
|
||||||
|
messagePlayerInfo(client, getGroupedLocaleString(client, "ActionTips", "RadioCommandAfterEnablingWalkieTalkie", `{ALTCOLOUR}/r{MAINCOLOUR}`));
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1829,7 +1905,7 @@ function playerSwitchItem(client, newHotBarSlot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let currentHotBarSlot = getPlayerData(client).activeHotBarSlot;
|
let currentHotBarSlot = getPlayerData(client).activeHotBarSlot;
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Item] ${getPlayerDisplayForConsole(client)} switched from hotbar slot ${currentHotBarSlot} to ${newHotBarSlot}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Item] ${getPlayerDisplayForConsole(client)} switched from hotbar slot ${currentHotBarSlot} to ${newHotBarSlot}`);
|
||||||
|
|
||||||
let currentHotBarItem = -1;
|
let currentHotBarItem = -1;
|
||||||
let newHotBarItem = -1;
|
let newHotBarItem = -1;
|
||||||
@@ -1905,6 +1981,44 @@ function playerSwitchItem(client, newHotBarSlot) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch (getItemTypeData(getItemData(newHotBarItem).itemTypeIndex).useType) {
|
||||||
|
case AGRP_ITEM_USE_TYPE_AMMO_CLIP:
|
||||||
|
if (!hasPlayerSeenActionTip(client, "AmmoClipItemUsage")) {
|
||||||
|
messagePlayerTip(client, getGroupedLocaleString(client, "AmmoClipItemUsage", getKeyOrCommandForPlayerMessage(client, "use")));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case AGRP_ITEM_USE_TYPE_VEHREPAIR:
|
||||||
|
if (!hasPlayerSeenActionTip(client, "VehicleRepairKitItemUsage")) {
|
||||||
|
messagePlayerTip(client, getGroupedLocaleString(client, "VehicleRepairKitItemUsage", getKeyOrCommandForPlayerMessage(client, "use")));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case AGRP_ITEM_USE_TYPE_VEHCOLOUR:
|
||||||
|
if (!hasPlayerSeenActionTip(client, "VehicleColourKitItemUsage")) {
|
||||||
|
messagePlayerTip(client, getGroupedLocaleString(client, "VehicleColourKitItemUsage", getKeyOrCommandForPlayerMessage(client, "use")));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case AGRP_ITEM_USE_TYPE_VEHUPGRADE_PART:
|
||||||
|
if (!hasPlayerSeenActionTip(client, "VehiclePartItemUsage")) {
|
||||||
|
messagePlayerTip(client, getGroupedLocaleString(client, "VehiclePartItemUsage", getKeyOrCommandForPlayerMessage(client, "use"), getItemTypeData(getItemData(newHotBarItem).itemTypeIndex).name));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case AGRP_ITEM_USE_TYPE_WALKIETALKIE:
|
||||||
|
if (!hasPlayerSeenActionTip(client, "UseItemKeyAfterEquippingWalkieTalkie")) {
|
||||||
|
messagePlayerInfo(client, getGroupedLocaleString(client, "ActionTips", "UseItemKeyAfterEquippingWalkieTalkie", (doesPlayerHaveKeyBindForCommand(client, "use")) ? `{ALTCOLOUR}U{MAINCOLOUR}` : `{ALTCOLOUR}/use{MAINCOLOUR}`));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
if (!hasPlayerSeenActionTip(client, "UseItemKeyAfterEquipping")) {
|
||||||
|
messagePlayerInfo(client, getGroupedLocaleString(client, "ActionTips", "UseItemKeyAfterEquipping", (doesPlayerHaveKeyBindForCommand(client, "use")) ? `{ALTCOLOUR}U{MAINCOLOUR}` : `{ALTCOLOUR}/use{MAINCOLOUR}`));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
getPlayerData(client).activeHotBarSlot = newHotBarSlot;
|
getPlayerData(client).activeHotBarSlot = newHotBarSlot;
|
||||||
updatePlayerHotBar(client);
|
updatePlayerHotBar(client);
|
||||||
}
|
}
|
||||||
@@ -2021,7 +2135,7 @@ function cacheAllGroundItems() {
|
|||||||
|
|
||||||
function createAllGroundItemObjects() {
|
function createAllGroundItemObjects() {
|
||||||
for (let i in getServerData().groundItemCache) {
|
for (let i in getServerData().groundItemCache) {
|
||||||
createGroundItemObject(i);
|
createGroundItemObject(getServerData().groundItemCache[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2150,6 +2264,20 @@ function deleteItem(itemId, whoDeleted = -1) {
|
|||||||
function getBestNewOwnerToPutItem(client) {
|
function getBestNewOwnerToPutItem(client) {
|
||||||
let position = getPlayerPosition(client);
|
let position = getPlayerPosition(client);
|
||||||
|
|
||||||
|
let possibleItem = getClosestItemOnGround(position);
|
||||||
|
if (possibleItem != -1) {
|
||||||
|
if (getDistance(getItemPosition(possibleItem), position) <= getGlobalConfig().itemContainerDistance) {
|
||||||
|
return [AGRP_ITEM_OWNER_ITEM, possibleItem];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let possibleVehicle = getClosestVehicle(position);
|
||||||
|
if (possibleVehicle != false) {
|
||||||
|
if (getVehicleData(possibleVehicle) != false && getDistance(getVehicleTrunkPosition(possibleVehicle), position) <= getGlobalConfig().vehicleTrunkDistance) {
|
||||||
|
return [AGRP_ITEM_OWNER_VEHTRUNK, possibleVehicle];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let possibleHouse = getPlayerHouse(client);
|
let possibleHouse = getPlayerHouse(client);
|
||||||
if (possibleHouse != -1) {
|
if (possibleHouse != -1) {
|
||||||
if (getHouseData(possibleHouse) != false) {
|
if (getHouseData(possibleHouse) != false) {
|
||||||
@@ -2164,20 +2292,6 @@ function getBestNewOwnerToPutItem(client) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let possibleVehicle = getClosestVehicle(position);
|
|
||||||
if (possibleVehicle != false) {
|
|
||||||
if (getVehicleData(possibleVehicle) != false && getDistance(getVehicleTrunkPosition(possibleVehicle), position) <= getGlobalConfig().vehicleTrunkDistance) {
|
|
||||||
return [AGRP_ITEM_OWNER_VEHTRUNK, possibleVehicle];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let possibleItem = getClosestItemOnGround(position);
|
|
||||||
if (possibleItem != -1) {
|
|
||||||
if (getDistance(getItemPosition(possibleItem), position) <= getGlobalConfig().itemContainerDistance) {
|
|
||||||
return [AGRP_ITEM_OWNER_ITEM, possibleItem];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return [AGRP_ITEM_OWNER_NONE, 0];
|
return [AGRP_ITEM_OWNER_NONE, 0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2190,6 +2304,15 @@ function getBestItemToTake(client, slot) {
|
|||||||
let ownerType = AGRP_ITEM_OWNER_NONE;
|
let ownerType = AGRP_ITEM_OWNER_NONE;
|
||||||
let ownerId = 0;
|
let ownerId = 0;
|
||||||
|
|
||||||
|
let possibleItem = getClosestItemOnGround(position);
|
||||||
|
if (getItemData(possibleItem)) {
|
||||||
|
if (typeof getItemData(possibleItem).itemCache[slot] != "undefined") {
|
||||||
|
itemId = getItemData(possibleItem).itemCache[slot]
|
||||||
|
ownerType = AGRP_ITEM_OWNER_ITEM;
|
||||||
|
ownerId = possibleItem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let possibleHouse = getPlayerHouse(client);
|
let possibleHouse = getPlayerHouse(client);
|
||||||
if (getHouseData(possibleHouse)) {
|
if (getHouseData(possibleHouse)) {
|
||||||
if (typeof getHouseData(possibleHouse).itemCache[slot] != "undefined") {
|
if (typeof getHouseData(possibleHouse).itemCache[slot] != "undefined") {
|
||||||
@@ -2434,7 +2557,7 @@ function saveItemToDatabase(itemId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Item]: Saving item '${itemData.index}' to database ...`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Item]: Saving item '${itemData.index}' to database ...`);
|
||||||
|
|
||||||
let position = getItemPosition(itemId);
|
let position = getItemPosition(itemId);
|
||||||
|
|
||||||
@@ -2491,7 +2614,7 @@ function saveItemTypeToDatabase(itemTypeId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Item]: Saving item type '${itemTypeData.name}' to database ...`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Item]: Saving item type '${itemTypeData.name}' to database ...`);
|
||||||
|
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
@@ -2623,7 +2746,7 @@ function getItemTypeIndexFromDatabaseId(databaseId) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function playerItemActionDelayComplete(client) {
|
function playerItemActionDelayComplete(client) {
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Item]: Player ${getPlayerDisplayForConsole(client)} item action delay complete (State: ${getPlayerData(client).itemActionState})`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Item]: Player ${getPlayerDisplayForConsole(client)} item action delay complete (State: ${getPlayerData(client).itemActionState})`);
|
||||||
switch (getPlayerData(client).itemActionState) {
|
switch (getPlayerData(client).itemActionState) {
|
||||||
case AGRP_ITEM_ACTION_USE:
|
case AGRP_ITEM_ACTION_USE:
|
||||||
playerUseItem(client, getPlayerData(client).itemActionItem);
|
playerUseItem(client, getPlayerData(client).itemActionItem);
|
||||||
@@ -2940,7 +3063,7 @@ function showBusinessFloorInventoryToPlayer(client, businessId) {
|
|||||||
if (getBusinessData(businessId).floorItemCache == -1) {
|
if (getBusinessData(businessId).floorItemCache == -1) {
|
||||||
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}{ALTCOLOUR}(Empty)`);
|
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}{ALTCOLOUR}(Empty)`);
|
||||||
} else {
|
} else {
|
||||||
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}: {ALTCOLOUR}${getItemTypeData(getItemData(getBusinessData(businessId).floorItemCache[i]).itemTypeIndex).name} - ${(getPlayerCurrentSubAccount(client).cash > getItemData(getBusinessData(businessId).floorItemCache[i]).buyPrice) ? "{softGreen}" : "{softRed}"}$${getItemData(getBusinessData(businessId).floorItemCache[i]).buyPrice}`);
|
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}: {ALTCOLOUR}${getItemTypeData(getItemData(getBusinessData(businessId).floorItemCache[i]).itemTypeIndex).name} - ${(getPlayerCurrentSubAccount(client).cash > getItemData(getBusinessData(businessId).floorItemCache[i]).buyPrice) ? "{softGreen}" : "{softRed}"}${getCurrencyString(getItemData(getBusinessData(businessId).floorItemCache[i]).buyPrice)}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2959,7 +3082,7 @@ function showBusinessStorageInventoryToPlayer(client, businessId) {
|
|||||||
if (getBusinessData(businessId).storageItemCache == -1) {
|
if (getBusinessData(businessId).storageItemCache == -1) {
|
||||||
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}{ALTCOLOUR}(Empty)`);
|
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}{ALTCOLOUR}(Empty)`);
|
||||||
} else {
|
} else {
|
||||||
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}: {ALTCOLOUR}${getItemTypeData(getItemData(getBusinessData(businessId).storageItemCache[i]).itemTypeIndex).name}`);
|
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}: {ALTCOLOUR}${getItemTypeData(getItemData(getBusinessData(businessId).storageItemCache[i]).itemTypeIndex).name} ${getItemValueDisplayForItem(getBusinessData(businessId).storageItemCache[i])}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2977,9 +3100,9 @@ function showItemInventoryToPlayer(client, itemId) {
|
|||||||
let itemDisplay = [];
|
let itemDisplay = [];
|
||||||
for (let i in getItemData(itemId).itemCache) {
|
for (let i in getItemData(itemId).itemCache) {
|
||||||
if (getItemData(itemId).itemCache == -1) {
|
if (getItemData(itemId).itemCache == -1) {
|
||||||
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}{ALTCOLOUR}(Empty)`);
|
itemDisplay.push(`{businessBlue}${toInteger(i) + 1}{ALTCOLOUR}(Empty)`);
|
||||||
} else {
|
} else {
|
||||||
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}: {ALTCOLOUR}${getItemTypeData(getItemData(getItemData(itemId).itemCache[i]).itemTypeIndex).name}`);
|
itemDisplay.push(`{businessBlue}${toInteger(i) + 1}: {ALTCOLOUR}${getItemTypeData(getItemData(getItemData(itemId).itemCache[i]).itemTypeIndex).name} ${getItemValueDisplayForItem(getItemData(itemId).itemCache[i])}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3002,13 +3125,13 @@ function showPlayerInventoryToPlayer(showToClient, targetClient) {
|
|||||||
colour = "{yellow}";
|
colour = "{yellow}";
|
||||||
}
|
}
|
||||||
if (getPlayerData(targetClient).hotBarItems[i] == -1) {
|
if (getPlayerData(targetClient).hotBarItems[i] == -1) {
|
||||||
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}: ${colour}(Empty)`);
|
itemDisplay.push(`{businessBlue}${toInteger(i) + 1}: ${colour}(Empty)`);
|
||||||
} else {
|
} else {
|
||||||
let itemTypeData = getItemTypeData(getItemData(getPlayerData(targetClient).hotBarItems[i]).itemTypeIndex);
|
let itemTypeData = getItemTypeData(getItemData(getPlayerData(targetClient).hotBarItems[i]).itemTypeIndex);
|
||||||
if (itemTypeData != false) {
|
if (itemTypeData != false) {
|
||||||
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}: ${colour}${itemTypeData.name}`);
|
itemDisplay.push(`{businessBlue}${toInteger(i) + 1}: ${colour}${itemTypeData.name} ${getItemValueDisplayForItem(getPlayerData(targetClient).hotBarItems[i])}`);
|
||||||
} else {
|
} else {
|
||||||
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}: ${colour}(Empty)`);
|
itemDisplay.push(`{businessBlue}${toInteger(i) + 1}: ${colour}(Empty)`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3033,7 +3156,7 @@ function showHouseInventoryToPlayer(client, houseId) {
|
|||||||
if (getHouseData(houseId).itemCache == -1) {
|
if (getHouseData(houseId).itemCache == -1) {
|
||||||
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}{ALTCOLOUR}(Empty)`);
|
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}{ALTCOLOUR}(Empty)`);
|
||||||
} else {
|
} else {
|
||||||
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}: {ALTCOLOUR}${getItemTypeData(getItemData(getHouseData(houseId).itemCache[i]).itemTypeIndex).name}`);
|
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}: {ALTCOLOUR}${getItemTypeData(getItemData(getHouseData(houseId).itemCache[i]).itemTypeIndex).name} ${getItemValueDisplayForItem(getHouseData(houseId).itemCache[i])}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -131,7 +131,10 @@ function walkieTalkieChatCommand(command, params, client) {
|
|||||||
messagePlayerError(client, "Please turn on a walkie talkie first!");
|
messagePlayerError(client, "Please turn on a walkie talkie first!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
walkieTalkieTransmit(getPlayerActiveWalkieTalkieFrequency(client), params, client);
|
walkieTalkieTransmit(getPlayerActiveWalkieTalkieFrequency(client), params, client);
|
||||||
|
|
||||||
|
markPlayerActionTipSeen(client, "RadioCommandAfterEnablingWalkieTalkie");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -472,15 +472,15 @@ let jobRouteLocationTypeNames = {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initJobScript() {
|
function initJobScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Job]: Initializing job script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.Job]: Initializing job script ...");
|
||||||
logToConsole(LOG_INFO, "[VRR.Job]: Job script initialized successfully!");
|
logToConsole(LOG_INFO, "[AGRP.Job]: Job script initialized successfully!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadJobsFromDatabase() {
|
function loadJobsFromDatabase() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Job]: Loading jobs from database ...");
|
logToConsole(LOG_DEBUG, "[AGRP.Job]: Loading jobs from database ...");
|
||||||
|
|
||||||
let tempJobs = [];
|
let tempJobs = [];
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
@@ -499,7 +499,7 @@ function loadJobsFromDatabase() {
|
|||||||
tempJobData.routes = loadJobRoutesFromDatabase(tempJobData.databaseId);
|
tempJobData.routes = loadJobRoutesFromDatabase(tempJobData.databaseId);
|
||||||
tempJobData.ranks = loadJobRanksFromDatabase(tempJobData.databaseId);
|
tempJobData.ranks = loadJobRanksFromDatabase(tempJobData.databaseId);
|
||||||
tempJobs.push(tempJobData);
|
tempJobs.push(tempJobData);
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Job]: Job '${tempJobData.name}' loaded from database successfully!`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Job '${tempJobData.name}' loaded from database successfully!`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
@@ -507,7 +507,7 @@ function loadJobsFromDatabase() {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: ${tempJobs.length} jobs loaded from database successfully!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: ${tempJobs.length} jobs loaded from database successfully!`);
|
||||||
return tempJobs;
|
return tempJobs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -546,7 +546,7 @@ function loadAllJobLocationsFromDatabase() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadJobRanksFromDatabase(jobDatabaseId) {
|
function loadJobRanksFromDatabase(jobDatabaseId) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Loading ranks for job ${jobDatabaseId} from database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Loading ranks for job ${jobDatabaseId} from database ...`);
|
||||||
|
|
||||||
let tempJobRanks = [];
|
let tempJobRanks = [];
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
@@ -560,7 +560,7 @@ function loadJobRanksFromDatabase(jobDatabaseId) {
|
|||||||
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
||||||
let tempJobRankData = new JobRankData(dbAssoc);
|
let tempJobRankData = new JobRankData(dbAssoc);
|
||||||
tempJobRanks.push(tempJobRankData);
|
tempJobRanks.push(tempJobRankData);
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Job]: Job rank '${tempJobRankData.name}' loaded from database successfully!`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Job rank '${tempJobRankData.name}' loaded from database successfully!`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
@@ -568,14 +568,14 @@ function loadJobRanksFromDatabase(jobDatabaseId) {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: ${tempJobRanks.length} ranks for job ${jobDatabaseId} loaded from database successfully!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: ${tempJobRanks.length} ranks for job ${jobDatabaseId} loaded from database successfully!`);
|
||||||
return tempJobRanks;
|
return tempJobRanks;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadJobRoutesFromDatabase(jobDatabaseId) {
|
function loadJobRoutesFromDatabase(jobDatabaseId) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Loading job routes for job ${jobDatabaseId} from database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Loading job routes for job ${jobDatabaseId} from database ...`);
|
||||||
|
|
||||||
let tempJobRoutes = [];
|
let tempJobRoutes = [];
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
@@ -590,7 +590,7 @@ function loadJobRoutesFromDatabase(jobDatabaseId) {
|
|||||||
let tempJobRouteData = new JobRouteData(dbAssoc);
|
let tempJobRouteData = new JobRouteData(dbAssoc);
|
||||||
tempJobRouteData.locations = loadJobRouteLocationsFromDatabase(tempJobRouteData.databaseId);
|
tempJobRouteData.locations = loadJobRouteLocationsFromDatabase(tempJobRouteData.databaseId);
|
||||||
tempJobRoutes.push(tempJobRouteData);
|
tempJobRoutes.push(tempJobRouteData);
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Job]: Job route '${tempJobRouteData.name}' loaded from database successfully!`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Job route '${tempJobRouteData.name}' loaded from database successfully!`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
@@ -598,14 +598,14 @@ function loadJobRoutesFromDatabase(jobDatabaseId) {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: ${tempJobRoutes.length} job routes for job ${jobDatabaseId} loaded from database successfully!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: ${tempJobRoutes.length} job routes for job ${jobDatabaseId} loaded from database successfully!`);
|
||||||
return tempJobRoutes;
|
return tempJobRoutes;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadJobRouteLocationsFromDatabase(jobRouteId) {
|
function loadJobRouteLocationsFromDatabase(jobRouteId) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Loading locations for job route ${jobRouteId} from database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Loading locations for job route ${jobRouteId} from database ...`);
|
||||||
|
|
||||||
let tempJobRouteLocations = [];
|
let tempJobRouteLocations = [];
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
@@ -619,7 +619,7 @@ function loadJobRouteLocationsFromDatabase(jobRouteId) {
|
|||||||
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
||||||
let tempJobRouteLocationData = new JobRouteLocationData(dbAssoc);
|
let tempJobRouteLocationData = new JobRouteLocationData(dbAssoc);
|
||||||
tempJobRouteLocations.push(tempJobRouteLocationData);
|
tempJobRouteLocations.push(tempJobRouteLocationData);
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Job]: Job route location '${tempJobRouteLocationData.databaseId}' loaded from database successfully!`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Job route location '${tempJobRouteLocationData.databaseId}' loaded from database successfully!`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
@@ -627,14 +627,14 @@ function loadJobRouteLocationsFromDatabase(jobRouteId) {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: ${tempJobRouteLocations.length} locations for job route ${jobRouteId} loaded from database successfully!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: ${tempJobRouteLocations.length} locations for job route ${jobRouteId} loaded from database successfully!`);
|
||||||
return tempJobRouteLocations;
|
return tempJobRouteLocations;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadJobEquipmentsFromDatabase(jobDatabaseId) {
|
function loadJobEquipmentsFromDatabase(jobDatabaseId) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Loading job equipments for job ${jobDatabaseId} from database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Loading job equipments for job ${jobDatabaseId} from database ...`);
|
||||||
|
|
||||||
let tempJobEquipments = [];
|
let tempJobEquipments = [];
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
@@ -649,7 +649,7 @@ function loadJobEquipmentsFromDatabase(jobDatabaseId) {
|
|||||||
let tempJobEquipmentData = new JobEquipmentData(dbAssoc);
|
let tempJobEquipmentData = new JobEquipmentData(dbAssoc);
|
||||||
tempJobEquipmentData.items = loadJobEquipmentItemsFromDatabase(tempJobEquipmentData.databaseId);
|
tempJobEquipmentData.items = loadJobEquipmentItemsFromDatabase(tempJobEquipmentData.databaseId);
|
||||||
tempJobEquipments.push(tempJobEquipmentData);
|
tempJobEquipments.push(tempJobEquipmentData);
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Job]: Job equipment '${tempJobEquipmentData.name}' loaded from database successfully!`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Job equipment '${tempJobEquipmentData.name}' loaded from database successfully!`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
@@ -657,14 +657,14 @@ function loadJobEquipmentsFromDatabase(jobDatabaseId) {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: ${tempJobEquipments.length} job equipments for job ${jobDatabaseId} loaded from database successfully!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: ${tempJobEquipments.length} job equipments for job ${jobDatabaseId} loaded from database successfully!`);
|
||||||
return tempJobEquipments;
|
return tempJobEquipments;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadJobLocationsFromDatabase(jobDatabaseId) {
|
function loadJobLocationsFromDatabase(jobDatabaseId) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Loading job locations for job ${jobDatabaseId} from database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Loading job locations for job ${jobDatabaseId} from database ...`);
|
||||||
|
|
||||||
let tempJobLocations = [];
|
let tempJobLocations = [];
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
@@ -678,7 +678,7 @@ function loadJobLocationsFromDatabase(jobDatabaseId) {
|
|||||||
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
||||||
let tempJobLocationData = new JobLocationData(dbAssoc);
|
let tempJobLocationData = new JobLocationData(dbAssoc);
|
||||||
tempJobLocations.push(tempJobLocationData);
|
tempJobLocations.push(tempJobLocationData);
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Job]: Job location '${tempJobLocationData.databaseId}' loaded from database successfully!`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Job location '${tempJobLocationData.databaseId}' loaded from database successfully!`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
@@ -686,14 +686,14 @@ function loadJobLocationsFromDatabase(jobDatabaseId) {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: ${tempJobLocations.length} job locations for job ${jobDatabaseId} loaded from database successfully!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: ${tempJobLocations.length} job locations for job ${jobDatabaseId} loaded from database successfully!`);
|
||||||
return tempJobLocations;
|
return tempJobLocations;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadJobUniformsFromDatabase(jobDatabaseId) {
|
function loadJobUniformsFromDatabase(jobDatabaseId) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Loading job uniforms for job ${jobDatabaseId} from database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Loading job uniforms for job ${jobDatabaseId} from database ...`);
|
||||||
|
|
||||||
let tempJobUniforms = [];
|
let tempJobUniforms = [];
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
@@ -707,7 +707,7 @@ function loadJobUniformsFromDatabase(jobDatabaseId) {
|
|||||||
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
||||||
let tempJobUniformData = new JobUniformData(dbAssoc);
|
let tempJobUniformData = new JobUniformData(dbAssoc);
|
||||||
tempJobUniforms.push(tempJobUniformData);
|
tempJobUniforms.push(tempJobUniformData);
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Job]: Job uniform '${tempJobUniformData.databaseId}' loaded from database successfully!`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Job uniform '${tempJobUniformData.databaseId}' loaded from database successfully!`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
@@ -715,14 +715,14 @@ function loadJobUniformsFromDatabase(jobDatabaseId) {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: ${tempJobUniforms.length} job uniforms for job ${jobDatabaseId} loaded from database successfully!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: ${tempJobUniforms.length} job uniforms for job ${jobDatabaseId} loaded from database successfully!`);
|
||||||
return tempJobUniforms;
|
return tempJobUniforms;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadJobEquipmentItemsFromDatabase(jobEquipmentDatabaseId) {
|
function loadJobEquipmentItemsFromDatabase(jobEquipmentDatabaseId) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Loading job equipment items for job equipment ${jobEquipmentDatabaseId} from database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Loading job equipment items for job equipment ${jobEquipmentDatabaseId} from database ...`);
|
||||||
|
|
||||||
let tempJobEquipmentItems = [];
|
let tempJobEquipmentItems = [];
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
@@ -736,7 +736,7 @@ function loadJobEquipmentItemsFromDatabase(jobEquipmentDatabaseId) {
|
|||||||
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
||||||
let tempJobEquipmentItemData = new JobEquipmentItemData(dbAssoc);
|
let tempJobEquipmentItemData = new JobEquipmentItemData(dbAssoc);
|
||||||
tempJobEquipmentItems.push(tempJobEquipmentItemData);
|
tempJobEquipmentItems.push(tempJobEquipmentItemData);
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Job]: Job equipment item '${tempJobEquipmentItemData.databaseId}' loaded from database successfully!`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Job equipment item '${tempJobEquipmentItemData.databaseId}' loaded from database successfully!`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
@@ -744,7 +744,7 @@ function loadJobEquipmentItemsFromDatabase(jobEquipmentDatabaseId) {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: ${tempJobEquipmentItems.length} job equipment items for equipment ${jobEquipmentDatabaseId} loaded from database successfully!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: ${tempJobEquipmentItems.length} job equipment items for equipment ${jobEquipmentDatabaseId} loaded from database successfully!`);
|
||||||
return tempJobEquipmentItems;
|
return tempJobEquipmentItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -755,13 +755,13 @@ function createAllJobBlips() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job] Spawning all job location blips ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job] Spawning all job location blips ...`);
|
||||||
for (let i in getServerData().jobs) {
|
for (let i in getServerData().jobs) {
|
||||||
for (let j in getServerData().jobs[i].locations) {
|
for (let j in getServerData().jobs[i].locations) {
|
||||||
createJobLocationBlip(i, j);
|
createJobLocationBlip(i, j);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job] All job location blips spawned!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job] All job location blips spawned!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -771,7 +771,7 @@ function createAllJobPickups() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job] Spawning all job location pickups ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job] Spawning all job location pickups ...`);
|
||||||
let pickupCount = 0;
|
let pickupCount = 0;
|
||||||
for (let i in getServerData().jobs) {
|
for (let i in getServerData().jobs) {
|
||||||
if (getServerData().jobs[i].pickupModel != 0) {
|
if (getServerData().jobs[i].pickupModel != 0) {
|
||||||
@@ -787,11 +787,11 @@ function createAllJobPickups() {
|
|||||||
setElementDimension(getServerData().jobs[i].locations[j].pickup, getServerData().jobs[i].locations[j].dimension);
|
setElementDimension(getServerData().jobs[i].locations[j].pickup, getServerData().jobs[i].locations[j].dimension);
|
||||||
addToWorld(getServerData().jobs[i].locations[j].pickup);
|
addToWorld(getServerData().jobs[i].locations[j].pickup);
|
||||||
|
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Job] Job '${getServerData().jobs[i].name}' location pickup ${j} spawned!`);
|
logToConsole(LOG_VERBOSE, `[AGRP.Job] Job '${getServerData().jobs[i].name}' location pickup ${j} spawned!`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job] All job location pickups (${pickupCount}) spawned!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job] All job location pickups (${pickupCount}) spawned!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -904,7 +904,7 @@ function jobListCommand(command, params, client) {
|
|||||||
|
|
||||||
function takeJobCommand(command, params, client) {
|
function takeJobCommand(command, params, client) {
|
||||||
if (!canPlayerUseJobs(client)) {
|
if (!canPlayerUseJobs(client)) {
|
||||||
messagePlayerError(client, "You are not allowed to use any jobs!");
|
messagePlayerError(client, getLocaleString(client, "NotAllowedToUseJobs"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -912,7 +912,7 @@ function takeJobCommand(command, params, client) {
|
|||||||
let jobData = getJobData(closestJobLocation.jobIndex);
|
let jobData = getJobData(closestJobLocation.jobIndex);
|
||||||
|
|
||||||
if (closestJobLocation.position.distance(getPlayerPosition(client)) > getGlobalConfig().takeJobDistance) {
|
if (closestJobLocation.position.distance(getPlayerPosition(client)) > getGlobalConfig().takeJobDistance) {
|
||||||
messagePlayerError(client, "There are no job points close enough!");
|
messagePlayerError(client, getLocaleString(client, "NoJobLocationCloseEnough"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -922,12 +922,12 @@ function takeJobCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!canPlayerUseJob(client, closestJobLocation.jobIndex)) {
|
if (!canPlayerUseJob(client, closestJobLocation.jobIndex)) {
|
||||||
messagePlayerError(client, "You can't use this job!");
|
messagePlayerError(client, getLocaleString(client, "CantUseThisJob"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
takeJob(client, closestJobLocation.jobIndex);
|
takeJob(client, closestJobLocation.jobIndex);
|
||||||
messagePlayerSuccess(client, `{MAINCOLOUR}You now have the {jobYellow}${jobData.name} {MAINCOLOUR}job`);
|
messagePlayerSuccess(client, getLocaleString(client, "JobChanged", `{jobYellow}${jobData.name}{MAINCOLOUR}`));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -944,7 +944,7 @@ function startWorkingCommand(command, params, client) {
|
|||||||
if (closestJobLocation.position.distance(getPlayerPosition(client)) > getGlobalConfig().startWorkingDistance) {
|
if (closestJobLocation.position.distance(getPlayerPosition(client)) > getGlobalConfig().startWorkingDistance) {
|
||||||
let closestVehicle = getClosestVehicle(getPlayerPosition(client));
|
let closestVehicle = getClosestVehicle(getPlayerPosition(client));
|
||||||
if (getDistance(getVehiclePosition(closestVehicle), getPlayerPosition(client)) > getGlobalConfig().startWorkingDistance) {
|
if (getDistance(getVehiclePosition(closestVehicle), getPlayerPosition(client)) > getGlobalConfig().startWorkingDistance) {
|
||||||
messagePlayerError(client, "You need to be near your job site or vehicle that belongs to your job!");
|
messagePlayerError(client, getLocaleString(client, "NeedToBeNearJob"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -961,13 +961,13 @@ function startWorkingCommand(command, params, client) {
|
|||||||
jobData = getJobData(getJobIdFromDatabaseId(getVehicleData(closestVehicle).ownerId));
|
jobData = getJobData(getJobIdFromDatabaseId(getVehicleData(closestVehicle).ownerId));
|
||||||
} else {
|
} else {
|
||||||
if (getPlayerCurrentSubAccount(client).job == AGRP_JOB_NONE) {
|
if (getPlayerCurrentSubAccount(client).job == AGRP_JOB_NONE) {
|
||||||
messagePlayerError(client, "You don't have a job!");
|
messagePlayerError(client, getLocaleString(client, "DontHaveAJob"));
|
||||||
messagePlayerInfo(client, "You can get a job by going the yellow points on the map.");
|
messagePlayerInfo(client, "You can get a job by going the yellow points on the map.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getPlayerCurrentSubAccount(client).job != closestJobLocation.jobId) {
|
if (getPlayerCurrentSubAccount(client).job != closestJobLocation.jobId) {
|
||||||
messagePlayerError(client, "This is not your job!");
|
messagePlayerError(client, getLocaleString(client, "NotYourJob"));
|
||||||
messagePlayerInfo(client, getLocaleString(client, "QuitJobToTakeAnother", "{ALTCOLOUR}/quitjob{MAINCOLOUR}"));
|
messagePlayerInfo(client, getLocaleString(client, "QuitJobToTakeAnother", "{ALTCOLOUR}/quitjob{MAINCOLOUR}"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -980,11 +980,16 @@ function startWorkingCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
messagePlayerSuccess(client, `💼 You are now working for the {jobYellow}${jobData.name}{MAINCOLOUR} job`);
|
messagePlayerSuccess(client, getLocaleString(client, "StartedWorking", jobData.name));
|
||||||
messageDiscordEventChannel(`💼 ${getCharacterFullName(client)} started working for the {jobYellow}${jobData.name}{MAINCOLOUR} job`);
|
messageDiscordEventChannel(`💼 ${getCharacterFullName(client)} started working for the {jobYellow}${jobData.name}{MAINCOLOUR} job`);
|
||||||
|
|
||||||
startWorking(client);
|
startWorking(client);
|
||||||
//messagePlayerNewbieTip(client, `Enter a job vehicle to get started!`);
|
|
||||||
|
if (doesJobLocationHaveAnyRoutes(closestJobLocation)) {
|
||||||
|
if (hasPlayerSeenActionTip(client, "EnterJobVehicleForRoute")) {
|
||||||
|
messagePlayerTip(client, getGroupedLocaleString(client, "ActionTips", "EnterJobVehicleForRoute"));
|
||||||
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -996,13 +1001,13 @@ function stopWorkingCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!isPlayerWorking(client)) {
|
if (!isPlayerWorking(client)) {
|
||||||
messagePlayerError(client, "You are not working!");
|
messagePlayerError(client, getLocaleString(client, "NeedToBeWorking", "{ALTCOLOUR}/startwork{MAINCOLOUR}"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteJobItems(client);
|
deleteJobItems(client);
|
||||||
stopWorking(client);
|
stopWorking(client);
|
||||||
messagePlayerSuccess(client, "You have stopped working!");
|
messagePlayerSuccess(client, getLocaleString(client, "StoppedWorking"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1017,7 +1022,7 @@ function startWorking(client) {
|
|||||||
getPlayerCurrentSubAccount(client).skin = getPlayerSkin(client);
|
getPlayerCurrentSubAccount(client).skin = getPlayerSkin(client);
|
||||||
storePlayerItemsInTempLocker(client);
|
storePlayerItemsInTempLocker(client);
|
||||||
getPlayerData(client).tempLockerType = AGRP_TEMP_LOCKER_TYPE_JOB;
|
getPlayerData(client).tempLockerType = AGRP_TEMP_LOCKER_TYPE_JOB;
|
||||||
messagePlayerInfo(client, "Your personal items have been stored in your locker while you work");
|
messagePlayerInfo(client, getLocaleString(client, "ItemsStoredForJob"));
|
||||||
|
|
||||||
getPlayerCurrentSubAccount(client).isWorking = true;
|
getPlayerCurrentSubAccount(client).isWorking = true;
|
||||||
|
|
||||||
@@ -1148,6 +1153,7 @@ function stopWorking(client) {
|
|||||||
let jobId = getPlayerJob(client);
|
let jobId = getPlayerJob(client);
|
||||||
messageDiscordEventChannel(`💼 ${getCharacterFullName(client)} has stopped working as a ${getJobData(jobId).name}`);
|
messageDiscordEventChannel(`💼 ${getCharacterFullName(client)} has stopped working as a ${getJobData(jobId).name}`);
|
||||||
|
|
||||||
|
/*
|
||||||
switch (getJobType(jobId)) {
|
switch (getJobType(jobId)) {
|
||||||
case AGRP_JOB_POLICE:
|
case AGRP_JOB_POLICE:
|
||||||
messagePlayerInfo(client, "Your uniform, equipment, and vehicle have been returned to the police station");
|
messagePlayerInfo(client, "Your uniform, equipment, and vehicle have been returned to the police station");
|
||||||
@@ -1186,6 +1192,7 @@ function stopWorking(client) {
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
updatePlayerNameTag(client);
|
updatePlayerNameTag(client);
|
||||||
sendPlayerWorkingState(client, false);
|
sendPlayerWorkingState(client, false);
|
||||||
@@ -1200,12 +1207,12 @@ function jobUniformCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!doesPlayerHaveAnyJob(client)) {
|
if (!doesPlayerHaveAnyJob(client)) {
|
||||||
messagePlayerError(client, "You don't have a job!");
|
messagePlayerError(client, getLocaleString(client, "DontHaveAJob"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isPlayerWorking(client)) {
|
if (!isPlayerWorking(client)) {
|
||||||
messagePlayerError(client, "You are not working! Use /startwork at your job location or a job vehicle.");
|
messagePlayerError(client, getLocaleString(client, "NeedToBeWorking", `{ALTCOLOUR}/startwork{MAINCOLOUR}`));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1215,7 +1222,7 @@ function jobUniformCommand(command, params, client) {
|
|||||||
if (closestJobLocation.position.distance(getPlayerPosition(client)) > getGlobalConfig().startWorkingDistance) {
|
if (closestJobLocation.position.distance(getPlayerPosition(client)) > getGlobalConfig().startWorkingDistance) {
|
||||||
let closestVehicle = getClosestVehicle(getPlayerPosition(client));
|
let closestVehicle = getClosestVehicle(getPlayerPosition(client));
|
||||||
if (getDistance(getVehiclePosition(closestVehicle), getPlayerPosition(client)) > getGlobalConfig().startWorkingDistance) {
|
if (getDistance(getVehiclePosition(closestVehicle), getPlayerPosition(client)) > getGlobalConfig().startWorkingDistance) {
|
||||||
messagePlayerError(client, "You need to be near your job site or vehicle that belongs to your job!");
|
messagePlayerError(client, getLocaleString(client, "NeedToBeNearJob"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1303,12 +1310,12 @@ function jobEquipmentCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!doesPlayerHaveAnyJob(client)) {
|
if (!doesPlayerHaveAnyJob(client)) {
|
||||||
messagePlayerError(client, "You don't have a job!");
|
messagePlayerError(client, getLocaleString(client, "DontHaveAJob"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isPlayerWorking(client)) {
|
if (!isPlayerWorking(client)) {
|
||||||
messagePlayerError(client, "You are not working! Use /startwork at your job location.");
|
messagePlayerError(client, getLocaleString(client, "NeedToBeWorking", `{ALTCOLOUR}/startwork{MAINCOLOUR}`));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1318,7 +1325,7 @@ function jobEquipmentCommand(command, params, client) {
|
|||||||
if (closestJobLocation.position.distance(getPlayerPosition(client)) > getGlobalConfig().startWorkingDistance) {
|
if (closestJobLocation.position.distance(getPlayerPosition(client)) > getGlobalConfig().startWorkingDistance) {
|
||||||
let closestVehicle = getClosestVehicle(getPlayerPosition(client));
|
let closestVehicle = getClosestVehicle(getPlayerPosition(client));
|
||||||
if (getDistance(getVehiclePosition(closestVehicle), getPlayerPosition(client)) > getGlobalConfig().startWorkingDistance) {
|
if (getDistance(getVehiclePosition(closestVehicle), getPlayerPosition(client)) > getGlobalConfig().startWorkingDistance) {
|
||||||
messagePlayerError(client, "You need to be near your job site or vehicle that belongs to your job!");
|
messagePlayerError(client, getLocaleString(client, "NeedToBeNearJob"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1336,12 +1343,15 @@ function jobEquipmentCommand(command, params, client) {
|
|||||||
} else {
|
} else {
|
||||||
if (getPlayerCurrentSubAccount(client).job == AGRP_JOB_NONE) {
|
if (getPlayerCurrentSubAccount(client).job == AGRP_JOB_NONE) {
|
||||||
messagePlayerError(client, getLocaleString(client, "NotYourJob"));
|
messagePlayerError(client, getLocaleString(client, "NotYourJob"));
|
||||||
messagePlayerInfo(client, getLocaleString(client, "JobPoints"));
|
|
||||||
|
if (hasPlayerSeenActionTip(client, "JobLocations")) {
|
||||||
|
messagePlayerInfo(client, getGroupedLocaleString(client, "ActionTips", "JobPoints", "{ALTCOLOUR}/gps{MAINCOLOUR}"));
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getPlayerCurrentSubAccount(client).job != closestJobLocation.jobId) {
|
if (getPlayerCurrentSubAccount(client).job != closestJobLocation.jobId) {
|
||||||
messagePlayerError(client, "This is not your job!");
|
messagePlayerError(client, getLocaleString(client, "NotYourJob"));
|
||||||
messagePlayerInfo(client, getLocaleString(client, "QuitJobToTakeAnother", "{ALTCOLOUR}/quitjob{MAINCOLOUR}"));
|
messagePlayerInfo(client, getLocaleString(client, "QuitJobToTakeAnother", "{ALTCOLOUR}/quitjob{MAINCOLOUR}"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1377,7 +1387,7 @@ function jobEquipmentCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (equipmentId < 1 || equipmentId > equipments.length) {
|
if (equipmentId < 1 || equipmentId > equipments.length) {
|
||||||
messagePlayerError(client, "That equipment ID is invalid!");
|
messagePlayerError(client, getLocaleString(client, "InvalidJobEquipment"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1394,11 +1404,15 @@ function jobEquipmentCommand(command, params, client) {
|
|||||||
givePlayerJobEquipment(client, equipmentId - 1);
|
givePlayerJobEquipment(client, equipmentId - 1);
|
||||||
//messagePlayerSuccess(client, `You have been given the ${equipments[equipmentId-1].name} equipment`);
|
//messagePlayerSuccess(client, `You have been given the ${equipments[equipmentId-1].name} equipment`);
|
||||||
meActionToNearbyPlayers(client, `grabs the ${jobEquipmentData.name} equipment from the locker`);
|
meActionToNearbyPlayers(client, `grabs the ${jobEquipmentData.name} equipment from the locker`);
|
||||||
|
if (!hasPlayerSeenActionTip(client, "JobEquipmentInventory")) {
|
||||||
if (doesPlayerHaveKeyBindForCommand(client, "inv")) {
|
if (doesPlayerHaveKeyBindForCommand(client, "inv")) {
|
||||||
messagePlayerTip(client, getLocaleString(client, "JobEquipmentInventoryKeyBindTip", toUpperCase(getKeyNameFromId(getPlayerKeyBindForCommand(client, "inv").key))));
|
messagePlayerTip(client, getGroupedLocaleString(client, "ActionTips", "JobEquipmentInventory", toUpperCase(getKeyNameFromId(getPlayerKeyBindForCommand(client, "inv").key))));
|
||||||
} else {
|
} else {
|
||||||
messagePlayerTip(client, getLocaleString(client, "JobEquipmentInventoryCommandTip", "/inv"));
|
messagePlayerTip(client, getGroupedLocaleString(client, "ActionTips", "JobEquipmentInventory", "/inv"));
|
||||||
}
|
}
|
||||||
|
markPlayerActionTipSeen(client, "JobEquipmentInventory");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1548,11 +1562,11 @@ function createJobLocationCommand(command, params, client) {
|
|||||||
let jobId = getJobFromParams(params);
|
let jobId = getJobFromParams(params);
|
||||||
|
|
||||||
if (!getJobData(jobId)) {
|
if (!getJobData(jobId)) {
|
||||||
messagePlayerError(client, "That job was not found!");
|
messagePlayerError(client, getLocaleString(client, "InvalidJob"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
createJobLocation(jobId, getPlayerPosition(client), getPlayerInterior(client), getPlayerDimension(client));
|
createJobLocation(jobId, getPlayerPosition(client), getPlayerInterior(client), getPlayerDimension(client), getPlayerData(client).accountData.databaseId);
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} created a location for the {jobYellow}${getJobData(jobId).name}{MAINCOLOUR} job`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} created a location for the {jobYellow}${getJobData(jobId).name}{MAINCOLOUR} job`);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1562,10 +1576,8 @@ function createJobLocationCommand(command, params, client) {
|
|||||||
function deleteJobLocationCommand(command, params, client) {
|
function deleteJobLocationCommand(command, params, client) {
|
||||||
let closestJobLocation = getClosestJobLocation(getPlayerPosition(client), getPlayerDimension(client));
|
let closestJobLocation = getClosestJobLocation(getPlayerPosition(client), getPlayerDimension(client));
|
||||||
|
|
||||||
|
deleteJobLocation(closestJobLocation.jobIndex, closestJobLocation.index);
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} deleted location {ALTCOLOUR}${closestJobLocation.index} (DB ID ${closestJobLocation.databaseId}){MAINCOLOUR} for the {jobYellow}${getJobData(closestJobLocation.jobIndex).name}{MAINCOLOUR} job`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} deleted location {ALTCOLOUR}${closestJobLocation.index} (DB ID ${closestJobLocation.databaseId}){MAINCOLOUR} for the {jobYellow}${getJobData(closestJobLocation.jobIndex).name}{MAINCOLOUR} job`);
|
||||||
|
|
||||||
|
|
||||||
deleteJobLocation(closestJobLocation);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1743,7 +1755,7 @@ function toggleJobRouteEnabledCommand(command, params, client) {
|
|||||||
if (isPlayerOnJobRoute(clients[i])) {
|
if (isPlayerOnJobRoute(clients[i])) {
|
||||||
if (getPlayerJob(clients[i]) == jobId && getPlayerJobRoute(clients[i]) == jobRoute) {
|
if (getPlayerJob(clients[i]) == jobId && getPlayerJobRoute(clients[i]) == jobRoute) {
|
||||||
stopJobRoute(clients[i], true, false);
|
stopJobRoute(clients[i], true, false);
|
||||||
messagePlayerAlert(clients[i], "The job route you were on has been disabled by an admin");
|
messagePlayerAlert(clients[i], getLocaleString(clients[i], "CurrentJobRouteDeleted"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2139,7 +2151,7 @@ function setJobRoutePayCommand(command, params, client) {
|
|||||||
|
|
||||||
getJobData(jobId).routes[jobRoute].pay = toInteger(amount);
|
getJobData(jobId).routes[jobRoute].pay = toInteger(amount);
|
||||||
getJobData(jobId).routes[jobRoute].needsSaved = true;
|
getJobData(jobId).routes[jobRoute].needsSaved = true;
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)} {MAINCOLOUR} set the pay for route {ALTCOLOUR}${getJobRouteData(jobId, jobRoute).name}{MAINCOLOUR} of the {jobYellow}${getJobData(jobId).name}{MAINCOLOUR} job to {ALTCOLOUR}$${makeLargeNumberReadable(amount)} {MAINCOLOUR} `);
|
messageAdmins(`{adminOrange}${getPlayerName(client)} {MAINCOLOUR} set the pay for route {ALTCOLOUR}${getJobRouteData(jobId, jobRoute).name}{MAINCOLOUR} of the {jobYellow}${getJobData(jobId).name}{MAINCOLOUR} job to {ALTCOLOUR}${getCurrencyString(amount)} {MAINCOLOUR} `);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -2304,27 +2316,32 @@ function forceAllPlayersToStopWorking() {
|
|||||||
|
|
||||||
function jobStartRouteCommand(command, params, client) {
|
function jobStartRouteCommand(command, params, client) {
|
||||||
if (!canPlayerUseJobs(client)) {
|
if (!canPlayerUseJobs(client)) {
|
||||||
messagePlayerError(client, "You are not allowed to use jobs.");
|
messagePlayerError(client, getLocaleString(client, "NotAllowedToUseJobs"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isPlayerWorking(client)) {
|
if (!isPlayerWorking(client)) {
|
||||||
messagePlayerError(client, "You aren't working yet! Use /startwork first.");
|
messagePlayerError(client, getLocaleString(client, "NeedToBeWorking", "{ALTCOLOUR}/startwork{MAINCOLOUR}"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getJobData(getPlayerJob(client)).routes.length == 0) {
|
if (getJobData(getPlayerJob(client)).routes.length == 0) {
|
||||||
messagePlayerError(client, "Your job doesn't have any routes for this location!");
|
messagePlayerError(client, getLocaleString(client, "NoJobRoutesForLocation"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isPlayerInAnyVehicle(client)) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "MustBeInAVehicle"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isPlayerInJobVehicle(client)) {
|
if (!isPlayerInJobVehicle(client)) {
|
||||||
messagePlayerError(client, "You need to be in a vehicle that belongs to your job!");
|
messagePlayerError(client, getLocaleString(client, "NeedToBeInJobVehicle"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isPlayerOnJobRoute(client)) {
|
if (isPlayerOnJobRoute(client)) {
|
||||||
messagePlayerError(client, "You're already on a job route! Finish the route or use /stoproute");
|
messagePlayerError(client, getLocaleString(client, "AlreadyOnJobRoute", "{ALTCOLOUR}/stoproute{MAINCOLOUR}"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2338,6 +2355,8 @@ function jobStartRouteCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
markPlayerActionTipSeen(client, "JobRouteStart");
|
||||||
|
|
||||||
startJobRoute(client, forceRoute);
|
startJobRoute(client, forceRoute);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -2346,7 +2365,7 @@ function jobStartRouteCommand(command, params, client) {
|
|||||||
|
|
||||||
function jobStopRouteCommand(command, params, client) {
|
function jobStopRouteCommand(command, params, client) {
|
||||||
if (!canPlayerUseJobs(client)) {
|
if (!canPlayerUseJobs(client)) {
|
||||||
messagePlayerError(client, "You are not allowed to use jobs.");
|
messagePlayerError(client, getLocaleString(client, "NotAllowedToUseJobs"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2409,7 +2428,7 @@ function startJobRoute(client, forceRoute = -1) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (jobRoute == -1) {
|
if (jobRoute == -1) {
|
||||||
messagePlayerError(client, `There are no routes for this location.`);
|
messagePlayerError(client, getLocaleString(client, "NoRoutesForLocation"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2441,6 +2460,10 @@ function startJobRoute(client, forceRoute = -1) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function stopJobRoute(client, successful = false, alertPlayer = true) {
|
function stopJobRoute(client, successful = false, alertPlayer = true) {
|
||||||
|
if (!isPlayerOnJobRoute(client)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
let jobId = getPlayerJob(client);
|
let jobId = getPlayerJob(client);
|
||||||
let routeId = getPlayerJobRoute(client);
|
let routeId = getPlayerJobRoute(client);
|
||||||
|
|
||||||
@@ -2453,12 +2476,14 @@ function stopJobRoute(client, successful = false, alertPlayer = true) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (alertPlayer) {
|
||||||
|
messageDiscordEventChannel(`💼 ${getCharacterFullName(client)} failed to finish the ${getJobRouteData(jobId, getPlayerJobRoute(client)).name} route for the ${getJobData(jobId).name} job and didn't earn anything.`);
|
||||||
|
}
|
||||||
|
|
||||||
//if (alertPlayer) {
|
//if (alertPlayer) {
|
||||||
// messagePlayerAlert(client, replaceJobRouteStringsInMessage(getJobRouteData(jobId, routeId).failedMessage, jobId, routeId));
|
// messagePlayerAlert(client, replaceJobRouteStringsInMessage(getJobRouteData(jobId, routeId).failedMessage, jobId, routeId));
|
||||||
//}
|
//}
|
||||||
|
|
||||||
messageDiscordEventChannel(`💼 ${getCharacterFullName(client)} failed to finish the ${getJobRouteData(jobId, getPlayerJobRoute(client)).name} route for the ${getJobData(jobId).name} job and didn't earn anything.`);
|
|
||||||
|
|
||||||
stopReturnToJobVehicleCountdown(client);
|
stopReturnToJobVehicleCountdown(client);
|
||||||
sendPlayerStopJobRoute(client);
|
sendPlayerStopJobRoute(client);
|
||||||
respawnVehicle(getPlayerData(client).jobRouteVehicle);
|
respawnVehicle(getPlayerData(client).jobRouteVehicle);
|
||||||
@@ -2546,14 +2571,14 @@ function canPlayerUseJob(client, jobId) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function deleteJobLocation(jobLocationData) {
|
function deleteJobLocation(jobIndex, jobLocationIndex) {
|
||||||
if (jobLocationData.databaseId > 0) {
|
if (jobLocationData.databaseId > 0) {
|
||||||
quickDatabaseQuery(`DELETE FROM job_loc WHERE job_loc_id = ${jobLocationData.databaseId}`);
|
quickDatabaseQuery(`DELETE FROM job_loc WHERE job_loc_id = ${getJobLocationData(jobIndex, jobLocationIndex).databaseId}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteJobLocationBlip(tempJob, tempLocation);
|
deleteJobLocationBlip(jobIndex, jobLocationIndex);
|
||||||
deleteJobLocationPickup(tempJob, tempLocation);
|
deleteJobLocationPickup(jobIndex, jobLocationIndex);
|
||||||
getJobData(getJobIdFromDatabaseId(tempJob)).locations.splice(tempLocation, 1);
|
getJobData(getJobIdFromDatabaseId(jobIndex)).locations.splice(jobLocationIndex, 1);
|
||||||
setAllJobDataIndexes();
|
setAllJobDataIndexes();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2634,7 +2659,7 @@ function setAllJobDataIndexes() {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function createJobLocation(jobId, position, interior, dimension) {
|
function createJobLocation(jobId, position, interior, dimension, whoCreated) {
|
||||||
let jobLocationData = new JobLocationData(false);
|
let jobLocationData = new JobLocationData(false);
|
||||||
jobLocationData.position = position;
|
jobLocationData.position = position;
|
||||||
jobLocationData.jobId = getJobData(jobId).databaseId;
|
jobLocationData.jobId = getJobData(jobId).databaseId;
|
||||||
@@ -2643,11 +2668,14 @@ function createJobLocation(jobId, position, interior, dimension) {
|
|||||||
jobLocationData.enabled = true;
|
jobLocationData.enabled = true;
|
||||||
jobLocationData.jobIndex = jobId;
|
jobLocationData.jobIndex = jobId;
|
||||||
jobLocationData.needsSaved = true;
|
jobLocationData.needsSaved = true;
|
||||||
|
jobLocationData.whoCreated = whoCreated;
|
||||||
|
jobLocationData.whenCreated = getCurrentUnixTimestamp();
|
||||||
|
|
||||||
getServerData().jobs[jobId].locations.push(jobLocationData);
|
getServerData().jobs[jobId].locations.push(jobLocationData);
|
||||||
let newSlot = getServerData().jobs[jobId].locations.length - 1;
|
let newSlot = getServerData().jobs[jobId].locations.length - 1;
|
||||||
getServerData().jobs[jobId].locations[newSlot].index = newSlot;
|
getServerData().jobs[jobId].locations[newSlot].index = newSlot;
|
||||||
createJobLocationPickup(jobId, newSlot);
|
createJobLocationPickup(jobId, newSlot);
|
||||||
|
createJobLocationBlip(jobId, newSlot);
|
||||||
saveJobLocationToDatabase(jobLocationData);
|
saveJobLocationToDatabase(jobLocationData);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2660,11 +2688,11 @@ function saveJobToDatabase(jobData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (jobData.needsSaved == false) {
|
if (jobData.needsSaved == false) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Job ${jobData.name} doesn't need saved. Skipping ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Job ${jobData.name} doesn't need saved. Skipping ...`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Saving job ${jobData.name} to database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saving job ${jobData.name} to database ...`);
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let safeName = escapeDatabaseString(dbConnection, jobData.name);
|
let safeName = escapeDatabaseString(dbConnection, jobData.name);
|
||||||
@@ -2701,7 +2729,7 @@ function saveJobToDatabase(jobData) {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Saved job ${jobData.name} to database!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saved job ${jobData.name} to database!`);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -2715,11 +2743,11 @@ function saveJobRankToDatabase(jobRankData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (jobRankData.needsSaved == false) {
|
if (jobRankData.needsSaved == false) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Job route ${jobRankData.name} (DB ID ${jobRankData.databaseId}) doesn't need saved. Skipping ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Job route ${jobRankData.name} (DB ID ${jobRankData.databaseId}) doesn't need saved. Skipping ...`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Saving job route ${jobRankData.name} to database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saving job route ${jobRankData.name} to database ...`);
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let safeName = escapeDatabaseString(dbConnection, jobRankData.name);
|
let safeName = escapeDatabaseString(dbConnection, jobRankData.name);
|
||||||
@@ -2750,7 +2778,7 @@ function saveJobRankToDatabase(jobRankData) {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Saved job rank ${jobRankData.name} to database!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saved job rank ${jobRankData.name} to database!`);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -2764,11 +2792,11 @@ function saveJobRouteToDatabase(jobRouteData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (jobRouteData.needsSaved == false) {
|
if (jobRouteData.needsSaved == false) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Job route ${jobRouteData.name} (DB ID ${jobRouteData.databaseId}) doesn't need saved. Skipping ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Job route ${jobRouteData.name} (DB ID ${jobRouteData.databaseId}) doesn't need saved. Skipping ...`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Saving job route ${jobRouteData.name} to database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saving job route ${jobRouteData.name} to database ...`);
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let safeName = escapeDatabaseString(dbConnection, jobRouteData.name);
|
let safeName = escapeDatabaseString(dbConnection, jobRouteData.name);
|
||||||
@@ -2809,7 +2837,7 @@ function saveJobRouteToDatabase(jobRouteData) {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Saved job route ${jobRouteData.name} to database!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saved job route ${jobRouteData.name} to database!`);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -2823,11 +2851,11 @@ function saveJobRouteLocationToDatabase(jobRouteLocationData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (jobRouteLocationData.needsSaved == false) {
|
if (jobRouteLocationData.needsSaved == false) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Job route location ${jobRouteLocationData.name} (DB ID ${jobRouteLocationData.databaseId}) doesn't need saved. Skipping ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Job route location ${jobRouteLocationData.name} (DB ID ${jobRouteLocationData.databaseId}) doesn't need saved. Skipping ...`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Saving job route location ${jobRouteLocationData.name} to database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saving job route location ${jobRouteLocationData.name} to database ...`);
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let safeName = escapeDatabaseString(dbConnection, jobRouteLocationData.name);
|
let safeName = escapeDatabaseString(dbConnection, jobRouteLocationData.name);
|
||||||
@@ -2859,7 +2887,7 @@ function saveJobRouteLocationToDatabase(jobRouteLocationData) {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Saved job route location ${jobRoutePositionData.name} (${jobRouteLocationData.databaseId}) to database!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saved job route location ${jobRoutePositionData.name} (${jobRouteLocationData.databaseId}) to database!`);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -2873,11 +2901,11 @@ function saveJobLocationToDatabase(jobLocationData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!jobLocationData.needsSaved) {
|
if (!jobLocationData.needsSaved) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Job location ${jobLocationData.name} (${jobLocationData.databaseId}) doesn't need saved. Skipping ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Job location ${jobLocationData.name} (${jobLocationData.databaseId}) doesn't need saved. Skipping ...`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Saving job location ${jobLocationData.databaseId} to database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saving job location ${jobLocationData.databaseId} to database ...`);
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let data = [
|
let data = [
|
||||||
@@ -2908,7 +2936,7 @@ function saveJobLocationToDatabase(jobLocationData) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Saved job location ${jobLocationData.databaseId} to database`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saved job location ${jobLocationData.databaseId} to database`);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -2922,11 +2950,11 @@ function saveJobEquipmentToDatabase(jobEquipmentData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!jobEquipmentData.needsSaved) {
|
if (!jobEquipmentData.needsSaved) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Job equipment ${jobEquipmentData.name} (${jobEquipmentData.databaseId}) doesn't need saved. Skipping ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Job equipment ${jobEquipmentData.name} (${jobEquipmentData.databaseId}) doesn't need saved. Skipping ...`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Saving job equipment ${jobEquipmentData.databaseId} to database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saving job equipment ${jobEquipmentData.databaseId} to database ...`);
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let safeName = escapeDatabaseString(dbConnection, jobEquipmentData.name);
|
let safeName = escapeDatabaseString(dbConnection, jobEquipmentData.name);
|
||||||
@@ -2954,7 +2982,7 @@ function saveJobEquipmentToDatabase(jobEquipmentData) {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Saved job equipment ${jobEquipmentData.databaseId} to database`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saved job equipment ${jobEquipmentData.databaseId} to database`);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -2968,11 +2996,11 @@ function saveJobEquipmentItemToDatabase(jobEquipmentItemData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!jobEquipmentItemData.needsSaved) {
|
if (!jobEquipmentItemData.needsSaved) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Job equipment item ${jobEquipmentItemData.databaseId} doesn't need saved. Skipping ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Job equipment item ${jobEquipmentItemData.databaseId} doesn't need saved. Skipping ...`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Saving job equipment weapon ${jobEquipmentItemData.databaseId} to database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saving job equipment weapon ${jobEquipmentItemData.databaseId} to database ...`);
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let data = [
|
let data = [
|
||||||
@@ -2999,7 +3027,7 @@ function saveJobEquipmentItemToDatabase(jobEquipmentItemData) {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Saved job equipment weapon ${jobEquipmentItemData.databaseId} to database`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saved job equipment weapon ${jobEquipmentItemData.databaseId} to database`);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -3013,11 +3041,11 @@ function saveJobUniformToDatabase(jobUniformData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!jobUniformData.needSaved) {
|
if (!jobUniformData.needSaved) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Job uniform ${jobUniformData.databaseId} doesn't need saved. Skipping ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Job uniform ${jobUniformData.databaseId} doesn't need saved. Skipping ...`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Saving job uniform ${jobUniformData.databaseId} to database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saving job uniform ${jobUniformData.databaseId} to database ...`);
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let safeName = escapeDatabaseString(dbConnection, jobUniformData.name);
|
let safeName = escapeDatabaseString(dbConnection, jobUniformData.name);
|
||||||
@@ -3046,7 +3074,7 @@ function saveJobUniformToDatabase(jobUniformData) {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job]: Saved job uniform ${jobUniformData.databaseId} to database`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saved job uniform ${jobUniformData.databaseId} to database`);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -3112,20 +3140,19 @@ function createJobLocationPickup(jobId, locationId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isGameFeatureSupported("pickup")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
let tempJobData = getJobData(jobId);
|
let tempJobData = getJobData(jobId);
|
||||||
|
|
||||||
|
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating pickup for location ${locationId} of the ${tempJobData.name} job`);
|
||||||
|
|
||||||
if (tempJobData.pickupModel != -1) {
|
if (tempJobData.pickupModel != -1) {
|
||||||
let pickupModelId = getGameConfig().pickupModels[getGame()].Job;
|
let pickupModelId = -1;
|
||||||
|
if (isGameFeatureSupported("pickup")) {
|
||||||
|
pickupModelId = getGameConfig().pickupModels[getGame()].Job;
|
||||||
|
|
||||||
if (tempJobData.pickupModel != 0) {
|
if (tempJobData.pickupModel != 0) {
|
||||||
pickupModelId = tempJobData.pickupModel;
|
pickupModelId = tempJobData.pickupModel;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.Job]: Creating pickup for location ${locationId} of the ${tempJobData.name} job`);
|
|
||||||
|
|
||||||
if (areServerElementsSupported()) {
|
if (areServerElementsSupported()) {
|
||||||
let pickup = createGamePickup(pickupModelId, tempJobData.locations[locationId].position, getGameConfig().pickupTypes[getGame()].job);
|
let pickup = createGamePickup(pickupModelId, tempJobData.locations[locationId].position, getGameConfig().pickupTypes[getGame()].job);
|
||||||
@@ -3141,7 +3168,16 @@ function createJobLocationPickup(jobId, locationId) {
|
|||||||
addToWorld(pickup);
|
addToWorld(pickup);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// sendJobToPlayer(null, jobId, tempJobData.name, tempJobData.locations[locationId].position, pickupModel);
|
let blipModelId = -1;
|
||||||
|
if (isGameFeatureSupported("blip")) {
|
||||||
|
blipModelId = getGameConfig().blipSprites[getGame()].Job;
|
||||||
|
|
||||||
|
if (getJobData(jobId).blipModel != 0) {
|
||||||
|
blipModelId = getJobData(jobId).blipModel;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sendJobToPlayer(null, jobId, tempJobData.name, tempJobData.locations[locationId].position, blipModelId, pickupModelId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3189,8 +3225,6 @@ function createJobLocationBlip(jobId, locationId) {
|
|||||||
updateJobBlipsForPlayer(clients[i]);
|
updateJobBlipsForPlayer(clients[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
sendJobToPlayer(null, jobId, tempJobData.name, tempJobData.locations[locationId].position, blipModelId);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3416,7 +3450,7 @@ function createJobRouteCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isPlayerOnJobRoute(client)) {
|
if (isPlayerOnJobRoute(client)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "AlreadyOnJobRoute", "{ALTCOLOUR}/startroute{MAINCOLOUR}"));
|
messagePlayerError(client, getLocaleString(client, "AlreadyOnJobRoute", "{ALTCOLOUR}/stoproute{MAINCOLOUR}"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3483,7 +3517,7 @@ function createJobUniformCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let splitParams = params.spli(" ");
|
let splitParams = params.split(" ");
|
||||||
let jobId = getJobFromParams(getParam(params, " ", 1));
|
let jobId = getJobFromParams(getParam(params, " ", 1));
|
||||||
let skinIndex = getSkinModelIndexFromParams(splitParams.slice(1).join(" "), getGame());
|
let skinIndex = getSkinModelIndexFromParams(splitParams.slice(1).join(" "), getGame());
|
||||||
|
|
||||||
@@ -3498,7 +3532,7 @@ function createJobUniformCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
createJobUniform(jobId, skinIndex);
|
createJobUniform(jobId, skinIndex);
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} created uniform with skin {ALTCOLOUR}${getGameConfig().skins[skinIndex][1]} (}${getGameConfig().skins[skinIndex][0]}){MAINCOLOUR} for job {jobYellow}${getJobData(jobId).name}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} created uniform with skin {ALTCOLOUR}${getGameConfig().skins[skinIndex][1]} (${getGameConfig().skins[skinIndex][0]}){MAINCOLOUR} for job {jobYellow}${getJobData(jobId).name}`);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3756,6 +3790,14 @@ function getRandomJobRouteForLocation(closestJobLocation) {
|
|||||||
* @return {JobUniformData} The jobroutes's data (class instance)
|
* @return {JobUniformData} The jobroutes's data (class instance)
|
||||||
*/
|
*/
|
||||||
function getJobUniformData(jobIndex, uniformIndex) {
|
function getJobUniformData(jobIndex, uniformIndex) {
|
||||||
|
if (typeof getServerData().jobs[jobIndex] == "undefined") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof getServerData().jobs[jobIndex].uniforms[uniformIndex] == "undefined") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return getServerData().jobs[jobIndex].uniforms[uniformIndex];
|
return getServerData().jobs[jobIndex].uniforms[uniformIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3767,6 +3809,14 @@ function getJobUniformData(jobIndex, uniformIndex) {
|
|||||||
* @return {JobEquipmentData} The job equipment loadout's data (class instance)
|
* @return {JobEquipmentData} The job equipment loadout's data (class instance)
|
||||||
*/
|
*/
|
||||||
function getJobEquipmentData(jobIndex, equipmentIndex) {
|
function getJobEquipmentData(jobIndex, equipmentIndex) {
|
||||||
|
if (typeof getServerData().jobs[jobIndex] == "undefined") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof getServerData().jobs[jobIndex].equipment[equipmentIndex] == "undefined") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return getServerData().jobs[jobIndex].equipment[equipmentIndex];
|
return getServerData().jobs[jobIndex].equipment[equipmentIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3779,7 +3829,15 @@ function getJobEquipmentData(jobIndex, equipmentIndex) {
|
|||||||
* @return {JobEquipmentItemData} The job equipment loadout's data (class instance)
|
* @return {JobEquipmentItemData} The job equipment loadout's data (class instance)
|
||||||
*/
|
*/
|
||||||
function getJobEquipmentItemData(jobIndex, equipmentIndex, equipmentItemIndex) {
|
function getJobEquipmentItemData(jobIndex, equipmentIndex, equipmentItemIndex) {
|
||||||
return getJobEquipmentData(jobIndex, equipmentIndex).items[equipmentItemIndex];
|
if (typeof getServerData().jobs[jobIndex] == "undefined") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof getServerData().jobs[jobIndex].equipment[equipmentIndex] == "undefined") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return getServerData().jobs[jobIndex].equipment[equipmentIndex].items[equipmentItemIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -3790,6 +3848,10 @@ function getJobEquipmentItemData(jobIndex, equipmentIndex, equipmentItemIndex) {
|
|||||||
* @return {JobRouteData} The job rank's data (class instance)
|
* @return {JobRouteData} The job rank's data (class instance)
|
||||||
*/
|
*/
|
||||||
function getJobRankData(jobIndex, rankIndex) {
|
function getJobRankData(jobIndex, rankIndex) {
|
||||||
|
if (typeof getServerData().jobs[jobIndex] == "undefined") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return getServerData().jobs[jobIndex].ranks[rankIndex];
|
return getServerData().jobs[jobIndex].ranks[rankIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3801,6 +3863,14 @@ function getJobRankData(jobIndex, rankIndex) {
|
|||||||
* @return {JobRouteData} The job routes's data (class instance)
|
* @return {JobRouteData} The job routes's data (class instance)
|
||||||
*/
|
*/
|
||||||
function getJobRouteData(jobIndex, routeIndex) {
|
function getJobRouteData(jobIndex, routeIndex) {
|
||||||
|
if (typeof getServerData().jobs[jobIndex] == "undefined") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof getServerData().jobs[jobIndex].routes[routeIndex] == "undefined") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return getServerData().jobs[jobIndex].routes[routeIndex];
|
return getServerData().jobs[jobIndex].routes[routeIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3813,7 +3883,38 @@ function getJobRouteData(jobIndex, routeIndex) {
|
|||||||
* @return {JobRouteLocationData} The job route locations's data (class instance)
|
* @return {JobRouteLocationData} The job route locations's data (class instance)
|
||||||
*/
|
*/
|
||||||
function getJobRouteLocationData(jobIndex, routeIndex, routeLocationIndex) {
|
function getJobRouteLocationData(jobIndex, routeIndex, routeLocationIndex) {
|
||||||
return getJobRouteData(jobIndex, routeIndex).locations[routeLocationIndex];
|
if (typeof getServerData().jobs[jobIndex] == "undefined") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof getServerData().jobs[jobIndex].routes[routeIndex] == "undefined") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof getServerData().jobs[jobIndex].routes[routeIndex].locations[routeLocationIndex] == "undefined") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return getServerData().jobs[jobIndex].routes[routeIndex].locations[routeLocationIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {number} jobIndex - The data index of the job
|
||||||
|
* @param {number} locationIndex - The data index of the job location
|
||||||
|
* @return {JobLocationData} The job route locations's data (class instance)
|
||||||
|
*/
|
||||||
|
function getJobLocationData(jobIndex, locationIndex) {
|
||||||
|
if (typeof getServerData().jobs[jobIndex] == "undefined") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof getServerData().jobs[jobIndex].locations[locationIndex] == "undefined") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return getServerData().jobs[jobIndex].locations[locationIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -3856,7 +3957,7 @@ function finishSuccessfulJobRoute(client) {
|
|||||||
let payout = toInteger(applyServerInflationMultiplier(jobRouteData.pay));
|
let payout = toInteger(applyServerInflationMultiplier(jobRouteData.pay));
|
||||||
getPlayerData(client).payDayAmount = getPlayerData(client).payDayAmount + payout;
|
getPlayerData(client).payDayAmount = getPlayerData(client).payDayAmount + payout;
|
||||||
|
|
||||||
messageDiscordEventChannel(`💼 ${getCharacterFullName(client)} finished the ${jobRouteData.name} route for the ${getJobData(jobId).name} job and earned $${jobRouteData.pay}!`);
|
messageDiscordEventChannel(`💼 ${getCharacterFullName(client)} finished the ${jobRouteData.name} route for the ${getJobData(jobId).name} job and earned ${getCurrencyString(jobRouteData.pay)}!`);
|
||||||
messagePlayerSuccess(client, replaceJobRouteStringsInMessage(jobRouteData.finishMessage, jobId, jobRouteData.index));
|
messagePlayerSuccess(client, replaceJobRouteStringsInMessage(jobRouteData.finishMessage, jobId, jobRouteData.index));
|
||||||
|
|
||||||
stopReturnToJobVehicleCountdown(client);
|
stopReturnToJobVehicleCountdown(client);
|
||||||
@@ -3916,7 +4017,7 @@ function replaceJobRouteStringsInMessage(messageText, jobId, jobRouteId) {
|
|||||||
|
|
||||||
tempFind = `{JOBROUTEPAY}`;
|
tempFind = `{JOBROUTEPAY}`;
|
||||||
tempRegex = new RegExp(tempFind, 'g');
|
tempRegex = new RegExp(tempFind, 'g');
|
||||||
messageText = messageText.replace(tempRegex, `$${tempJobRouteData.pay}`);
|
messageText = messageText.replace(tempRegex, `${getCurrencyString(tempJobRouteData.pay)}`);
|
||||||
|
|
||||||
tempFind = `{JOBNAME}`;
|
tempFind = `{JOBNAME}`;
|
||||||
tempRegex = new RegExp(tempFind, 'g');
|
tempRegex = new RegExp(tempFind, 'g');
|
||||||
@@ -4025,3 +4126,9 @@ function createAllJobRouteLocationMarkers() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function doesJobLocationHaveAnyRoutes(jobLocationData) {
|
||||||
|
return (getRandomJobRouteForLocation(jobLocationData) != -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -36,8 +36,8 @@ class KeyBindData {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initKeyBindScript() {
|
function initKeyBindScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.KeyBind]: Initializing key bind script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.KeyBind]: Initializing key bind script ...");
|
||||||
logToConsole(LOG_INFO, "[VRR.KeyBind]: Key bind script initialized!");
|
logToConsole(LOG_INFO, "[AGRP.KeyBind]: Key bind script initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -78,7 +78,7 @@ function removeKeyBindCommand(command, params, client) {
|
|||||||
if (!keyId) {
|
if (!keyId) {
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidKeyBindName"));
|
messagePlayerError(client, getLocaleString(client, "InvalidKeyBindName"));
|
||||||
messagePlayerTip(client, getLocaleString(client, "KeyBindNameTip"));
|
messagePlayerTip(client, getLocaleString(client, "KeyBindNameTip"));
|
||||||
messagePlayerInfo(client, getLocaleString(client, "UniversalInlineExampleList", `{ALTCOLOUR}1, 2, a, b, numplus, num1, f1, f2, pageup, delete, insert, rightshift, leftctrl{MAINCOLOR}`));
|
messagePlayerInfo(client, getLocaleString(client, "UniversalInlineExamplesList", `{ALTCOLOUR}1, 2, a, b, numplus, num1, f1, f2, pageup, delete, insert, rightshift, leftctrl{MAINCOLOR}`));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,18 +106,18 @@ function copyKeyBindsToServerCommand(command, params, client) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function addPlayerKeyBind(client, keys, command, params, tempKey = false) {
|
function addPlayerKeyBind(client, keyId, command, params, tempKey = false) {
|
||||||
let keyBindData = new KeyBindData(false, keys, `${command} ${params}`);
|
let keyBindData = new KeyBindData(false, keys, `${command} ${params}`);
|
||||||
if (tempKey == true) {
|
if (tempKey == true) {
|
||||||
keyBindData.databaseId = -1;
|
keyBindData.databaseId = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
getPlayerData(client).keyBinds.push(keyBindData);
|
getPlayerData(client).keyBinds.push(keyBindData);
|
||||||
sendAddAccountKeyBindToClient(client, keys, (keys.length > 1) ? AGRP_KEYSTATE_COMBO : AGRP_KEYSTATE_UP);
|
sendAddAccountKeyBindToClient(client, keyId, AGRP_KEYSTATE_UP);
|
||||||
|
|
||||||
if (!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "enter")) {
|
if (!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "enter")) {
|
||||||
let keyId = getPlayerKeyBindForCommand(client, "enter");
|
let keyId = getPlayerKeyBindForCommand(client, "enter");
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Sending custom enter property key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Sending custom enter property key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendPlayerEnterPropertyKey(client, keyId.key);
|
sendPlayerEnterPropertyKey(client, keyId.key);
|
||||||
} else {
|
} else {
|
||||||
sendPlayerEnterPropertyKey(client, false);
|
sendPlayerEnterPropertyKey(client, false);
|
||||||
@@ -141,7 +141,7 @@ function removePlayerKeyBind(client, keyId) {
|
|||||||
|
|
||||||
if (!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "enter")) {
|
if (!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "enter")) {
|
||||||
let keyId = getPlayerKeyBindForCommand(client, "enter");
|
let keyId = getPlayerKeyBindForCommand(client, "enter");
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Sending custom enter property key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Sending custom enter property key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendPlayerEnterPropertyKey(client, keyId.key);
|
sendPlayerEnterPropertyKey(client, keyId.key);
|
||||||
} else {
|
} else {
|
||||||
sendPlayerEnterPropertyKey(client, false);
|
sendPlayerEnterPropertyKey(client, false);
|
||||||
@@ -209,7 +209,7 @@ function playerUsedKeyBind(client, key, duration = 0) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.KeyBind] ${getPlayerDisplayForConsole(client)} used keybind ${toUpperCase(getKeyNameFromId(key))} (${key})`);
|
logToConsole(LOG_DEBUG, `[AGRP.KeyBind] ${getPlayerDisplayForConsole(client)} used keybind ${toUpperCase(getKeyNameFromId(key))} (${key})`);
|
||||||
if (!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForKey(client, key)) {
|
if (!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForKey(client, key)) {
|
||||||
let keyBindData = getPlayerKeyBindForKey(client, key);
|
let keyBindData = getPlayerKeyBindForKey(client, key);
|
||||||
if (keyBindData.enabled) {
|
if (keyBindData.enabled) {
|
||||||
|
|||||||
@@ -23,9 +23,13 @@ class LocaleData {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
let englishLocale = 0;
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
function initLocaleScript() {
|
function initLocaleScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Locale]: Initializing locale script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.Locale]: Initializing locale script ...");
|
||||||
logToConsole(LOG_INFO, "[VRR.Locale]: Locale script initialized!");
|
logToConsole(LOG_INFO, "[AGRP.Locale]: Locale script initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -35,9 +39,9 @@ function getLocaleString(client, stringName, ...args) {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
let tempString = getRawLocaleString(stringName, getPlayerData(client).locale);
|
let tempString = getRawLocaleString(getPlayerData(client).locale, stringName);
|
||||||
if (tempString == "" || tempString == null || typeof tempString == "undefined") {
|
if (tempString == "" || tempString == null || typeof tempString == "undefined") {
|
||||||
logToConsole(LOG_WARN, `[VRR.Locale] Locale string missing for ${stringName} on language ${getLocaleData(getPlayerData(client).locale).englishName}`);
|
logToConsole(LOG_WARN, `[AGRP.Locale] Locale string missing for ${stringName} on language ${getLocaleData(getPlayerData(client).locale).englishName}`);
|
||||||
submitBugReport(client, `(AUTOMATED REPORT) Locale string "${stringName}" is missing for "${getPlayerLocaleName(client)}"`);
|
submitBugReport(client, `(AUTOMATED REPORT) Locale string "${stringName}" is missing for "${getPlayerLocaleName(client)}"`);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@@ -52,9 +56,9 @@ function getLocaleString(client, stringName, ...args) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getLanguageLocaleString(localeId, stringName, ...args) {
|
function getLanguageLocaleString(localeId, stringName, ...args) {
|
||||||
let tempString = getRawLocaleString(stringName, localeId);
|
let tempString = getRawLocaleString(localeId, stringName);
|
||||||
if (tempString == "" || tempString == null || typeof tempString == "undefined") {
|
if (tempString == "" || tempString == null || typeof tempString == "undefined") {
|
||||||
logToConsole(LOG_WARN, `[VRR.Locale] Locale string missing for ${stringName} on language ${getLocaleData(localeId).englishName}`);
|
logToConsole(LOG_WARN, `[AGRP.Locale] Locale string missing for ${stringName} on language ${getLocaleData(localeId).englishName}`);
|
||||||
submitBugReport(null, `(AUTOMATED REPORT) Locale string "${stringName}" is missing for "${getLocaleData(localeId).englishName}"`);
|
submitBugReport(null, `(AUTOMATED REPORT) Locale string "${stringName}" is missing for "${getLocaleData(localeId).englishName}"`);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@@ -68,12 +72,29 @@ function getLanguageLocaleString(localeId, stringName, ...args) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getLanguageGroupedLocaleString(localeId, stringName, index, ...args) {
|
||||||
|
let tempString = getRawGroupedLocaleString(localeId, stringName, index);
|
||||||
|
if (tempString == "" || tempString == null || typeof tempString == "undefined") {
|
||||||
|
logToConsole(LOG_WARN, `[AGRP.Locale] Locale string missing for index ${index} of "${stringName}" on language ${getLocaleData(localeId).englishName}`);
|
||||||
|
submitBugReport(null, `(AUTOMATED REPORT) Locale string index ${index} of "${stringName}" is missing for "${getLocaleData(localeId).englishName}"`);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i = 1; i <= args.length; i++) {
|
||||||
|
tempString = tempString.replace(`{${i}}`, args[i - 1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return tempString;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
function getGroupedLocaleString(client, stringName, index, ...args) {
|
function getGroupedLocaleString(client, stringName, index, ...args) {
|
||||||
if (client == null) {
|
if (client == null) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
let tempString = getRawGroupedLocaleString(stringName, getPlayerData(client).locale, index);
|
let tempString = getRawGroupedLocaleString(getPlayerData(client).locale, stringName, index);
|
||||||
|
|
||||||
for (let i = 1; i <= args.length; i++) {
|
for (let i = 1; i <= args.length; i++) {
|
||||||
tempString = tempString.replace(`{${i}}`, args[i - 1]);
|
tempString = tempString.replace(`{${i}}`, args[i - 1]);
|
||||||
@@ -84,9 +105,9 @@ function getGroupedLocaleString(client, stringName, index, ...args) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getRawLocaleString(stringName, localeId) {
|
function getRawLocaleString(localeId, stringName) {
|
||||||
if (typeof getLocaleStrings()[localeId][stringName] == "undefined") {
|
if (typeof getLocaleStrings()[localeId][stringName] == "undefined") {
|
||||||
logToConsole(LOG_WARN, `[VRR.Locale] Locale string missing for ${getLocaleStrings()[localeId][stringName]} on language ${getLocaleData(localeId).englishName}[${localeId}]`);
|
logToConsole(LOG_WARN, `[AGRP.Locale] Locale string missing for ${getLocaleStrings()[localeId][stringName]} on language ${getLocaleData(localeId).englishName}[${localeId}]`);
|
||||||
submitBugReport(null, `(AUTOMATED REPORT) Locale string is missing for "${getLocaleStrings()[localeId][stringName]}" on language ${getLocaleData(localeId).englishName}[${localeId}]`);
|
submitBugReport(null, `(AUTOMATED REPORT) Locale string is missing for "${getLocaleStrings()[localeId][stringName]}" on language ${getLocaleData(localeId).englishName}[${localeId}]`);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@@ -105,9 +126,9 @@ function getRawLocaleString(stringName, localeId) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getRawGroupedLocaleString(stringName, localeId, index) {
|
function getRawGroupedLocaleString(localeId, stringName, index) {
|
||||||
if (typeof getLocaleStrings()[localeId][stringName][index] == "undefined") {
|
if (typeof getLocaleStrings()[localeId][stringName][index] == "undefined") {
|
||||||
logToConsole(LOG_WARN, `[VRR.Locale] Grouped locale string missing for index ${index} of string ${getLocaleStrings()[localeId][stringName][index]} on language ${getLocaleData(localeId).englishName}[${localeId}]`);
|
logToConsole(LOG_WARN, `[AGRP.Locale] Grouped locale string missing for index ${index} of string ${getLocaleStrings()[localeId][stringName][index]} on language ${getLocaleData(localeId).englishName}[${localeId}]`);
|
||||||
submitBugReport(null, `(AUTOMATED REPORT) Grouped locale string is missing for index ${index} of string "${getLocaleStrings()[localeId][stringName][index]}" on language ${getLocaleData(localeId).englishName}[${localeId}]`);
|
submitBugReport(null, `(AUTOMATED REPORT) Grouped locale string is missing for index ${index} of string "${getLocaleStrings()[localeId][stringName][index]}" on language ${getLocaleData(localeId).englishName}[${localeId}]`);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@@ -143,7 +164,7 @@ function loadAllLocaleStrings() {
|
|||||||
let locales = getGlobalConfig().locale.locales;
|
let locales = getGlobalConfig().locale.locales;
|
||||||
for (let i in locales) {
|
for (let i in locales) {
|
||||||
let localeData = locales[i];
|
let localeData = locales[i];
|
||||||
let localeFile = JSON.parse(loadTextFile(`locale/${localeData.stringsFile}`));
|
let localeFile = JSON.parse(getContentsOfTextFile(`locale/${localeData.stringsFile}`));
|
||||||
tempLocaleStrings[i] = localeFile;
|
tempLocaleStrings[i] = localeFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -258,7 +279,7 @@ async function translateMessage(messageText, translateFrom = getGlobalConfig().l
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let thisTranslationURL = getGlobalConfig().locale.translateURL.format(encodeURI(messageText), toUpperCase(getGlobalConfig().locale.locales[translateFrom].isoCode), toUpperCase(getGlobalConfig().locale.locales[translateTo].isoCode), getGlobalConfig().locale.apiEmail);
|
let thisTranslationURL = getGlobalConfig().locale.translateURL.format(encodeURIComponent(messageText), toUpperCase(getGlobalConfig().locale.locales[translateFrom].isoCode), toUpperCase(getGlobalConfig().locale.locales[translateTo].isoCode), getGlobalConfig().locale.apiEmail);
|
||||||
httpGet(
|
httpGet(
|
||||||
thisTranslationURL,
|
thisTranslationURL,
|
||||||
"",
|
"",
|
||||||
@@ -275,3 +296,15 @@ async function translateMessage(messageText, translateFrom = getGlobalConfig().l
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getLocaleFromCountryISO(isoCode = "US") {
|
||||||
|
for (let i in getLocales()) {
|
||||||
|
for (let j in getLocales()[i].countries) {
|
||||||
|
if (toLowerCase(getLocales()[i].countries[j]) == toLowerCase(isoCode)) {
|
||||||
|
return getLocales()[i].id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -9,8 +9,8 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initMessagingScript() {
|
function initMessagingScript() {
|
||||||
logToConsole(LOG_INFO, "[VRR.Messaging]: Initializing messaging script ...");
|
logToConsole(LOG_INFO, "[AGRP.Messaging]: Initializing messaging script ...");
|
||||||
logToConsole(LOG_INFO, "[VRR.Messaging]: Messaging script initialized successfully!");
|
logToConsole(LOG_INFO, "[AGRP.Messaging]: Messaging script initialized successfully!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -41,37 +41,31 @@ function announceAdminAction(localeString, ...args) {
|
|||||||
function messagePlayerNormal(client, messageText, colour = COLOUR_WHITE) {
|
function messagePlayerNormal(client, messageText, colour = COLOUR_WHITE) {
|
||||||
if (client != null) {
|
if (client != null) {
|
||||||
if (client.console) {
|
if (client.console) {
|
||||||
logToConsole(LOG_INFO, `${messageText}`);
|
logToConsole(LOG_INFO, `${removeColoursInMessage(messageText)}`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//logToConsole(LOG_INFO, `${messageText}`);
|
|
||||||
|
|
||||||
//messageText = replaceColoursInMessage(messageText);
|
|
||||||
|
|
||||||
//if(client == null) {
|
|
||||||
// message(messageText, colour);
|
|
||||||
//} else {
|
|
||||||
// messageClient(messageText, client, colour);
|
|
||||||
//}
|
|
||||||
|
|
||||||
sendChatBoxMessageToPlayer(client, messageText, colour);
|
sendChatBoxMessageToPlayer(client, messageText, colour);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function messageAdmins(messageText, colour = getColourByName("softRed")) {
|
function messageAdmins(messageText, announceToEventChannel = false) {
|
||||||
let clients = getClients();
|
let clients = getClients();
|
||||||
for (let i in clients) {
|
for (let i in clients) {
|
||||||
if (doesPlayerHaveStaffPermission(clients[i], getStaffFlagValue("BasicModeration"))) {
|
if (doesPlayerHaveStaffPermission(clients[i], getStaffFlagValue("BasicModeration"))) {
|
||||||
messagePlayerNormal(clients[i], `🛡️ ${messageText}`, colour);
|
messagePlayerNormal(clients[i], `🛡️ ${messageText}`, getColourByName("white"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let plainMessage = removeColoursInMessage(messageText);
|
let plainMessage = removeColoursInMessage(messageText);
|
||||||
messageDiscordAdminChannel(plainMessage);
|
messageDiscordAdminChannel(plainMessage);
|
||||||
|
|
||||||
|
if (announceToEventChannel == true) {
|
||||||
|
messageDiscordEventChannel(`🛡️ ${plainMessage}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -169,7 +163,7 @@ function messagePlayerDoAction(client, doingActionClient, messageText) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function messagePlayerMeAction(client, doingActionClient, messageText) {
|
function messagePlayerMeAction(client, doingActionClient, messageText) {
|
||||||
messagePlayerNormal(client, `${getClientSubAccountName(doingActionClient)} ${messageText}`, getColourByType("meActionMessage"));
|
messagePlayerNormal(client, `${getCharacterFullName(doingActionClient)} ${messageText}`, getColourByType("meActionMessage"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -181,7 +175,7 @@ function messagePlayerClanChat(client, clanChattingClient, messageText) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function messagePlayerAdminChat(client, adminChattingClient, messageText) {
|
function messagePlayerAdminChat(client, adminChattingClient, messageText) {
|
||||||
messagePlayerNormal(client, `🛡️ [ADMIN CHAT] {ALTCOLOUR}${getPlayerData(adminChattingClient).accountData.staffTitle} [#CCCCCC]${getPlayerData(adminChattingClient).accountData.name}: {MAINCOLOUR}${messageText}`, getColourByType("orange"));
|
messagePlayerNormal(client, `🛡️ [ADMIN CHAT] {ALTCOLOUR}${getPlayerData(adminChattingClient).accountData.staffTitle} {lightGrey}${getPlayerData(adminChattingClient).accountData.name}: {MAINCOLOUR}${messageText}`, getColourByType("orange"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -238,7 +232,28 @@ function messagePlayersInRace(raceId, message) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function messagePlayerPrivateMessage(toClient, fromClient, messageText) {
|
function messagePlayerPrivateMessage(toClient, fromClient, messageText) {
|
||||||
messagePlayerNormal(toClient, `{yellow}[DM] ${getCharacterFullName(fromClient)}{MAINCOLOUR}says: {ALTCOLOUR}${messageText}`);
|
messagePlayerNormal(toClient, `📥 {yellow}DM from ${getCharacterFullName(fromClient)}{MAINCOLOUR}: ${messageText}`);
|
||||||
|
messagePlayerNormal(fromClient, `📤 {yellow}DM to ${getCharacterFullName(toClient)}{MAINCOLOUR}: ${messageText}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function showPlayerError(client, errorMessage, errorTitle = "Error") {
|
||||||
|
if (doesPlayerUseGUI(client)) {
|
||||||
|
showPlayerErrorGUI(client, errorMessage, errorTitle);
|
||||||
|
} else {
|
||||||
|
messagePlayerError(client, errorMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function showPlayerAlert(client, alertMessage, alertTitle = "Alert") {
|
||||||
|
if (doesPlayerUseGUI(client)) {
|
||||||
|
showPlayerInfoGUI(client, alertMessage, alertTitle);
|
||||||
|
} else {
|
||||||
|
messagePlayerAlert(client, alertMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -31,7 +31,7 @@ const AGRP_BLIP_EXIT = 6;
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
// Ped States
|
// Ped States
|
||||||
const AGRP_PEDSTATE_NONE = 2; // None
|
const AGRP_PEDSTATE_NONE = 0; // None
|
||||||
const AGRP_PEDSTATE_READY = 1; // Ready
|
const AGRP_PEDSTATE_READY = 1; // Ready
|
||||||
const AGRP_PEDSTATE_DRIVER = 2; // Driving a vehicle
|
const AGRP_PEDSTATE_DRIVER = 2; // Driving a vehicle
|
||||||
const AGRP_PEDSTATE_PASSENGER = 3; // In a vehicle as passenger
|
const AGRP_PEDSTATE_PASSENGER = 3; // In a vehicle as passenger
|
||||||
@@ -47,11 +47,16 @@ const AGRP_PEDSTATE_INITEM = 12; // In item (crate, box, etc)
|
|||||||
const AGRP_PEDSTATE_HANDSUP = 13; // Has hands up (surrendering)
|
const AGRP_PEDSTATE_HANDSUP = 13; // Has hands up (surrendering)
|
||||||
const AGRP_PEDSTATE_SPAWNING = 14; // Spawning
|
const AGRP_PEDSTATE_SPAWNING = 14; // Spawning
|
||||||
|
|
||||||
|
// Property Types
|
||||||
|
const AGRP_PROPERTY_TYPE_NONE = 0; // None
|
||||||
|
const AGRP_PROPERTY_TYPE_BUSINESS = 1; // Business
|
||||||
|
const AGRP_PROPERTY_TYPE_HOUSE = 2; // House
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initMiscScript() {
|
function initMiscScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Misc]: Initializing misc script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.Misc]: Initializing misc script ...");
|
||||||
logToConsole(LOG_INFO, "[VRR.Misc]: Misc script initialized successfully!");
|
logToConsole(LOG_INFO, "[AGRP.Misc]: Misc script initialized successfully!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,7 +149,7 @@ function setNewCharacterMoneyCommand(command, params, client) {
|
|||||||
getServerConfig().newCharacter.cash = amount;
|
getServerConfig().newCharacter.cash = amount;
|
||||||
getServerConfig().needsSaved = true;
|
getServerConfig().needsSaved = true;
|
||||||
|
|
||||||
messagePlayerNormal(client, `The new character money has been set to $${amount}`);
|
messagePlayerNormal(client, `The new character money has been set to ${getCurrencyString(amount)}`);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,11 +205,20 @@ function enterExitPropertyCommand(command, params, client) {
|
|||||||
let isEntrance = false;
|
let isEntrance = false;
|
||||||
let isBusiness = false;
|
let isBusiness = false;
|
||||||
|
|
||||||
if (areServerElementsSupported()) {
|
// Make sure they aren't already trying to enter/exit a property
|
||||||
if (!getPlayerData(client).currentPickup) {
|
if (getPlayerData(client).pedState == AGRP_PEDSTATE_ENTERINGPROPERTY || getPlayerData(client).pedState == AGRP_PEDSTATE_EXITINGPROPERTY) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "UnableToDoThat"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let position = getPlayerPosition(client);
|
||||||
|
let dimension = getPlayerDimension(client);
|
||||||
|
|
||||||
|
/*
|
||||||
|
// The player's currentPickup wasn't always being set. This prevented entering/exiting a property.
|
||||||
|
// Needs further testing and tweaks.
|
||||||
|
if (getPlayerData(client).currentPickup != null) {
|
||||||
|
if (getDistance(getPlayerData(client).currentPickup.position, getPlayerPosition(client)) <= 2) {
|
||||||
let ownerType = getEntityData(getPlayerData(client).currentPickup, "agrp.owner.type");
|
let ownerType = getEntityData(getPlayerData(client).currentPickup, "agrp.owner.type");
|
||||||
let ownerId = getEntityData(getPlayerData(client).currentPickup, "agrp.owner.id");
|
let ownerId = getEntityData(getPlayerData(client).currentPickup, "agrp.owner.id");
|
||||||
|
|
||||||
@@ -237,43 +251,101 @@ function enterExitPropertyCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (let i in getServerData().businesses) {
|
getPlayerData(client).currentPickup = null;
|
||||||
if (getPlayerDimension(client) == getGameConfig().mainWorldDimension[getGame()] && getPlayerInterior(client) == getGameConfig().mainWorldInterior[getGame()]) {
|
}
|
||||||
let businessId = getClosestBusinessEntrance(getPlayerPosition(client), getPlayerDimension(client));
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
// Check businesses first
|
||||||
|
if (closestProperty == null) {
|
||||||
|
let businessIndex = getClosestBusinessEntrance(getPlayerPosition(client), getPlayerDimension(client));
|
||||||
|
if (getDistance(getBusinessData(businessIndex).entrancePosition, getPlayerPosition(client)) <= 1.5) {
|
||||||
isBusiness = true;
|
isBusiness = true;
|
||||||
isEntrance = true;
|
isEntrance = true;
|
||||||
closestProperty = getServerData().businesses[businessId];
|
closestProperty = getServerData().businesses[businessIndex];
|
||||||
} else {
|
|
||||||
let businessId = getClosestBusinessExit(getPlayerPosition(client), getPlayerDimension(client));
|
|
||||||
isBusiness = true;
|
|
||||||
isEntrance = false;
|
|
||||||
closestProperty = getServerData().businesses[businessId];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let j in getServerData().houses) {
|
if (closestProperty == null) {
|
||||||
if (getPlayerDimension(client) == getGameConfig().mainWorldDimension[getGame()] && getPlayerInterior(client) == getGameConfig().mainWorldInterior[getGame()]) {
|
let businessIndex = getClosestBusinessExit(getPlayerPosition(client), getPlayerDimension(client));
|
||||||
let houseId = getClosestHouseEntrance(getPlayerPosition(client), getPlayerDimension(client));
|
if (getDistance(getBusinessData(businessIndex).exitPosition, getPlayerPosition(client)) <= 1.5) {
|
||||||
|
isBusiness = true;
|
||||||
|
isEntrance = false;
|
||||||
|
closestProperty = getServerData().businesses[businessIndex];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check houses second
|
||||||
|
if (closestProperty == null) {
|
||||||
|
let houseIndex = getClosestHouseEntrance(getPlayerPosition(client), getPlayerDimension(client));
|
||||||
|
if (getDistance(getHouseData(houseIndex).entrancePosition, getPlayerPosition(client)) <= 1.5) {
|
||||||
isBusiness = false;
|
isBusiness = false;
|
||||||
isEntrance = true;
|
isEntrance = true;
|
||||||
closestProperty = getServerData().businesses[houseId];
|
closestProperty = getServerData().houses[houseIndex];
|
||||||
} else {
|
}
|
||||||
let houseId = getClosestHouseExit(getPlayerPosition(client), getPlayerDimension(client));
|
}
|
||||||
|
|
||||||
|
if (closestProperty == null) {
|
||||||
|
let houseIndex = getClosestHouseExit(getPlayerPosition(client), getPlayerDimension(client));
|
||||||
|
if (getDistance(getHouseData(houseIndex).exitPosition, getPlayerPosition(client)) <= 1.5) {
|
||||||
isBusiness = false;
|
isBusiness = false;
|
||||||
isEntrance = false;
|
isEntrance = false;
|
||||||
closestProperty = getServerData().businesses[houseId];
|
closestProperty = getServerData().houses[houseIndex];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Check businesses first
|
||||||
|
if (closestProperty == null) {
|
||||||
|
for (let i in getServerData().businesses) {
|
||||||
|
if (getServerData().businesses[i].entranceDimension == dimension) {
|
||||||
|
if (getDistance(position, getServerData().businesses[i].entrancePosition) <= getGlobalConfig().enterPropertyDistance) {
|
||||||
|
isBusiness = true;
|
||||||
|
isEntrance = true;
|
||||||
|
closestProperty = getServerData().businesses[i];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (getServerData().businesses[i].exitDimension == dimension) {
|
||||||
|
if (getDistance(position, getServerData().businesses[i].exitPosition) <= getGlobalConfig().exitPropertyDistance) {
|
||||||
|
isBusiness = true;
|
||||||
|
isEntrance = false;
|
||||||
|
closestProperty = getServerData().businesses[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (closestProperty == null) {
|
if (closestProperty == null) {
|
||||||
|
for (let i in getServerData().houses) {
|
||||||
|
if (getServerData().houses[i].entranceDimension == dimension) {
|
||||||
|
if (getDistance(position, getServerData().houses[i].entrancePosition) <= getGlobalConfig().enterPropertyDistance) {
|
||||||
|
isBusiness = false;
|
||||||
|
isEntrance = true;
|
||||||
|
closestProperty = getServerData().houses[i];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (getServerData().houses[i].exitDimension == dimension) {
|
||||||
|
if (getDistance(position, getServerData().houses[i].exitPosition) <= getGlobalConfig().exitPropertyDistance) {
|
||||||
|
isBusiness = false;
|
||||||
|
isEntrance = false;
|
||||||
|
closestProperty = getServerData().houses[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (closestProperty == null) {
|
||||||
|
logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)}'s closest door is null`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)}'s closest door is ${(isBusiness) ? closestProperty.name : closestProperty.description} ${(isEntrance) ? "entrance" : "exit"}`);
|
logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)}'s closest door is ${(isBusiness) ? closestProperty.name : closestProperty.description} ${(isEntrance) ? "entrance" : "exit"}`);
|
||||||
|
|
||||||
let englishId = getLocaleFromParams("English");
|
let englishId = getLocaleFromParams("English");
|
||||||
let typeString = (isBusiness) ? getLocaleString(client, "Business") : getLocaleString(client, "House");
|
let typeString = (isBusiness) ? getLanguageLocaleString(englishId, "Business") : getLanguageLocaleString(englishId, "House");
|
||||||
let nameString = (isBusiness) ? closestProperty.name : closestProperty.description;
|
let nameString = (isBusiness) ? closestProperty.name : closestProperty.description;
|
||||||
|
|
||||||
if (isEntrance) {
|
if (isEntrance) {
|
||||||
@@ -290,43 +362,27 @@ function enterExitPropertyCommand(command, params, client) {
|
|||||||
|
|
||||||
clearPlayerStateToEnterExitProperty(client);
|
clearPlayerStateToEnterExitProperty(client);
|
||||||
getPlayerData(client).pedState = AGRP_PEDSTATE_ENTERINGPROPERTY;
|
getPlayerData(client).pedState = AGRP_PEDSTATE_ENTERINGPROPERTY;
|
||||||
|
getPlayerData(client).enteringExitingProperty = [(isBusiness) ? AGRP_PROPERTY_TYPE_BUSINESS : AGRP_PROPERTY_TYPE_HOUSE, closestProperty.index];
|
||||||
|
|
||||||
meActionToNearbyPlayers(client, getLanguageLocaleString(englishId, "EntersProperty", typeString, nameString));
|
meActionToNearbyPlayers(client, getLanguageLocaleString(englishId, "EntersProperty", typeString, nameString));
|
||||||
|
|
||||||
|
if (closestProperty.exitScene != "" && isGameFeatureSupported("interiorScene")) {
|
||||||
|
getPlayerCurrentSubAccount(client).spawnPosition = closestProperty.exitPosition;
|
||||||
|
if (isMainWorldScene(closestProperty.exitScene) || closestProperty.exitScene == "AGRP.MAINWORLD") {
|
||||||
|
setPlayerScene(client, getGameConfig().mainWorldScene[getGame()]);
|
||||||
|
} else {
|
||||||
|
setPlayerScene(client, closestProperty.exitScene);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (isFadeCameraSupported()) {
|
if (isFadeCameraSupported()) {
|
||||||
fadeCamera(client, false, 1.0);
|
fadeCamera(client, false, 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
setPlayerInCutsceneInterior(client, closestProperty.exitCutscene);
|
processPlayerEnteringExitingProperty(client);
|
||||||
setPlayerDimension(client, closestProperty.exitDimension);
|
|
||||||
setPlayerInterior(client, closestProperty.exitInterior);
|
|
||||||
setPlayerPosition(client, closestProperty.exitPosition);
|
|
||||||
setPlayerHeading(client, closestProperty.exitRotation);
|
|
||||||
setTimeout(function () {
|
|
||||||
if (isFadeCameraSupported()) {
|
|
||||||
fadeCamera(client, true, 1.0);
|
|
||||||
}
|
|
||||||
updateInteriorLightsForPlayer(client, closestProperty.interiorLights);
|
|
||||||
}, 1000);
|
|
||||||
//setPlayerInCutsceneInterior(client, closestProperty.exitCutscene);
|
|
||||||
//updateAllInteriorVehiclesForPlayer(client, closestProperty.exitInterior, closestProperty.exitDimension);
|
|
||||||
}, 1100);
|
}, 1100);
|
||||||
|
|
||||||
if (isBusiness) {
|
|
||||||
if (closestProperty.type == AGRP_BIZ_TYPE_PAINTBALL) {
|
|
||||||
messagePlayerAlert(client, getLocaleString(client, "JoinedPaintBall"));
|
|
||||||
startPaintBall(client);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let radioStationIndex = closestProperty.streamingRadioStationIndex;
|
|
||||||
if (radioStationIndex != -1) {
|
|
||||||
if (getRadioStationData(radioStationIndex)) {
|
|
||||||
playRadioStreamForPlayer(client, getRadioStationData(radioStationIndex).url);
|
|
||||||
getPlayerData(client).streamingRadioStation = radioStationIndex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -335,69 +391,34 @@ function enterExitPropertyCommand(command, params, client) {
|
|||||||
meActionToNearbyPlayers(client, getLocaleString(client, "EnterExitPropertyDoorLocked", (isBusiness) ? getLocaleString(client, "Business") : getLocaleString(client, "House")));
|
meActionToNearbyPlayers(client, getLocaleString(client, "EnterExitPropertyDoorLocked", (isBusiness) ? getLocaleString(client, "Business") : getLocaleString(client, "House")));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
getPlayerData(client).pedState = AGRP_PEDSTATE_EXITINGPROPERTY;
|
|
||||||
clearPlayerStateToEnterExitProperty(client);
|
clearPlayerStateToEnterExitProperty(client);
|
||||||
|
getPlayerData(client).pedState = AGRP_PEDSTATE_EXITINGPROPERTY;
|
||||||
|
getPlayerData(client).enteringExitingProperty = [(isBusiness) ? AGRP_PROPERTY_TYPE_BUSINESS : AGRP_PROPERTY_TYPE_HOUSE, closestProperty.index];
|
||||||
|
|
||||||
meActionToNearbyPlayers(client, getLanguageLocaleString(englishId, "ExitsProperty", typeString, nameString));
|
meActionToNearbyPlayers(client, getLanguageLocaleString(englishId, "ExitsProperty", typeString, nameString));
|
||||||
|
|
||||||
|
if (closestProperty.entranceScene != "" && isGameFeatureSupported("interiorScene")) {
|
||||||
|
getPlayerCurrentSubAccount(client).spawnPosition = closestProperty.entrancePosition;
|
||||||
|
if (isMainWorldScene(closestProperty.entranceScene) || closestProperty.entranceScene == "AGRP.MAINWORLD") {
|
||||||
|
setPlayerScene(client, getGameConfig().mainWorldScene[getGame()]);
|
||||||
|
} else {
|
||||||
|
setPlayerScene(client, closestProperty.entranceScene);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (isFadeCameraSupported()) {
|
if (isFadeCameraSupported()) {
|
||||||
fadeCamera(client, false, 1.0);
|
fadeCamera(client, false, 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
disableCityAmbienceForPlayer(client, true);
|
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
setPlayerInCutsceneInterior(client, closestProperty.entranceCutscene);
|
processPlayerEnteringExitingProperty(client);
|
||||||
setPlayerPosition(client, closestProperty.entrancePosition);
|
|
||||||
setPlayerHeading(client, closestProperty.entranceRotation);
|
|
||||||
setPlayerDimension(client, closestProperty.entranceDimension);
|
|
||||||
setPlayerInterior(client, closestProperty.entranceInterior);
|
|
||||||
setTimeout(function () {
|
|
||||||
if (isFadeCameraSupported()) {
|
|
||||||
fadeCamera(client, true, 1.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
updateInteriorLightsForPlayer(client, true);
|
|
||||||
}, 1000);
|
|
||||||
}, 1100);
|
}, 1100);
|
||||||
|
|
||||||
if (isBusiness) {
|
|
||||||
if (closestProperty.type == AGRP_BIZ_TYPE_PAINTBALL) {
|
|
||||||
messagePlayerAlert(client, getLocaleString(client, "LeftPaintBall"));
|
|
||||||
stopPaintBall(client);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//logToConsole(LOG_DEBUG, `[AGRP.Misc] ${getPlayerDisplayForConsole(client)} exited business ${inBusiness.name}[${inBusiness.index}/${inBusiness.databaseId}]`);
|
||||||
clearLocalPickupsForPlayer(client);
|
|
||||||
|
|
||||||
//setPlayerInCutsceneInterior(client, closestProperty.entranceCutscene);
|
|
||||||
stopRadioStreamForPlayer(client);
|
|
||||||
getPlayerData(client).streamingRadioStation = -1;
|
|
||||||
|
|
||||||
// Check if exiting property was into another house/business and set radio station accordingly
|
|
||||||
let inHouse = getPlayerHouse(client);
|
|
||||||
let inBusiness = getPlayerBusiness(client);
|
|
||||||
|
|
||||||
if (inBusiness != -1) {
|
|
||||||
if (getBusinessData(inBusiness).streamingRadioStationIndex != -1) {
|
|
||||||
if (getRadioStationData(getBusinessData(inBusiness).streamingRadioStationIndex)) {
|
|
||||||
playRadioStreamForPlayer(client, getRadioStationData(getBusinessData(inBusiness).streamingRadioStationIndex).url);
|
|
||||||
getPlayerData(client).streamingRadioStation = getBusinessData(inBusiness).streamingRadioStationIndex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (inHouse != -1) {
|
|
||||||
if (getHouseData(inHouse).streamingRadioStationIndex != -1) {
|
|
||||||
if (getRadioStationData(getHouseData(inHouse).streamingRadioStationIndex)) {
|
|
||||||
playRadioStreamForPlayer(client, getRadioStationData(getHouseData(inHouse).streamingRadioStationIndex).url);
|
|
||||||
getPlayerData(client).streamingRadioStation = getHouseData(inHouse).streamingRadioStationIndex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//logToConsole(LOG_DEBUG, `[VRR.Misc] ${getPlayerDisplayForConsole(client)} exited business ${inBusiness.name}[${inBusiness.index}/${inBusiness.databaseId}]`);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -446,16 +467,16 @@ function getPlayerInfoCommand(command, params, client) {
|
|||||||
["Account", `${getPlayerData(targetClient).accountData.name}{mediumGrey}[${getPlayerData(targetClient).accountData.databaseId}]{ALTCOLOUR}`],
|
["Account", `${getPlayerData(targetClient).accountData.name}{mediumGrey}[${getPlayerData(targetClient).accountData.databaseId}]{ALTCOLOUR}`],
|
||||||
["Character", `${getCharacterFullName(targetClient)}{mediumGrey}[${getPlayerCurrentSubAccount(targetClient).databaseId}]{ALTCOLOUR}`],
|
["Character", `${getCharacterFullName(targetClient)}{mediumGrey}[${getPlayerCurrentSubAccount(targetClient).databaseId}]{ALTCOLOUR}`],
|
||||||
["Connected", `${getTimeDifferenceDisplay(getCurrentUnixTimestamp(), getPlayerData(targetClient).connectTime)} ago`],
|
["Connected", `${getTimeDifferenceDisplay(getCurrentUnixTimestamp(), getPlayerData(targetClient).connectTime)} ago`],
|
||||||
["Registered", `${registerDate.toLocaleDateString()} - ${registerDate.toLocaleTimeString()}`],
|
["Registered", `${registerDate.toLocaleDateString()}`],
|
||||||
["Game Version", `${targetClient.gameVersion}`],
|
["Game Version", `${targetClient.gameVersion}`],
|
||||||
["Script Version", `${scriptVersion}`],
|
["Script Version", `${scriptVersion}`],
|
||||||
["Client Version", `${getPlayerData(targetClient).clientVersion}`],
|
["Client Version", `${getPlayerData(targetClient).clientVersion}`],
|
||||||
["Client Version", `${getPlayerData(targetClient).clientVersion}`],
|
["Client Version", `${getPlayerData(targetClient).clientVersion}`],
|
||||||
["Cash", `$${getPlayerCurrentSubAccount(client).cash}`],
|
["Cash", `${getCurrencyString(getPlayerCurrentSubAccount(client).cash)}`],
|
||||||
["Skin", `${skinName}{mediumGrey}[${skinModel}]{ALTCOLOUR}`],
|
["Skin", `${skinName}{mediumGrey}[Model: ${skinModel}/Index: ${skinIndex}]{ALTCOLOUR}`],
|
||||||
["Clan", `${clan}`],
|
["Clan", `${clan}`],
|
||||||
["Job", `${job}`],
|
["Job", `${job}`],
|
||||||
["Current Date", `${currentDate.toLocaleDateString()} - ${currentDate.toLocaleTimeString()}`],
|
["Current Date", `${currentDate.toLocaleDateString()}`],
|
||||||
]
|
]
|
||||||
|
|
||||||
let stats = tempStats.map(stat => `{MAINCOLOUR}${stat[0]}: {ALTCOLOUR}${stat[1]} {MAINCOLOUR}`);
|
let stats = tempStats.map(stat => `{MAINCOLOUR}${stat[0]}: {ALTCOLOUR}${stat[1]} {MAINCOLOUR}`);
|
||||||
@@ -500,10 +521,10 @@ function checkPlayerSpawning() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showPlayerPrompt(client, promptMessage, promptTitle, yesButtonText, noButtonText) {
|
function showPlayerPrompt(client, promptMessage, promptTitle, yesButtonText, noButtonText) {
|
||||||
if (canPlayerUseGUI(client)) {
|
if (doesPlayerUseGUI(client)) {
|
||||||
showPlayerPromptGUI(client, promptMessage, promptTitle, yesButtonText, noButtonText);
|
showPlayerPromptGUI(client, promptMessage, promptTitle, yesButtonText, noButtonText);
|
||||||
} else {
|
} else {
|
||||||
messagePlayerNormal(client, `❓ ${promptMessage} `);
|
messagePlayerNormal(client, `🛎️ ${promptMessage} `);
|
||||||
messagePlayerInfo(client, getLocaleString(client, "PromptResponseTip", `{ALTCOLOUR}/yes{MAINCOLOUR}`, `{ALTCOLOUR}/no{MAINCOLOUR}`));
|
messagePlayerInfo(client, getLocaleString(client, "PromptResponseTip", `{ALTCOLOUR}/yes{MAINCOLOUR}`, `{ALTCOLOUR}/no{MAINCOLOUR}`));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -904,9 +925,7 @@ function processPlayerDeath(client) {
|
|||||||
updatePlayerSpawnedState(client, false);
|
updatePlayerSpawnedState(client, false);
|
||||||
setPlayerControlState(client, false);
|
setPlayerControlState(client, false);
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
if (isFadeCameraSupported()) {
|
fadePlayerCamera(client, false, 1000);
|
||||||
fadeCamera(client, false, 1.0);
|
|
||||||
}
|
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
if (isPlayerInPaintBall(client)) {
|
if (isPlayerInPaintBall(client)) {
|
||||||
respawnPlayerForPaintBall(client);
|
respawnPlayerForPaintBall(client);
|
||||||
@@ -921,15 +940,9 @@ function processPlayerDeath(client) {
|
|||||||
stopWorking(client);
|
stopWorking(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getGame() == AGRP_GAME_MAFIA_ONE) {
|
|
||||||
spawnPlayer(client, getGameConfig().skins[getGame()][getPlayerCurrentSubAccount(client).skin][0], closestJail.position, closestJail.heading);
|
|
||||||
} else {
|
|
||||||
spawnPlayer(client, closestJail.position, closestJail.heading, getGameConfig().skins[getGame()][getPlayerCurrentSubAccount(client).skin][0]);
|
spawnPlayer(client, closestJail.position, closestJail.heading, getGameConfig().skins[getGame()][getPlayerCurrentSubAccount(client).skin][0]);
|
||||||
}
|
|
||||||
|
|
||||||
if (isFadeCameraSupported()) {
|
fadePlayerCamera(client, true, 1000);
|
||||||
fadeCamera(client, true, 1.0);
|
|
||||||
}
|
|
||||||
updatePlayerSpawnedState(client, true);
|
updatePlayerSpawnedState(client, true);
|
||||||
makePlayerStopAnimation(client);
|
makePlayerStopAnimation(client);
|
||||||
setPlayerControlState(client, true);
|
setPlayerControlState(client, true);
|
||||||
@@ -944,16 +957,8 @@ function processPlayerDeath(client) {
|
|||||||
stopWorking(client);
|
stopWorking(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getGame() == AGRP_GAME_MAFIA_ONE) {
|
|
||||||
spawnPlayer(client, getGameConfig().skins[getGame()][getPlayerCurrentSubAccount(client).skin][0], closestHospital.position, closestHospital.heading);
|
|
||||||
} else {
|
|
||||||
spawnPlayer(client, closestHospital.position, closestHospital.heading, getGameConfig().skins[getGame()][getPlayerCurrentSubAccount(client).skin][0]);
|
spawnPlayer(client, closestHospital.position, closestHospital.heading, getGameConfig().skins[getGame()][getPlayerCurrentSubAccount(client).skin][0]);
|
||||||
}
|
fadePlayerCamera(client, true, 1000);
|
||||||
|
|
||||||
if (isFadeCameraSupported()) {
|
|
||||||
fadeCamera(client, true, 1.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
updatePlayerSpawnedState(client, true);
|
updatePlayerSpawnedState(client, true);
|
||||||
makePlayerStopAnimation(client);
|
makePlayerStopAnimation(client);
|
||||||
setPlayerControlState(client, true);
|
setPlayerControlState(client, true);
|
||||||
@@ -988,3 +993,21 @@ function isPlayerRestrained(client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getPlayerInPropertyData(client) {
|
||||||
|
let businessId = getPlayerBusiness(client);
|
||||||
|
if (businessId != -1) {
|
||||||
|
getPlayerData(client).inProperty = [AGRP_PROPERTY_TYPE_BUSINESS, businessId];
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
let houseId = getPlayerHouse(client);
|
||||||
|
if (houseId != -1) {
|
||||||
|
getPlayerData(client).inProperty = [AGRP_PROPERTY_TYPE_HOUSE, houseId];
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
getPlayerData(client).inProperty = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -193,9 +193,9 @@ function getVehicleHeading(vehicle) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setVehicleHeading(vehicle, heading) {
|
function setVehicleHeading(vehicle, heading) {
|
||||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
//if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
return sendNetworkEventToPlayer("agrp.vehPosition", null, getVehicleForNetworkEvent(vehicle), heading);
|
// return sendNetworkEventToPlayer("agrp.vehPosition", null, getVehicleForNetworkEvent(vehicle), heading);
|
||||||
}
|
//}
|
||||||
return vehicle.heading = heading;
|
return vehicle.heading = heading;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -227,12 +227,12 @@ function getVehicleSyncer(vehicle) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getVehicleForNetworkEvent(vehicle) {
|
function getVehicleForNetworkEvent(vehicle) {
|
||||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
//if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
if (getVehicleData(vehicle).ivNetworkId != -1) {
|
// if (getVehicleData(vehicle).ivNetworkId != -1) {
|
||||||
return getVehicleData(vehicle).ivNetworkId;
|
// return getVehicleData(vehicle).ivNetworkId;
|
||||||
}
|
// }
|
||||||
return -1;
|
// return -1;
|
||||||
}
|
//}
|
||||||
return vehicle.id;
|
return vehicle.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -490,6 +490,15 @@ function createGamePickup(modelIndex, position, type) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function createGameDummyElement(position) {
|
||||||
|
if (!isGameFeatureSupported("dummyElement")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return game.createDummy(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
function createGameBlip(position, type = 0, size = 1, colour = toColour(255, 255, 255, 255)) {
|
function createGameBlip(position, type = 0, size = 1, colour = toColour(255, 255, 255, 255)) {
|
||||||
if (!isGameFeatureSupported("blip")) {
|
if (!isGameFeatureSupported("blip")) {
|
||||||
return false;
|
return false;
|
||||||
@@ -565,97 +574,75 @@ function isVehicleObject(vehicle) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function repairVehicle(vehicleIndex) {
|
function repairVehicle(vehicle) {
|
||||||
if (areServerElementsSupported()) {
|
vehicle.fix();
|
||||||
getElementFromId(vehicleIndex).vehicle.fix();
|
|
||||||
} else {
|
|
||||||
sendNetworkEventToPlayer("agrp.veh.fix", null, vehicleIndex);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setVehicleLights(vehicle, lights) {
|
||||||
function setVehicleLights(vehicleIndex, lights) {
|
setEntityData(vehicle, "agrp.lights", lights, true);
|
||||||
if (areServerElementsSupported()) {
|
sendNetworkEventToPlayer("agrp.veh.lights", null, vehicle.id, lights);
|
||||||
setEntityData(getElementFromId(vehicleIndex), "agrp.lights", lights, true);
|
|
||||||
sendNetworkEventToPlayer("agrp.veh.lights", null, vehicleIndex, lights);
|
|
||||||
} else {
|
|
||||||
sendNetworkEventToPlayer("agrp.veh.lights", null, vehicleIndex, lights);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setVehicleEngine(vehicleIndex, engine) {
|
function setVehicleEngine(vehicle, engine) {
|
||||||
if (areServerElementsSupported()) {
|
//vehicle.engine = engine;
|
||||||
getElementFromId(vehicleIndex).engine = engine;
|
setEntityData(vehicle, "agrp.engine", engine, true);
|
||||||
setEntityData(getElementFromId(vehicleIndex), "agrp.engine", engine, true);
|
sendNetworkEventToPlayer("agrp.veh.engine", null, vehicle.id, engine);
|
||||||
} else {
|
|
||||||
sendNetworkEventToPlayer("agrp.veh.engine", null, vehicleIndex, engine);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setVehicleLocked(vehicleIndex, locked) {
|
function setVehicleLocked(vehicle, locked) {
|
||||||
if (areServerElementsSupported()) {
|
vehicle.locked = locked;
|
||||||
getElementFromId(vehicleIndex).vehicle.locked = locked;
|
setEntityData(vehicle, "agrp.locked", locked, true);
|
||||||
} else {
|
sendNetworkEventToPlayer("agrp.veh.locked", null, vehicle.id, locked);
|
||||||
sendNetworkEventToPlayer("agrp.veh.locked", null, vehicleIndex, locked);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setVehicleSiren(vehicleIndex, siren) {
|
function setVehicleSiren(vehicle, siren) {
|
||||||
if (areServerElementsSupported()) {
|
vehicle.siren = siren;
|
||||||
getVehicleData(vehicleIndex).vehicle.siren = siren;
|
|
||||||
} else {
|
|
||||||
sendNetworkEventToPlayer("agrp.veh.siren", null, vehicleIndex, siren);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getVehicleLights(vehicleIndex) {
|
function getVehicleLights(vehicle) {
|
||||||
return getVehicleData(vehicleIndex).lights;
|
return vehicle.lights;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getVehicleEngine(vehicleIndex) {
|
function getVehicleEngine(vehicle) {
|
||||||
return getVehicleData(vehicleIndex).engine;
|
return vehicle.engine;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getVehicleLocked(vehicleIndex) {
|
function getVehicleLocked(vehicle) {
|
||||||
return getVehicleData(vehicleIndex).locked;
|
return vehicle.lockedStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getVehicleSiren(vehicleIndex) {
|
function getVehicleSiren(vehicle) {
|
||||||
return getVehicleData(vehicleIndex).siren;
|
return vehicle.siren;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setVehicleColours(vehicleIndex, colour1, colour2, colour3 = -1, colour4 = -1) {
|
function setVehicleColours(vehicle, colour1, colour2, colour3 = -1, colour4 = -1) {
|
||||||
if (areServerElementsSupported()) {
|
vehicle.colour1 = colour1;
|
||||||
getVehicleData(vehicleIndex).vehicle.colour1 = colour1;
|
vehicle.colour2 = colour2;
|
||||||
getVehicleData(vehicleIndex).vehicle.colour2 = colour2;
|
|
||||||
|
|
||||||
if (colour3 != -1) {
|
if (colour3 != -1) {
|
||||||
getVehicleData(vehicleIndex).vehicle.colour3 = colour3;
|
vehicle.colour3 = colour3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (colour4 != -1) {
|
if (colour4 != -1) {
|
||||||
getVehicleData(vehicleIndex).vehicle.colour4 = colour4;
|
vehicle.colour4 = colour4;
|
||||||
}
|
|
||||||
} else {
|
|
||||||
sendNetworkEventToPlayer("agrp.veh.colours", null, vehicleIndex, colour1, colour2, colour3, colour4);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -734,7 +721,7 @@ function setPlayerFightStyle(client, fightStyleId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isGameFeatureSupported("fightStyles")) {
|
if (!areFightStylesSupported()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -835,24 +822,24 @@ function getPlayerWeapon(client) {
|
|||||||
function connectToDatabase() {
|
function connectToDatabase() {
|
||||||
if (getDatabaseConfig().usePersistentConnection) {
|
if (getDatabaseConfig().usePersistentConnection) {
|
||||||
if (persistentDatabaseConnection == null) {
|
if (persistentDatabaseConnection == null) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Database] Initializing database connection ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Database] Initializing database connection ...`);
|
||||||
persistentDatabaseConnection = module.mysql.connect(getDatabaseConfig().host, getDatabaseConfig().user, getDatabaseConfig().pass, getDatabaseConfig().name, getDatabaseConfig().port);
|
persistentDatabaseConnection = module.mysql.connect(getDatabaseConfig().host, getDatabaseConfig().user, getDatabaseConfig().pass, getDatabaseConfig().name, getDatabaseConfig().port);
|
||||||
if (persistentDatabaseConnection.error) {
|
if (persistentDatabaseConnection.error) {
|
||||||
logToConsole(LOG_ERROR, `[VRR.Database] Database connection error: ${persistentDatabaseConnection.error}`);
|
logToConsole(LOG_ERROR, `[AGRP.Database] Database connection error: ${persistentDatabaseConnection.error}`);
|
||||||
persistentDatabaseConnection = null;
|
persistentDatabaseConnection = null;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Database] Database connection successful!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Database] Database connection successful!`);
|
||||||
return persistentDatabaseConnection;
|
return persistentDatabaseConnection;
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Database] Using existing database connection.`);
|
logToConsole(LOG_DEBUG, `[AGRP.Database] Using existing database connection.`);
|
||||||
return persistentDatabaseConnection;
|
return persistentDatabaseConnection;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let databaseConnection = module.mysql.connect(getDatabaseConfig().host, getDatabaseConfig().user, getDatabaseConfig().pass, getDatabaseConfig().name, getDatabaseConfig().port);
|
let databaseConnection = module.mysql.connect(getDatabaseConfig().host, getDatabaseConfig().user, getDatabaseConfig().pass, getDatabaseConfig().name, getDatabaseConfig().port);
|
||||||
if (databaseConnection.error) {
|
if (databaseConnection.error) {
|
||||||
logToConsole(LOG_ERROR, `[VRR.Database] Database connection error: ${persistentDatabaseConnection.error}`);
|
logToConsole(LOG_ERROR, `[AGRP.Database] Database connection error: ${persistentDatabaseConnection.error}`);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return databaseConnection;
|
return databaseConnection;
|
||||||
@@ -866,9 +853,9 @@ function disconnectFromDatabase(dbConnection, force = false) {
|
|||||||
if (!getDatabaseConfig().usePersistentConnection || force == true) {
|
if (!getDatabaseConfig().usePersistentConnection || force == true) {
|
||||||
try {
|
try {
|
||||||
dbConnection.close();
|
dbConnection.close();
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Database] Database connection closed successfully`);
|
logToConsole(LOG_DEBUG, `[AGRP.Database] Database connection closed successfully`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logToConsole(LOG_ERROR, `[VRR.Database] Database connection could not be closed! (Error: ${error})`);
|
logToConsole(LOG_ERROR, `[AGRP.Database] Database connection could not be closed! (Error: ${error})`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -877,7 +864,7 @@ function disconnectFromDatabase(dbConnection, force = false) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function queryDatabase(dbConnection, queryString, useThread = false) {
|
function queryDatabase(dbConnection, queryString, useThread = false) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Database] Query string: ${queryString}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Database] Query string: ${queryString}`);
|
||||||
if (useThread == true) {
|
if (useThread == true) {
|
||||||
Promise.resolve().then(() => {
|
Promise.resolve().then(() => {
|
||||||
let queryResult = dbConnection.query(queryString);
|
let queryResult = dbConnection.query(queryString);
|
||||||
@@ -930,8 +917,18 @@ function freeDatabaseQuery(dbQuery) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function fetchQueryAssoc(dbQuery) {
|
async function fetchQueryAssoc(dbConnection, dbQueryString) {
|
||||||
return dbQuery.fetchAssoc();
|
//logToConsole(LOG_DEBUG, dbQueryString);
|
||||||
|
let dbQuery = dbConnection.query(dbQueryString);
|
||||||
|
let assocArray = [];
|
||||||
|
let dbAssoc = null;
|
||||||
|
|
||||||
|
while (dbAssoc = dbQuery.fetchAssoc()) {
|
||||||
|
assocArray.push(dbAssoc);
|
||||||
|
//logToConsole(LOG_DEBUG | LOG_WARN, dbAssoc["svr_id"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return assocArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -940,19 +937,19 @@ function quickDatabaseQuery(queryString) {
|
|||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
let insertId = 0;
|
let insertId = 0;
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
//logToConsole(LOG_DEBUG, `[VRR.Database] Query string: ${queryString}`);
|
//logToConsole(LOG_DEBUG, `[AGRP.Database] Query string: ${queryString}`);
|
||||||
let dbQuery = queryDatabase(dbConnection, queryString);
|
let dbQuery = queryDatabase(dbConnection, queryString);
|
||||||
if (getDatabaseInsertId(dbConnection)) {
|
if (getDatabaseInsertId(dbConnection)) {
|
||||||
insertId = getDatabaseInsertId(dbConnection);
|
insertId = getDatabaseInsertId(dbConnection);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Database] Query returned insert id ${insertId}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Database] Query returned insert id ${insertId}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dbQuery) {
|
if (dbQuery) {
|
||||||
try {
|
try {
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Database] Query result free'd successfully`);
|
logToConsole(LOG_DEBUG, `[AGRP.Database] Query result free'd successfully`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logToConsole(LOG_ERROR, `[VRR.Database] Query result could not be free'd! (Error: ${error})`);
|
logToConsole(LOG_ERROR, `[AGRP.Database] Query result could not be free'd! (Error: ${error})`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1004,9 +1001,9 @@ function setConstantsAsGlobalVariablesInDatabase() {
|
|||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
let entries = Object.entries(global);
|
let entries = Object.entries(global);
|
||||||
for (let i in entries) {
|
for (let i in entries) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Database] Checking entry ${i} (${entries[i]})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Database] Checking entry ${i} (${entries[i]})`);
|
||||||
if (toString(i).slice(0, 3).indexOf("AGRP_") != -1) {
|
if (toString(i).slice(0, 3).indexOf("AGRP_") != -1) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Database] Adding ${i} (${entries[i]}) to database global variables`);
|
logToConsole(LOG_DEBUG, `[AGRP.Database] Adding ${i} (${entries[i]}) to database global variables`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1128,18 +1125,15 @@ function getClosestCivilian(position) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getVehiclesInRange(position, range) {
|
function getVehiclesInRange(position, range) {
|
||||||
if (!areServerElementsSupported()) {
|
//if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
return getServerData().vehicles.filter(x => getDistance(position, x.syncPosition) <= distance);
|
// return getServerData().vehicles.reduce((i, j) => (getDistance(position, i.syncPosition) <= getDistance(position, j.syncPosition)) ? i : j);
|
||||||
}
|
//}
|
||||||
return getElementsByTypeInRange(ELEMENT_VEHICLE, position, range);
|
return getElementsByTypeInRange(ELEMENT_VEHICLE, position, range);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getClosestVehicle(position) {
|
function getClosestVehicle(position) {
|
||||||
if (!areServerElementsSupported()) {
|
|
||||||
getServerData().vehicles.reduce((i, j) => (getDistance(position, i.syncPosition) <= getDistance(position, j.syncPosition)) ? i : j);
|
|
||||||
}
|
|
||||||
return getClosestElementByType(ELEMENT_VEHICLE, position);
|
return getClosestElementByType(ELEMENT_VEHICLE, position);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1194,7 +1188,7 @@ function setVehicleHealth(vehicle, health) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function givePlayerWeapon(client, weaponId, ammo, active = true) {
|
function givePlayerWeapon(client, weaponId, ammo, active = true) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to give weapon (Weapon: ${weaponId}, Ammo: ${ammo})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to give weapon (Weapon: ${weaponId}, Ammo: ${ammo})`);
|
||||||
sendNetworkEventToPlayer("agrp.giveWeapon", client, weaponId, ammo, active);
|
sendNetworkEventToPlayer("agrp.giveWeapon", client, weaponId, ammo, active);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1231,16 +1225,40 @@ function setElementStreamOutDistance(element, distance) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getElementStreamInDistance(element) {
|
||||||
|
if (!isNull(element) && element != false) {
|
||||||
|
if (typeof element == "Entity") {
|
||||||
|
if (typeof element.streamInDistance != "undefined") {
|
||||||
|
return element.streamInDistance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getElementStreamOutDistance(element) {
|
||||||
|
if (!isNull(element) && element != false) {
|
||||||
|
if (typeof element == "Entity") {
|
||||||
|
if (typeof element.streamOutDistance != "undefined") {
|
||||||
|
return element.streamOutDistance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
function getPlayerPed(client) {
|
function getPlayerPed(client) {
|
||||||
if (isNull(client)) {
|
if (isNull(client)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
//if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
return getPlayerData(client).ped;
|
// return getPlayerData(client).ped;
|
||||||
} else {
|
//} else {
|
||||||
return client.player;
|
return client.player;
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1495,3 +1513,21 @@ function setServerPassword(password) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function shutdownServer() {
|
||||||
|
server.shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getContentsOfTextFile(filePath) {
|
||||||
|
return loadTextFile(filePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setServerRule(ruleName, ruleValue) {
|
||||||
|
server.setRule(ruleName, ruleValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -3,39 +3,14 @@
|
|||||||
// https://github.com/VortrexFTW/agrp_main
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
// (c) 2022 Asshat Gaming
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: connected.js
|
// FILE: ragemp.js
|
||||||
// DESC: Provides wrapped natives for GTA Connected and Mafia Connected mods
|
// DESC: Provides wrapped natives for RAGEMP
|
||||||
// TYPE: Server (JavaScript)
|
// TYPE: Server (JavaScript)
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
var fs = require('fs');
|
||||||
|
|
||||||
let builtInCommands = [
|
let builtInCommands = [
|
||||||
"refresh",
|
|
||||||
"restart",
|
|
||||||
"stop",
|
|
||||||
"start",
|
|
||||||
"reconnect",
|
|
||||||
"setname",
|
|
||||||
"connect",
|
|
||||||
"disconnect",
|
|
||||||
"say",
|
|
||||||
"dumpdoc",
|
|
||||||
];
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
let disconnectReasons = [
|
|
||||||
"Lost Connection",
|
|
||||||
"Disconnected",
|
|
||||||
"Unsupported Client",
|
|
||||||
"Wrong Game",
|
|
||||||
"Incorrect Password",
|
|
||||||
"Unsupported Executable",
|
|
||||||
"Disconnected",
|
|
||||||
"Banned",
|
|
||||||
"Failed",
|
|
||||||
"Invalid Name",
|
|
||||||
"Crashed",
|
|
||||||
"Modified Game"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -760,24 +735,24 @@ function getPlayerWeapon(client) {
|
|||||||
function connectToDatabase() {
|
function connectToDatabase() {
|
||||||
if (getDatabaseConfig().usePersistentConnection) {
|
if (getDatabaseConfig().usePersistentConnection) {
|
||||||
if (persistentDatabaseConnection == null) {
|
if (persistentDatabaseConnection == null) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Database] Initializing database connection ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Database] Initializing database connection ...`);
|
||||||
persistentDatabaseConnection = module.mysql.connect(getDatabaseConfig().host, getDatabaseConfig().user, getDatabaseConfig().pass, getDatabaseConfig().name, getDatabaseConfig().port);
|
persistentDatabaseConnection = module.mysql.connect(getDatabaseConfig().host, getDatabaseConfig().user, getDatabaseConfig().pass, getDatabaseConfig().name, getDatabaseConfig().port);
|
||||||
if (persistentDatabaseConnection.error) {
|
if (persistentDatabaseConnection.error) {
|
||||||
logToConsole(LOG_ERROR, `[VRR.Database] Database connection error: ${persistentDatabaseConnection.error}`);
|
logToConsole(LOG_ERROR, `[AGRP.Database] Database connection error: ${persistentDatabaseConnection.error}`);
|
||||||
persistentDatabaseConnection = null;
|
persistentDatabaseConnection = null;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Database] Database connection successful!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Database] Database connection successful!`);
|
||||||
return persistentDatabaseConnection;
|
return persistentDatabaseConnection;
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Database] Using existing database connection.`);
|
logToConsole(LOG_DEBUG, `[AGRP.Database] Using existing database connection.`);
|
||||||
return persistentDatabaseConnection;
|
return persistentDatabaseConnection;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let databaseConnection = module.mysql.connect(getDatabaseConfig().host, getDatabaseConfig().user, getDatabaseConfig().pass, getDatabaseConfig().name, getDatabaseConfig().port);
|
let databaseConnection = module.mysql.connect(getDatabaseConfig().host, getDatabaseConfig().user, getDatabaseConfig().pass, getDatabaseConfig().name, getDatabaseConfig().port);
|
||||||
if (databaseConnection.error) {
|
if (databaseConnection.error) {
|
||||||
logToConsole(LOG_ERROR, `[VRR.Database] Database connection error: ${persistentDatabaseConnection.error}`);
|
logToConsole(LOG_ERROR, `[AGRP.Database] Database connection error: ${persistentDatabaseConnection.error}`);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return databaseConnection;
|
return databaseConnection;
|
||||||
@@ -791,9 +766,9 @@ function disconnectFromDatabase(dbConnection) {
|
|||||||
if (!getDatabaseConfig().usePersistentConnection) {
|
if (!getDatabaseConfig().usePersistentConnection) {
|
||||||
try {
|
try {
|
||||||
dbConnection.close();
|
dbConnection.close();
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Database] Database connection closed successfully`);
|
logToConsole(LOG_DEBUG, `[AGRP.Database] Database connection closed successfully`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logToConsole(LOG_ERROR, `[VRR.Database] Database connection could not be closed! (Error: ${error})`);
|
logToConsole(LOG_ERROR, `[AGRP.Database] Database connection could not be closed! (Error: ${error})`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -802,7 +777,7 @@ function disconnectFromDatabase(dbConnection) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function queryDatabase(dbConnection, queryString, useThread = false) {
|
function queryDatabase(dbConnection, queryString, useThread = false) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Database] Query string: ${queryString}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Database] Query string: ${queryString}`);
|
||||||
if (useThread == true) {
|
if (useThread == true) {
|
||||||
Promise.resolve().then(() => {
|
Promise.resolve().then(() => {
|
||||||
let queryResult = dbConnection.query(queryString);
|
let queryResult = dbConnection.query(queryString);
|
||||||
@@ -865,19 +840,19 @@ function quickDatabaseQuery(queryString) {
|
|||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
let insertId = 0;
|
let insertId = 0;
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
//logToConsole(LOG_DEBUG, `[VRR.Database] Query string: ${queryString}`);
|
//logToConsole(LOG_DEBUG, `[AGRP.Database] Query string: ${queryString}`);
|
||||||
let dbQuery = queryDatabase(dbConnection, queryString);
|
let dbQuery = queryDatabase(dbConnection, queryString);
|
||||||
if (getDatabaseInsertId(dbConnection)) {
|
if (getDatabaseInsertId(dbConnection)) {
|
||||||
insertId = getDatabaseInsertId(dbConnection);
|
insertId = getDatabaseInsertId(dbConnection);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Database] Query returned insert id ${insertId}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Database] Query returned insert id ${insertId}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dbQuery) {
|
if (dbQuery) {
|
||||||
try {
|
try {
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Database] Query result free'd successfully`);
|
logToConsole(LOG_DEBUG, `[AGRP.Database] Query result free'd successfully`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logToConsole(LOG_ERROR, `[VRR.Database] Query result could not be free'd! (Error: ${error})`);
|
logToConsole(LOG_ERROR, `[AGRP.Database] Query result could not be free'd! (Error: ${error})`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1014,7 +989,7 @@ function setVehicleHealth(vehicle, health) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function givePlayerWeapon(client, weaponId, ammo, active = true) {
|
function givePlayerWeapon(client, weaponId, ammo, active = true) {
|
||||||
//logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to give weapon (Weapon: ${weaponId}, Ammo: ${ammo})`);
|
//logToConsole(LOG_DEBUG, `[AGRP.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to give weapon (Weapon: ${weaponId}, Ammo: ${ammo})`);
|
||||||
//sendNetworkEventToPlayer("agrp.giveWeapon", client, weaponId, ammo, active);
|
//sendNetworkEventToPlayer("agrp.giveWeapon", client, weaponId, ammo, active);
|
||||||
client.giveWeapon(weaponId, ammo);
|
client.giveWeapon(weaponId, ammo);
|
||||||
}
|
}
|
||||||
@@ -1223,36 +1198,35 @@ function bindServerEventHandler(eventName, bindTo, handlerFunction) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setElementName(element, name) {
|
function setElementName(element, name) {
|
||||||
element.name = name;
|
//element.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function hideElementForPlayer(element, client) {
|
function hideElementForPlayer(element, client) {
|
||||||
element.setExistsFor(client, false);
|
//element.setExistsFor(client, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showElementForPlayer(element, client) {
|
function showElementForPlayer(element, client) {
|
||||||
element.setExistsFor(client, true);
|
//element.setExistsFor(client, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setElementShownByDefault(element, state) {
|
function setElementShownByDefault(element, state) {
|
||||||
element.netFlags.defaultExistance = state;
|
//element.netFlags.defaultExistance = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function createAttachedGameBlip(element, type, size, colour = toColour(255, 255, 255, 255)) {
|
function createAttachedGameBlip(element, type, size, colour = toColour(255, 255, 255, 255)) {
|
||||||
if (isGameFeatureSupported("attachedBlip")) {
|
if (isGameFeatureSupported("attachedBlip")) {
|
||||||
return game.createBlipAttachedTo(element, type, size, colour, true, false);
|
// return game.createBlipAttachedTo(element, type, size, colour, true, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1264,7 +1238,11 @@ function deletePlayerPed(client) {
|
|||||||
} else {
|
} else {
|
||||||
sendNetworkEventToPlayer("agrp.deleteLocalPlayerPed", client);
|
sendNetworkEventToPlayer("agrp.deleteLocalPlayerPed", client);
|
||||||
}
|
}
|
||||||
|
//if (areServerElementsSupported()) {
|
||||||
|
// destroyElement(client.player);
|
||||||
|
//} else {
|
||||||
|
// sendNetworkEventToPlayer("agrp.deleteLocalPlayerPed", client);
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1276,13 +1254,31 @@ function isPlayerOnBoat(client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setServerName(name) {
|
function setServerName(name) {
|
||||||
server.name = name;
|
//server.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setServerPassword(password) {
|
function setServerPassword(password) {
|
||||||
server.setPassword(password);
|
//server.setPassword(password);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setServerRule(ruleName, ruleValue) {
|
||||||
|
//server.setRule(ruleName, ruleValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
async function getContentsOfTextFile(filePath) {
|
||||||
|
let fileContents = fs.readFile(filePath, 'utf8', function (err, data) {
|
||||||
|
if (err) {
|
||||||
|
console.error("Could not open file: %s", err);
|
||||||
|
} else {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -9,14 +9,14 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initNetworkEventsScript() {
|
function initNetworkEventsScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.NetEvents]: Initializing network events script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.NetEvents]: Initializing network events script ...");
|
||||||
logToConsole(LOG_INFO, "[VRR.NetEvents]: Network events script initialized!");
|
logToConsole(LOG_INFO, "[AGRP.NetEvents]: Network events script initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function addAllNetworkEventHandlers() {
|
function addAllNetworkEventHandlers() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Client]: Adding network handlers ...");
|
logToConsole(LOG_DEBUG, "[AGRP.Client]: Adding network handlers ...");
|
||||||
|
|
||||||
// KeyBind
|
// KeyBind
|
||||||
addNetworkEventHandler("agrp.useKeyBind", playerUsedKeyBind);
|
addNetworkEventHandler("agrp.useKeyBind", playerUsedKeyBind);
|
||||||
@@ -74,21 +74,20 @@ function addAllNetworkEventHandlers() {
|
|||||||
addNetworkEventHandler("agrp.vehBuyState", receiveVehiclePurchaseStateUpdateFromClient);
|
addNetworkEventHandler("agrp.vehBuyState", receiveVehiclePurchaseStateUpdateFromClient);
|
||||||
addNetworkEventHandler("agrp.playerPedId", receivePlayerPedNetworkId);
|
addNetworkEventHandler("agrp.playerPedId", receivePlayerPedNetworkId);
|
||||||
addNetworkEventHandler("agrp.playerCop", setPlayerAsCopState);
|
addNetworkEventHandler("agrp.playerCop", setPlayerAsCopState);
|
||||||
|
addNetworkEventHandler("agrp.mapLoaded", playerMapLoaded);
|
||||||
addNetworkEventHandler("agrp.vehicleSpawned", vehicleSpawnedByPlayer)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function updatePlayerNameTag(client) {
|
function updatePlayerNameTag(client) {
|
||||||
//logToConsole(LOG_DEBUG, `[VRR.Client] Sending ${getPlayerDisplayForConsole(client)}'s updated nametag to all players`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending ${getPlayerDisplayForConsole(client)}'s updated nametag to all players`);
|
||||||
sendNetworkEventToPlayer("agrp.nametag", null, getPlayerName(client), getPlayerNameForNameTag(client), getPlayerColour(client), getPlayerData(client).afk, getPlayerPing(client));
|
sendNetworkEventToPlayer("agrp.nametag", null, getPlayerName(client), getPlayerNameForNameTag(client), getPlayerColour(client), getPlayerData(client).afk, getPlayerPing(client));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function updateAllPlayerNameTags() {
|
function updateAllPlayerNameTags() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending updated nametags to all players`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending updated nametags to all players`);
|
||||||
let clients = getClients();
|
let clients = getClients();
|
||||||
for (let i in clients) {
|
for (let i in clients) {
|
||||||
updatePlayerNameTag(clients[i]);
|
updatePlayerNameTag(clients[i]);
|
||||||
@@ -98,7 +97,7 @@ function updateAllPlayerNameTags() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function updatePlayerPing(client) {
|
function updatePlayerPing(client) {
|
||||||
//logToConsole(LOG_DEBUG, `[VRR.Client] Sending ${getPlayerDisplayForConsole(client)}'s ping to all players`);
|
//logToConsole(LOG_DEBUG, `[AGRP.Client] Sending ${getPlayerDisplayForConsole(client)}'s ping to all players`);
|
||||||
sendNetworkEventToPlayer("agrp.ping", null, getPlayerName(client), getPlayerPing(client));
|
sendNetworkEventToPlayer("agrp.ping", null, getPlayerName(client), getPlayerPing(client));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,7 +105,7 @@ function updatePlayerPing(client) {
|
|||||||
|
|
||||||
function playerClientReady(client) {
|
function playerClientReady(client) {
|
||||||
playerResourceReady[client.index] = true;
|
playerResourceReady[client.index] = true;
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s client resources are downloaded and ready! Started: ${getYesNoFromBool(playerResourceStarted[client.index])}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)}'s client resources are downloaded and ready! Started: ${getYesNoFromBool(playerResourceStarted[client.index])}`);
|
||||||
if (playerResourceStarted[client.index] == true && playerInitialized[client.index] == false) {
|
if (playerResourceStarted[client.index] == true && playerInitialized[client.index] == false) {
|
||||||
initClient(client);
|
initClient(client);
|
||||||
}
|
}
|
||||||
@@ -116,14 +115,14 @@ function playerClientReady(client) {
|
|||||||
|
|
||||||
function playerGUIReady(client) {
|
function playerGUIReady(client) {
|
||||||
playerGUI[client.index] = true;
|
playerGUI[client.index] = true;
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s client GUI is initialized and ready!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)}'s client GUI is initialized and ready!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function playerClientStarted(client) {
|
function playerClientStarted(client) {
|
||||||
playerResourceStarted[client.index] = true;
|
playerResourceStarted[client.index] = true;
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s client resources are started and running! Ready: ${getYesNoFromBool(playerResourceReady[client.index])}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)}'s client resources are started and running! Ready: ${getYesNoFromBool(playerResourceReady[client.index])}`);
|
||||||
if (playerResourceReady[client.index] == true && playerInitialized[client.index] == false) {
|
if (playerResourceReady[client.index] == true && playerInitialized[client.index] == false) {
|
||||||
initClient(client);
|
initClient(client);
|
||||||
}
|
}
|
||||||
@@ -132,15 +131,21 @@ function playerClientStarted(client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function playerClientStopped(client) {
|
function playerClientStopped(client) {
|
||||||
//logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s client resources have stopped (possibly error?). Kicking them from the server ...`);
|
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.Client] ${getPlayerDisplayForConsole(client)}'s client resources have stopped (possibly error?)`);
|
||||||
//getPlayerData(client).customDisconnectReason = `Kicked - Client script verification failed. Possible hacks.`;
|
getPlayerData(client).customDisconnectReason = "ClientScriptVerificationFail";
|
||||||
//disconnectPlayer(client);
|
//disconnectPlayer(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showSmallGameMessage(client, text, colour, duration, fontName = "Pricedown") {
|
function showSmallGameMessage(client, text, colour, duration, fontName = "Roboto") {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing game message to ${getPlayerDisplayForConsole(client)} (${text}) for ${duration} milliseconds`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing game message to ${getPlayerDisplayForConsole(client)} (${text}) for ${duration} milliseconds`);
|
||||||
|
|
||||||
|
if (getGame() <= AGRP_GAME_GTA_IV_EFLC) {
|
||||||
|
fontName = "Pricedown";
|
||||||
|
} else {
|
||||||
|
fontName = "AuroraBdCnBT";
|
||||||
|
}
|
||||||
sendNetworkEventToPlayer("agrp.smallGameMessage", client, text, colour, duration, fontName);
|
sendNetworkEventToPlayer("agrp.smallGameMessage", client, text, colour, duration, fontName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,7 +156,7 @@ function enableCityAmbienceForPlayer(client, clearElements = false) {
|
|||||||
// return false;
|
// return false;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s city ambience to ${toUpperCase(getOnOffFromBool(false))}`);
|
//logToConsole(LOG_DEBUG, `[AGRP.Client] Setting ${getPlayerDisplayForConsole(client)}'s city ambience to ${toUpperCase(getOnOffFromBool(false))}`);
|
||||||
//sendNetworkEventToPlayer("agrp.ambience", client, true);
|
//sendNetworkEventToPlayer("agrp.ambience", client, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,21 +167,21 @@ function disableCityAmbienceForPlayer(client, clearElements = false) {
|
|||||||
// return false;
|
// return false;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s city ambience to ${toUpperCase(getOnOffFromBool(false))}`);
|
//logToConsole(LOG_DEBUG, `[AGRP.Client] Setting ${getPlayerDisplayForConsole(client)}'s city ambience to ${toUpperCase(getOnOffFromBool(false))}`);
|
||||||
//sendNetworkEventToPlayer("agrp.ambience", client, false, clearElements);
|
//sendNetworkEventToPlayer("agrp.ambience", client, false, clearElements);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function clearPlayerOwnedPeds(client) {
|
function clearPlayerOwnedPeds(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Clearing peds owned by ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Clearing peds owned by ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.clearPeds", client);
|
sendNetworkEventToPlayer("agrp.clearPeds", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function updatePlayerSpawnedState(client, state) {
|
function updatePlayerSpawnedState(client, state) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s spawned state ${toUpperCase(getOnOffFromBool(state))}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Setting ${getPlayerDisplayForConsole(client)}'s spawned state ${toUpperCase(getOnOffFromBool(state))}`);
|
||||||
getPlayerData(client).spawned = true;
|
getPlayerData(client).spawned = true;
|
||||||
sendNetworkEventToPlayer("agrp.spawned", client, state);
|
sendNetworkEventToPlayer("agrp.spawned", client, state);
|
||||||
}
|
}
|
||||||
@@ -184,21 +189,21 @@ function updatePlayerSpawnedState(client, state) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setPlayerControlState(client, state) {
|
function setPlayerControlState(client, state) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s control state ${toUpperCase(getOnOffFromBool(state))}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Setting ${getPlayerDisplayForConsole(client)}'s control state ${toUpperCase(getOnOffFromBool(state))}`);
|
||||||
sendNetworkEventToPlayer("agrp.control", client, state, !state);
|
sendNetworkEventToPlayer("agrp.control", client, state, !state);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function updatePlayerShowLogoState(client, state) {
|
function updatePlayerShowLogoState(client, state) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s logo state ${toUpperCase(getOnOffFromBool(state))}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Setting ${getPlayerDisplayForConsole(client)}'s logo state ${toUpperCase(getOnOffFromBool(state))}`);
|
||||||
sendNetworkEventToPlayer("agrp.logo", client, state);
|
sendNetworkEventToPlayer("agrp.logo", client, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function restorePlayerCamera(client) {
|
function restorePlayerCamera(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Restoring ${getPlayerDisplayForConsole(client)}'s camera`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Restoring ${getPlayerDisplayForConsole(client)}'s camera`);
|
||||||
sendNetworkEventToPlayer("agrp.restoreCamera", client);
|
sendNetworkEventToPlayer("agrp.restoreCamera", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,23 +216,23 @@ function setPlayer2DRendering(client, hudState = false, labelState = false, smal
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function syncPlayerProperties(client) {
|
function syncPlayerProperties(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to sync ${getPlayerDisplayForConsole(client)}'s player ped properties`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending signal to sync ${getPlayerDisplayForConsole(client)}'s player ped properties`);
|
||||||
sendNetworkEventToPlayer("agrp.syncElement", null, getPlayerPed(client).id);
|
sendNetworkEventToPlayer("agrp.syncElement", null, getPlayerPed(client).id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function updatePlayerSnowState(client) {
|
function updatePlayerSnowState(client, forceGroundSnow = false) {
|
||||||
if (isSnowSupported(getGame())) {
|
if (isSnowSupported(getGame())) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s snow state (Falling: ${toUpperCase(getOnOffFromBool(getServerConfig().fallingSnow))}, Ground: ${toUpperCase(getOnOffFromBool(getServerConfig().groundSnow))})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Setting ${getPlayerDisplayForConsole(client)}'s snow state (Falling: ${toUpperCase(getOnOffFromBool(getServerConfig().fallingSnow))}, Ground: ${toUpperCase(getOnOffFromBool(getServerConfig().groundSnow))})`);
|
||||||
sendNetworkEventToPlayer("agrp.snow", client, getServerConfig().fallingSnow, getServerConfig().groundSnow);
|
sendNetworkEventToPlayer("agrp.snow", client, getServerConfig().fallingSnow, getServerConfig().groundSnow, forceGroundSnow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function updatePlayerHotBar(client) {
|
function updatePlayerHotBar(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending updated hotbar data to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending updated hotbar data to ${getPlayerDisplayForConsole(client)}`);
|
||||||
let tempHotBarItems = [];
|
let tempHotBarItems = [];
|
||||||
for (let i in getPlayerData(client).hotBarItems) {
|
for (let i in getPlayerData(client).hotBarItems) {
|
||||||
let itemImage = "";
|
let itemImage = "";
|
||||||
@@ -250,14 +255,14 @@ function updatePlayerHotBar(client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setPlayerWeaponDamageEnabled(client, state) {
|
function setPlayerWeaponDamageEnabled(client, state) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending weapon damage state for ${getPlayerDisplayForConsole(client)} to all players`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending weapon damage state for ${getPlayerDisplayForConsole(client)} to all players`);
|
||||||
sendNetworkEventToPlayer("agrp.weaponDamageEnabled", null, getPlayerName(client), state);
|
sendNetworkEventToPlayer("agrp.weaponDamageEnabled", null, getPlayerName(client), state);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setPlayerWeaponDamageEvent(client, eventType) {
|
function setPlayerWeaponDamageEvent(client, eventType) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending weapon damage event (${eventType}) for ${getPlayerDisplayForConsole(client)} to all players`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending weapon damage event (${eventType}) for ${getPlayerDisplayForConsole(client)} to all players`);
|
||||||
sendNetworkEventToPlayer("agrp.weaponDamageEvent", null, getPlayerName(client), eventType);
|
sendNetworkEventToPlayer("agrp.weaponDamageEvent", null, getPlayerName(client), eventType);
|
||||||
getPlayerData(client).weaponDamageEvent = eventType;
|
getPlayerData(client).weaponDamageEvent = eventType;
|
||||||
}
|
}
|
||||||
@@ -265,259 +270,259 @@ function setPlayerWeaponDamageEvent(client, eventType) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendJobRouteLocationToPlayer(client, position, colour) {
|
function sendJobRouteLocationToPlayer(client, position, colour) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending job route location data to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending job route location data to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.showJobRouteLocation", client, position, colour);
|
sendNetworkEventToPlayer("agrp.showJobRouteLocation", client, position, colour);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showPlayerLoginSuccessGUI(client) {
|
function showPlayerLoginSuccessGUI(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending login success GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending login success GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.loginSuccess", client);
|
sendNetworkEventToPlayer("agrp.loginSuccess", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showPlayerLoginFailedGUI(client, errorMessage) {
|
function showPlayerLoginFailedGUI(client, errorMessage) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending login failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending login failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.loginFailed", client, errorMessage);
|
sendNetworkEventToPlayer("agrp.loginFailed", client, errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showPlayerRegistrationSuccessGUI(client) {
|
function showPlayerRegistrationSuccessGUI(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending registration success GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending registration success GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.registrationSuccess", client);
|
sendNetworkEventToPlayer("agrp.registrationSuccess", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showPlayerRegistrationFailedGUI(client, errorMessage) {
|
function showPlayerRegistrationFailedGUI(client, errorMessage) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending registration failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending registration failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.registrationFailed", client, errorMessage);
|
sendNetworkEventToPlayer("agrp.registrationFailed", client, errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendPlayerGUIColours(client) {
|
function sendPlayerGUIColours(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending GUI colours to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending GUI colours to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.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]);
|
sendNetworkEventToPlayer("agrp.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) {
|
function sendPlayerGUIInit(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending GUI init signal to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending GUI init signal to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.guiInit", client);
|
sendNetworkEventToPlayer("agrp.guiInit", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showPlayerLoginGUI(client, errorMessage = "") {
|
function showPlayerLoginGUI(client, errorMessage = "") {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending show login GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show login GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.showLogin", client);
|
sendNetworkEventToPlayer("agrp.showLogin", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showPlayerRegistrationGUI(client, errorMessage = "") {
|
function showPlayerRegistrationGUI(client, errorMessage = "") {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending show registration GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show registration GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.showRegistration", client);
|
sendNetworkEventToPlayer("agrp.showRegistration", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showPlayerNewCharacterGUI(client) {
|
function showPlayerNewCharacterGUI(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending show new character GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show new character GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.showNewCharacter", client);
|
sendNetworkEventToPlayer("agrp.showNewCharacter", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showPlayerChangePasswordGUI(client, errorMessage = "") {
|
function showPlayerChangePasswordGUI(client, errorMessage = "") {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending show change password GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show change password GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.showChangePassword", client, errorMessage);
|
sendNetworkEventToPlayer("agrp.showChangePassword", client, errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showPlayerResetPasswordCodeInputGUI(client) {
|
function showPlayerResetPasswordCodeInputGUI(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending show reset password code input GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show reset password code input GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.showResetPasswordCodeInput", client);
|
sendNetworkEventToPlayer("agrp.showResetPasswordCodeInput", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showPlayerResetPasswordEmailInputGUI(client) {
|
function showPlayerResetPasswordEmailInputGUI(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending show reset password email input GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show reset password email input GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.showResetPasswordEmailInput", client);
|
sendNetworkEventToPlayer("agrp.showResetPasswordEmailInput", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showPlayerCharacterSelectGUI(client, firstName, lastName, cash, clan, lastPlayed, skin) {
|
function showPlayerCharacterSelectGUI(client, firstName, lastName, cash, clan, lastPlayed, skin) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending character select GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending character select GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.showCharacterSelect", client, firstName, lastName, cash, clan, lastPlayed, skin);
|
sendNetworkEventToPlayer("agrp.showCharacterSelect", client, firstName, lastName, cash, clan, lastPlayed, skin);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function updatePlayerCharacterSelectGUI(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)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending update character select GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.switchCharacterSelect", client, firstName, lastName, cash, clan, lastPlayed, skin);
|
sendNetworkEventToPlayer("agrp.switchCharacterSelect", client, firstName, lastName, cash, clan, lastPlayed, skin);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showPlayerCharacterSelectSuccessGUI(client) {
|
function showPlayerCharacterSelectSuccessGUI(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending character select success GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending character select success GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.characterSelectSuccess", client);
|
sendNetworkEventToPlayer("agrp.characterSelectSuccess", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showPlayerCharacterSelectFailedGUI(client) {
|
function showPlayerCharacterSelectFailedGUI(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending character select failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending character select failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.characterSelectFailed", client);
|
sendNetworkEventToPlayer("agrp.characterSelectFailed", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showPlayerPromptGUI(client, promptMessage, promptTitle, yesButtonText = "Yes", noButtonText = "No") {
|
function showPlayerPromptGUI(client, promptMessage, promptTitle, yesButtonText = "Yes", noButtonText = "No") {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending show prompt GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${promptTitle}, Message: ${promptMessage}, YesButton: ${yesButtonText}, NoButton: ${noButtonText})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show prompt GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${promptTitle}, Message: ${promptMessage}, YesButton: ${yesButtonText}, NoButton: ${noButtonText})`);
|
||||||
sendNetworkEventToPlayer("agrp.showPrompt", client, promptMessage, promptTitle, yesButtonText, noButtonText);
|
sendNetworkEventToPlayer("agrp.showPrompt", client, promptMessage, promptTitle, yesButtonText, noButtonText);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showPlayerInfoGUI(client, infoMessage, infoTitle, buttonText = "OK") {
|
function showPlayerInfoGUI(client, infoMessage, infoTitle, buttonText = "OK") {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending show info GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${infoTitle}, Message: ${infoMessage})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show info GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${infoTitle}, Message: ${infoMessage})`);
|
||||||
sendNetworkEventToPlayer("agrp.showInfo", client, infoMessage, infoTitle, buttonText);
|
sendNetworkEventToPlayer("agrp.showInfo", client, infoMessage, infoTitle, buttonText);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showPlayerErrorGUI(client, errorMessage, errorTitle, buttonText = "OK") {
|
function showPlayerErrorGUI(client, errorMessage, errorTitle, buttonText = "OK") {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending show error GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${errorTitle}, Message: ${errorMessage})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show error GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${errorTitle}, Message: ${errorMessage})`);
|
||||||
sendNetworkEventToPlayer("agrp.showError", client, errorMessage, errorTitle, buttonText);
|
sendNetworkEventToPlayer("agrp.showError", client, errorMessage, errorTitle, buttonText);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendRunCodeToClient(client, code, returnTo) {
|
function sendRunCodeToClient(client, code, returnTo) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending runcode to ${getPlayerDisplayForConsole(client)} (returnTo: ${getPlayerDisplayForConsole(getClientFromIndex(returnTo))}, Code: ${code})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending runcode to ${getPlayerDisplayForConsole(client)} (returnTo: ${getPlayerDisplayForConsole(getClientFromIndex(returnTo))}, Code: ${code})`);
|
||||||
sendNetworkEventToPlayer("agrp.runCode", client, code, getPlayerId(returnTo));
|
sendNetworkEventToPlayer("agrp.runCode", client, code, getPlayerId(returnTo));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendPlayerWorkingState(client, state) {
|
function sendPlayerWorkingState(client, state) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending working state (${toUpperCase(getYesNoFromBool(state))}) to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending working state (${toUpperCase(getYesNoFromBool(state))}) to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.working", client, state);
|
sendNetworkEventToPlayer("agrp.working", client, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendPlayerJobType(client, jobType) {
|
function sendPlayerJobType(client, jobType) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending job type (${jobType}) to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending job type (${jobType}) to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.jobType", client, jobType);
|
sendNetworkEventToPlayer("agrp.jobType", client, jobType);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendPlayerStopJobRoute(client) {
|
function sendPlayerStopJobRoute(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to abort job route to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending signal to abort job route to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.hideJobRouteLocation", client);
|
sendNetworkEventToPlayer("agrp.hideJobRouteLocation", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendPlayerMouseCameraToggle(client) {
|
function sendPlayerMouseCameraToggle(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to toggle mouse camera ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending signal to toggle mouse camera ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.mouseCamera", client);
|
sendNetworkEventToPlayer("agrp.mouseCamera", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setPlayerMouseCameraState(client, state) {
|
function setPlayerMouseCameraState(client, state) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to toggle mouse camera ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending signal to toggle mouse camera ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.mouseCameraForce", client, state);
|
sendNetworkEventToPlayer("agrp.mouseCameraForce", client, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendPlayerMouseCursorToggle(client) {
|
function sendPlayerMouseCursorToggle(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to toggle mouse cursor ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending signal to toggle mouse cursor ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.mouseCursor", client);
|
sendNetworkEventToPlayer("agrp.mouseCursor", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendAddAccountKeyBindToClient(client, key, keyState) {
|
function sendAddAccountKeyBindToClient(client, key, keyState) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending added keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))}, State: ${(keyState) ? "down" : "up"})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending added keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))}, State: ${(keyState) ? "down" : "up"})`);
|
||||||
sendNetworkEventToPlayer("agrp.addKeyBind", client, toInteger(key), (keyState) ? KEYSTATE_DOWN : KEYSTATE_UP);
|
sendNetworkEventToPlayer("agrp.addKeyBind", client, toInteger(key), (keyState) ? KEYSTATE_DOWN : KEYSTATE_UP);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendClearKeyBindsToClient(client, key, keyState) {
|
function sendClearKeyBindsToClient(client, key, keyState) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending added keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))}, State: ${(keyState) ? "down" : "up"})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending added keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))}, State: ${(keyState) ? "down" : "up"})`);
|
||||||
sendNetworkEventToPlayer("agrp.clearKeyBinds", client);
|
sendNetworkEventToPlayer("agrp.clearKeyBinds", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendRemoveAccountKeyBindToClient(client, key) {
|
function sendRemoveAccountKeyBindToClient(client, key) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending deleted keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending deleted keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))})`);
|
||||||
sendNetworkEventToPlayer("agrp.delKeyBind", client, toInteger(key));
|
sendNetworkEventToPlayer("agrp.delKeyBind", client, toInteger(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendPlayerSetPosition(client, position) {
|
function sendPlayerSetPosition(client, position) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending set position signal to ${getPlayerDisplayForConsole(client)} (Position: ${position.x}, ${position.y}, ${position.z})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending set position signal to ${getPlayerDisplayForConsole(client)} (Position: ${position.x}, ${position.y}, ${position.z})`);
|
||||||
sendNetworkEventToPlayer("agrp.position", client, position);
|
sendNetworkEventToPlayer("agrp.position", client, position);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendPlayerSetHeading(client, heading) {
|
function sendPlayerSetHeading(client, heading) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending set heading signal to ${getPlayerDisplayForConsole(client)} (Heading: ${heading})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending set heading signal to ${getPlayerDisplayForConsole(client)} (Heading: ${heading})`);
|
||||||
sendNetworkEventToPlayer("agrp.heading", client, heading);
|
sendNetworkEventToPlayer("agrp.heading", client, heading);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendPlayerSetInterior(client, interior) {
|
function sendPlayerSetInterior(client, interior) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending set interior signal to ${getPlayerDisplayForConsole(client)} (Interior: ${interior})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending set interior signal to ${getPlayerDisplayForConsole(client)} (Interior: ${interior})`);
|
||||||
sendNetworkEventToPlayer("agrp.interior", client, interior);
|
sendNetworkEventToPlayer("agrp.interior", client, interior);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendPlayerFrozenState(client, state) {
|
function sendPlayerFrozenState(client, state) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending set frozen signal to ${getPlayerDisplayForConsole(client)} (State: ${toUpperCase(getYesNoFromBool(state))})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending set frozen signal to ${getPlayerDisplayForConsole(client)} (State: ${toUpperCase(getYesNoFromBool(state))})`);
|
||||||
sendNetworkEventToPlayer("agrp.frozen", client, state);
|
sendNetworkEventToPlayer("agrp.frozen", client, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function clearPlayerWeapons(client, clearData = true) {
|
function clearPlayerWeapons(client, clearData = true) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to clear weapons`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to clear weapons`);
|
||||||
sendNetworkEventToPlayer("agrp.clearWeapons", client, clearData);
|
sendNetworkEventToPlayer("agrp.clearWeapons", client, clearData);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showPlayerNewCharacterFailedGUI(client, errorMessage) {
|
function showPlayerNewCharacterFailedGUI(client, errorMessage) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending new character failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending new character failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.newCharacterFailed", client, errorMessage);
|
sendNetworkEventToPlayer("agrp.newCharacterFailed", client, errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendPlayerRemoveFromVehicle(client) {
|
function sendPlayerRemoveFromVehicle(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending remove from vehicle signal to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending remove from vehicle signal to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.removeFromVehicle", client);
|
sendNetworkEventToPlayer("agrp.removeFromVehicle", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -535,10 +540,10 @@ function showPlayerItemTakeDelay(client, itemId) {
|
|||||||
if (getItemData(itemId)) {
|
if (getItemData(itemId)) {
|
||||||
let delay = getItemTypeData(getItemData(itemId).itemTypeIndex).pickupDelay;
|
let delay = getItemTypeData(getItemData(itemId).itemTypeIndex).pickupDelay;
|
||||||
if (delay > 0) {
|
if (delay > 0) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item TAKE delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item TAKE delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
||||||
sendNetworkEventToPlayer("agrp.showItemActionDelay", client, delay);
|
sendNetworkEventToPlayer("agrp.showItemActionDelay", client, delay);
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item TAKE delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item TAKE delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||||
playerItemActionDelayComplete(client);
|
playerItemActionDelayComplete(client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -550,10 +555,10 @@ function showPlayerItemUseDelay(client, itemSlot) {
|
|||||||
if (getItemData(getPlayerData(client).hotBarItems[itemSlot])) {
|
if (getItemData(getPlayerData(client).hotBarItems[itemSlot])) {
|
||||||
let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).useDelay;
|
let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).useDelay;
|
||||||
if (delay > 0) {
|
if (delay > 0) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item USE delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item USE delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
||||||
sendNetworkEventToPlayer("agrp.showItemActionDelay", client, delay);
|
sendNetworkEventToPlayer("agrp.showItemActionDelay", client, delay);
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item USE delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item USE delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||||
playerItemActionDelayComplete(client);
|
playerItemActionDelayComplete(client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -565,10 +570,10 @@ function showPlayerItemDropDelay(client, itemSlot) {
|
|||||||
if (getItemData(getPlayerData(client).hotBarItems[itemSlot])) {
|
if (getItemData(getPlayerData(client).hotBarItems[itemSlot])) {
|
||||||
let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).dropDelay;
|
let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).dropDelay;
|
||||||
if (delay > 0) {
|
if (delay > 0) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item DROP delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item DROP delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
||||||
sendNetworkEventToPlayer("agrp.showItemActionDelay", client, delay);
|
sendNetworkEventToPlayer("agrp.showItemActionDelay", client, delay);
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item DROP delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item DROP delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||||
playerItemActionDelayComplete(client);
|
playerItemActionDelayComplete(client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -580,10 +585,10 @@ function showPlayerItemPickupDelay(client, itemId) {
|
|||||||
if (getItemData(itemId)) {
|
if (getItemData(itemId)) {
|
||||||
let delay = getItemTypeData(getItemData(itemId).itemTypeIndex).pickupDelay;
|
let delay = getItemTypeData(getItemData(itemId).itemTypeIndex).pickupDelay;
|
||||||
if (delay > 0) {
|
if (delay > 0) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PICKUP delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item PICKUP delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
||||||
sendNetworkEventToPlayer("agrp.showItemActionDelay", client, delay);
|
sendNetworkEventToPlayer("agrp.showItemActionDelay", client, delay);
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PICKUP delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item PICKUP delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||||
playerItemActionDelayComplete(client);
|
playerItemActionDelayComplete(client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -595,10 +600,10 @@ function showPlayerItemPutDelay(client, itemSlot) {
|
|||||||
if (getItemData(getPlayerData(client).hotBarItems[itemSlot])) {
|
if (getItemData(getPlayerData(client).hotBarItems[itemSlot])) {
|
||||||
let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).putDelay;
|
let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).putDelay;
|
||||||
if (delay > 0) {
|
if (delay > 0) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PUT delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item PUT delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
||||||
sendNetworkEventToPlayer("agrp.showItemActionDelay", client, delay);
|
sendNetworkEventToPlayer("agrp.showItemActionDelay", client, delay);
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PUT delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item PUT delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||||
playerItemActionDelayComplete(client);
|
playerItemActionDelayComplete(client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -611,18 +616,18 @@ function showPlayerItemSwitchDelay(client, itemSlot) {
|
|||||||
if (getPlayerData(client).hotBarItems[itemSlot] != -1) {
|
if (getPlayerData(client).hotBarItems[itemSlot] != -1) {
|
||||||
let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).switchDelay;
|
let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).switchDelay;
|
||||||
if (delay > 0) {
|
if (delay > 0) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
||||||
sendNetworkEventToPlayer("agrp.showItemActionDelay", client, delay);
|
sendNetworkEventToPlayer("agrp.showItemActionDelay", client, delay);
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||||
playerItemActionDelayComplete(client);
|
playerItemActionDelayComplete(client);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||||
playerItemActionDelayComplete(client);
|
playerItemActionDelayComplete(client);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||||
playerSwitchItem(client, itemSlot);
|
playerSwitchItem(client, itemSlot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -630,14 +635,14 @@ function showPlayerItemSwitchDelay(client, itemSlot) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendPlayerDrunkEffect(client, amount, duration) {
|
function sendPlayerDrunkEffect(client, amount, duration) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Setting drunk effect for ${getPlayerDisplayForConsole(client)} to ${amount} for ${duration} milliseconds`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Setting drunk effect for ${getPlayerDisplayForConsole(client)} to ${amount} for ${duration} milliseconds`);
|
||||||
sendNetworkEventToPlayer("agrp.drunkEffect", client, amount, duration);
|
sendNetworkEventToPlayer("agrp.drunkEffect", client, amount, duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendPlayerClearPedState(client) {
|
function sendPlayerClearPedState(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Clearing ped state for ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Clearing ped state for ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendNetworkEventToPlayer("agrp.clearPedState", client);
|
sendNetworkEventToPlayer("agrp.clearPedState", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -647,29 +652,29 @@ function playerDamagedByPlayer(client, damagerEntityName, weaponId, pedPiece, he
|
|||||||
let damagerEntity = getPlayerFromParams(damagerEntityName);
|
let damagerEntity = getPlayerFromParams(damagerEntityName);
|
||||||
|
|
||||||
if (isNull(damagerEntity)) {
|
if (isNull(damagerEntity)) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager entity from ID is null`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)}'s damager entity from ID is null`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)} was damaged by ${damagerEntity}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)} was damaged by ${damagerEntity}`);
|
||||||
|
|
||||||
if (isNull(damagerEntity)) {
|
if (isNull(damagerEntity)) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager client is INVALID`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)}'s damager client is INVALID`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!getPlayerData(damagerEntity) || !getPlayerData(client)) {
|
if (!getPlayerData(damagerEntity) || !getPlayerData(client)) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager's client data is INVALID`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)}'s damager's client data is INVALID`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager is ${getPlayerDisplayForConsole(damagerEntity)}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)}'s damager is ${getPlayerDisplayForConsole(damagerEntity)}`);
|
||||||
|
|
||||||
switch (getPlayerData(damagerEntity).weaponDamageEvent) {
|
switch (getPlayerData(damagerEntity).weaponDamageEvent) {
|
||||||
case AGRP_WEAPON_DAMAGE_EVENT_TAZER:
|
case AGRP_WEAPON_DAMAGE_EVENT_TAZER:
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} is using a tazer`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} is using a tazer`);
|
||||||
if (!isPlayerTazed(client) && !isPlayerHandCuffed(client) && !isPlayerInAnyVehicle(client)) {
|
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`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)} was not previously tazed, binded, or in a vehicle. Taze successful`);
|
||||||
meActionToNearbyPlayers(damagerEntity, `electrifies ${getCharacterFullName(client)} with their tazer`);
|
meActionToNearbyPlayers(damagerEntity, `electrifies ${getCharacterFullName(client)} with their tazer`);
|
||||||
tazePlayer(client);
|
tazePlayer(client);
|
||||||
}
|
}
|
||||||
@@ -682,10 +687,10 @@ function playerDamagedByPlayer(client, damagerEntityName, weaponId, pedPiece, he
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case AGRP_WEAPON_DAMAGE_EVENT_NORMAL:
|
case AGRP_WEAPON_DAMAGE_EVENT_NORMAL:
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} caused ${healthLoss} damage (damage reduction makes it ${(healthLoss * getPlayerData(client).incomingDamageMultiplier)})`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} caused ${healthLoss} damage (damage reduction makes it ${(healthLoss * getPlayerData(client).incomingDamageMultiplier)})`);
|
||||||
let remainingDamage = healthLoss * getPlayerData(client).incomingDamageMultiplier;
|
let remainingDamage = healthLoss * getPlayerData(client).incomingDamageMultiplier;
|
||||||
if (getPlayerArmour(client) > 0) {
|
if (getPlayerArmour(client) > 0) {
|
||||||
//logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s armour was ${getPlayerArmour(client)}, so it was reduced by ${healthLoss}`);
|
//logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)}'s armour was ${getPlayerArmour(client)}, so it was reduced by ${healthLoss}`);
|
||||||
if (getPlayerArmour(client) - remainingDamage < 0) {
|
if (getPlayerArmour(client) - remainingDamage < 0) {
|
||||||
setPlayerArmour(client, 0);
|
setPlayerArmour(client, 0);
|
||||||
remainingDamage = remainingDamage - getPlayerArmour(client);
|
remainingDamage = remainingDamage - getPlayerArmour(client);
|
||||||
@@ -697,7 +702,7 @@ function playerDamagedByPlayer(client, damagerEntityName, weaponId, pedPiece, he
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} caused ${healthLoss} damage (damage reduction makes it ${(healthLoss * getPlayerData(client).incomingDamageMultiplier)})`);
|
logToConsole(LOG_DEBUG, `[AGRP.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));
|
setPlayerHealth(client, getPlayerHealth(client) - (healthLoss * getPlayerData(client).incomingDamageMultiplier));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -957,21 +962,21 @@ function sendPlayerChatAutoHideDelay(client, delay) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function playRadioStreamForPlayer(client, streamURL, loop = true, volume = 0, element = false) {
|
function playRadioStreamForPlayer(client, streamURL, loop = true, volume = 0, element = false) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Forcing ${getPlayerDisplayForConsole(client)} to stream ${streamURL}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Forcing ${getPlayerDisplayForConsole(client)} to stream ${streamURL}`);
|
||||||
sendNetworkEventToPlayer("agrp.radioStream", client, streamURL, loop, volume, element);
|
sendNetworkEventToPlayer("agrp.radioStream", client, streamURL, loop, volume, element);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function playAudioFileForPlayer(client, audioName, loop = true, volume = 0, element = false) {
|
function playAudioFileForPlayer(client, audioName, loop = true, volume = 0, element = false) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Forcing ${getPlayerDisplayForConsole(client)} to play audio ${audioName}`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Forcing ${getPlayerDisplayForConsole(client)} to play audio ${audioName}`);
|
||||||
sendNetworkEventToPlayer("agrp.audioFileStream", client, audioName, loop, volume);
|
sendNetworkEventToPlayer("agrp.audioFileStream", client, audioName, loop, volume);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function stopRadioStreamForPlayer(client) {
|
function stopRadioStreamForPlayer(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Forcing ${getPlayerDisplayForConsole(client)} to stop their radio stream`);
|
logToConsole(LOG_DEBUG, `[AGRP.Client] Forcing ${getPlayerDisplayForConsole(client)} to stop their radio stream`);
|
||||||
sendNetworkEventToPlayer("agrp.stopRadioStream", client);
|
sendNetworkEventToPlayer("agrp.stopRadioStream", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1098,25 +1103,25 @@ function setPlayerInfiniteRun(client, state) {
|
|||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
function sendBusinessToPlayer(client, businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems) {
|
function sendBusinessToPlayer(client, businessId, name, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked, hasItems) {
|
||||||
sendNetworkEventToPlayer("agrp.business", client, businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems);
|
sendNetworkEventToPlayer("agrp.business", client, businessId, name, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked, hasItems);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
function sendHouseToPlayer(client, houseId, description, entrancePosition, blipModel, pickupModel, hasInterior) {
|
function sendHouseToPlayer(client, houseId, description, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked) {
|
||||||
sendNetworkEventToPlayer("agrp.house", client, houseId, description, entrancePosition, blipModel, pickupModel, hasInterior);
|
sendNetworkEventToPlayer("agrp.house", client, houseId, description, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
function sendJobToPlayer(client, jobId, jobLocationId, name, position) {
|
function sendJobToPlayer(client, jobId, jobLocationId, name, position, blipModel, pickupModel) {
|
||||||
sendNetworkEventToPlayer("agrp.job", client, jobId, jobLocationId, name, position);
|
sendNetworkEventToPlayer("agrp.job", client, jobId, jobLocationId, name, position);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
function sendVehicleToPlayer(client, vehicleId, networkId, model, position, heading, colour1, colour2, colour3, colour4) {
|
function sendVehicleToPlayer(client, vehicleId, model, position, heading, colour1, colour2, colour3, colour4) {
|
||||||
sendNetworkEventToPlayer("agrp.vehicle", client, vehicleId, model, position, heading, colour1, colour2, colour3, colour4);
|
sendNetworkEventToPlayer("agrp.vehicle", client, vehicleId, model, position, heading, colour1, colour2, colour3, colour4);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1125,7 +1130,7 @@ function sendVehicleToPlayer(client, vehicleId, networkId, model, position, head
|
|||||||
function sendAllBusinessesToPlayer(client) {
|
function sendAllBusinessesToPlayer(client) {
|
||||||
let businesses = getServerData().businesses;
|
let businesses = getServerData().businesses;
|
||||||
for (let i in 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);
|
sendBusinessToPlayer(client, businesses[i].index, businesses[i].name, businesses[i].entrancePosition, businesses[i].entranceBlipModel, businesses[i].entrancePickupModel, businesses[i].buyPrice, businesses[i].rentPrice, businesses[i].hasInterior, doesBusinessHaveAnyItemsToBuy(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1134,7 +1139,7 @@ function sendAllBusinessesToPlayer(client) {
|
|||||||
function sendAllHousesToPlayer(client) {
|
function sendAllHousesToPlayer(client) {
|
||||||
let houses = getServerData().houses;
|
let houses = getServerData().houses;
|
||||||
for (let i in houses) {
|
for (let i in houses) {
|
||||||
sendHouseToPlayer(client, houses[i].index, houses[i].entrancePosition, houses[i].entranceBlipModel, houses[i].entrancePickupModel, houses[i].hasInterior);
|
sendHouseToPlayer(client, houses[i].index, houses[i].entrancePosition, houses[i].entranceBlipModel, houses[i].entrancePickupModel, houses[i].buyPrice, houses[i].rentPrice, houses[i].hasInterior);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1144,7 +1149,7 @@ function sendAllJobsToPlayer(client) {
|
|||||||
let jobs = getServerData().jobs;
|
let jobs = getServerData().jobs;
|
||||||
for (let i in jobs) {
|
for (let i in jobs) {
|
||||||
for (let j in jobs[i].locations) {
|
for (let j in jobs[i].locations) {
|
||||||
sendJobToPlayer(client, jobs[i].index, jobs[i].locations[j].index, jobs[i].name, jobs[i].locations[j].position, jobs[i].blipModel);
|
sendJobToPlayer(client, jobs[i].index, jobs[i].locations[j].index, jobs[i].name, jobs[i].locations[j].position, jobs[i].pickupModel, jobs[i].blipModel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1154,7 +1159,7 @@ function sendAllJobsToPlayer(client) {
|
|||||||
function sendAllVehiclesToPlayer(client) {
|
function sendAllVehiclesToPlayer(client) {
|
||||||
let vehicles = getServerData().vehicles;
|
let vehicles = getServerData().vehicles;
|
||||||
for (let i in vehicles) {
|
for (let i in vehicles) {
|
||||||
sendVehicleToPlayer(client, vehicles[i].index, vehicles[i].ivNetworkId, vehicles[i].model, vehicles[i].syncPosition, vehicles[i].syncHeading, vehicles[i].colour1, vehicles[i].colour2, vehicles[i].colour3, vehicles[i].colour4);
|
sendVehicleToPlayer(client, vehicles[i].index, vehicles[i].model, vehicles[i].syncPosition, vehicles[i].syncHeading, vehicles[i].colour1, vehicles[i].colour2, vehicles[i].colour3, vehicles[i].colour4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1178,9 +1183,9 @@ function requestPlayerPedNetworkId(client) {
|
|||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
function setPlayerInCutsceneInterior(client, cutsceneName) {
|
function setPlayerScene(client, sceneName) {
|
||||||
getPlayerData(client).interiorCutscene = cutsceneName;
|
getPlayerData(client).scene = sceneName;
|
||||||
sendNetworkEventToPlayer("agrp.cutsceneInterior", client, cutsceneName);
|
sendNetworkEventToPlayer("agrp.scene", client, sceneName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
@@ -1278,3 +1283,44 @@ function showSingleParticleEffect(position, particleEffectId, strength = 1.0, du
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
|
function sendPlayerCurrencyString(client) {
|
||||||
|
sendNetworkEventToPlayer("agrp.currencyString", client, getGlobalConfig().economy.currencyString);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==========================================================================
|
||||||
|
|
||||||
|
function sendMapChangeWarningToPlayer(client, changingToNight) {
|
||||||
|
sendNetworkEventToPlayer("agrp.mapChangingSoon", client, changingToNight);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==========================================================================
|
||||||
|
|
||||||
|
function playerMapLoaded(client, mapName) {
|
||||||
|
//updateAllInteriorVehiclesForPlayer(client, propertyData.exitInterior, propertyData.exitDimension);
|
||||||
|
getPlayerData(client).scene = mapName;
|
||||||
|
|
||||||
|
setTimeout(function () {
|
||||||
|
processPlayerEnteringExitingProperty(client);
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==========================================================================
|
||||||
|
|
||||||
|
function setMapChangeWarningForPlayer(client, isChanging) {
|
||||||
|
sendNetworkEventToPlayer("agrp.mapChangeWarning", client, isChanging);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==========================================================================
|
||||||
|
|
||||||
|
function fadePlayerCamera(client, fadeIn, time, colour = toColour(0, 0, 0, 255)) {
|
||||||
|
sendNetworkEventToPlayer("agrp.fadeCamera", client, fadeIn, time, colour);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==========================================================================
|
||||||
|
|
||||||
|
function sendClientVariablesToClient(client) {
|
||||||
|
sendNetworkEventToPlayer("agrp.cvar", client, JSON.stringify(clientVariables));
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==========================================================================
|
||||||
@@ -45,6 +45,7 @@ class NPCData {
|
|||||||
this.scale = toVector3(1.0, 1.0, 1.0);
|
this.scale = toVector3(1.0, 1.0, 1.0);
|
||||||
this.heading = 0.0;
|
this.heading = 0.0;
|
||||||
this.clan = 0;
|
this.clan = 0;
|
||||||
|
this.rank = 0;
|
||||||
this.isWorking = false;
|
this.isWorking = false;
|
||||||
this.jobUniform = this.skin;
|
this.jobUniform = this.skin;
|
||||||
this.lastJobVehicle = null;
|
this.lastJobVehicle = null;
|
||||||
@@ -65,6 +66,7 @@ class NPCData {
|
|||||||
this.animationName = "";
|
this.animationName = "";
|
||||||
this.ownerType = AGRP_NPC_OWNER_NONE;
|
this.ownerType = AGRP_NPC_OWNER_NONE;
|
||||||
this.ownerId = 0;
|
this.ownerId = 0;
|
||||||
|
this.enabled = false;
|
||||||
|
|
||||||
this.bodyParts = {
|
this.bodyParts = {
|
||||||
hair: [0, 0],
|
hair: [0, 0],
|
||||||
@@ -98,21 +100,22 @@ class NPCData {
|
|||||||
this.rotation = toVector3(toFloat(dbAssoc["npc_rot_x"]), toFloat(dbAssoc["npc_rot_y"]), toFloat(dbAssoc["npc_rot_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.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.heading = toFloat(dbAssoc["npc_rot_z"]);
|
||||||
this.lastLogin = toInteger(dbAssoc["npc_when_lastlogin"]);
|
|
||||||
this.rank = toInteger(dbAssoc["npc_rank"]);
|
this.rank = toInteger(dbAssoc["npc_rank"]);
|
||||||
this.title = toInteger(dbAssoc["npc_title"]);
|
this.title = toInteger(dbAssoc["npc_title"]);
|
||||||
this.job = toInteger(dbAssoc["npc_job"]);
|
this.job = toInteger(dbAssoc["npc_job"]);
|
||||||
this.interior = toInteger(dbAssoc["npc_int"]);
|
this.interior = toInteger(dbAssoc["npc_int"]);
|
||||||
this.dimension = toInteger(dbAssoc["npc_vw"]);
|
this.dimension = toInteger(dbAssoc["npc_vw"]);
|
||||||
this.walkStyle = toInteger(dbAssoc["npc_walkstyle"]);
|
this.walkStyle = toInteger(dbAssoc["npc_walk_style"]);
|
||||||
this.fightStyle = toInteger(dbAssoc["npc_fightstyle"]);
|
this.fightStyle = toInteger(dbAssoc["npc_fight_style"]);
|
||||||
this.health = toInteger(dbAssoc["npc_health"]);
|
this.health = toInteger(dbAssoc["npc_health"]);
|
||||||
this.armour = toInteger(dbAssoc["npc_armour"]);
|
this.armour = toInteger(dbAssoc["npc_armour"]);
|
||||||
this.typeFlags = toInteger(dbAssoc["npc_type_flags"]);
|
this.typeFlags = toInteger(dbAssoc["npc_type_flags"]);
|
||||||
this.heedThreats = intToBool(dbAssoc["npc_headthreats"]);
|
this.heedThreats = intToBool(dbAssoc["npc_headthreats"]);
|
||||||
this.threats = toInteger(dbAssoc["npc_threats"]);
|
this.threats = toInteger(dbAssoc["npc_threats"]);
|
||||||
this.invincible = intToBool(dbAssoc["npc_invincible"]);
|
this.invincible = intToBool(dbAssoc["npc_invincible"]);
|
||||||
this.animationName = intToBool(dbAssoc["npc_animation"]);
|
this.animationName = toString(dbAssoc["npc_animation"]);
|
||||||
|
this.enabled = intToBool(dbAssoc["npc_enabled"]);
|
||||||
|
this.lookAtPlayer = intToBool(dbAssoc["npc_lookatplr"]);
|
||||||
|
|
||||||
this.bodyParts = {
|
this.bodyParts = {
|
||||||
hair: [toInteger(dbAssoc["npc_hd_part_hair_model"]) || 0, toInteger(dbAssoc["npc_hd_part_hair_texture"]) || 0],
|
hair: [toInteger(dbAssoc["npc_hd_part_hair_model"]) || 0, toInteger(dbAssoc["npc_hd_part_hair_texture"]) || 0],
|
||||||
@@ -203,8 +206,8 @@ class NPCTriggerResponseData {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initNPCScript() {
|
function initNPCScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.NPC]: Initializing NPC script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.NPC]: Initializing NPC script ...");
|
||||||
logToConsole(LOG_INFO, "[VRR.NPC]: NPC script initialized successfully!");
|
logToConsole(LOG_INFO, "[AGRP.NPC]: NPC script initialized successfully!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -243,100 +246,92 @@ function createNPCCommand(command, params, client) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadNPCsFromDatabase() {
|
async function loadNPCsFromDatabase() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.NPC]: Loading NPCs from database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.NPC]: Loading NPCs from database ...`);
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
let tempNPCs = [];
|
let tempNPCs = [];
|
||||||
let dbAssoc;
|
let dbAssoc;
|
||||||
|
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let dbQueryString = `SELECT * FROM npc_main WHERE npc_server = ${getServerId()} AND npc_enabled = 1`;
|
let dbQueryString = `SELECT * FROM npc_main WHERE npc_server = ${getServerId()} AND npc_enabled = 1`;
|
||||||
let dbQuery = queryDatabase(dbConnection, dbQueryString);
|
dbAssoc = await fetchQueryAssoc(dbConnection, dbQueryString);
|
||||||
if (dbQuery) {
|
for (let i in dbAssoc) {
|
||||||
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
let tempNPCData = new NPCData(dbAssoc[i]);
|
||||||
let tempNPCData = new NPCData(dbAssoc);
|
tempNPCData.triggers = loadNPCTriggersFromDatabase();
|
||||||
tempNPCData.triggers = loadNPCTriggersFromDatabase(tempNPCData.databaseId);
|
|
||||||
tempNPCs.push(tempNPCData);
|
tempNPCs.push(tempNPCData);
|
||||||
}
|
}
|
||||||
freeDatabaseQuery(dbQuery);
|
|
||||||
}
|
|
||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.NPC]: ${tempNPCs.length} NPCs loaded from database successfully!`);
|
logToConsole(LOG_DEBUG, `[AGRP.NPC]: ${tempNPCs.length} NPCs loaded from database successfully!`);
|
||||||
return tempNPCs;
|
return tempNPCs;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadNPCTriggersFromDatabase(npcDatabaseId) {
|
async function loadNPCTriggersFromDatabase(npcDatabaseId) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.NPC]: Loading NPC triggers for NPC ${npcDatabaseId} from database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.NPC]: Loading NPC triggers for NPC ${npcDatabaseId} from database ...`);
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
let tempNPCTriggers = [];
|
let tempNPCTriggers = [];
|
||||||
let dbAssoc;
|
let dbAssoc;
|
||||||
|
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let dbQueryString = `SELECT * FROM npc_trig WHERE npc_trig_npc = ${npcDatabaseId} AND npc_trig_enabled = 1`;
|
let dbQueryString = `SELECT * FROM npc_trig WHERE npc_trig_npc = ${npcDatabaseId} AND npc_trig_enabled = 1`;
|
||||||
let dbQuery = queryDatabase(dbConnection, dbQueryString);
|
dbAssoc = await fetchQueryAssoc(dbConnection, dbQueryString);
|
||||||
if (dbQuery) {
|
for (let i in dbAssoc) {
|
||||||
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
let tempNPCTriggerData = new NPCTriggerData(dbAssoc[i]);
|
||||||
let tempNPCTriggerData = new NPCTriggerData(dbAssoc);
|
|
||||||
tempNPCTriggerData.conditions = loadNPCTriggerConditionsFromDatabase(tempNPCTriggerData.databaseId);
|
tempNPCTriggerData.conditions = loadNPCTriggerConditionsFromDatabase(tempNPCTriggerData.databaseId);
|
||||||
tempNPCTriggerData.responses = loadNPCTriggerResponsesFromDatabase(tempNPCTriggerData.databaseId);
|
tempNPCTriggerData.responses = loadNPCTriggerResponsesFromDatabase(tempNPCTriggerData.databaseId);
|
||||||
tempNPCTriggers.push(tempNPCTriggerData);
|
tempNPCTriggers.push(tempNPCTriggerData);
|
||||||
}
|
}
|
||||||
freeDatabaseQuery(dbQuery);
|
|
||||||
}
|
|
||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.NPC]: ${tempNPCTriggers.length} NPC triggers loaded for NPC ${npcDatabaseId} from database successfully!`);
|
logToConsole(LOG_DEBUG, `[AGRP.NPC]: ${tempNPCTriggers.length} NPC triggers loaded for NPC ${npcDatabaseId} from database successfully!`);
|
||||||
return tempNPCTriggers;
|
return tempNPCTriggers;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadNPCTriggerConditionsFromDatabase(npcTriggerDatabaseId) {
|
async function loadNPCTriggerConditionsFromDatabase(npcTriggerDatabaseId) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.NPC]: Loading NPC trigger conditions for trigger ${npcTriggerDatabaseId} from database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.NPC]: Loading NPC trigger conditions for trigger ${npcTriggerDatabaseId} from database ...`);
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
let tempNPCTriggerConditions = [];
|
let tempNPCTriggerConditions = [];
|
||||||
let dbAssoc;
|
let dbAssoc;
|
||||||
|
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let dbQueryString = `SELECT * FROM npc_cond WHERE npc_cond_trig = ${npcTriggerDatabaseId} AND npc_cond_enabled = 1`;
|
let dbQueryString = `SELECT * FROM npc_cond WHERE npc_cond_trig = ${npcTriggerDatabaseId} AND npc_cond_enabled = 1`;
|
||||||
let dbQuery = queryDatabase(dbConnection, dbQueryString);
|
dbAssoc = await fetchQueryAssoc(dbConnection, dbQueryString);
|
||||||
if (dbQuery) {
|
for (let i in dbAssoc) {
|
||||||
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
let tempNPCTriggerConditionData = new NPCTriggerConditionData(dbAssoc[i]);
|
||||||
let tempNPCTriggerConditionData = new NPCTriggerConditionData(dbAssoc);
|
|
||||||
tempNPCTriggerConditions.push(tempNPCTriggerConditionData);
|
tempNPCTriggerConditions.push(tempNPCTriggerConditionData);
|
||||||
}
|
}
|
||||||
freeDatabaseQuery(dbQuery);
|
|
||||||
}
|
|
||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.NPC]: ${tempNPCTriggerConditions.length} conditions loaded for trigger ${npcTriggerDatabaseId} from database successfully!`);
|
logToConsole(LOG_DEBUG, `[AGRP.NPC]: ${tempNPCTriggerConditions.length} conditions loaded for trigger ${npcTriggerDatabaseId} from database successfully!`);
|
||||||
return tempNPCTriggerConditions;
|
return tempNPCTriggerConditions;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadNPCTriggerResponsesFromDatabase(npcTriggerDatabaseId) {
|
async function loadNPCTriggerResponsesFromDatabase(npcTriggerDatabaseId) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.NPC]: Loading NPC trigger responses for trigger ${npcTriggerDatabaseId} from database ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.NPC]: Loading NPC trigger responses for trigger ${npcTriggerDatabaseId} from database ...`);
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
let tempNPCTriggerResponses = [];
|
let tempNPCTriggerResponses = [];
|
||||||
let dbAssoc;
|
let dbAssoc;
|
||||||
|
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let dbQueryString = `SELECT * FROM npc_resp WHERE npc_resp_trig = ${npcTriggerDatabaseId} AND npc_resp_enabled = 1`;
|
let dbQueryString = `SELECT * FROM npc_resp WHERE npc_resp_trig = ${npcTriggerDatabaseId} AND npc_resp_enabled = 1`;
|
||||||
let dbQuery = queryDatabase(dbConnection, dbQueryString);
|
dbAssoc = await fetchQueryAssoc(dbConnection, dbQueryString);
|
||||||
if (dbQuery) {
|
for (let i in dbAssoc) {
|
||||||
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
let tempNPCTriggerResponseData = new NPCTriggerResponseData(dbAssoc[i]);
|
||||||
let tempNPCTriggerResponseData = new NPCTriggerResponseData(dbAssoc);
|
|
||||||
tempNPCTriggerResponses.push(tempNPCTriggerResponseData);
|
tempNPCTriggerResponses.push(tempNPCTriggerResponseData);
|
||||||
}
|
}
|
||||||
freeDatabaseQuery(dbQuery);
|
|
||||||
}
|
|
||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.NPC]: ${tempNPCTriggerResponses.length} responses loaded for trigger ${npcTriggerDatabaseId} from database successfully!`);
|
logToConsole(LOG_DEBUG, `[AGRP.NPC]: ${tempNPCTriggerResponses.length} responses loaded for trigger ${npcTriggerDatabaseId} from database successfully!`);
|
||||||
return tempNPCTriggerResponses;
|
return tempNPCTriggerResponses;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -356,28 +351,28 @@ function saveAllNPCsToDatabase() {
|
|||||||
|
|
||||||
function saveNPCToDatabase(npcDataId) {
|
function saveNPCToDatabase(npcDataId) {
|
||||||
if (getServerConfig().devServer) {
|
if (getServerConfig().devServer) {
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.NPC]: NPC ${npcDataId} can't be saved because server is running as developer only. Aborting save ...`);
|
logToConsole(LOG_VERBOSE, `[AGRP.NPC]: NPC ${npcDataId} can't be saved because server is running as developer only. Aborting save ...`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getNPCData(npcDataId) == false) {
|
if (getNPCData(npcDataId) == false) {
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.NPC]: NPC ${npcDataId} data is invalid. Aborting save ...`);
|
logToConsole(LOG_VERBOSE, `[AGRP.NPC]: NPC ${npcDataId} data is invalid. Aborting save ...`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let tempNPCData = getNPCData(npcDataId);
|
let tempNPCData = getNPCData(npcDataId);
|
||||||
|
|
||||||
if (tempNPCData.databaseId == -1) {
|
if (tempNPCData.databaseId == -1) {
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.NPC]: NPC ${npcDataId} is a temp NPC. Aborting save ...`);
|
logToConsole(LOG_VERBOSE, `[AGRP.NPC]: NPC ${npcDataId} is a temp NPC. Aborting save ...`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!tempNPCData.needsSaved) {
|
if (!tempNPCData.needsSaved) {
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.NPC]: NPC ${npcDataId} hasn't changed data. Aborting save ...`);
|
logToConsole(LOG_VERBOSE, `[AGRP.NPC]: NPC ${npcDataId} hasn't changed data. Aborting save ...`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.NPC]: Saving NPC ${tempNPCData.databaseId} to database ...`);
|
logToConsole(LOG_VERBOSE, `[AGRP.NPC]: Saving NPC ${tempNPCData.databaseId} to database ...`);
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
if (tempNPCData.ped != false) {
|
if (tempNPCData.ped != false) {
|
||||||
@@ -394,6 +389,7 @@ function saveNPCToDatabase(npcDataId) {
|
|||||||
|
|
||||||
let safeAnimationName = escapeDatabaseString(dbConnection, tempNPCData.animationName);
|
let safeAnimationName = escapeDatabaseString(dbConnection, tempNPCData.animationName);
|
||||||
let safeName = escapeDatabaseString(dbConnection, tempNPCData.name);
|
let safeName = escapeDatabaseString(dbConnection, tempNPCData.name);
|
||||||
|
let safeTitle = escapeDatabaseString(dbConnection, tempNPCData.title);
|
||||||
|
|
||||||
let data = [
|
let data = [
|
||||||
["npc_server", getServerId()],
|
["npc_server", getServerId()],
|
||||||
@@ -416,6 +412,15 @@ function saveNPCToDatabase(npcDataId) {
|
|||||||
["npc_threats", toInteger(tempNPCData.threats)],
|
["npc_threats", toInteger(tempNPCData.threats)],
|
||||||
["npc_stay", boolToInt(tempNPCData.stay)],
|
["npc_stay", boolToInt(tempNPCData.stay)],
|
||||||
["npc_type_flags", toInteger(tempNPCData.typeFlags)],
|
["npc_type_flags", toInteger(tempNPCData.typeFlags)],
|
||||||
|
["npc_int", toInteger(tempNPCData.interior)],
|
||||||
|
["npc_vw", toInteger(tempNPCData.dimension)],
|
||||||
|
["npc_fight_style", toInteger(tempNPCData.fightStyle)],
|
||||||
|
["npc_walk_style", toInteger(tempNPCData.walkStyle)],
|
||||||
|
["npc_rank", toInteger(tempNPCData.rank)],
|
||||||
|
["npc_title", toString(safeTitle)],
|
||||||
|
["npc_enabled", boolToInt(tempNPCData.enabled)],
|
||||||
|
["npc_lookatplr", boolToInt(tempNPCData.lookAtPlayer)],
|
||||||
|
//["npc_recreate", toInteger(tempNPCData.recreateOnDeath)],
|
||||||
];
|
];
|
||||||
|
|
||||||
let dbQuery = null;
|
let dbQuery = null;
|
||||||
@@ -434,7 +439,7 @@ function saveNPCToDatabase(npcDataId) {
|
|||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.NPC]: Saved NPC ${npcDataId} to database!`);
|
logToConsole(LOG_VERBOSE, `[AGRP.NPC]: Saved NPC ${npcDataId} to database!`);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -502,7 +507,7 @@ function deleteNPCCommand(command, params, client) {
|
|||||||
let npcName = getNPCData(closestNPC).name;
|
let npcName = getNPCData(closestNPC).name;
|
||||||
|
|
||||||
deleteNPC(closestNPC);
|
deleteNPC(closestNPC);
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} deleted NPC {npcPink}${npcName}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} deleted NPC {npcPink}${npcName}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -512,7 +517,7 @@ function deleteNPC(npcId) {
|
|||||||
|
|
||||||
if (getNPCData(npcId)) {
|
if (getNPCData(npcId)) {
|
||||||
if (getNPCData(npcId).ped != false) {
|
if (getNPCData(npcId).ped != false) {
|
||||||
deleteEntity(getNPCData(npcId).ped);
|
deleteGameElement(getNPCData(npcId).ped);
|
||||||
}
|
}
|
||||||
getServerData().npcs.splice(npcId, 1);
|
getServerData().npcs.splice(npcId, 1);
|
||||||
}
|
}
|
||||||
@@ -606,7 +611,7 @@ function setNPCClanCommand(command, params, client) {
|
|||||||
getNPCData(closestNPC).ownerId = getClanData(clanId).databaseId;
|
getNPCData(closestNPC).ownerId = getClanData(clanId).databaseId;
|
||||||
getNPCData(closestNPC).needsSaved = true;
|
getNPCData(closestNPC).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set {npcPink}${getNPCData(closestNPC).name}${MAINCOLOUR}'s clan to {clanOrange}${getClanData(clanId).name}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set {npcPink}${getNPCData(closestNPC).name}${MAINCOLOUR}'s clan to {clanOrange}${getClanData(clanId).name}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -618,25 +623,11 @@ function addNPCTriggerCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let closestNPC = getClosestNPC(getPlayerPosition(client), getPlayerDimension(client), getPlayerInterior(client));
|
let closestNPC = getClosestNPC(getPlayerPosition(client), getPlayerDimension(client), getPlayerInterior(client));
|
||||||
let clanId = getClanFromParams(params);
|
|
||||||
|
|
||||||
if (!getNPCData(closestNPC)) {
|
if (!getNPCData(closestNPC)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidNPC"));
|
messagePlayerError(client, getLocaleString(client, "InvalidNPC"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!getClanData(clanId)) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidClan"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//let triggerData = new TriggerData();
|
|
||||||
|
|
||||||
getNPCData(closestNPC).ownerType = AGRP_NPC_OWNER_CLAN;
|
|
||||||
getNPCData(closestNPC).ownerId = getClanData(clanId).databaseId;
|
|
||||||
getNPCData(closestNPC).needsSaved = true;
|
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set {npcPink}${getNPCData(closestNPC).name}${MAINCOLOUR}'s clan to {clanOrange}${getClanData(clanId).name}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -664,7 +655,7 @@ function getNPCInfoCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let closestNPC = getClosestNPC(getPlayerPosition(client));
|
let closestNPC = getClosestNPC(getPlayerPosition(client), getPlayerDimension(client), getPlayerInterior(client));
|
||||||
|
|
||||||
if (!getNPCData(closestNPC)) {
|
if (!getNPCData(closestNPC)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidNPC"));
|
messagePlayerError(client, getLocaleString(client, "InvalidNPC"));
|
||||||
@@ -724,15 +715,17 @@ function getNPCInfoCommand(command, params, client) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getClosestNPC(position, interior, dimension) {
|
function getClosestNPC(position, dimension, interior) {
|
||||||
let npcs = getServerData().npcs;
|
let npcs = getServerData().npcs;
|
||||||
|
|
||||||
let closest = 0;
|
let closest = 0;
|
||||||
for (let i in npcs) {
|
for (let i in npcs) {
|
||||||
if (getDistance(npcs[i].ped.position, position) < getDistance(npcs[closest].ped.position, position) && npcs[closest].interior == interior && npcs[closest].dimension == dimension) {
|
if (npcs[i].interior == interior && npcs[i].dimension == dimension) {
|
||||||
|
if (getDistance(npcs[i].ped.position, position) < getDistance(npcs[closest].ped.position, position)) {
|
||||||
closest = i;
|
closest = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return closest;
|
return closest;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,14 +50,18 @@ let paintBallItemNames = {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initPaintBallScript() {
|
function initPaintBallScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.PaintBall]: Initializing paintball script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.PaintBall]: Initializing paintball script ...");
|
||||||
logToConsole(LOG_DEBUG, "[VRR.PaintBall]: Paintball script initialized successfully!");
|
logToConsole(LOG_DEBUG, "[AGRP.PaintBall]: Paintball script initialized successfully!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function startPaintBall(client) {
|
function startPaintBall(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.PaintBall]: Starting paintball for ${getPlayerDisplayForConsole(client)} ...`);
|
if (isPlayerInPaintBall(client)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.PaintBall]: Starting paintball for ${getPlayerDisplayForConsole(client)} ...`);
|
||||||
if (isPlayerWorking(client)) {
|
if (isPlayerWorking(client)) {
|
||||||
stopWorking(client);
|
stopWorking(client);
|
||||||
}
|
}
|
||||||
@@ -67,25 +71,62 @@ function startPaintBall(client) {
|
|||||||
|
|
||||||
getPlayerData(client).inPaintBall = true;
|
getPlayerData(client).inPaintBall = true;
|
||||||
getPlayerData(client).paintBallBusiness = getPlayerBusiness(client);
|
getPlayerData(client).paintBallBusiness = getPlayerBusiness(client);
|
||||||
|
getPlayerData(client).paintBallKills = 0;
|
||||||
|
getPlayerData(client).paintBallDeaths = 0;
|
||||||
|
getBusinessData(getPlayerData(client).paintBallBusiness).paintBallPlayers.push(client.index);
|
||||||
|
getBusinessData(getPlayerData(client).paintBallBusiness).paintBallPot += getBusinessData(getPlayerData(client).paintBallBusiness).entranceFee * 2;
|
||||||
|
|
||||||
givePlayerPaintBallItems(client);
|
givePlayerPaintBallItems(client);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.PaintBall]: Started paintball for ${getPlayerDisplayForConsole(client)} successfully`);
|
|
||||||
|
messagePlayerAlert(client, getLocaleString(client, "JoinedPaintBall"));
|
||||||
|
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.PaintBall]: Started paintball for ${getPlayerDisplayForConsole(client)} successfully`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function stopPaintBall(client) {
|
function stopPaintBall(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.PaintBall]: Stopping paintball for ${getPlayerDisplayForConsole(client)} ...`);
|
if (!isPlayerInPaintBall(client)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.PaintBall]: Stopping paintball for ${getPlayerDisplayForConsole(client)} ...`);
|
||||||
clearPlayerWeapons(client);
|
clearPlayerWeapons(client);
|
||||||
deletePaintBallItems(client);
|
deletePaintBallItems(client);
|
||||||
restorePlayerTempLockerItems(client);
|
restorePlayerTempLockerItems(client);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.PaintBall]: Stopped paintball for ${getPlayerDisplayForConsole(client)} successfully`);
|
|
||||||
|
let tempBusiness = getPlayerData(client).paintBallBusiness;
|
||||||
|
|
||||||
|
messagePlayerAlert(client, getLocaleString(client, "LeftPaintBall"));
|
||||||
|
|
||||||
|
getBusinessData(tempBusiness).paintBallPlayers.splice(getBusinessData(tempBusiness).paintBallPlayers.indexOf(client.index), 1);
|
||||||
|
|
||||||
|
if (getBusinessData(tempBusiness).paintBallPlayers.length == 0) {
|
||||||
|
messagePlayerAlert(client, getLocaleString(client, "PaintBallEnded"));
|
||||||
|
messagePlayerInfo(client, getLocaleString(client, "YourPaintBallResults", getPlayerData(client).paintBallKills, getPlayerData(client).paintBallDeaths));
|
||||||
|
|
||||||
|
//messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderEventWinners")));
|
||||||
|
//messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderEventWinners")));
|
||||||
|
|
||||||
|
givePlayerCash(client, getBusinessData(tempBusiness).paintBallPot);
|
||||||
|
getBusinessData(tempBusiness).paintBallPot = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
getPlayerData(client).inPaintBall = false;
|
||||||
|
getPlayerData(client).paintBallBusiness = false;
|
||||||
|
getPlayerData(client).tempLockerType = AGRP_TEMP_LOCKER_TYPE_NONE;
|
||||||
|
getPlayerData(client).paintBallKills = 0;
|
||||||
|
getPlayerData(client).paintBallDeaths = 0;
|
||||||
|
|
||||||
|
//checkRemainingPaintBallPlayers(tempBusiness);
|
||||||
|
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.PaintBall]: Stopped paintball for ${getPlayerDisplayForConsole(client)} successfully`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function givePlayerPaintBallItems(client) {
|
function givePlayerPaintBallItems(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.PaintBall]: Giving ${getPlayerDisplayForConsole(client)} paintball items ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.PaintBall]: Giving ${getPlayerDisplayForConsole(client)} paintball items ...`);
|
||||||
for (let i in paintBallItems) {
|
for (let i in paintBallItems) {
|
||||||
let itemId = createItem(paintBallItems[i], 999999, AGRP_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId);
|
let itemId = createItem(paintBallItems[i], 999999, AGRP_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId);
|
||||||
getItemData(itemId).needsSaved = false;
|
getItemData(itemId).needsSaved = false;
|
||||||
@@ -95,26 +136,26 @@ function givePlayerPaintBallItems(client) {
|
|||||||
getPlayerData(client).paintBallItemCache.push(itemId);
|
getPlayerData(client).paintBallItemCache.push(itemId);
|
||||||
updatePlayerHotBar(client);
|
updatePlayerHotBar(client);
|
||||||
}
|
}
|
||||||
logToConsole(LOG_DEBUG, `[VRR.PaintBall]: Gave ${getPlayerDisplayForConsole(client)} paintball items successfully`);
|
logToConsole(LOG_DEBUG, `[AGRP.PaintBall]: Gave ${getPlayerDisplayForConsole(client)} paintball items successfully`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function deletePaintBallItems(client) {
|
function deletePaintBallItems(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.PaintBall]: Deleting paintball items for ${getPlayerDisplayForConsole(client)} ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.PaintBall]: Deleting paintball items for ${getPlayerDisplayForConsole(client)} ...`);
|
||||||
for (let i in getPlayerData(client).paintBallItemCache) {
|
for (let i in getPlayerData(client).paintBallItemCache) {
|
||||||
deleteItem(getPlayerData(client).paintBallItemCache[i]);
|
deleteItem(getPlayerData(client).paintBallItemCache[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
cachePlayerHotBarItems(client);
|
cachePlayerHotBarItems(client);
|
||||||
updatePlayerHotBar(client);
|
updatePlayerHotBar(client);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.PaintBall]: Deleting paintball items for ${getPlayerDisplayForConsole(client)} successfully`);
|
logToConsole(LOG_DEBUG, `[AGRP.PaintBall]: Deleting paintball items for ${getPlayerDisplayForConsole(client)} successfully`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function cacheAllPaintBallItemTypes() {
|
function cacheAllPaintBallItemTypes() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.PaintBall]: Cacheing all paintball item types ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.PaintBall]: Cacheing all paintball item types ...`);
|
||||||
for (let i in paintBallItemNames[getGame()]) {
|
for (let i in paintBallItemNames[getGame()]) {
|
||||||
let itemTypeId = getItemTypeFromParams(paintBallItemNames[getGame()][i]);
|
let itemTypeId = getItemTypeFromParams(paintBallItemNames[getGame()][i]);
|
||||||
if (itemTypeId != -1 && getItemTypeData(itemTypeId) != false) {
|
if (itemTypeId != -1 && getItemTypeData(itemTypeId) != false) {
|
||||||
@@ -122,13 +163,13 @@ function cacheAllPaintBallItemTypes() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.PaintBall]: Cached all paintball item types`);
|
logToConsole(LOG_DEBUG, `[AGRP.PaintBall]: Cached all paintball item types`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function respawnPlayerForPaintBall(client) {
|
function respawnPlayerForPaintBall(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.PaintBall]: Respawning ${getPlayerDisplayForConsole(client)} for paintball ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.PaintBall]: Respawning ${getPlayerDisplayForConsole(client)} for paintball ...`);
|
||||||
despawnPlayer(client);
|
despawnPlayer(client);
|
||||||
|
|
||||||
let businessId = getPlayerData(client).paintBallBusiness;
|
let businessId = getPlayerData(client).paintBallBusiness;
|
||||||
@@ -143,7 +184,7 @@ function respawnPlayerForPaintBall(client) {
|
|||||||
makePlayerStopAnimation(client);
|
makePlayerStopAnimation(client);
|
||||||
setPlayerControlState(client, true);
|
setPlayerControlState(client, true);
|
||||||
resetPlayerBlip(client);
|
resetPlayerBlip(client);
|
||||||
logToConsole(LOG_DEBUG, `[VRR.PaintBall]: Respawned ${getPlayerDisplayForConsole(client)} for paintball successfully`);
|
logToConsole(LOG_DEBUG, `[AGRP.PaintBall]: Respawned ${getPlayerDisplayForConsole(client)} for paintball successfully`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -153,3 +194,11 @@ function isPlayerInPaintBall(client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function checkRemainingPaintBallPlayers(businessIndex) {
|
||||||
|
//if (getBusinessData(businessIndex).paintBallPlayers.length == 0) {
|
||||||
|
//
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
300
scripts/server/prompt.js
Normal file
300
scripts/server/prompt.js
Normal file
@@ -0,0 +1,300 @@
|
|||||||
|
// ===========================================================================
|
||||||
|
// Asshat Gaming Roleplay
|
||||||
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
|
// ===========================================================================
|
||||||
|
// FILE: prompt.js
|
||||||
|
// DESC: Provides prompt (yes/no confirmations) functions and usage
|
||||||
|
// TYPE: Server (JavaScript)
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
// Prompts (used for prompt responses)
|
||||||
|
const AGRP_PROMPT_NONE = 0;
|
||||||
|
const AGRP_PROMPT_CREATEFIRSTCHAR = 1;
|
||||||
|
const AGRP_PROMPT_BIZORDER = 2;
|
||||||
|
const AGRP_PROMPT_GIVEVEHTOCLAN = 3;
|
||||||
|
const AGRP_PROMPT_GIVEBIZTOCLAN = 4;
|
||||||
|
const AGRP_PROMPT_GIVEHOUSETOCLAN = 5;
|
||||||
|
const AGRP_PROMPT_BUYBIZ = 6;
|
||||||
|
const AGRP_PROMPT_BUYHOUSE = 7;
|
||||||
|
const AGRP_PROMPT_RESETKEYBINDS = 8;
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function initPromptScript() {
|
||||||
|
logToConsole(LOG_INFO, "[AGRP.Prompt]: Initializing Prompt script ...");
|
||||||
|
logToConsole(LOG_INFO, "[AGRP.Prompt]: Prompt script initialized successfully!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function playerPromptAnswerNo(client) {
|
||||||
|
if (getPlayerData(client).promptType == AGRP_PROMPT_NONE) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Prompt] ${getPlayerDisplayForConsole(client)} answered NO to their prompt (${getPlayerData(client).promptType})`);
|
||||||
|
|
||||||
|
switch (getPlayerData(client).promptType) {
|
||||||
|
case AGRP_PROMPT_CREATEFIRSTCHAR:
|
||||||
|
logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} chose not to create a first character. Kicking them from the server ...`);
|
||||||
|
showPlayerErrorGUI(client, getLocaleString(client, "DidNotCreateCharacter"), getLocaleString(client, getLocaleString(client, "GUIWarningTitle")));
|
||||||
|
getPlayerData(targetClient).customDisconnectReason = "FailedToCreateCharacter";
|
||||||
|
setTimeout(function () { disconnectPlayer(client); }, 5000);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case AGRP_PROMPT_BIZORDER:
|
||||||
|
if (getPlayerData(client).businessOrderAmount > 0) {
|
||||||
|
if (doesPlayerUseGUI(client)) {
|
||||||
|
showPlayerErrorGUI(client, getLocaleString(client, "BusinessOrderCanceled"), getLocaleString(client, "Alert"));
|
||||||
|
} else {
|
||||||
|
logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} canceled the order of ${getPlayerData(client).businessOrderAmount} ${getPlayerData(client).businessOrderItem} at ${getPlayerData(client).businessOrderCost / getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness)}`);
|
||||||
|
messagePlayerError(client, getLocaleString(client, "BusinessOrderCanceled"));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
showPlayerErrorGUI(client, getLocaleString(client, "NotOrderingAnyBusinessItems"), getLocaleString(client, getLocaleString(client, "GUIWarningTitle")));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
messagePlayerError(client, getLocaleString(client, "NoPromptReject"));
|
||||||
|
submitBugReport(client, `[AUTOMATED REPORT] Tried to reject invalid prompt type: ${getPlayerData(client).promptType}`);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
getPlayerData(client).promptType = AGRP_PROMPT_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function playerPromptAnswerYes(client) {
|
||||||
|
if (getPlayerData(client).promptType == AGRP_PROMPT_NONE) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Prompt] ${getPlayerDisplayForConsole(client)} answered YES to their prompt (${getPlayerData(client).promptType})`);
|
||||||
|
|
||||||
|
switch (getPlayerData(client).promptType) {
|
||||||
|
case AGRP_PROMPT_CREATEFIRSTCHAR: {
|
||||||
|
showPlayerNewCharacterGUI(client);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case AGRP_PROMPT_BIZORDER: {
|
||||||
|
if (getPlayerData(client).businessOrderAmount > 0) {
|
||||||
|
if (getBusinessData(getPlayerData(client).businessOrderBusiness).till < getPlayerData(client).businessOrderCost) {
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Prompt] ${getPlayerDisplayForConsole(client)} failed to order ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} at ${getPlayerData(client).businessOrderCost / getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness).name} (Reason: Not enough money in business till)`);
|
||||||
|
if (doesPlayerHaveGUIEnabled(client)) {
|
||||||
|
showPlayerErrorGUI(client, getLocaleString(client, "BusinessOrderNotEnoughMoney", `{ALTCOLOUR}/bizdeposit{MAINCOLOUR}`), getLocaleString(client, "BusinessOrderCanceled"));
|
||||||
|
} else {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "BusinessOrderNotEnoughMoney", `{ALTCOLOUR}/bizdeposit{MAINCOLOUR}`));
|
||||||
|
}
|
||||||
|
getPlayerData(client).businessOrderAmount = 0;
|
||||||
|
getPlayerData(client).businessOrderBusiness = false;
|
||||||
|
getPlayerData(client).businessOrderItem = -1;
|
||||||
|
getPlayerData(client).businessOrderValue = -1;
|
||||||
|
} else {
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Prompt] ${getPlayerDisplayForConsole(client)} successfully ordered ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} at ${getPlayerData(client).businessOrderCost / getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness).name}`);
|
||||||
|
|
||||||
|
showPlayerInfoGUI(client, getLocaleString(client, "BusinessOrderSuccessInfo", getPlayerData(client).businessOrderAmount, getItemTypeData(getPlayerData(client).businessOrderItem).name, getItemValueDisplay(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue), getPlayerData(client).businessOrderCost), getLocaleString(client, "GUIInfoTitle"));
|
||||||
|
createItem(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue, AGRP_ITEM_OWNER_BIZFLOOR, getBusinessData(getPlayerData(client).businessOrderBusiness).databaseId, getPlayerData(client).businessOrderAmount);
|
||||||
|
cacheBusinessItems(getPlayerData(client).businessOrderBusiness);
|
||||||
|
getBusinessData(getPlayerData(client).businessOrderBusiness).till -= getPlayerData(client).businessOrderCost;
|
||||||
|
updateBusinessPickupLabelData(getPlayerData(client).businessOrderBusiness);
|
||||||
|
getPlayerData(client).businessOrderAmount = 0;
|
||||||
|
getPlayerData(client).businessOrderBusiness = false;
|
||||||
|
getPlayerData(client).businessOrderItem = -1;
|
||||||
|
getPlayerData(client).businessOrderValue = -1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
showPlayerErrorGUI(client, ``, `Business Order Canceled`);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case AGRP_PROMPT_GIVEVEHTOCLAN: {
|
||||||
|
if (!isPlayerInAnyVehicle(client)) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "MustBeInVehicle"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!getVehicleData(getPlayerVehicle(client))) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "RandomVehicleCommandsDisabled"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getVehicleData(getPlayerVehicle(client)).ownerType != AGRP_VEHOWNER_PLAYER) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "MustOwnVehicle"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getVehicleData(getPlayerVehicle(client)).ownerId != getPlayerCurrentSubAccount(client).databaseId) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "MustOwnVehicle"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
getVehicleData(getPlayerVehicle(client)).ownerType = AGRP_VEHOWNER_CLAN;
|
||||||
|
getVehicleData(getPlayerVehicle(client)).ownerId = getPlayerCurrentSubAccount(client).clan;
|
||||||
|
messagePlayerSuccess(client, getLocaleString(client, "GaveVehicleToClan", getVehicleName(getPlayerVehicle(client))));
|
||||||
|
//messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} {MAINCOLOUR}set their {vehiclePurple}${getVehicleName(vehicle)} {MAINCOLOUR}owner to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan`);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case AGRP_PROMPT_GIVEHOUSETOCLAN: {
|
||||||
|
let houseId = getPlayerHouse(client);
|
||||||
|
if (!houseId) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "InvalidHouse"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getHouseData(houseId).ownerType != AGRP_VEHOWNER_PLAYER) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "MustOwnHouse"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getHouseData(houseId).ownerId != getPlayerCurrentSubAccount(client).databaseId) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "MustOwnHouse"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_CLAN;
|
||||||
|
getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(client).clan;
|
||||||
|
messagePlayerSuccess(client, getLocaleString(client, "GaveHouseToClan"));
|
||||||
|
//messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} {MAINCOLOUR}set their {vehiclePurple}${getVehicleName(vehicle)} {MAINCOLOUR}owner to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan`);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case AGRP_PROMPT_GIVEBIZTOCLAN: {
|
||||||
|
let businessId = getPlayerBusiness(client);
|
||||||
|
if (!businessId) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "InvalidBusiness"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getBusinessData(businessId).ownerType != AGRP_VEHOWNER_PLAYER) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "MustOwnBusiness"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getBusinessData(businessId).ownerId != getPlayerCurrentSubAccount(client).databaseId) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "MustOwnBusiness"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_CLAN;
|
||||||
|
getBusinessData(businessId).ownerId = getPlayerCurrentSubAccount(client).clan;
|
||||||
|
messagePlayerSuccess(client, getLocaleString(client, "GaveBusinessToClan"));
|
||||||
|
//messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} {MAINCOLOUR}set their {vehiclePurple}${getVehicleName(vehicle)} {MAINCOLOUR}owner to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan`);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case AGRP_PROMPT_BUYHOUSE: {
|
||||||
|
let houseId = getPlayerHouse(client);
|
||||||
|
if (!houseId) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "InvalidHouse"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getHouseData(houseId).buyPrice <= 0) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "HouseNotForSale"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getPlayerCurrentSubAccount(client).cash < getHouseData(houseId).buyPrice) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "HousePurchaseNotEnoughMoney"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_PLAYER;
|
||||||
|
getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(client).databaseId;
|
||||||
|
getHouseData(houseId).buyPrice = 0;
|
||||||
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
updateHousePickupLabelData(houseId);
|
||||||
|
|
||||||
|
messageDiscordEventChannel(`🏘️ ${getCharacterFullName(client)} is now the owner of house *${getHouseData(houseId).description}*!`);
|
||||||
|
messagePlayerSuccess(client, `🏘️ You are now the owner of {houseGreen}${getHouseData(houseId).description}`);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case AGRP_PROMPT_BUYBIZ: {
|
||||||
|
let businessId = getPlayerBusiness(client);
|
||||||
|
if (!businessId) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "InvalidBusiness"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getBusinessData(businessId).buyPrice <= 0) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "BusinessNotForSale"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getPlayerCurrentSubAccount(client).cash < getBusinessData(businessId).buyPrice) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "BusinessPurchaseNotEnoughMoney"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_PLAYER;
|
||||||
|
getBusinessData(businessId).ownerId = getPlayerCurrentSubAccount(client).databaseId;
|
||||||
|
getBusinessData(businessId).buyPrice = 0;
|
||||||
|
getBusinessData(businessId).needsSaved = true;
|
||||||
|
updateBusinessPickupLabelData(businessId);
|
||||||
|
|
||||||
|
messageDiscordEventChannel(`🏢 ${getCharacterFullName(client)} is now the owner of *${getBusinessData(businessId).name}*!`);
|
||||||
|
messagePlayerSuccess(client, getLocaleString(client, "BusinessPurchased", `{businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR}`));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case AGRP_PROMPT_RESETKEYBINDS: {
|
||||||
|
// TODO: Needs database query!
|
||||||
|
|
||||||
|
//for (let i in getPlayerData(client).keyBinds) {
|
||||||
|
// removePlayerKeyBind(client, getPlayerData(client).keyBinds[i].key)
|
||||||
|
//}
|
||||||
|
|
||||||
|
//for (let i in getGlobalConfig().keyBind.defaultKeyBinds) {
|
||||||
|
// let tempKeyBindData = new KeyBindData(false);
|
||||||
|
// tempKeyBindData.databaseId = -1;
|
||||||
|
// tempKeyBindData.key = getKeyIdFromParams(getGlobalConfig().keyBind.defaultKeyBinds[i].keyName);
|
||||||
|
// tempKeyBindData.commandString = getGlobalConfig().keyBind.defaultKeyBinds[i].commandString;
|
||||||
|
// tempKeyBindData.keyState = getGlobalConfig().keyBind.defaultKeyBinds[i].keyState;
|
||||||
|
// getPlayerData(client).keyBinds.push(tempKeyBindData);
|
||||||
|
//}
|
||||||
|
|
||||||
|
//messagePlayerSuccess(client, getLocaleString(client, "KeyBindsReset"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case AGRP_PROMPT_COPYKEYBINDSTOSERVER: {
|
||||||
|
//messagePlayerSuccess(client, getLocaleString(client, "KeyBindsCopiedToServer", serverName));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default: {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "NoPromptAccept"));
|
||||||
|
submitBugReport(client, `[AUTOMATED REPORT] Tried to accept invalid prompt type: ${getPlayerData(client).promptType}`);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getPlayerData(client).promptType = AGRP_PROMPT_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function playerPromptAnswerYesCommand(command, params, client) {
|
||||||
|
playerPromptAnswerYes(client);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function playerPromptAnswerNoCommand(command, params, client) {
|
||||||
|
playerPromptAnswerNo(client);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function showPlayerTwoFactorAuthenticationGUI(client) {
|
||||||
|
sendNetworkEventToPlayer("agrp.2fa", client);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
2658
scripts/server/property.js
Normal file
2658
scripts/server/property.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -9,8 +9,8 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initRaceScript() {
|
function initRaceScript() {
|
||||||
logToConsole(LOG_INFO, "[VRR.Race]: Initializing race script ...");
|
logToConsole(LOG_INFO, "[AGRP.Race]: Initializing race script ...");
|
||||||
logToConsole(LOG_INFO, "[VRR.Race]: Race script initialized successfully!");
|
logToConsole(LOG_INFO, "[AGRP.Race]: Race script initialized successfully!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user