Compare commits
587 Commits
separate-r
...
ragemp
| 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 | ||
|
|
6e0bf2a8ee | ||
|
|
28111c4771 | ||
|
|
d0748c9152 | ||
|
|
7139f0e4bc | ||
|
|
c1c4820c45 | ||
|
|
c90932a602 | ||
|
|
9cf0dc38c7 | ||
|
|
7a71c08c3d | ||
|
|
beec73daed | ||
|
|
47c1c277af | ||
|
|
32a2a02b52 | ||
|
|
efbcc8b1f9 | ||
|
|
8320acb9ec | ||
|
|
2c67147239 | ||
|
|
da722de87d | ||
|
|
3d55e70657 | ||
|
|
9b4ad628c8 | ||
|
|
e2ec0b85b6 | ||
|
|
502b211840 | ||
|
|
13c039d7a9 | ||
|
|
3a87131185 | ||
|
|
710f41f9da | ||
|
|
7ccbff0ae9 | ||
|
|
7ae1b8bf48 | ||
|
|
5be864f77c | ||
|
|
f301469072 | ||
|
|
e6f5e31e98 | ||
|
|
98769435be | ||
|
|
4fac1cb350 | ||
|
|
364e3ef3ab | ||
|
|
8b1fcc1cc1 | ||
|
|
48a5d6a543 | ||
|
|
5e82edbf0d | ||
|
|
a96b7e6e2e | ||
|
|
d30116cac6 | ||
|
|
4621048f0f | ||
|
|
b27effbfcd | ||
|
|
b0602bb0ca | ||
|
|
6981cfdc5b | ||
|
|
cb0a0f518e | ||
|
|
6db5cad667 | ||
|
|
703843549c | ||
|
|
2d3eb800b3 | ||
|
|
fd10ae6665 | ||
|
|
521b0a406c | ||
|
|
e94da0eb95 | ||
|
|
8e9f8eb7d8 | ||
|
|
348fb2e469 | ||
|
|
49aa8c35fe | ||
|
|
dc633e7e83 | ||
|
|
08b065a650 | ||
|
|
54cfcdcdc5 | ||
|
|
425f405897 | ||
|
|
7569aff3d4 | ||
|
|
d2452979f8 | ||
|
|
7ccc9d92cc | ||
|
|
0b54145764 | ||
|
|
ab4339c46b | ||
|
|
215124a0bc | ||
|
|
f6614ff92b | ||
|
|
f69ca2ac59 | ||
|
|
149e3f3fa5 | ||
|
|
ad5dd488b9 | ||
|
|
8de8a30d1f | ||
|
|
a1e9ad0b42 | ||
|
|
0fd711dc0b | ||
|
|
3a501f0b39 | ||
|
|
af699acd24 | ||
|
|
258af788c7 | ||
|
|
17481001b0 | ||
|
|
2c28b17047 | ||
|
|
2c6401e9ed | ||
|
|
bb4b821db7 | ||
|
|
b7bc0ca8a8 | ||
|
|
a8843dba20 | ||
|
|
945a44506b | ||
|
|
784129e8e6 | ||
|
|
1f381732b3 | ||
|
|
277c4a2697 | ||
|
|
73fbf6f655 | ||
|
|
da65e74ef1 | ||
|
|
900ec4ab39 | ||
|
|
f5b388b045 | ||
|
|
9cedecf40c | ||
|
|
f4adc3c3e9 | ||
|
|
2efccb638f | ||
|
|
225d78c60d | ||
|
|
4d607d3c5d | ||
|
|
4ede78bd7c | ||
|
|
468cd46750 | ||
|
|
dfaf611a1e | ||
|
|
f03502e380 | ||
|
|
5973553171 | ||
|
|
6970d40f42 | ||
|
|
13cf75262a | ||
|
|
c486c00a02 | ||
|
|
3f0e8548d8 | ||
|
|
c28815b61c | ||
|
|
206f7e691e | ||
|
|
afdbbdbaa5 | ||
|
|
2102d7a0d7 | ||
|
|
d1bdc069fd | ||
|
|
42bb527844 | ||
|
|
da6d12c8d7 | ||
|
|
07e65591d0 | ||
|
|
c3d0f826db | ||
|
|
e65cd0b4be | ||
|
|
ab697557ef | ||
|
|
73757ebbc5 | ||
|
|
6b73be287b | ||
|
|
26e5617ccb | ||
|
|
c73c8b6b9a | ||
|
|
ef3c8049ea | ||
|
|
2b5307077f | ||
|
|
e6be16c30f | ||
|
|
d30a3bcb29 | ||
|
|
2eb58fa8cf | ||
|
|
8de1204ed7 | ||
|
|
b4b3996e00 | ||
|
|
a04b442df6 | ||
|
|
74062a7d36 | ||
|
|
d04b5549a6 | ||
|
|
59e704ee19 | ||
|
|
7a89d8bcba | ||
|
|
be237dc0aa | ||
|
|
8785255366 | ||
|
|
a69aec9222 | ||
|
|
a3fe0f8708 | ||
|
|
9e3f5d4a8f | ||
|
|
11685eacf6 | ||
|
|
6b914f8056 | ||
|
|
9be2a7a95b | ||
|
|
b1d8beb23b | ||
|
|
25e79b26d6 | ||
|
|
140749e8c0 | ||
|
|
25543b5f07 | ||
|
|
8ca7a8bdfd | ||
|
|
da7e0c35d1 | ||
|
|
99a21f9892 | ||
|
|
945d44d878 | ||
|
|
a52590ea56 | ||
|
|
713022da47 | ||
|
|
8b66e7914d | ||
|
|
e52c3a0e8d | ||
|
|
f83a602047 | ||
|
|
34ec6e60f8 | ||
|
|
883cac8f47 | ||
|
|
e6be6d7241 | ||
|
|
5c5e2d027e | ||
|
|
03febd8076 | ||
|
|
a37262b32f | ||
|
|
805f843e05 | ||
|
|
087c03cae4 | ||
|
|
a83a4f91af | ||
|
|
8e587b13ad | ||
|
|
cd87b90ac7 | ||
|
|
362f20a059 | ||
|
|
315bd5f926 | ||
|
|
78f53f7af7 | ||
|
|
09bbca49db | ||
|
|
0625dcd5c1 | ||
|
|
1e5ea4fd87 | ||
|
|
74bc330596 | ||
|
|
e67b3eeb23 | ||
|
|
d5d7f8b98f | ||
|
|
2bb4e9a23b | ||
|
|
1d61ec26db | ||
|
|
8d620882ce | ||
|
|
9285cf6fd3 | ||
|
|
8e24b35c29 | ||
|
|
2a0f2443d4 | ||
|
|
9539eb20f8 | ||
|
|
35251372c5 | ||
|
|
179556b878 | ||
|
|
eb582a666d | ||
|
|
2587ee6cdf | ||
|
|
340c96eab2 | ||
|
|
17c342be54 | ||
|
|
0595f25f3f | ||
|
|
a9f82b4150 | ||
|
|
df949a35f7 | ||
|
|
c5cef51655 | ||
|
|
334a7637f6 | ||
|
|
89bcbf9a8a | ||
|
|
0ec8608b2b | ||
|
|
9c937b76fb | ||
|
|
20502f5bca | ||
|
|
e17f6f3c4e | ||
|
|
cb86419f2b | ||
|
|
2f7f3a1b00 | ||
|
|
dd3f027c1e | ||
|
|
beb7e2070c | ||
|
|
ff6768d64d | ||
|
|
72562688e7 | ||
|
|
defee4c76e | ||
|
|
66840a0de9 | ||
|
|
ab7c73d7da | ||
|
|
b86d2c7bcb | ||
|
|
3fe5894499 | ||
|
|
ea018c7b65 | ||
|
|
d71335ed5f | ||
|
|
5f687b7b01 | ||
|
|
91bfed4f8e | ||
|
|
725d7cff66 | ||
|
|
3484602114 | ||
|
|
bfc434a38f | ||
|
|
1d59183811 | ||
|
|
14148da429 | ||
|
|
a13dfa220d | ||
|
|
e017313b58 | ||
|
|
acd03cc124 | ||
|
|
69dc299621 | ||
|
|
2b34fb708a | ||
|
|
8cceaa7e6a | ||
|
|
2181550618 | ||
|
|
763241d2ce | ||
|
|
0f6ab26ca9 | ||
|
|
ad672a5912 | ||
|
|
49e0c4afeb | ||
|
|
7883d3503a | ||
|
|
43e41a1139 | ||
|
|
ad1f7a3c7f | ||
|
|
d90dc8e7b8 | ||
|
|
644a188929 | ||
|
|
7c2249aa5d | ||
|
|
ae1185856d | ||
|
|
732d268e04 | ||
|
|
931a0d5ab0 | ||
|
|
13267a7e32 | ||
|
|
d7a66fb503 | ||
|
|
5ba69fca4d | ||
|
|
98e936fc71 | ||
|
|
71e13e2323 | ||
|
|
51c01b9c94 | ||
|
|
6fa3eb9997 | ||
|
|
bd0a994225 | ||
|
|
3ea19927a5 | ||
|
|
16fd26dc9a | ||
|
|
4c8630c174 | ||
|
|
e260d6176c | ||
|
|
7b77c99fb0 | ||
|
|
f121b473aa | ||
|
|
e7e2fb16d1 | ||
|
|
bbc41a5f3f | ||
|
|
cb029ff2e8 | ||
|
|
a403530f11 | ||
|
|
6d826c48cc | ||
|
|
87ca42c48a | ||
|
|
90face486b | ||
|
|
f1affc2f8f | ||
|
|
78005a7d17 | ||
|
|
70a1520f56 | ||
|
|
7373f1454e | ||
|
|
35f9e1fe3d | ||
|
|
66f351a16e | ||
|
|
fe42541dab | ||
|
|
b7271029f7 | ||
|
|
326286bdc5 | ||
|
|
f9701e81a7 | ||
|
|
282832b30a | ||
|
|
53eaddbfce | ||
|
|
731d0d6905 | ||
|
|
f0d5d6b361 | ||
|
|
d9c007c4bc | ||
|
|
519796fd60 | ||
|
|
318a01eea1 | ||
|
|
02e80a47ab | ||
|
|
1e4bc2a19d | ||
|
|
4e0bce571f | ||
|
|
4392cea694 | ||
|
|
c8992ce2de | ||
|
|
a9e30d79e3 | ||
|
|
3676e1ac85 | ||
|
|
a84acae095 | ||
|
|
ef19191cc9 | ||
|
|
234e50e035 | ||
|
|
9653b7c7c5 | ||
|
|
a7e070fbe1 | ||
|
|
6b6d2ed7b8 | ||
|
|
1380d749f4 | ||
|
|
facd9cf97f | ||
|
|
116865a2d9 | ||
|
|
673942e945 | ||
|
|
a239cd554e | ||
|
|
e794976e50 | ||
|
|
7d5d660ad9 | ||
|
|
eab4d6cfe8 | ||
|
|
a0c61c4f9c | ||
|
|
35f3d527c5 | ||
|
|
e54cacd3d2 | ||
|
|
7a90cbb867 | ||
|
|
dbde2ed35f | ||
|
|
7e7f729997 | ||
|
|
8f02c5c3d8 | ||
|
|
d6f767e321 | ||
|
|
e965e15ad2 | ||
|
|
87be1f3b42 | ||
|
|
2f133a456b | ||
|
|
55758854fb | ||
|
|
b2a30f225d | ||
|
|
21eaa4e97d | ||
|
|
ae6a08c457 | ||
|
|
db4967b5d0 | ||
|
|
674006abfd | ||
|
|
c933c32ac3 | ||
|
|
197256da4f |
48
IDEAS.md
48
IDEAS.md
@@ -14,7 +14,8 @@
|
|||||||
### Interactive peds with each one having a background story, characteristics, certain people or groups they like/dislike.
|
### Interactive peds with each one having a background story, characteristics, certain people or groups they like/dislike.
|
||||||
* Procedurally generated?
|
* Procedurally generated?
|
||||||
---
|
---
|
||||||
* Nightclubs, bars, etc can employ "bouncer" peds that either prevent entry to certain people, or kick people out.
|
### Bouncers
|
||||||
|
* Nightclubs, bars, etc can employ "bouncer" peds that either prevent entry to certain people, or kick people out.
|
||||||
---
|
---
|
||||||
### Background ambience.
|
### Background ambience.
|
||||||
* Anonymous city traffic and pedestrians
|
* Anonymous city traffic and pedestrians
|
||||||
@@ -51,9 +52,9 @@
|
|||||||
### Vehicle Towing
|
### Vehicle Towing
|
||||||
* Use a Yankee or something to store the vehicle "inside" (just make the car disappear) until better sync options are built.
|
* Use a Yankee or something to store the vehicle "inside" (just make the car disappear) until better sync options are built.
|
||||||
* Universal command to tow/release a vehicle ( /tow ).
|
* Universal command to tow/release a vehicle ( /tow ).
|
||||||
* Attach to nearest vehicle.
|
* Try attach to nearest vehicle.
|
||||||
---
|
---
|
||||||
### Item System
|
### Item System (FINISHED)
|
||||||
* Several item types, including armour, skins, weapons, drugs, materials, and more.
|
* Several item types, including armour, skins, weapons, drugs, materials, and more.
|
||||||
* Items can be dropped and picked up.
|
* Items can be dropped and picked up.
|
||||||
* Items can be stored in a vehicle trunk or dash compartment.
|
* Items can be stored in a vehicle trunk or dash compartment.
|
||||||
@@ -68,21 +69,21 @@
|
|||||||
* If all are full, have a waiting list.
|
* If all are full, have a waiting list.
|
||||||
* Allow people to go in and lay on a bed to heal (or use a check-in system)
|
* Allow people to go in and lay on a bed to heal (or use a check-in system)
|
||||||
---
|
---
|
||||||
### Several NPC's
|
### Several NPC's (NEEDS SPAWNED)
|
||||||
* Paramedics/Doctors at hospitals,
|
* Paramedics/Doctors at hospitals,
|
||||||
* LC/VC/LS/SF/LV police dept desk clerk and dispatcher.
|
* LC/VC/LS/SF/LV police dept desk clerk and dispatcher.
|
||||||
* Jail guard
|
* Jail guard
|
||||||
* Interactive. Go up and talk to them for responses etc
|
* Interactive. Go up and talk to them for responses etc
|
||||||
---
|
---
|
||||||
### Use permissions/flag system for everything.
|
### Use permissions/flag system for everything (FINISHED)
|
||||||
* Admin abilities
|
* Admin abilities
|
||||||
* Moderation (muted/frozen/etc)
|
* Moderation (muted/frozen/etc)
|
||||||
* LEO abilities
|
* LEO abilities (skipped for now)
|
||||||
* Clan abilities
|
* Clan abilities
|
||||||
* Account Settings
|
* Account Settings
|
||||||
* etc
|
* etc
|
||||||
---
|
---
|
||||||
### Interiors
|
### Interiors (FINISHED)
|
||||||
* For games with interiors, properties inside of properties (possibly make it a sub-property, but using a "type" to define it. May not be necessary) AKA a business inside a business (illegal back room gambling, anyone?)
|
* For games with interiors, properties inside of properties (possibly make it a sub-property, but using a "type" to define it. May not be necessary) AKA a business inside a business (illegal back room gambling, anyone?)
|
||||||
---
|
---
|
||||||
### Stealable skins.
|
### Stealable skins.
|
||||||
@@ -174,8 +175,6 @@
|
|||||||
* Concealable smaller weapon.
|
* Concealable smaller weapon.
|
||||||
* Officers usually have a utility belt. Allow it to hold equipment as well.
|
* Officers usually have a utility belt. Allow it to hold equipment as well.
|
||||||
---
|
---
|
||||||
###
|
|
||||||
---
|
|
||||||
### Vehicle Trunks
|
### Vehicle Trunks
|
||||||
* Can hold tied up players/peds
|
* Can hold tied up players/peds
|
||||||
* Can hold items
|
* Can hold items
|
||||||
@@ -230,10 +229,10 @@
|
|||||||
* Tweakers
|
* Tweakers
|
||||||
* Bouncers
|
* Bouncers
|
||||||
---
|
---
|
||||||
### Accents
|
### Accents (FINISHED)
|
||||||
* Shown before message ... "[Japanese] John Smith says: hello"
|
* Shown before message ... "[Japanese] John Smith says: hello"
|
||||||
* Pre-set accent choices
|
* Pre-set accent choices
|
||||||
* Custom accent
|
* Custom accent (skipped for now)
|
||||||
---
|
---
|
||||||
### Speakerphone
|
### Speakerphone
|
||||||
* While on a phone call, using /speakerphone or something can allow others near the person on the phone to hear and be heard over the call.
|
* While on a phone call, using /speakerphone or something can allow others near the person on the phone to hear and be heard over the call.
|
||||||
@@ -333,7 +332,8 @@
|
|||||||
---
|
---
|
||||||
### Pointing
|
### Pointing
|
||||||
* Key to point sort of like FiveM has.
|
* Key to point sort of like FiveM has.
|
||||||
* Use a 3D primitive on the spot thats pointed to, if no anim available.
|
* Use a 3D primitive on the spot thats pointed to.
|
||||||
|
* Use pointing (finger?) animation if available
|
||||||
---
|
---
|
||||||
### Multi-command one-liners
|
### Multi-command one-liners
|
||||||
Obviously this would still be using slashes for commands still. The way this works is simple: Every command returns a value `{RETURN}`, and provides indexed numerical references to it's args that can be *piped* to another command `{1}`, `{2}`, etc. For example, the /tempveh command adds a vehicle and provides both a reference to the vehicle itself (`{RETURN}`) and a reference to it's only argument (`{1}`). Some commands already implement a final, optional command to override the default chosen entity to act on (for example, `/bizname Some Business 3` will set business ID 3's name instead of the closest business to the player. Only works for staff with the manageBusinesses permission or if the player using it owns or is in the clan that owns business ID 3 and has the ability to set it's name. So this: `/tempveh infernus | /vehrgb 0 0 0 0 {RETURN} | /vehrgb 1 {2} {3} {4} {RETURN}` Would spawn a temporary infernus and immediately set both colours as completely black RGB values.
|
Obviously this would still be using slashes for commands still. The way this works is simple: Every command returns a value `{RETURN}`, and provides indexed numerical references to it's args that can be *piped* to another command `{1}`, `{2}`, etc. For example, the /tempveh command adds a vehicle and provides both a reference to the vehicle itself (`{RETURN}`) and a reference to it's only argument (`{1}`). Some commands already implement a final, optional command to override the default chosen entity to act on (for example, `/bizname Some Business 3` will set business ID 3's name instead of the closest business to the player. Only works for staff with the manageBusinesses permission or if the player using it owns or is in the clan that owns business ID 3 and has the ability to set it's name. So this: `/tempveh infernus | /vehrgb 0 0 0 0 {RETURN} | /vehrgb 1 {2} {3} {4} {RETURN}` Would spawn a temporary infernus and immediately set both colours as completely black RGB values.
|
||||||
@@ -350,20 +350,20 @@ Obviously this would still be using slashes for commands still. The way this wor
|
|||||||
* Ice cream cone
|
* Ice cream cone
|
||||||
* Cotton Candy
|
* Cotton Candy
|
||||||
* Snow cone
|
* Snow cone
|
||||||
|
|
||||||
* Misc
|
* Misc
|
||||||
* Gas Can
|
* Gas Can
|
||||||
---
|
---
|
||||||
### Quick Reply
|
### Quick Reply (FINISHED)
|
||||||
* When somebody sends a private message, use /reply to quickly reply without having to find their ID to use the private message command
|
* When somebody sends a private message, use /reply to quickly reply without having to find their ID to use the private message command
|
||||||
---
|
---
|
||||||
### Item management commands
|
### Item management commands (ALMOST FINISHED)
|
||||||
* Item Types
|
* Item Types
|
||||||
* Create
|
* Create
|
||||||
* Set base price
|
* Set base price
|
||||||
* Set model
|
* Set model
|
||||||
* Set drop position offset
|
* Set drop position offset
|
||||||
* Set drop rotation offset
|
* Set drop rotation offset
|
||||||
|
* Set forward
|
||||||
---
|
---
|
||||||
### Tutorial
|
### Tutorial
|
||||||
* Pick up item (grab bottle of beer off ground)
|
* Pick up item (grab bottle of beer off ground)
|
||||||
@@ -379,3 +379,21 @@ Obviously this would still be using slashes for commands still. The way this wor
|
|||||||
So with new Steam Deck being available now, and all the other attempts to use mobile devices that either emulate or stream the older GTA PC games, I figure we'd need a way for players to interact with each other using them. Roleplay is usually a very chat-oriented gamemode, but I can probably make things easier with simple controls. Also customizable messages, animations, and actions for each menu/wheel slot
|
So with new Steam Deck being available now, and all the other attempts to use mobile devices that either emulate or stream the older GTA PC games, I figure we'd need a way for players to interact with each other using them. Roleplay is usually a very chat-oriented gamemode, but I can probably make things easier with simple controls. Also customizable messages, animations, and actions for each menu/wheel slot
|
||||||
The inventory system is already planned to use a hotbar/wheel but I don't have all the images for it yet
|
The inventory system is already planned to use a hotbar/wheel but I don't have all the images for it yet
|
||||||
---
|
---
|
||||||
|
### Fishing
|
||||||
|
* Fishing works near water or on a boat (I have a way to detect both)
|
||||||
|
* Use the bat swing anim for casting line, and the crouch anim for applying bait.
|
||||||
|
* Bait is used same as ammo item for a weapon. Hold the fishing rod, make sure bait is in inventory, and press use (default U) to apply bait.
|
||||||
|
* Use a "press and hold" key to cast a line to a custom distance. Show progress bar to indicate how far the line will be cast.
|
||||||
|
* Place a single-use particle effect on the water (distance to front of player) to show where the casted line hits.
|
||||||
|
* Use particle effects (water spray or splash effect) to display a fish being hooked.
|
||||||
|
* Slowly move the particle effect to the player to show it being reeled in as the player holds the reel key.
|
||||||
|
* Random selection of predefined catch items, both junk and fish.
|
||||||
|
* Player would be wise to bring a bucket or crate to keep the fish in, using existing /take and /put system like any other item.
|
||||||
|
**This will need extra stuff added to keybinds system for duration key holding**
|
||||||
|
---
|
||||||
|
### GPS indicator like the 3D Fallout games
|
||||||
|
An indicator at the bottom, showing compass direction and a dot or something in the direction of the GPS location. Like an object marker.
|
||||||
|
In-world indicator too, when player gets close and is in line of sight
|
||||||
|
---
|
||||||
|
### Item/Object pickup and move like the 3D Fallout games
|
||||||
|
Fallout 3 and New Vegas have a neat feature where you can "grab" an object and fling it around while the key is pressed. Could be implemented for items in GTACRP servers
|
||||||
3
TODO.md
3
TODO.md
@@ -21,3 +21,6 @@
|
|||||||
---
|
---
|
||||||
== Bug Fixes
|
== Bug Fixes
|
||||||
* Check natives for if player is console (getPlayerPosition, etc)
|
* Check natives for if player is console (getPlayerPosition, etc)
|
||||||
|
|
||||||
|
* Add command to copy account keybinds to other server(s)
|
||||||
|
* Add command to reset all account keybinds to default
|
||||||
@@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
58
meta.xml
58
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" />
|
||||||
|
|
||||||
@@ -22,6 +22,7 @@
|
|||||||
<script src="scripts/server/ban.js" type="server" language="javascript" />
|
<script src="scripts/server/ban.js" type="server" language="javascript" />
|
||||||
<script src="scripts/server/bitflag.js" type="server" language="javascript" />
|
<script src="scripts/server/bitflag.js" type="server" language="javascript" />
|
||||||
<script src="scripts/server/business.js" type="server" language="javascript" />
|
<script src="scripts/server/business.js" type="server" language="javascript" />
|
||||||
|
<script src="scripts/server/casino.js" type="server" language="javascript" />
|
||||||
<script src="scripts/server/chat.js" type="server" language="javascript" />
|
<script src="scripts/server/chat.js" type="server" language="javascript" />
|
||||||
<script src="scripts/server/clan.js" type="server" language="javascript" />
|
<script src="scripts/server/clan.js" type="server" language="javascript" />
|
||||||
<script src="scripts/server/client.js" type="server" language="javascript" />
|
<script src="scripts/server/client.js" type="server" language="javascript" />
|
||||||
@@ -47,6 +48,9 @@
|
|||||||
<script src="scripts/server/messaging.js" type="server" language="javascript" />
|
<script src="scripts/server/messaging.js" type="server" language="javascript" />
|
||||||
<script src="scripts/server/misc.js" type="server" language="javascript" />
|
<script src="scripts/server/misc.js" type="server" language="javascript" />
|
||||||
<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/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" />
|
||||||
@@ -82,8 +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/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" />
|
||||||
@@ -94,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/chatbox.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/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" />
|
||||||
@@ -117,18 +133,44 @@
|
|||||||
<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/server.js" type="client" language="javascript" />
|
|
||||||
<script src="scripts/client/skin-select.js" type="client" language="javascript" />
|
<script src="scripts/client/skin-select.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/sync.js" type="client" language="javascript" />
|
<script src="scripts/client/sync.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/utilities.js" type="client" language="javascript" />
|
<script src="scripts/client/utilities.js" type="client" language="javascript" />
|
||||||
<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 -->
|
||||||
|
<file type="client" src="config/client/locale.json" />
|
||||||
|
<file type="client" src="locale/english.json" />
|
||||||
|
<file type="client" src="locale/russian.json" />
|
||||||
|
<file type="client" src="locale/polish.json" />
|
||||||
|
<file type="client" src="locale/spanish.json" />
|
||||||
|
<file type="client" src="locale/french.json" />
|
||||||
|
<file type="client" src="locale/japanese.json" />
|
||||||
|
<file type="client" src="locale/german.json" />
|
||||||
|
<file type="client" src="locale/slovak.json" />
|
||||||
|
<file type="client" src="locale/finnish.json" />
|
||||||
|
<file type="client" src="locale/chinese.json" />
|
||||||
|
<file type="client" src="locale/arabic.json" />
|
||||||
|
|
||||||
|
<!-- International Flag Images -->
|
||||||
|
<file type="client" src="files/images/flags/uk.png" />
|
||||||
|
<file type="client" src="files/images/flags/de.png" />
|
||||||
|
<file type="client" src="files/images/flags/fr.png" />
|
||||||
|
<file type="client" src="files/images/flags/pl.png" />
|
||||||
|
<file type="client" src="files/images/flags/es.png" />
|
||||||
|
<file type="client" src="files/images/flags/jp.png" />
|
||||||
|
<file type="client" src="files/images/flags/sk.png" />
|
||||||
|
<file type="client" src="files/images/flags/sa.png" />
|
||||||
|
<file type="client" src="files/images/flags/cn.png" />
|
||||||
|
<file type="client" src="files/images/flags/fi.png" />
|
||||||
|
<file type="client" src="files/images/flags/ru.png" />
|
||||||
|
|
||||||
<!-- MexUI -->
|
<!-- MexUI -->
|
||||||
<file type="client" src="third-party/mexui/Images/down-arrow.png" />
|
<file type="client" src="third-party/mexui/Images/down-arrow.png" />
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: afk.js
|
// FILE: afk.js
|
||||||
// DESC: Provides AFK detection
|
// DESC: Provides AFK detection
|
||||||
@@ -9,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!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -1,54 +1,62 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: animation.js
|
// FILE: animation.js
|
||||||
// DESC: Provides animation functions and usage
|
// DESC: Provides animation functions and usage
|
||||||
// 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);
|
||||||
|
|
||||||
if(ped == null) {
|
if (ped == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
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) {
|
||||||
case VRR_ANIMMOVE_FORWARD: {
|
case AGRP_ANIMMOVE_FORWARD: {
|
||||||
setElementCollisionsEnabled(ped, false);
|
setElementCollisionsEnabled(ped, false);
|
||||||
if(ped.isSyncer) {
|
if (ped.isSyncer) {
|
||||||
setElementPosition(ped, getPosInFrontOfPos(getElementPosition(pedId), fixAngle(getElementHeading(pedId)), positionOffset));
|
setElementPosition(ped, getPosInFrontOfPos(getElementPosition(pedId), fixAngle(getElementHeading(pedId)), positionOffset));
|
||||||
}
|
}
|
||||||
freezePlayer = true;
|
freezePlayer = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case VRR_ANIMMOVE_BACK: {
|
case AGRP_ANIMMOVE_BACK: {
|
||||||
setElementCollisionsEnabled(pedId, false);
|
setElementCollisionsEnabled(pedId, false);
|
||||||
if(ped.isSyncer) {
|
if (ped.isSyncer) {
|
||||||
setElementPosition(pedId, getPosBehindPos(getElementPosition(pedId), fixAngle(getElementHeading(pedId)), positionOffset));
|
setElementPosition(pedId, getPosBehindPos(getElementPosition(pedId), fixAngle(getElementHeading(pedId)), positionOffset));
|
||||||
}
|
}
|
||||||
freezePlayer = true;
|
freezePlayer = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case VRR_ANIMMOVE_LEFT: {
|
case AGRP_ANIMMOVE_LEFT: {
|
||||||
setElementCollisionsEnabled(pedId, false);
|
setElementCollisionsEnabled(pedId, false);
|
||||||
if(ped.isSyncer) {
|
if (ped.isSyncer) {
|
||||||
setElementPosition(pedId, getPosToLeftOfPos(getElementPosition(pedId), fixAngle(getElementHeading(pedId)), positionOffset));
|
setElementPosition(pedId, getPosToLeftOfPos(getElementPosition(pedId), fixAngle(getElementHeading(pedId)), positionOffset));
|
||||||
}
|
}
|
||||||
freezePlayer = true;
|
freezePlayer = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case VRR_ANIMMOVE_RIGHT: {
|
case AGRP_ANIMMOVE_RIGHT: {
|
||||||
setElementCollisionsEnabled(pedId, false);
|
setElementCollisionsEnabled(pedId, false);
|
||||||
if(ped.isSyncer) {
|
if (ped.isSyncer) {
|
||||||
setElementPosition(pedId, getPosToRightOfPos(getElementPosition(pedId), fixAngle(getElementHeading(pedId)), positionOffset));
|
setElementPosition(pedId, getPosToRightOfPos(getElementPosition(pedId), fixAngle(getElementHeading(pedId)), positionOffset));
|
||||||
}
|
}
|
||||||
freezePlayer = true;
|
freezePlayer = true;
|
||||||
@@ -60,21 +68,21 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getGame() < VRR_GAME_GTA_IV) {
|
if (getGame() < AGRP_GAME_GTA_IV) {
|
||||||
if(animationData.animType == VRR_ANIMTYPE_NORMAL || animationData.animType == VRR_ANIMTYPE_SURRENDER) {
|
if (animationData.animType == AGRP_ANIMTYPE_NORMAL || animationData.animType == AGRP_ANIMTYPE_SURRENDER) {
|
||||||
if(getGame() == VRR_GAME_GTA_VC || getGame() == VRR_GAME_GTA_SA) {
|
if (getGame() == AGRP_GAME_GTA_VC || getGame() == AGRP_GAME_GTA_SA) {
|
||||||
ped.clearAnimations();
|
ped.clearAnimations();
|
||||||
} else {
|
} else {
|
||||||
ped.clearObjective();
|
ped.clearObjective();
|
||||||
}
|
}
|
||||||
ped.addAnimation(animationData.groupId, animationData.animId);
|
ped.addAnimation(animationData.groupId, animationData.animId);
|
||||||
|
|
||||||
if(ped == localPlayer && freezePlayer == true) {
|
if (ped == localPlayer && freezePlayer == true) {
|
||||||
inAnimation = true;
|
inAnimation = true;
|
||||||
setLocalPlayerControlState(false, false);
|
setLocalPlayerControlState(false, false);
|
||||||
localPlayer.collisionsEnabled = false;
|
localPlayer.collisionsEnabled = false;
|
||||||
}
|
}
|
||||||
} else if(animationData.animType == VRR_ANIMTYPE_BLEND) {
|
} else if (animationData.animType == AGRP_ANIMTYPE_BLEND) {
|
||||||
ped.position = ped.position;
|
ped.position = ped.position;
|
||||||
ped.blendAnimation(animationData.groupId, animationData.animId, animationData.animSpeed);
|
ped.blendAnimation(animationData.groupId, animationData.animId, animationData.animSpeed);
|
||||||
}
|
}
|
||||||
@@ -89,17 +97,17 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) {
|
|||||||
function forcePedAnimation(pedId, animSlot) {
|
function forcePedAnimation(pedId, animSlot) {
|
||||||
let ped = getElementFromId(pedId);
|
let ped = getElementFromId(pedId);
|
||||||
|
|
||||||
if(ped == null) {
|
if (ped == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let animationData = getAnimationData(animSlot);
|
let animationData = getAnimationData(animSlot);
|
||||||
|
|
||||||
if(getGame() < VRR_GAME_GTA_IV) {
|
if (getGame() < AGRP_GAME_GTA_IV) {
|
||||||
ped.position = ped.position;
|
ped.position = ped.position;
|
||||||
ped.addAnimation(animationData.groupId, animationData.animId);
|
ped.addAnimation(animationData.groupId, animationData.animId);
|
||||||
|
|
||||||
if(ped == localPlayer) {
|
if (ped == localPlayer) {
|
||||||
inAnimation = true;
|
inAnimation = true;
|
||||||
setLocalPlayerControlState(false, false);
|
setLocalPlayerControlState(false, false);
|
||||||
localPlayer.collisionsEnabled = false;
|
localPlayer.collisionsEnabled = false;
|
||||||
@@ -115,20 +123,20 @@ function forcePedAnimation(pedId, animSlot) {
|
|||||||
function makePedStopAnimation(pedId) {
|
function makePedStopAnimation(pedId) {
|
||||||
let ped = getElementFromId(pedId);
|
let ped = getElementFromId(pedId);
|
||||||
|
|
||||||
if(ped == null) {
|
if (ped == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getGame() != VRR_GAME_GTA_IV) {
|
if (getGame() != AGRP_GAME_GTA_IV) {
|
||||||
if(getGame() == VRR_GAME_GTA_VC || getGame() == VRR_GAME_GTA_SA) {
|
if (getGame() == AGRP_GAME_GTA_VC || getGame() == AGRP_GAME_GTA_SA) {
|
||||||
ped.clearAnimations();
|
ped.clearAnimations();
|
||||||
} else {
|
} else {
|
||||||
ped.clearObjective();
|
ped.clearObjective();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ped == localPlayer) {
|
if (ped == localPlayer) {
|
||||||
if(getGame() != VRR_GAME_GTA_IV) {
|
if (getGame() != AGRP_GAME_GTA_IV) {
|
||||||
localPlayer.collisionsEnabled = true;
|
localPlayer.collisionsEnabled = true;
|
||||||
}
|
}
|
||||||
setLocalPlayerControlState(true, false);
|
setLocalPlayerControlState(true, false);
|
||||||
@@ -136,13 +144,3 @@ function makePedStopAnimation(pedId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {number} animationSlot - The slot index of the animation
|
|
||||||
* @return {AnimationData} The animation's data (array)
|
|
||||||
*/
|
|
||||||
function getAnimationData(animationSlot, gameId = getGame()) {
|
|
||||||
return getGameConfig().animations[gameId][animationSlot];
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: business.js
|
// FILE: business.js
|
||||||
// DESC: Provides business functions and usage
|
// DESC: Provides business functions and usage
|
||||||
@@ -16,32 +17,57 @@ 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()) {
|
// ===========================================================================
|
||||||
if(getBusinessData(businessId) != false) {
|
|
||||||
|
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) {
|
||||||
let businessData = getBusinessData(businessId);
|
let businessData = getBusinessData(businessId);
|
||||||
businessData.name = name;
|
businessData.name = name;
|
||||||
businessData.entrancePosition = entrancePosition;
|
businessData.entrancePosition = entrancePosition;
|
||||||
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) {
|
||||||
if(blipModel == -1) {
|
businessData.labelInfoType = AGRP_PROPLABEL_INFO_ENTER;
|
||||||
if(businessData.blipId != -1) {
|
} else if (!hasInterior && hasItems) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been removed by the server`);
|
businessData.labelInfoType = AGRP_PROPLABEL_INFO_BUY;
|
||||||
if(getGame() == VRR_GAME_GTA_IV) {
|
} 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 (businessData.blipId != -1) {
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId}'s blip has been removed by the server`);
|
||||||
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
natives.removeBlipAndClearIndex(getBusinessData(businessId).blipId);
|
natives.removeBlipAndClearIndex(getBusinessData(businessId).blipId);
|
||||||
} else {
|
} else {
|
||||||
destroyElement(getElementFromId(blipId));
|
destroyElement(getElementFromId(blipId));
|
||||||
@@ -50,37 +76,37 @@ 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() == VRR_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);
|
||||||
natives.setBlipMarkerLongDistance(businessData.blipId, false);
|
natives.setBlipMarkerLongDistance(businessData.blipId, false);
|
||||||
natives.setBlipAsShortRange(tempBusinessData.blipId, true);
|
natives.setBlipAsShortRange(tempBusinessData.blipId, true);
|
||||||
natives.changeBlipNameFromAscii(businessData.blipId, `${businessData.name.substr(0, 24)}${(businessData.name.length > 24) ? " ...": ""}`);
|
natives.changeBlipNameFromAscii(businessData.blipId, `${businessData.name.substr(0, 24)}${(businessData.name.length > 24) ? " ..." : ""}`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
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} 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();
|
||||||
@@ -100,8 +126,8 @@ function getBusinessData(businessId) {
|
|||||||
|
|
||||||
let businesses = getServerData().businesses;
|
let businesses = getServerData().businesses;
|
||||||
|
|
||||||
for(let i in businesses) {
|
for (let i in businesses) {
|
||||||
if(businesses[i].businessId == businessId) {
|
if (businesses[i].businessId == businessId) {
|
||||||
return businesses[i];
|
return businesses[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,7 +138,7 @@ function getBusinessData(businessId) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setAllBusinessDataIndexes() {
|
function setAllBusinessDataIndexes() {
|
||||||
for(let i in getServerData().businesses) {
|
for (let i in getServerData().businesses) {
|
||||||
getServerData().businesses[i].index = i;
|
getServerData().businesses[i].index = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
232
scripts/client/chat.js
Normal file
232
scripts/client/chat.js
Normal file
@@ -0,0 +1,232 @@
|
|||||||
|
// ===========================================================================
|
||||||
|
// Asshat Gaming Roleplay
|
||||||
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
|
// ===========================================================================
|
||||||
|
// FILE: chatbox.js
|
||||||
|
// DESC: Provides extra chatbox features
|
||||||
|
// TYPE: Client (JavaScript)
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
let chatTimeStampsEnabled = false;
|
||||||
|
let chatEmojiEnabled = false;
|
||||||
|
|
||||||
|
let chatBoxHistory = [];
|
||||||
|
let bottomMessageIndex = 0;
|
||||||
|
let maxChatBoxHistory = 500;
|
||||||
|
|
||||||
|
let scrollAmount = 1;
|
||||||
|
let maxChatBoxLines = 6;
|
||||||
|
|
||||||
|
let chatAutoHideDelay = 0;
|
||||||
|
let chatLastUse = 0;
|
||||||
|
|
||||||
|
let scrollUpKey = false;
|
||||||
|
let scrollDownKey = false;
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function initChatBoxScript() {
|
||||||
|
logToConsole(LOG_DEBUG, "[AGRP.Chat]: Initializing chat script ...");
|
||||||
|
scrollUpKey = getKeyIdFromParams("pageup");
|
||||||
|
scrollDownKey = getKeyIdFromParams("pagedown");
|
||||||
|
bindChatBoxKeys();
|
||||||
|
logToConsole(LOG_INFO, "[AGRP.Chat]: Chat script initialized!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function bindChatBoxKeys() {
|
||||||
|
bindKey(toInteger(scrollUpKey), KEYSTATE_DOWN, chatBoxScrollUp);
|
||||||
|
bindKey(toInteger(scrollDownKey), KEYSTATE_DOWN, chatBoxScrollDown);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function unBindChatBoxKeys() {
|
||||||
|
unbindKey(toInteger(scrollUpKey));
|
||||||
|
unbindKey(toInteger(scrollDownKey));
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function receiveChatBoxMessageFromServer(messageString, colour, hour, minute, second) {
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Chat]: Received chatbox message from server: ${messageString}`);
|
||||||
|
|
||||||
|
// Just in case it's hidden by auto hide
|
||||||
|
//setChatWindowEnabled(true);
|
||||||
|
|
||||||
|
//let timeStamp = findResourceByName("agrp_time").exports.getCurrentUnixTimeStampSquirrel();
|
||||||
|
|
||||||
|
hour = fillLeadingZeros(hour, 2);
|
||||||
|
minute = fillLeadingZeros(minute, 2);
|
||||||
|
second = fillLeadingZeros(second, 2);
|
||||||
|
|
||||||
|
addToChatBoxHistory(messageString, colour, hour, minute, second);
|
||||||
|
|
||||||
|
//let unixTimeStampMS = new Date().getTime();
|
||||||
|
//let timeStampDate = new Date(unixTimeStampMS);
|
||||||
|
//let timeStampDate = new Date(timeStamp);
|
||||||
|
//let timeStampText = `${timeStampDate.getHours()}:${timeStampDate.getMinutes()}:${timeStampDate.getSeconds()}`;
|
||||||
|
|
||||||
|
let outputString = messageString;
|
||||||
|
if (chatTimeStampsEnabled == true) {
|
||||||
|
let colourRGBA = rgbaArrayFromToColour(colour);
|
||||||
|
let timeStampString = `{TIMESTAMPCOLOUR}[${hour}:${minute}:${second}][${rgbToHex(colourRGBA[0], colourRGBA[1], colourRGBA[2])}] `;
|
||||||
|
outputString = `${timeStampString}${messageString}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Chat]: Changed colours in string: ${outputString}`);
|
||||||
|
outputString = replaceColoursInMessage(`${outputString}`);
|
||||||
|
|
||||||
|
if (chatEmojiEnabled == true) {
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Chat]: Enabled emoji in string: ${outputString}`);
|
||||||
|
outputString = replaceEmojiInMessage(outputString);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (profanityFilterEnabled == true) {
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Chat]: Removed profanity in string: ${outputString}`);
|
||||||
|
outputString = replaceProfanityInMessage(outputString);
|
||||||
|
}
|
||||||
|
|
||||||
|
message(outputString, colour);
|
||||||
|
bottomMessageIndex = chatBoxHistory.length - 1;
|
||||||
|
|
||||||
|
chatLastUse = getCurrentUnixTimestamp();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setChatScrollLines(amount) {
|
||||||
|
scrollAmount = amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setChatTimeStampsState(state) {
|
||||||
|
chatTimeStampsEnabled = state;
|
||||||
|
updateChatBox();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setChatEmojiState(state) {
|
||||||
|
chatEmojiEnabled = state;
|
||||||
|
updateChatBox();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setChatAutoHideDelay(delay) {
|
||||||
|
chatAutoHideDelay = delay * 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function addToChatBoxHistory(messageString, colour, hour, minute, second) {
|
||||||
|
chatBoxHistory.push([messageString, colour, hour, minute, second]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function chatBoxScrollUp() {
|
||||||
|
if (bottomMessageIndex > maxChatBoxLines) {
|
||||||
|
bottomMessageIndex = bottomMessageIndex - scrollAmount;
|
||||||
|
updateChatBox();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function chatBoxScrollDown() {
|
||||||
|
if (bottomMessageIndex < chatBoxHistory.length - 1) {
|
||||||
|
bottomMessageIndex = bottomMessageIndex + scrollAmount;
|
||||||
|
updateChatBox();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function clearChatBox() {
|
||||||
|
for (let i = 0; i <= maxChatBoxLines; i++) {
|
||||||
|
message("", COLOUR_WHITE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function updateChatBox() {
|
||||||
|
clearChatBox();
|
||||||
|
for (let i = bottomMessageIndex - maxChatBoxLines; i <= bottomMessageIndex; i++) {
|
||||||
|
if (typeof chatBoxHistory[i] != "undefined") {
|
||||||
|
let outputString = chatBoxHistory[i][0];
|
||||||
|
if (chatTimeStampsEnabled == true) {
|
||||||
|
let timeStampText = `${chatBoxHistory[i][2]}:${chatBoxHistory[i][3]}:${chatBoxHistory[i][4]}`;
|
||||||
|
let colourRGBA = rgbaArrayFromToColour(chatBoxHistory[i][1]);
|
||||||
|
outputString = `{TIMESTAMPCOLOUR}[${timeStampText}][${rgbToHex(colourRGBA[0], colourRGBA[1], colourRGBA[2])}] ${chatBoxHistory[i][0]}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
outputString = replaceColoursInMessage(outputString);
|
||||||
|
|
||||||
|
if (chatEmojiEnabled == true) {
|
||||||
|
outputString = replaceEmojiInMessage(outputString);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (profanityFilterEnabled == true) {
|
||||||
|
outputString = replaceProfanityInMessage(outputString);
|
||||||
|
}
|
||||||
|
|
||||||
|
message(outputString, chatBoxHistory[i][1]);
|
||||||
|
} else {
|
||||||
|
message("", COLOUR_WHITE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
chatLastUse = getCurrentUnixTimestamp();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function processMouseWheelForChatBox(mouseId, deltaCoordinates, flipped) {
|
||||||
|
// There isn't a way to detect whether chat input is active, but mouse cursor is forced shown when typing so ¯\_(ツ)_/¯
|
||||||
|
if (!gui.cursorEnabled) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!flipped) {
|
||||||
|
if (deltaCoordinates.y > 0) {
|
||||||
|
chatBoxScrollUp();
|
||||||
|
} else {
|
||||||
|
chatBoxScrollDown();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (deltaCoordinates.y > 0) {
|
||||||
|
chatBoxScrollDown();
|
||||||
|
} else {
|
||||||
|
chatBoxScrollUp();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function checkChatAutoHide() {
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Make sure chat input isn't active
|
||||||
|
if (gui.cursorEnabled) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Don't process auto-hide if it's disabled
|
||||||
|
if (chatAutoHideDelay == 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getCurrentUnixTimestamp() - chatLastUse >= chatAutoHideDelay) {
|
||||||
|
setChatWindowEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -1,171 +0,0 @@
|
|||||||
// ===========================================================================
|
|
||||||
// Vortrex's Roleplay Resource
|
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
|
||||||
// ===========================================================================
|
|
||||||
// FILE: chatbox.js
|
|
||||||
// DESC: Provides extra chatbox features
|
|
||||||
// TYPE: Client (JavaScript)
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
let chatBoxHistory = [];
|
|
||||||
let bottomMessageIndex = 0;
|
|
||||||
let maxChatBoxHistory = 500;
|
|
||||||
|
|
||||||
let scrollAmount = 1;
|
|
||||||
let maxChatBoxLines = 6;
|
|
||||||
|
|
||||||
let chatAutoHideDelay = 0;
|
|
||||||
let chatLastUse = 0;
|
|
||||||
|
|
||||||
let scrollUpKey = false;
|
|
||||||
let scrollDownKey = false;
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function initChatBoxScript() {
|
|
||||||
logToConsole(LOG_DEBUG, "[VRR.ChatBox]: Initializing chatbox script ...");
|
|
||||||
scrollUpKey = getKeyIdFromParams("pageup");
|
|
||||||
scrollDownKey = getKeyIdFromParams("pagedown");
|
|
||||||
bindChatBoxKeys();
|
|
||||||
logToConsole(LOG_DEBUG, "[VRR.ChatBox]: Chatbox script initialized!");
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function bindChatBoxKeys() {
|
|
||||||
bindKey(toInteger(scrollUpKey), KEYSTATE_DOWN, chatBoxScrollUp);
|
|
||||||
bindKey(toInteger(scrollDownKey), KEYSTATE_DOWN, chatBoxScrollDown);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function unBindChatBoxKeys() {
|
|
||||||
unbindKey(toInteger(scrollUpKey));
|
|
||||||
unbindKey(toInteger(scrollDownKey));
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function receiveChatBoxMessageFromServer(messageString, colour) {
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.ChatBox]: Received chatbox message from server: ${messageString}`);
|
|
||||||
|
|
||||||
// Just in case it's hidden by auto hide
|
|
||||||
//setChatWindowEnabled(true);
|
|
||||||
|
|
||||||
let colouredString = replaceColoursInMessage(messageString);
|
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.ChatBox]: Changed colours in string: ${colouredString}`);
|
|
||||||
|
|
||||||
addToChatBoxHistory(colouredString, colour);
|
|
||||||
//if(bottomMessageIndex >= chatBoxHistory.length-1) {
|
|
||||||
message(colouredString, colour);
|
|
||||||
bottomMessageIndex = chatBoxHistory.length-1;
|
|
||||||
//}
|
|
||||||
|
|
||||||
chatLastUse = getCurrentUnixTimestamp();
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function setChatScrollLines(amount) {
|
|
||||||
scrollAmount = amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function setChatAutoHideDelay(delay) {
|
|
||||||
chatAutoHideDelay = delay*1000;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function addToChatBoxHistory(messageString, colour) {
|
|
||||||
chatBoxHistory.push([messageString, colour]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function chatBoxScrollUp() {
|
|
||||||
if(bottomMessageIndex > maxChatBoxLines) {
|
|
||||||
bottomMessageIndex = bottomMessageIndex-scrollAmount;
|
|
||||||
updateChatBox();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function chatBoxScrollDown() {
|
|
||||||
if(bottomMessageIndex < chatBoxHistory.length-1) {
|
|
||||||
bottomMessageIndex = bottomMessageIndex+scrollAmount;
|
|
||||||
updateChatBox();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function clearChatBox() {
|
|
||||||
for(let i = 0 ; i <= maxChatBoxLines ; i++) {
|
|
||||||
message("", COLOUR_WHITE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function updateChatBox() {
|
|
||||||
clearChatBox();
|
|
||||||
for(let i = bottomMessageIndex-maxChatBoxLines ; i <= bottomMessageIndex ; i++) {
|
|
||||||
if(typeof chatBoxHistory[i] != "undefined") {
|
|
||||||
message(chatBoxHistory[i][0], chatBoxHistory[i][1]);
|
|
||||||
} else {
|
|
||||||
message("", COLOUR_WHITE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
chatLastUse = getCurrentUnixTimestamp();
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function processMouseWheelForChatBox(mouseId, deltaCoordinates, flipped) {
|
|
||||||
// There isn't a way to detect whether chat input is active, but mouse cursor is forced shown when typing so ¯\_(ツ)_/¯
|
|
||||||
if(!gui.cursorEnabled) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!flipped) {
|
|
||||||
if(deltaCoordinates.y > 0) {
|
|
||||||
chatBoxScrollUp();
|
|
||||||
} else {
|
|
||||||
chatBoxScrollDown();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if(deltaCoordinates.y > 0) {
|
|
||||||
chatBoxScrollDown();
|
|
||||||
} else {
|
|
||||||
chatBoxScrollUp();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function checkChatAutoHide() {
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// Make sure chat input isn't active
|
|
||||||
if(gui.cursorEnabled) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Don't process auto-hide if it's disabled
|
|
||||||
if(chatAutoHideDelay == 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(getCurrentUnixTimestamp()-chatLastUse >= chatAutoHideDelay) {
|
|
||||||
setChatWindowEnabled(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: content.js
|
// FILE: content.js
|
||||||
// DESC: Provides connection to extra content resources
|
// DESC: Provides connection to extra content resources
|
||||||
@@ -9,10 +10,10 @@
|
|||||||
|
|
||||||
function getCustomImage(imageName) {
|
function getCustomImage(imageName) {
|
||||||
let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
|
let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
|
||||||
if(contentResource != null) {
|
if (contentResource != null) {
|
||||||
if(contentResource.isStarted) {
|
if (contentResource.isStarted) {
|
||||||
let image = contentResource.exports.getCustomImage(imageName);
|
let image = contentResource.exports.getCustomImage(imageName);
|
||||||
if(image != null) {
|
if (image != null) {
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -24,10 +25,10 @@ function getCustomImage(imageName) {
|
|||||||
|
|
||||||
function getCustomFont(fontName) {
|
function getCustomFont(fontName) {
|
||||||
let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
|
let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
|
||||||
if(contentResource != null) {
|
if (contentResource != null) {
|
||||||
if(contentResource.isStarted) {
|
if (contentResource.isStarted) {
|
||||||
let font = contentResource.exports.getCustomFont(fontName);
|
let font = contentResource.exports.getCustomFont(fontName);
|
||||||
if(font != null) {
|
if (font != null) {
|
||||||
return font;
|
return font;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -39,10 +40,10 @@ function getCustomFont(fontName) {
|
|||||||
|
|
||||||
function getCustomAudio(audioName) {
|
function getCustomAudio(audioName) {
|
||||||
let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
|
let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
|
||||||
if(contentResource != null) {
|
if (contentResource != null) {
|
||||||
if(contentResource.isStarted) {
|
if (contentResource.isStarted) {
|
||||||
let audioFile = contentResource.exports.getCustomAudio(audioName);
|
let audioFile = contentResource.exports.getCustomAudio(audioName);
|
||||||
if(audioFile != null) {
|
if (audioFile != null) {
|
||||||
return audioFile;
|
return audioFile;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -54,8 +55,8 @@ function getCustomAudio(audioName) {
|
|||||||
|
|
||||||
function playCustomAudio(audioName, volume = 0.5, loop = false) {
|
function playCustomAudio(audioName, volume = 0.5, loop = false) {
|
||||||
let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
|
let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
|
||||||
if(contentResource != null) {
|
if (contentResource != null) {
|
||||||
if(contentResource.isStarted) {
|
if (contentResource.isStarted) {
|
||||||
contentResource.exports.playCustomAudio(audioName, volume, loop);
|
contentResource.exports.playCustomAudio(audioName, volume, loop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: main.js
|
// FILE: main.js
|
||||||
// DESC: Main client script (will be reorganized into individual files later)
|
// DESC: Main client script (will be reorganized into individual files later)
|
||||||
@@ -18,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;
|
||||||
@@ -30,7 +31,7 @@ let renderHotBar = true;
|
|||||||
let renderItemActionDelay = true;
|
let renderItemActionDelay = true;
|
||||||
let renderInteriorLights = true;
|
let renderInteriorLights = true;
|
||||||
|
|
||||||
let logLevel = LOG_INFO|LOG_DEBUG|LOG_VERBOSE;
|
let logLevel = LOG_INFO | LOG_DEBUG;
|
||||||
|
|
||||||
let weaponDamageEnabled = {};
|
let weaponDamageEnabled = {};
|
||||||
let weaponDamageEvent = {};
|
let weaponDamageEvent = {};
|
||||||
@@ -60,10 +61,11 @@ 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;
|
||||||
|
|
||||||
let vehiclePurchaseState = VRR_VEHBUYSTATE_NONE;
|
let vehiclePurchaseState = AGRP_VEHBUYSTATE_NONE;
|
||||||
let vehiclePurchasing = null;
|
let vehiclePurchasing = null;
|
||||||
let vehiclePurchasePosition = null;
|
let vehiclePurchasePosition = null;
|
||||||
|
|
||||||
@@ -78,8 +80,19 @@ let guiDownKey = false;
|
|||||||
// Pre-cache all allowed skins
|
// Pre-cache all allowed skins
|
||||||
let allowedSkins = getAllowedSkins(getGame());
|
let allowedSkins = getAllowedSkins(getGame());
|
||||||
|
|
||||||
|
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: [],
|
||||||
@@ -87,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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
13
scripts/client/economy.js
Normal file
13
scripts/client/economy.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
// ===========================================================================
|
||||||
|
// Asshat Gaming Roleplay
|
||||||
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
|
// ===========================================================================
|
||||||
|
// FILE: economy.js
|
||||||
|
// DESC: Provides economy functions
|
||||||
|
// TYPE: Client (JavaScript)
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: event.js
|
// FILE: event.js
|
||||||
// DESC: Provides handlers for built in GTAC and Asshat-Gaming created events
|
// DESC: Provides handlers for built in GTAC and Asshat-Gaming created events
|
||||||
@@ -8,77 +9,91 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initEventScript() {
|
function initEventScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Event]: Initializing event script ...");
|
logToConsole(LOG_DEBUG, "[AGRP.Event]: Initializing event script ...");
|
||||||
addCustomEvents();
|
|
||||||
addAllEventHandlers();
|
addAllEventHandlers();
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Event]: Event script initialized!");
|
logToConsole(LOG_DEBUG, "[AGRP.Event]: Event script initialized!");
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function addCustomEvents() {
|
|
||||||
addEvent("OnLocalPlayerEnterSphere", 1);
|
|
||||||
addEvent("OnLocalPlayerExitSphere", 1);
|
|
||||||
addEvent("OnLocalPlayerEnteredVehicle", 1);
|
|
||||||
addEvent("OnLocalPlayerExitedVehicle", 1);
|
|
||||||
addEvent("OnLocalPlayerSwitchWeapon", 2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function addAllEventHandlers() {
|
function addAllEventHandlers() {
|
||||||
bindEventHandler("OnResourceStart", thisResource, onResourceStart);
|
addEventHandler("OnResourceStart", onResourceStart);
|
||||||
bindEventHandler("OnResourceReady", thisResource, onResourceReady);
|
addEventHandler("OnResourceReady", onResourceReady);
|
||||||
bindEventHandler("OnResourceStop", thisResource, onResourceStop);
|
addEventHandler("OnResourceStop", onResourceStop);
|
||||||
|
|
||||||
addEventHandler("OnProcess", onProcess);
|
addEventHandler("OnProcess", onProcess);
|
||||||
addEventHandler("OnKeyUp", onKeyUp);
|
addEventHandler("OnKeyUp", onKeyUp);
|
||||||
addEventHandler("OnDrawnHUD", onDrawnHUD);
|
addEventHandler("OnDrawnHUD", onDrawnHUD);
|
||||||
|
|
||||||
addEventHandler("OnPedWasted", onPedWasted);
|
addEventHandler("OnPedWasted", onPedWasted);
|
||||||
|
|
||||||
addEventHandler("OnElementStreamIn", onElementStreamIn);
|
addEventHandler("OnElementStreamIn", onElementStreamIn);
|
||||||
|
addEventHandler("OnPedChangeWeapon", onPedChangeWeapon);
|
||||||
addEventHandler("OnLocalPlayerEnteredVehicle", onLocalPlayerEnteredVehicle);
|
|
||||||
addEventHandler("OnLocalPlayerExitedVehicle", onLocalPlayerExitedVehicle);
|
|
||||||
addEventHandler("OnLocalPlayerEnterSphere", onLocalPlayerEnterSphere);
|
|
||||||
addEventHandler("OnLocalPlayerExitSphere", onLocalPlayerExitSphere);
|
|
||||||
addEventHandler("OnLocalPlayerSwitchWeapon", onLocalPlayerSwitchWeapon);
|
|
||||||
|
|
||||||
addEventHandler("OnPedInflictDamage", onPedInflictDamage);
|
addEventHandler("OnPedInflictDamage", onPedInflictDamage);
|
||||||
|
|
||||||
addEventHandler("OnLostFocus", onLostFocus);
|
addEventHandler("OnLostFocus", onLostFocus);
|
||||||
addEventHandler("OnFocus", onFocus);
|
addEventHandler("OnFocus", onFocus);
|
||||||
|
|
||||||
addEventHandler("OnCameraProcess", onCameraProcess);
|
addEventHandler("OnCameraProcess", onCameraProcess);
|
||||||
|
|
||||||
addEventHandler("OnMouseWheel", onMouseWheel);
|
addEventHandler("OnMouseWheel", onMouseWheel);
|
||||||
|
|
||||||
addEventHandler("OnEntityProcess", onEntityProcess);
|
addEventHandler("OnEntityProcess", onEntityProcess);
|
||||||
|
|
||||||
|
if (findResourceByName("v-events") != null) {
|
||||||
|
if (findResourceByName("v-events").isStarted) {
|
||||||
|
addEventHandler("OnPedEnteredVehicleEx", onPedEnteredVehicle);
|
||||||
|
addEventHandler("OnPedExitedVehicleEx", onPedExitedVehicle);
|
||||||
|
addEventHandler("OnPedEnteredSphereEx", onPedEnteredSphere);
|
||||||
|
addEventHandler("OnPedExitedSphereEx", onPedExitedSphere);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getGame() == AGRP_GAME_MAFIA_ONE) {
|
||||||
|
addEventHandler("OnMapLoaded", onMapLoaded);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onResourceStart(event, resource) {
|
function onResourceStart(event, resource) {
|
||||||
sendResourceStartedSignalToServer();
|
if (resource == findResourceByName("v-events")) {
|
||||||
//garbageCollectorInterval = setInterval(collectAllGarbage, 1000*60);
|
// Remove and re-add events, in case v-events was loaded after agrp_main
|
||||||
|
removeEventHandler("OnPedEnteredVehicleEx");
|
||||||
|
removeEventHandler("OnPedExitedVehicleEx");
|
||||||
|
removeEventHandler("OnPedEnteredSphereEx");
|
||||||
|
removeEventHandler("OnPedExitedSphereEx");
|
||||||
|
|
||||||
|
addEventHandler("OnPedEnteredVehicleEx", onPedEnteredVehicle);
|
||||||
|
addEventHandler("OnPedExitedVehicleEx", onPedExitedVehicle);
|
||||||
|
addEventHandler("OnPedEnteredSphereEx", onPedEnteredSphere);
|
||||||
|
addEventHandler("OnPedExitedSphereEx", onPedExitedSphere);
|
||||||
|
}
|
||||||
|
|
||||||
|
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) {
|
||||||
sendResourceStoppedSignalToServer();
|
if (resource == thisResource) {
|
||||||
|
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.Event] onResourceStop called - Sending signal to server`);
|
||||||
|
sendResourceStoppedSignalToServer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onResourceReady(event, resource) {
|
function onResourceReady(event, resource) {
|
||||||
sendResourceReadySignalToServer();
|
if (resource == thisResource) {
|
||||||
|
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.Event] onResourceReady called - Sending signal to server`);
|
||||||
|
loadLocaleConfig();
|
||||||
|
sendResourceReadySignalToServer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onProcess(event, deltaTime) {
|
function onProcess(event, deltaTime) {
|
||||||
|
logToConsole(LOG_VERBOSE, `[AGRP.Event] onProcess`);
|
||||||
if (localPlayer == null) {
|
if (localPlayer == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -90,18 +105,15 @@ function onProcess(event, deltaTime) {
|
|||||||
processSync();
|
processSync();
|
||||||
processLocalPlayerControlState();
|
processLocalPlayerControlState();
|
||||||
processLocalPlayerVehicleControlState();
|
processLocalPlayerVehicleControlState();
|
||||||
processLocalPlayerSphereEntryExitHandling();
|
|
||||||
processLocalPlayerVehicleEntryExitHandling();
|
|
||||||
processJobRouteSphere();
|
|
||||||
forceLocalPlayerEquippedWeaponItem();
|
forceLocalPlayerEquippedWeaponItem();
|
||||||
processWantedLevelReset();
|
processWantedLevelReset();
|
||||||
processGameSpecifics();
|
processGameSpecifics();
|
||||||
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();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -116,11 +128,14 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (localPlayer == null) {
|
if (!localPlayer) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,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();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,31 +164,65 @@ function onElementStreamIn(event, element) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onLocalPlayerExitedVehicle(event, 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("vrr.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 onLocalPlayerEnteredVehicle(event, vehicle, seat) {
|
function onPedExitingVehicle(event, ped, vehicle, seat) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Local player entered vehicle`);
|
//logToConsole(LOG_DEBUG, `[AGRP.Event] Local player exited vehicle`);
|
||||||
|
//sendNetworkEventToServer("agrp.onPlayerExitVehicle", getVehicleForNetworkEvent(vehicle), seat);
|
||||||
|
|
||||||
sendNetworkEventToServer("vrr.onPlayerEnterVehicle", getVehicleForNetworkEvent(vehicle), seat);
|
if (localPlayer != null) {
|
||||||
|
if (ped == localPlayer) {
|
||||||
|
cruiseControlEnabled = false;
|
||||||
|
cruiseControlSpeed = 0.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (areServerElementsSupported()) {
|
// ===========================================================================
|
||||||
//if(inVehicleSeat == 0) {
|
|
||||||
//setVehicleEngine(vehicle, false);
|
function onPedEnteredVehicle(event, ped, vehicle, seat) {
|
||||||
//if(!inVehicle.engine) {
|
logToConsole(LOG_DEBUG, `[AGRP.Event] Ped entered vehicle`);
|
||||||
// parkedVehiclePosition = inVehicle.position;
|
//sendNetworkEventToServer("agrp.onPlayerEnterVehicle", getVehicleForNetworkEvent(vehicle), seat);
|
||||||
// parkedVehicleHeading = inVehicle.heading;
|
|
||||||
//}
|
cruiseControlEnabled = false;
|
||||||
//}
|
cruiseControlSpeed = 0.0;
|
||||||
|
|
||||||
|
if (localPlayer != null) {
|
||||||
|
if (ped == localPlayer) {
|
||||||
|
if (areServerElementsSupported()) {
|
||||||
|
if (inVehicleSeat == 0) {
|
||||||
|
//parkedVehiclePosition = inVehicle.position;
|
||||||
|
//parkedVehicleHeading = inVehicle.heading;
|
||||||
|
if (doesEntityDataExist(vehicle, "agrp.server") == true) {
|
||||||
|
//setVehicleEngine(vehicle.id, false);
|
||||||
|
setVehicleEngine(vehicle.id, getEntityData(vehicle, "agrp.engine"));
|
||||||
|
//setLocalPlayerControlState(false, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,14 +231,14 @@ function onLocalPlayerEnteredVehicle(event, 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) {
|
||||||
//if(!weaponDamageEnabled[damagerEntity.name]) {
|
if (!weaponDamageEnabled[damagerEntity.name]) {
|
||||||
preventDefaultEventAction(event);
|
preventDefaultEventAction(event);
|
||||||
sendNetworkEventToServer("vrr.weaponDamage", damagerEntity.name, weaponId, pedPiece, healthLoss);
|
}
|
||||||
//}
|
sendNetworkEventToServer("agrp.weaponDamage", damagerEntity.name, weaponId, pedPiece, healthLoss);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -197,8 +246,7 @@ function onPedInflictDamage(event, damagedEntity, damagerEntity, weaponId, healt
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onLocalPlayerEnterSphere(event, sphere) {
|
function onPedEnteredSphere(event, ped, sphere) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Local player entered sphere`);
|
|
||||||
if (sphere == jobRouteLocationSphere) {
|
if (sphere == jobRouteLocationSphere) {
|
||||||
enteredJobRouteSphere();
|
enteredJobRouteSphere();
|
||||||
}
|
}
|
||||||
@@ -206,8 +254,8 @@ function onLocalPlayerEnterSphere(event, sphere) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onLocalPlayerExitSphere(event, sphere) {
|
function onPedExitedSphere(event, ped, sphere) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Event] Local player exited sphere`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -224,7 +272,7 @@ function onFocus(event) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onLocalPlayerSwitchWeapon(oldWeapon, newWeapon) {
|
function onPedChangeWeapon(event, ped, oldWeapon, newWeapon) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,13 +291,13 @@ function onMouseWheel(event, mouseId, deltaCoordinates, flipped) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onEntityProcess(event, entity) {
|
function onEntityProcess(event, entity) {
|
||||||
if (!isSpawned) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//if(entity.isType(ELEMENT_PED) && !entity.isType(ELEMENT_PLAYER)) {
|
}
|
||||||
// processNPCMovement(entity);
|
|
||||||
//}
|
// ===========================================================================
|
||||||
|
|
||||||
|
function onMapLoaded(mapName) {
|
||||||
|
sendNetworkEventToServer("agrp.mapLoaded", mapName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: gps.js
|
// FILE: gps.js
|
||||||
// DESC: Provides GPS functions and usage
|
// DESC: Provides GPS functions and usage
|
||||||
@@ -16,9 +17,9 @@ 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() == VRR_MPMOD_GTAC) {
|
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
|
||||||
if(getGame() == VRR_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.
|
||||||
gpsSphere = game.createPickup(1318, position, 1);
|
gpsSphere = game.createPickup(1318, position, 1);
|
||||||
} else {
|
} else {
|
||||||
@@ -26,7 +27,7 @@ function showGPSLocation(position, colour) {
|
|||||||
gpsSphere.colour = colour;
|
gpsSphere.colour = colour;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(gpsBlip != null) {
|
if (gpsBlip != null) {
|
||||||
destroyElement(gpsBlip);
|
destroyElement(gpsBlip);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,16 +41,16 @@ function showGPSLocation(position, colour) {
|
|||||||
|
|
||||||
function blinkGPSBlip(times, position, colour) {
|
function blinkGPSBlip(times, position, colour) {
|
||||||
gpsBlipBlinkTimes = times;
|
gpsBlipBlinkTimes = times;
|
||||||
gpsBlipBlinkTimer = setInterval(function() {
|
gpsBlipBlinkTimer = setInterval(function () {
|
||||||
if(gpsBlip != null) {
|
if (gpsBlip != null) {
|
||||||
destroyElement(gpsBlip);
|
destroyElement(gpsBlip);
|
||||||
gpsBlip = null;
|
gpsBlip = null;
|
||||||
} else {
|
} else {
|
||||||
gpsBlip = game.createBlip(position, 0, 2, colour);
|
gpsBlip = game.createBlip(position, 0, 2, colour);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(gpsBlipBlinkAmount >= gpsBlipBlinkTimes) {
|
if (gpsBlipBlinkAmount >= gpsBlipBlinkTimes) {
|
||||||
if(gpsBlip != null) {
|
if (gpsBlip != null) {
|
||||||
destroyElement(gpsBlip);
|
destroyElement(gpsBlip);
|
||||||
gpsBlip = null;
|
gpsBlip = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: gui.js
|
// FILE: gui.js
|
||||||
// DESC: Provides GUI functionality and styles (using MexUI)
|
// DESC: Provides GUI functionality and styles (using MexUI)
|
||||||
@@ -40,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();
|
||||||
@@ -61,25 +62,27 @@ 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);
|
||||||
loadAllLocaleStrings();
|
|
||||||
|
|
||||||
resetGUIStrings();
|
|
||||||
resetLocaleChooserOptions();
|
|
||||||
|
|
||||||
sendNetworkEventToServer("vrr.guiReady", true);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
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;
|
||||||
@@ -92,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;
|
||||||
@@ -160,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];
|
||||||
@@ -186,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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -230,13 +277,17 @@ function processGUIKeyPress(keyCode) {
|
|||||||
|
|
||||||
function processToggleGUIKeyPress(keyCode) {
|
function processToggleGUIKeyPress(keyCode) {
|
||||||
if (keyCode == disableGUIKey) {
|
if (keyCode == disableGUIKey) {
|
||||||
sendNetworkEventToServer("vrr.toggleGUI");
|
sendNetworkEventToServer("agrp.toggleGUI");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
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");
|
||||||
@@ -281,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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: 2fa.js
|
// FILE: 2fa.js
|
||||||
// DESC: Provides two factor authentication GUI
|
// DESC: Provides two factor authentication GUI
|
||||||
@@ -20,8 +21,8 @@ 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),
|
||||||
transitionTime: 500,
|
transitionTime: 500,
|
||||||
@@ -38,7 +39,7 @@ function initTwoFactorAuthenticationGUI() {
|
|||||||
borderColour: toColour(0, 0, 0, 0),
|
borderColour: toColour(0, 0, 0, 0),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
twoFactorAuth.window.titleBarIconSize = toVector2(0,0);
|
twoFactorAuth.window.titleBarIconSize = toVector2(0, 0);
|
||||||
twoFactorAuth.window.titleBarHeight = 0;
|
twoFactorAuth.window.titleBarHeight = 0;
|
||||||
|
|
||||||
twoFactorAuth.qrCode = twoFactorAuth.window.image(100, 20, 100, 100, mainLogoPath, {
|
twoFactorAuth.qrCode = twoFactorAuth.window.image(100, 20, 100, 100, mainLogoPath, {
|
||||||
@@ -94,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;
|
||||||
@@ -112,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 = "";
|
||||||
@@ -121,15 +122,15 @@ 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("vrr.2fa", twoFactorAuth.codeInput.lines[0]);
|
sendNetworkEventToServer("agrp.2fa", twoFactorAuth.codeInput.lines[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1,8 +1,85 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: bizmgr.js
|
// FILE: bizmgr.js
|
||||||
// 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);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: changepass.js
|
// FILE: changepass.js
|
||||||
// DESC: Provides change password GUI
|
// DESC: Provides change password GUI
|
||||||
@@ -19,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),
|
||||||
@@ -110,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 = "";
|
||||||
@@ -127,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("vrr.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);
|
||||||
@@ -149,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();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: charselect.js
|
// FILE: charselect.js
|
||||||
// DESC: Provides character select GUI
|
// DESC: Provides character select GUI
|
||||||
@@ -23,23 +24,23 @@ 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),
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
textSize: 12.0,
|
textSize: 12.0,
|
||||||
textFont: mainFont,
|
textFont: mainFont,
|
||||||
textColour: toColour(0, 0, 0, 255),
|
textColour: toColour(0, 0, 0, 255),
|
||||||
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
|
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
|
||||||
},
|
},
|
||||||
icon: {
|
icon: {
|
||||||
textSize: 10.0,
|
textSize: 10.0,
|
||||||
textFont: mainFont,
|
textFont: mainFont,
|
||||||
textColour: toColour(0, 0, 0, 255),
|
textColour: toColour(0, 0, 0, 255),
|
||||||
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
|
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
characterSelect.window.titleBarIconSize = toVector2(0, 0);
|
characterSelect.window.titleBarIconSize = toVector2(0, 0);
|
||||||
characterSelect.window.titleBarIconShown = false;
|
characterSelect.window.titleBarIconShown = false;
|
||||||
@@ -150,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");
|
||||||
@@ -171,53 +172,53 @@ function showCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, ski
|
|||||||
guiLeftKey = selectPreviousCharacter;
|
guiLeftKey = selectPreviousCharacter;
|
||||||
guiRightKey = selectNextCharacter;
|
guiRightKey = selectNextCharacter;
|
||||||
|
|
||||||
showLocaleChooserGUI(new Vec2(getScreenWidth()/2-(localeChooser.window.size.x/2), characterSelect.window.position.y+characterSelect.window.size.y+20));
|
showLocaleChooserGUI(new Vec2(getScreenWidth() / 2 - (localeChooser.window.size.x / 2), characterSelect.window.position.y + characterSelect.window.size.y + 20));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
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("vrr.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("vrr.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("vrr.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}`;
|
||||||
|
|
||||||
if(characterSelect.skinImage != null) {
|
if (characterSelect.skinImage != null) {
|
||||||
characterSelect.skinImage.remove();
|
characterSelect.skinImage.remove();
|
||||||
}
|
}
|
||||||
characterSelect.skinImage = (getGame() == VRR_GAME_GTA_III) ? characterSelect.window.image(310, 32, 100, 90, `files/images/skins/gta3/${getSkinImage(skinId)}.png`) : characterSelect.window.image(310, 32, 100, 90, "files/images/skins/none.png");
|
characterSelect.skinImage = (getGame() == AGRP_GAME_GTA_III) ? characterSelect.window.image(310, 32, 100, 90, `files/images/skins/gta3/${getSkinImage(skinId)}.png`) : characterSelect.window.image(310, 32, 100, 90, "files/images/skins/none.png");
|
||||||
|
|
||||||
characterSelect.window.shown = true;
|
characterSelect.window.shown = true;
|
||||||
|
|
||||||
@@ -229,18 +230,18 @@ 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();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getSkinImage(skinId, gameId = getGame()) {
|
function getSkinImage(skinId, gameId = getGame()) {
|
||||||
if(skinId < 10) {
|
if (skinId < 10) {
|
||||||
return `Skin_00${skinId}.png`;
|
return `Skin_00${skinId}.png`;
|
||||||
} else if(skinId > 10 && skinId < 100) {
|
} else if (skinId > 10 && skinId < 100) {
|
||||||
return `Skin_0${skinId}.png`;
|
return `Skin_0${skinId}.png`;
|
||||||
} else if(skinId > 100) {
|
} else if (skinId > 100) {
|
||||||
return `Skin_${skinId}.png`;
|
return `Skin_${skinId}.png`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: clanmgr.js
|
// FILE: clanmgr.js
|
||||||
// DESC: Provides clan manager GUI
|
// DESC: Provides clan manager GUI
|
||||||
@@ -9,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() {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: error.js
|
// FILE: error.js
|
||||||
// DESC: Provides error box GUI
|
// DESC: Provides error box GUI
|
||||||
@@ -16,8 +17,8 @@ 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),
|
||||||
transitionTime: 500,
|
transitionTime: 500,
|
||||||
@@ -58,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;
|
||||||
@@ -77,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`);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
147
scripts/client/gui/games/betting.js
Normal file
147
scripts/client/gui/games/betting.js
Normal file
@@ -0,0 +1,147 @@
|
|||||||
|
// ===========================================================================
|
||||||
|
// Asshat Gaming Roleplay
|
||||||
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
|
// ===========================================================================
|
||||||
|
// FILE: betting.js
|
||||||
|
// DESC: Provides betting GUI (used for multiple casino games)
|
||||||
|
// TYPE: Client (JavaScript)
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
let bettingGUI = {
|
||||||
|
window: null,
|
||||||
|
amountLabel: null,
|
||||||
|
fiveThousandLabel: null,
|
||||||
|
fiveThousandPlusButton: null,
|
||||||
|
fiveThousandMinusButton: null,
|
||||||
|
oneThousandLabel: null,
|
||||||
|
oneThousandPlusButton: null,
|
||||||
|
oneThousandMinusButton: null,
|
||||||
|
fiveHundredPlusButton: null,
|
||||||
|
fiveHundredMinusButton: null,
|
||||||
|
oneHundredLabel: null,
|
||||||
|
oneHundredPlusButton: null,
|
||||||
|
oneHundredMinusButton: null,
|
||||||
|
fiftyLabel: null,
|
||||||
|
fiftyPlusButton: null,
|
||||||
|
fiftyMinusButton: null,
|
||||||
|
twentyLabel: null,
|
||||||
|
twentyPlusButton: null,
|
||||||
|
twentyMinusButton: null,
|
||||||
|
tenLabel: null,
|
||||||
|
tenPlusButton: null,
|
||||||
|
tenMinusButton: null,
|
||||||
|
fiveLabel: null,
|
||||||
|
fivePlusButton: null,
|
||||||
|
fiveMinusButton: null,
|
||||||
|
oneLabel: null,
|
||||||
|
onePlusButton: null,
|
||||||
|
oneMinusButton: null,
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function initBettingGUI() {
|
||||||
|
bettingGUI.window = mexui.window(getScreenWidth() / 2 - 125, getScreenHeight() / 2 - 250, 250, 500, 'BETTING', {
|
||||||
|
main: {
|
||||||
|
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
||||||
|
transitionTime: 500,
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
textSize: 0.0,
|
||||||
|
textColour: toColour(0, 0, 0, 0),
|
||||||
|
},
|
||||||
|
icon: {
|
||||||
|
textSize: 0.0,
|
||||||
|
textColour: toColour(0, 0, 0, 0),
|
||||||
|
},
|
||||||
|
focused: {
|
||||||
|
borderColour: toColour(0, 0, 0, 0),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
bettingGUI.window.titleBarIconSize = toVector2(0, 0);
|
||||||
|
bettingGUI.window.titleBarHeight = 0;
|
||||||
|
bettingGUI.window.titleBarShown = false;
|
||||||
|
|
||||||
|
bettingGUI.amountLabel = bettingGUI.window.text(10, 20, 230, 20, 'Amount: 0', {
|
||||||
|
main: {
|
||||||
|
textSize: 20.0,
|
||||||
|
textAlign: 0.5,
|
||||||
|
textColour: toColour(200, 200, 200, 255),
|
||||||
|
textFont: mainFont,
|
||||||
|
},
|
||||||
|
focused: {
|
||||||
|
borderColour: toColour(0, 0, 0, 0),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
bettingGUI.oneLabel = bettingGUI.window.text(10, 50, 230, 20, '1', {
|
||||||
|
main: {
|
||||||
|
textSize: 10.0,
|
||||||
|
textAlign: 0.5,
|
||||||
|
textColour: toColour(200, 200, 200, 255),
|
||||||
|
textFont: mainFont,
|
||||||
|
},
|
||||||
|
focused: {
|
||||||
|
borderColour: toColour(0, 0, 0, 0),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
bettingGUI.fiveLabel = bettingGUI.window.text(10, 65, 230, 20, '1', {
|
||||||
|
main: {
|
||||||
|
textSize: 10.0,
|
||||||
|
textAlign: 0.5,
|
||||||
|
textColour: toColour(200, 200, 200, 255),
|
||||||
|
textFont: mainFont,
|
||||||
|
},
|
||||||
|
focused: {
|
||||||
|
borderColour: toColour(0, 0, 0, 0),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
bettingGUI.tenLabel = bettingGUI.window.text(10, 80, 230, 20, '1', {
|
||||||
|
main: {
|
||||||
|
textSize: 10.0,
|
||||||
|
textAlign: 0.5,
|
||||||
|
textColour: toColour(200, 200, 200, 255),
|
||||||
|
textFont: mainFont,
|
||||||
|
},
|
||||||
|
focused: {
|
||||||
|
borderColour: toColour(0, 0, 0, 0),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
bettingGUI.fiftyLabel = bettingGUI.window.text(10, 95, 230, 20, '1', {
|
||||||
|
main: {
|
||||||
|
textSize: 10.0,
|
||||||
|
textAlign: 0.5,
|
||||||
|
textColour: toColour(200, 200, 200, 255),
|
||||||
|
textFont: mainFont,
|
||||||
|
},
|
||||||
|
focused: {
|
||||||
|
borderColour: toColour(0, 0, 0, 0),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
bettingGUI.hundredLabel = bettingGUI.window.text(10, 95, 230, 20, '1', {
|
||||||
|
main: {
|
||||||
|
textSize: 10.0,
|
||||||
|
textAlign: 0.5,
|
||||||
|
textColour: toColour(200, 200, 200, 255),
|
||||||
|
textFont: mainFont,
|
||||||
|
},
|
||||||
|
focused: {
|
||||||
|
borderColour: toColour(0, 0, 0, 0),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
bettingGUI.window.shown = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function showBettingGUI() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
49
scripts/client/gui/games/blackjack.js
Normal file
49
scripts/client/gui/games/blackjack.js
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
// ===========================================================================
|
||||||
|
// Asshat Gaming Roleplay
|
||||||
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
|
// ===========================================================================
|
||||||
|
// FILE: blackjack.js
|
||||||
|
// DESC: Provides blackjack game GUI
|
||||||
|
// TYPE: Client (JavaScript)
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
let blackJackGUI = {
|
||||||
|
window: null,
|
||||||
|
dealerHand: [],
|
||||||
|
playerHand: [],
|
||||||
|
};
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
let playerCards = [];
|
||||||
|
let dealerCards = [];
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function initBlackJackGUI() {
|
||||||
|
// Render a blackjack game in MexUI
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating blackjack GUI ...`);
|
||||||
|
blackJackGUI.window = mexui.window(game.width / 2 - 200, game.height - 150, 400, 400, 'Blackjack', {
|
||||||
|
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),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
blackJackGUI.window.titleBarShown = false;
|
||||||
|
|
||||||
|
blackJackGUI.window.shown = false;
|
||||||
|
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created blackjack GUI`);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: housemgr.js
|
// FILE: housemgr.js
|
||||||
// DESC: Provides house manager GUI
|
// DESC: Provides house manager GUI
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Connected RP: Login</title>
|
|
||||||
<style type="text/css" rel="stylesheet">
|
|
||||||
.input-box
|
|
||||||
{
|
|
||||||
font-family: 'Roboto';
|
|
||||||
font-size: 14px;
|
|
||||||
border-style: solid;
|
|
||||||
border-colour: #0066AA;
|
|
||||||
border-radius: 2px;
|
|
||||||
color: #0066AA;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button
|
|
||||||
{
|
|
||||||
font-family: "Roboto";
|
|
||||||
font-size: 14px;
|
|
||||||
border-style: solid;
|
|
||||||
border-colour: #0066AA;
|
|
||||||
border-radius: 2px;
|
|
||||||
color: #0066AA;
|
|
||||||
};
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<img src="server-logo.png" />
|
|
||||||
<input type="password" placeholder="Password" id="login_input_password" />
|
|
||||||
<button class="button" id="login_input_submit">LOGIN</button>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: info.js
|
// FILE: info.js
|
||||||
// DESC: Provides info dialog box GUI
|
// DESC: Provides info dialog box GUI
|
||||||
@@ -16,8 +17,8 @@ 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),
|
||||||
},
|
},
|
||||||
@@ -57,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);
|
||||||
}
|
}
|
||||||
@@ -72,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);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: list.js
|
// FILE: list.js
|
||||||
// DESC: Provides simple list GUI
|
// DESC: Provides simple list GUI
|
||||||
@@ -11,13 +12,15 @@ 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),
|
||||||
},
|
},
|
||||||
@@ -50,34 +53,34 @@ function initListGUI() {
|
|||||||
|
|
||||||
listDialog.listGrid = listDialog.window.grid(5, 25, 390, 450, {
|
listDialog.listGrid = listDialog.window.grid(5, 25, 390, 450, {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
||||||
},
|
},
|
||||||
column: {
|
column: {
|
||||||
lineColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
|
lineColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha-50),
|
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha - 50),
|
||||||
textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], windowTitleAlpha),
|
textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], windowTitleAlpha),
|
||||||
},
|
},
|
||||||
cell: {
|
cell: {
|
||||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
||||||
textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], windowTitleAlpha),
|
textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], windowTitleAlpha),
|
||||||
},
|
},
|
||||||
row: {
|
row: {
|
||||||
lineColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
|
lineColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
|
||||||
hover: {
|
hover: {
|
||||||
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], 120),
|
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], 120),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
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;
|
||||||
@@ -89,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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: localechooser.js
|
// FILE: localechooser.js
|
||||||
// DESC: Provides locale chooser GUI
|
// DESC: Provides locale chooser GUI
|
||||||
@@ -19,8 +20,8 @@ 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),
|
||||||
},
|
},
|
||||||
@@ -37,38 +38,45 @@ function initLocaleChooserGUI() {
|
|||||||
});
|
});
|
||||||
localeChooser.window.titleBarShown = false;
|
localeChooser.window.titleBarShown = false;
|
||||||
|
|
||||||
loadLocaleConfig();
|
localeChooser.window.shown = false;
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Created locale chooser GUI`);
|
logToConsole(LOG_DEBUG, `[AGRP.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) {
|
||||||
|
localeChooser.flagImages[i].shown = false;
|
||||||
|
}
|
||||||
mexui.setInput(false);
|
mexui.setInput(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showLocaleChooserGUI(position = toVector2(0.0, 0.0)) {
|
function showLocaleChooserGUI(position = toVector2(0.0, 0.0)) {
|
||||||
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 {
|
||||||
localeChooser.window.position = toVector2((getScreenWidth()/2)-(localeChooser.window.size.x/2), getScreenHeight()-100);
|
localeChooser.window.position = toVector2((getScreenWidth() / 2) - (localeChooser.window.size.x / 2), getScreenHeight() - 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
//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;
|
||||||
|
|
||||||
|
for (let i in localeChooser.flagImages) {
|
||||||
|
localeChooser.flagImages[i].shown = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function toggleLocaleChooserGUI() {
|
function toggleLocaleChooserGUI() {
|
||||||
if(localeChooser.window.shown) {
|
if (localeChooser.window.shown == true) {
|
||||||
closeLocaleChooserGUI();
|
closeLocaleChooserGUI();
|
||||||
} else {
|
} else {
|
||||||
showLocaleChooserGUI();
|
showLocaleChooserGUI();
|
||||||
@@ -78,36 +86,38 @@ 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();
|
||||||
|
|
||||||
localeChooser.window.size = toVector2((tempLocaleOptions.length*(flagImageSize.x+flagImageGap.x))+flagImageGap.x, flagImageSize.y+flagImageGap.y*2);
|
localeChooser.window.size = toVector2((tempLocaleOptions.length * (flagImageSize.x + flagImageGap.x)) + flagImageGap.x, flagImageSize.y + flagImageGap.y * 2);
|
||||||
localeChooser.window.position = toVector2((getScreenWidth()/2)-(localeChooser.window.size.x/2), getScreenHeight()-100);
|
localeChooser.window.position = toVector2((getScreenWidth() / 2) - (localeChooser.window.size.x / 2), getScreenHeight() - 100);
|
||||||
|
|
||||||
for(let i in localeChooser.flagImages) {
|
for (let i in localeChooser.flagImages) {
|
||||||
localeChooser.flagImages[i].remove();
|
localeChooser.flagImages[i].remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
for(let i in tempLocaleOptions) {
|
for (let i in tempLocaleOptions) {
|
||||||
let imagePath = `files/images/flags/${tempLocaleOptions[i].flagImageFile}`;
|
let imagePath = `files/images/flags/${tempLocaleOptions[i].flagImageFile}`;
|
||||||
localeChooser.flagImages[i] = localeChooser.window.image((i*(flagImageSize.x+flagImageGap.x))+flagImageGap.x, flagImageGap.y, flagImageSize.x, flagImageSize.y, imagePath, {
|
localeChooser.flagImages[i] = localeChooser.window.image((i * (flagImageSize.x + flagImageGap.x)) + flagImageGap.x, flagImageGap.y, flagImageSize.x, flagImageSize.y, imagePath, {
|
||||||
focused: {
|
focused: {
|
||||||
borderColour: toColour(0, 0, 0, 0),
|
borderColour: toColour(0, 0, 0, 0),
|
||||||
},
|
},
|
||||||
}, function() {
|
}, function () {
|
||||||
localeChooserSetLocale(tempLocaleOptions[i].id);
|
localeChooserSetLocale(tempLocaleOptions[i].id);
|
||||||
});
|
});
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG|LOG_WARN, `[VRR.GUI] Created locale chooser option ${tempLocaleOptions[i].englishName} with image ${imagePath}`);
|
localeChooser.flagImages[i].shown = false;
|
||||||
|
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: login.js
|
// FILE: login.js
|
||||||
// DESC: Provides login GUI
|
// DESC: Provides login GUI
|
||||||
@@ -20,7 +21,7 @@ let login = {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
let loginHTML =
|
let loginHTML =
|
||||||
`<html>
|
`<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Asshat Gaming Roleplay: Login</title>
|
<title>Asshat Gaming Roleplay: Login</title>
|
||||||
<style type="text/css" rel="stylesheet">
|
<style type="text/css" rel="stylesheet">
|
||||||
@@ -42,8 +43,8 @@ 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),
|
||||||
transitionTime: 500,
|
transitionTime: 500,
|
||||||
@@ -60,7 +61,7 @@ function initLoginGUI() {
|
|||||||
borderColour: toColour(0, 0, 0, 0),
|
borderColour: toColour(0, 0, 0, 0),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
login.window.titleBarIconSize = toVector2(0,0);
|
login.window.titleBarIconSize = toVector2(0, 0);
|
||||||
login.window.titleBarHeight = 0;
|
login.window.titleBarHeight = 0;
|
||||||
login.window.titleBarShown = false;
|
login.window.titleBarShown = false;
|
||||||
|
|
||||||
@@ -108,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,
|
||||||
@@ -121,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,
|
||||||
@@ -143,35 +144,35 @@ 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;
|
||||||
mexui.focusedControl = login.passwordInput;
|
mexui.focusedControl = login.passwordInput;
|
||||||
guiSubmitKey = checkLogin;
|
guiSubmitKey = checkLogin;
|
||||||
|
|
||||||
showLocaleChooserGUI(new Vec2(getScreenWidth()/2-(localeChooser.window.size.x/2), login.window.position.y+login.window.size.y+20));
|
showLocaleChooserGUI(new Vec2(getScreenWidth() / 2 - (localeChooser.window.size.x / 2), login.window.position.y + login.window.size.y + 20));
|
||||||
//showSmallGameMessage(`If you don't have a mouse cursor, press ${toUpperCase(getKeyNameFromId(disableGUIKey))} to disable GUI`, COLOUR_WHITE, 7500);
|
//showSmallGameMessage(`If you don't have a mouse cursor, press ${toUpperCase(getKeyNameFromId(disableGUIKey))} to disable GUI`, COLOUR_WHITE, 7500);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function checkLogin() {
|
function checkLogin() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Checking login with server ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Checking login with server ...`);
|
||||||
sendNetworkEventToServer("vrr.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 = "";
|
||||||
@@ -180,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();
|
||||||
}
|
}
|
||||||
@@ -189,9 +190,9 @@ 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("vrr.checkResetPassword", "");
|
sendNetworkEventToServer("agrp.checkResetPassword", "");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: newchar.js
|
// FILE: newchar.js
|
||||||
// DESC: Provides new character creation GUI
|
// DESC: Provides new character creation GUI
|
||||||
@@ -19,8 +20,8 @@ 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),
|
||||||
transitionTime: 500,
|
transitionTime: 500,
|
||||||
@@ -110,19 +111,19 @@ 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 = "";
|
||||||
newCharacter.lastNameInput.text = "";
|
newCharacter.lastNameInput.text = "";
|
||||||
|
|
||||||
if(!newCharacter.window.shown) {
|
if (!newCharacter.window.shown) {
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
setChatWindowEnabled(false);
|
setChatWindowEnabled(false);
|
||||||
mexui.setInput(true);
|
mexui.setInput(true);
|
||||||
@@ -134,16 +135,16 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(newCharacter.lastNameInput.lines[0].length < 2) {
|
if (newCharacter.lastNameInput.lines[0].length < 2) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendNetworkEventToServer("vrr.checkNewCharacter",
|
sendNetworkEventToServer("agrp.checkNewCharacter",
|
||||||
newCharacter.firstNameInput.lines[0],
|
newCharacter.firstNameInput.lines[0],
|
||||||
newCharacter.lastNameInput.lines[0],
|
newCharacter.lastNameInput.lines[0],
|
||||||
);
|
);
|
||||||
@@ -152,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);
|
||||||
@@ -160,7 +161,7 @@ function showNewCharacterGUI() {
|
|||||||
mexui.focusedInput = newCharacter.firstNameInput;
|
mexui.focusedInput = newCharacter.firstNameInput;
|
||||||
guiSubmitKey = checkNewCharacter;
|
guiSubmitKey = checkNewCharacter;
|
||||||
|
|
||||||
showLocaleChooserGUI(new Vec2(getScreenWidth()/2-(localeChooser.window.size.x/2), newCharacter.window.position.y+newCharacter.window.size.y+20));
|
showLocaleChooserGUI(new Vec2(getScreenWidth() / 2 - (localeChooser.window.size.x / 2), newCharacter.window.position.y + newCharacter.window.size.y + 20));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: register.js
|
// FILE: register.js
|
||||||
// DESC: Provides account registration GUI
|
// DESC: Provides account registration GUI
|
||||||
@@ -20,8 +21,8 @@ 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),
|
||||||
transitionTime: 500,
|
transitionTime: 500,
|
||||||
@@ -37,7 +38,7 @@ function initRegisterGUI() {
|
|||||||
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
|
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
register.window.titleBarIconSize = toVector2(0,0);
|
register.window.titleBarIconSize = toVector2(0, 0);
|
||||||
register.window.titleBarHeight = 0;
|
register.window.titleBarHeight = 0;
|
||||||
register.window.titleBarShown = false;
|
register.window.titleBarShown = false;
|
||||||
|
|
||||||
@@ -130,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 = "";
|
||||||
@@ -147,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("vrr.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);
|
||||||
@@ -162,7 +163,7 @@ function showRegistrationGUI() {
|
|||||||
mexui.focusedControl = register.passwordInput;
|
mexui.focusedControl = register.passwordInput;
|
||||||
guiSubmitKey = checkRegistration;
|
guiSubmitKey = checkRegistration;
|
||||||
|
|
||||||
showLocaleChooserGUI(new Vec2(getScreenWidth()/2-(localeChooser.window.size.x/2), register.window.position.y+register.window.size.y+20));
|
showLocaleChooserGUI(new Vec2(getScreenWidth() / 2 - (localeChooser.window.size.x / 2), register.window.position.y + register.window.size.y + 20));
|
||||||
|
|
||||||
//showSmallGameMessage(`If you don't have a mouse cursor, press ${toUpperCase(getKeyNameFromId(disableGUIKey))} to disable GUI`, COLOUR_WHITE, 7500);
|
//showSmallGameMessage(`If you don't have a mouse cursor, press ${toUpperCase(getKeyNameFromId(disableGUIKey))} to disable GUI`, COLOUR_WHITE, 7500);
|
||||||
}
|
}
|
||||||
@@ -170,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();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: resetpass.js
|
// FILE: resetpass.js
|
||||||
// DESC: Provides password reset GUI
|
// DESC: Provides password reset GUI
|
||||||
@@ -20,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),
|
||||||
@@ -120,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;
|
||||||
@@ -141,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("vrr.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 = "";
|
||||||
@@ -157,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");
|
||||||
@@ -172,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");
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: yesno.js
|
// FILE: yesno.js
|
||||||
// DESC: Provides yes/no prompt dialog GUI
|
// DESC: Provides yes/no prompt dialog GUI
|
||||||
@@ -9,17 +10,17 @@
|
|||||||
|
|
||||||
|
|
||||||
let yesNoDialog = {
|
let yesNoDialog = {
|
||||||
window: null,
|
window: null,
|
||||||
messageLabel: null,
|
messageLabel: null,
|
||||||
yesButton: null,
|
yesButton: null,
|
||||||
noButton: null,
|
noButton: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
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),
|
||||||
transitionTime: 500,
|
transitionTime: 500,
|
||||||
@@ -73,43 +74,43 @@ 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 = "";
|
||||||
yesNoDialog.yesButton.text = "";
|
yesNoDialog.yesButton.text = "";
|
||||||
yesNoDialog.noButton.text = "";
|
yesNoDialog.noButton.text = "";
|
||||||
yesNoDialog.window.title = "";
|
yesNoDialog.window.title = "";
|
||||||
|
|
||||||
yesNoDialog.messageLabel.text = promptMessage;
|
yesNoDialog.messageLabel.text = promptMessage;
|
||||||
yesNoDialog.yesButton.text = yesButtonText;
|
yesNoDialog.yesButton.text = yesButtonText;
|
||||||
yesNoDialog.noButton.text = noButtonText;
|
yesNoDialog.noButton.text = noButtonText;
|
||||||
yesNoDialog.window.title = promptTitle;
|
yesNoDialog.window.title = promptTitle;
|
||||||
|
|
||||||
yesNoDialog.window.shown = true;
|
yesNoDialog.window.shown = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
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("vrr.promptAnswerNo");
|
sendNetworkEventToServer("agrp.promptAnswerNo");
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
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("vrr.promptAnswerYes");
|
sendNetworkEventToServer("agrp.promptAnswerYes");
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: house.js
|
// FILE: house.js
|
||||||
// DESC: Provides house functions and usage
|
// DESC: Provides house functions and usage
|
||||||
@@ -16,66 +17,82 @@ 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;
|
||||||
houseData.entrancePosition = entrancePosition;
|
houseData.entrancePosition = entrancePosition;
|
||||||
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) {
|
||||||
if(blipModel == -1) {
|
houseData.labelInfoType = AGRP_PROPLABEL_INFO_BUYHOUSE;
|
||||||
if(houseData.blipId != -1) {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been removed by the server`);
|
if (houseData.rentPrice > 0) {
|
||||||
if(getGame() == VRR_GAME_GTA_IV) {
|
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 (houseData.blipId != -1) {
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.House] House ${houseId}'s blip has been removed by the server`);
|
||||||
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
natives.removeBlipAndClearIndex(getHouseData(houseId).blipId);
|
natives.removeBlipAndClearIndex(getHouseData(houseId).blipId);
|
||||||
} else {
|
} else {
|
||||||
destroyElement(getElementFromId(blipId));
|
destroyElement(getElementFromId(blipId));
|
||||||
}
|
}
|
||||||
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() == VRR_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);
|
||||||
natives.setBlipMarkerLongDistance(houseData.blipId, false);
|
natives.setBlipMarkerLongDistance(houseData.blipId, false);
|
||||||
natives.setBlipAsShortRange(houseData.blipId, true);
|
natives.setBlipAsShortRange(houseData.blipId, true);
|
||||||
natives.changeBlipNameFromAscii(houseData.blipId, `${houseData.name.substr(0, 24)}${(houseData.name.length > 24) ? " ...": ""}`);
|
natives.changeBlipNameFromAscii(houseData.blipId, `${houseData.name.substr(0, 24)}${(houseData.name.length > 24) ? " ..." : ""}`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let blipId = createGameBlip(houseData.blipModel, houseData.entrancePosition, houseData.name);
|
let blipId = createGameBlip(houseData.blipModel, houseData.entrancePosition, houseData.name);
|
||||||
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();
|
||||||
@@ -89,10 +106,10 @@ function receiveHouseFromServer(houseId, description, entrancePosition, blipMode
|
|||||||
* @param {number} houseId - The ID of the house (initially provided by server)
|
* @param {number} houseId - The ID of the house (initially provided by server)
|
||||||
* @return {HouseData} The house's data (class instance)
|
* @return {HouseData} The house's data (class instance)
|
||||||
*/
|
*/
|
||||||
function getHouseData(houseId) {
|
function getHouseData(houseId) {
|
||||||
let houses = getServerData().houses;
|
let houses = getServerData().houses;
|
||||||
for(let i in houses) {
|
for (let i in houses) {
|
||||||
if(houses[i].houseId == houseId) {
|
if (houses[i].houseId == houseId) {
|
||||||
return houses[i];
|
return houses[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -103,7 +120,7 @@ function receiveHouseFromServer(houseId, description, entrancePosition, blipMode
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setAllHouseDataIndexes() {
|
function setAllHouseDataIndexes() {
|
||||||
for(let i in getServerData().houses) {
|
for (let i in getServerData().houses) {
|
||||||
getServerData().houses[i].index = i;
|
getServerData().houses[i].index = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
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");
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: item.js
|
// FILE: item.js
|
||||||
// DESC: Provides item action and hotbar functions
|
// DESC: Provides item action and hotbar functions
|
||||||
@@ -10,35 +11,35 @@
|
|||||||
let itemActionDelayDuration = 0;
|
let itemActionDelayDuration = 0;
|
||||||
let itemActionDelayStart = 0;
|
let itemActionDelayStart = 0;
|
||||||
let itemActionDelayEnabled = false;
|
let itemActionDelayEnabled = false;
|
||||||
let itemActionDelayPosition = toVector2(game.width/2-100, game.height-10);
|
let itemActionDelayPosition = toVector2(game.width / 2 - 100, game.height - 10);
|
||||||
let itemActionDelaySize = toVector2(200, 5);
|
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!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function processItemActionRendering() {
|
function processItemActionRendering() {
|
||||||
if(renderItemActionDelay) {
|
if (renderItemActionDelay) {
|
||||||
if(itemActionDelayEnabled) {
|
if (itemActionDelayEnabled) {
|
||||||
let finishTime = itemActionDelayStart+itemActionDelayDuration;
|
let finishTime = itemActionDelayStart + itemActionDelayDuration;
|
||||||
if(sdl.ticks >= finishTime) {
|
if (sdl.ticks >= finishTime) {
|
||||||
itemActionDelayEnabled = false;
|
itemActionDelayEnabled = false;
|
||||||
itemActionDelayDuration = 0;
|
itemActionDelayDuration = 0;
|
||||||
itemActionDelayStart = 0;
|
itemActionDelayStart = 0;
|
||||||
tellServerItemActionDelayComplete();
|
tellServerItemActionDelayComplete();
|
||||||
} else {
|
} else {
|
||||||
let currentTick = sdl.ticks-itemActionDelayStart;
|
let currentTick = sdl.ticks - itemActionDelayStart;
|
||||||
let progressPercent = Math.ceil(currentTick*100/itemActionDelayDuration);
|
let progressPercent = Math.ceil(currentTick * 100 / itemActionDelayDuration);
|
||||||
let width = Math.ceil(getPercentage(itemActionDelaySize.x, progressPercent));
|
let width = Math.ceil(getPercentage(itemActionDelaySize.x, progressPercent));
|
||||||
|
|
||||||
let backgroundColour = toColour(0, 0, 0, 255);
|
let backgroundColour = toColour(0, 0, 0, 255);
|
||||||
graphics.drawRectangle(null, [itemActionDelayPosition.x-(itemActionDelaySize.x/2)-1, itemActionDelayPosition.y-(itemActionDelaySize.y/2)-1], [itemActionDelaySize.x+2, itemActionDelaySize.y+2], backgroundColour, backgroundColour, backgroundColour, backgroundColour);
|
graphics.drawRectangle(null, [itemActionDelayPosition.x - (itemActionDelaySize.x / 2) - 1, itemActionDelayPosition.y - (itemActionDelaySize.y / 2) - 1], [itemActionDelaySize.x + 2, itemActionDelaySize.y + 2], backgroundColour, backgroundColour, backgroundColour, backgroundColour);
|
||||||
graphics.drawRectangle(null, [itemActionDelayPosition.x-(itemActionDelaySize.x/2), itemActionDelayPosition.y-(itemActionDelaySize.y/2)-2], [width, itemActionDelaySize.y], COLOUR_LIME, COLOUR_LIME, COLOUR_LIME, COLOUR_LIME);
|
graphics.drawRectangle(null, [itemActionDelayPosition.x - (itemActionDelaySize.x / 2), itemActionDelayPosition.y - (itemActionDelaySize.y / 2) - 2], [width, itemActionDelaySize.y], COLOUR_LIME, COLOUR_LIME, COLOUR_LIME, COLOUR_LIME);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -47,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`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: job.js
|
// FILE: job.js
|
||||||
// DESC: Provides job functions and usage
|
// DESC: Provides job functions and usage
|
||||||
@@ -35,30 +36,31 @@ 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`);
|
logToConsole(LOG_DEBUG, `[AGRP.Job] Showing job route location at ${position.x}, ${position.y}, ${position.z}`);
|
||||||
if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
|
hideJobRouteLocation();
|
||||||
if(getGame() == VRR_GAME_GTA_SA) {
|
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
|
||||||
|
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.
|
||||||
jobRouteLocationSphere = game.createPickup(1318, position, 1);
|
jobRouteLocationSphere = game.createPickup(1318, position, 1);
|
||||||
} else {
|
} else {
|
||||||
@@ -66,7 +68,7 @@ function showJobRouteLocation(position, colour) {
|
|||||||
jobRouteLocationSphere.colour = colour;
|
jobRouteLocationSphere.colour = colour;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(jobRouteLocationBlip != null) {
|
if (jobRouteLocationBlip != null) {
|
||||||
destroyElement(jobRouteLocationBlip);
|
destroyElement(jobRouteLocationBlip);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,22 +81,8 @@ 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();
|
||||||
clearInterval(jobBlipBlinkTimer);
|
|
||||||
jobBlipBlinkAmount = 0;
|
|
||||||
jobBlipBlinkTimes = 0;
|
|
||||||
|
|
||||||
if(jobRouteLocationBlip != null) {
|
|
||||||
destroyElement(jobRouteLocationBlip);
|
|
||||||
jobRouteLocationBlip = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(jobRouteLocationSphere != null) {
|
|
||||||
destroyElement(jobRouteLocationSphere);
|
|
||||||
jobRouteLocationSphere = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
tellServerPlayerArrivedAtJobRouteLocation();
|
tellServerPlayerArrivedAtJobRouteLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,23 +90,23 @@ function enteredJobRouteSphere() {
|
|||||||
|
|
||||||
function blinkJobRouteLocationBlip(times, position, colour) {
|
function blinkJobRouteLocationBlip(times, position, colour) {
|
||||||
jobBlipBlinkTimes = times;
|
jobBlipBlinkTimes = times;
|
||||||
jobBlipBlinkTimer = setInterval(function() {
|
jobBlipBlinkTimer = setInterval(function () {
|
||||||
if(jobRouteLocationBlip != null) {
|
if (jobRouteLocationBlip != null) {
|
||||||
destroyElement(jobRouteLocationBlip);
|
destroyElement(jobRouteLocationBlip);
|
||||||
jobRouteLocationBlip = null;
|
jobRouteLocationBlip = null;
|
||||||
} else {
|
} else {
|
||||||
jobRouteLocationBlip = game.createBlip(position, 0, 2, colour);
|
jobRouteLocationBlip = game.createBlip(position, 0, 3, colour);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(jobBlipBlinkAmount >= jobBlipBlinkTimes) {
|
if (jobBlipBlinkAmount >= jobBlipBlinkTimes) {
|
||||||
if(jobRouteLocationBlip != null) {
|
if (jobRouteLocationBlip != null) {
|
||||||
destroyElement(jobRouteLocationBlip);
|
destroyElement(jobRouteLocationBlip);
|
||||||
jobRouteLocationBlip = null;
|
jobRouteLocationBlip = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
jobBlipBlinkAmount = 0;
|
jobBlipBlinkAmount = 0;
|
||||||
jobBlipBlinkTimes = 0;
|
jobBlipBlinkTimes = 0;
|
||||||
jobRouteLocationBlip = game.createBlip(position, 0, 2, colour);
|
jobRouteLocationBlip = game.createBlip(position, 0, 3, colour);
|
||||||
clearInterval(jobBlipBlinkTimer);
|
clearInterval(jobBlipBlinkTimer);
|
||||||
}
|
}
|
||||||
}, jobBlipBlinkInterval);
|
}, jobBlipBlinkInterval);
|
||||||
@@ -127,19 +115,33 @@ function blinkJobRouteLocationBlip(times, position, colour) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function hideJobRouteLocation() {
|
function hideJobRouteLocation() {
|
||||||
destroyElement(jobRouteLocationSphere);
|
logToConsole(LOG_DEBUG, `[AGRP.Job] Hiding job route location`);
|
||||||
destroyElement(jobRouteLocationBlip);
|
|
||||||
jobRouteLocationSphere = null;
|
if (jobRouteLocationBlip != null) {
|
||||||
jobRouteLocationBlip = null;
|
destroyElement(jobRouteLocationBlip);
|
||||||
|
jobRouteLocationBlip = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (jobRouteLocationSphere != null) {
|
||||||
|
destroyElement(jobRouteLocationSphere);
|
||||||
|
jobRouteLocationSphere = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (jobBlipBlinkTimer != null) {
|
||||||
|
clearInterval(jobBlipBlinkTimer);
|
||||||
|
}
|
||||||
|
|
||||||
|
jobBlipBlinkAmount = 0;
|
||||||
|
jobBlipBlinkTimes = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
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() == VRR_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;
|
||||||
jobData.name = name;
|
jobData.name = name;
|
||||||
@@ -147,48 +149,48 @@ 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() == VRR_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
natives.removeBlipAndClearIndex(getJobData(jobId).blipId);
|
natives.removeBlipAndClearIndex(getJobData(jobId).blipId);
|
||||||
} else {
|
} else {
|
||||||
destroyElement(getElementFromId(blipId));
|
destroyElement(getElementFromId(blipId));
|
||||||
}
|
}
|
||||||
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() == VRR_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);
|
||||||
natives.setBlipMarkerLongDistance(jobData.blipId, false);
|
natives.setBlipMarkerLongDistance(jobData.blipId, false);
|
||||||
natives.setBlipAsShortRange(jobData.blipId, true);
|
natives.setBlipAsShortRange(jobData.blipId, true);
|
||||||
natives.changeBlipNameFromAscii(jobData.blipId, `${jobData.name.substr(0, 24)}${(jobData.name.length > 24) ? " ...": ""}`);
|
natives.changeBlipNameFromAscii(jobData.blipId, `${jobData.name.substr(0, 24)}${(jobData.name.length > 24) ? " ..." : ""}`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let blipId = createGameBlip(jobData.blipModel, jobData.position, jobData.name);
|
let blipId = createGameBlip(jobData.blipModel, jobData.position, jobData.name);
|
||||||
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();
|
||||||
@@ -202,9 +204,9 @@ function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, p
|
|||||||
* @param {number} job - The ID of the job (initially provided by server)
|
* @param {number} job - The ID of the job (initially provided by server)
|
||||||
* @return {JobData} The job's data (class instance)
|
* @return {JobData} The job's data (class instance)
|
||||||
*/
|
*/
|
||||||
function getJobData(jobId) {
|
function getJobData(jobId) {
|
||||||
for(let i in getServerData().jobs) {
|
for (let i in getServerData().jobs) {
|
||||||
if(getServerData().jobs[i].jobId == jobId) {
|
if (getServerData().jobs[i].jobId == jobId) {
|
||||||
return getServerData().jobs[i];
|
return getServerData().jobs[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -215,7 +217,7 @@ function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, p
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setAllJobDataIndexes() {
|
function setAllJobDataIndexes() {
|
||||||
for(let i in getServerData().jobs) {
|
for (let i in getServerData().jobs) {
|
||||||
jobs[i].index = i;
|
jobs[i].index = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: keybind.js
|
// FILE: keybind.js
|
||||||
// DESC: Provides keybind features
|
// DESC: Provides keybind features
|
||||||
@@ -16,30 +17,30 @@ 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()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
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!`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -47,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;
|
||||||
@@ -56,7 +57,7 @@ function unBindAccountKey(key) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function hasKeyBindDelayElapsed() {
|
function hasKeyBindDelayElapsed() {
|
||||||
if(sdl.ticks-lastKeyBindUse >= keyBindDelayTime) {
|
if (sdl.ticks - lastKeyBindUse >= keyBindDelayTime) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,15 +67,15 @@ function hasKeyBindDelayElapsed() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function canLocalPlayerUseKeyBinds() {
|
function canLocalPlayerUseKeyBinds() {
|
||||||
if(isAnyGUIActive()) {
|
if (isAnyGUIActive()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isSpawned) {
|
if (!isSpawned) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(itemActionDelayEnabled) {
|
if (itemActionDelayEnabled) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +85,7 @@ function canLocalPlayerUseKeyBinds() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function clearKeyBinds() {
|
function clearKeyBinds() {
|
||||||
for(let i in keyBinds) {
|
for (let i in keyBinds) {
|
||||||
unbindKey(keyBinds[i]);
|
unbindKey(keyBinds[i]);
|
||||||
}
|
}
|
||||||
keyBinds = [];
|
keyBinds = [];
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: labels.js
|
// FILE: labels.js
|
||||||
// DESC: Provides functionality for world labels (3D labels)
|
// DESC: Provides functionality for world labels (3D labels)
|
||||||
@@ -13,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;
|
||||||
@@ -22,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!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -65,73 +65,83 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(propertyLabelNameFont == null) {
|
if (propertyLabelNameFont == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(propertyLabelLockedFont == null) {
|
if (propertyLabelLockedFont == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getGame() == VRR_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() == VRR_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);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(screenPosition.x < 0 || screenPosition.x > game.width) {
|
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) {
|
||||||
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);
|
||||||
|
|
||||||
screenPosition.y -= propertyLabelPriceOffset;
|
screenPosition.y -= propertyLabelPriceOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
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);
|
||||||
|
|
||||||
screenPosition.y -= propertyLabelPriceOffset;
|
screenPosition.y -= propertyLabelPriceOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isBusiness) {
|
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);
|
||||||
|
propertyLabelLockedFont.render(text, [screenPosition.x - size[0] / 2, screenPosition.y - size[1] / 2], game.width, 0.0, 0.0, propertyLabelLockedFont.size, toColour(200, 200, 200, 255), false, true, false, true);
|
||||||
|
|
||||||
|
screenPosition.y -= propertyLabelPriceOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isBusiness) {
|
||||||
text = (locked) ? toUpperCase(getLocaleString("Closed")) : toUpperCase(getLocaleString("Open"));
|
text = (locked) ? toUpperCase(getLocaleString("Closed")) : toUpperCase(getLocaleString("Open"));
|
||||||
} else {
|
} else {
|
||||||
text = (locked) ? toUpperCase(getLocaleString("Locked")) : toUpperCase(getLocaleString("Unlocked"));
|
text = (locked) ? toUpperCase(getLocaleString("Locked")) : toUpperCase(getLocaleString("Unlocked"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!locked && labelInfoType != VRR_PROPLABEL_INFO_NONE) {
|
if (!locked && labelInfoType != AGRP_PROPLABEL_INFO_NONE) {
|
||||||
let infoText = "";
|
let infoText = "";
|
||||||
switch(labelInfoType) {
|
switch (labelInfoType) {
|
||||||
case VRR_PROPLABEL_INFO_ENTER: {
|
case AGRP_PROPLABEL_INFO_ENTER: {
|
||||||
if(enterPropertyKey) {
|
if (enterPropertyKey) {
|
||||||
infoText = getLocaleString("PropertyEnterKeyPressLabel", toUpperCase(getKeyNameFromId(enterPropertyKey)));
|
infoText = getLocaleString("PropertyEnterKeyPressLabel", toUpperCase(getKeyNameFromId(enterPropertyKey)));
|
||||||
} else {
|
} else {
|
||||||
infoText = getLocaleString("PropertyEnterCommandLabel", "/enter");
|
infoText = getLocaleString("PropertyEnterCommandLabel", "/enter");
|
||||||
@@ -139,33 +149,33 @@ function renderPropertyEntranceLabel(name, position, locked, isBusiness, price,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case VRR_PROPLABEL_INFO_BUY: {
|
case AGRP_PROPLABEL_INFO_BUY: {
|
||||||
infoText = getLocaleString("BusinessBuyItemsLabel", "/buy");
|
infoText = getLocaleString("BusinessBuyItemsLabel", "/buy");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case VRR_PROPLABEL_INFO_BUYBIZ: {
|
case AGRP_PROPLABEL_INFO_BUYBIZ: {
|
||||||
infoText = getLocaleString("BuyBusinessLabel", "/bizbuy");
|
infoText = getLocaleString("BuyBusinessLabel", "/bizbuy");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case VRR_PROPLABEL_INFO_BUYHOUSE: {
|
case AGRP_PROPLABEL_INFO_BUYHOUSE: {
|
||||||
infoText = getLocaleString("BuyHouseLabel", "/housebuy");
|
infoText = getLocaleString("BuyHouseLabel", "/housebuy");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case VRR_PROPLABEL_INFO_RENTHOUSE: {
|
case AGRP_PROPLABEL_INFO_RENTHOUSE: {
|
||||||
infoText = getLocaleString("RentHouseLabel", "/houserent");
|
infoText = getLocaleString("RentHouseLabel", "/houserent");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case VRR_PROPLABEL_INFO_ENTERVEHICLE: {
|
case AGRP_PROPLABEL_INFO_ENTERVEHICLE: {
|
||||||
infoText = getLocaleString("VehicleDealershipLabel");
|
infoText = getLocaleString("VehicleDealershipLabel");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
if(enterPropertyKey) {
|
if (enterPropertyKey) {
|
||||||
infoText = getLocaleString("PropertyEnterKeyPressLabel", toUpperCase(getKeyNameFromId(enterPropertyKey)));
|
infoText = getLocaleString("PropertyEnterKeyPressLabel", toUpperCase(getKeyNameFromId(enterPropertyKey)));
|
||||||
} else {
|
} else {
|
||||||
infoText = getLocaleString("PropertyEnterCommandLabel", "/enter");
|
infoText = getLocaleString("PropertyEnterCommandLabel", "/enter");
|
||||||
@@ -173,46 +183,50 @@ 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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, (locked) ? lockedColour : unlockedColour, 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, (locked) ? lockedColour : unlockedColour, false, true, false, true);
|
||||||
|
|
||||||
screenPosition.y -= propertyLabelNameOffset;
|
screenPosition.y -= propertyLabelNameOffset;
|
||||||
|
|
||||||
text = name || " ";
|
text = name || " ";
|
||||||
|
if (profanityFilterEnabled) {
|
||||||
|
text = replaceProfanityInMessage(text);
|
||||||
|
}
|
||||||
|
|
||||||
size = propertyLabelNameFont.measure(text, game.width, 0.0, 0.0, propertyLabelNameFont.size, true, true);
|
size = propertyLabelNameFont.measure(text, game.width, 0.0, 0.0, propertyLabelNameFont.size, true, true);
|
||||||
propertyLabelNameFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelNameFont.size, (isBusiness) ? toColour(0, 153, 255, 255) : toColour(17, 204, 17, 255), false, true, false, true);
|
propertyLabelNameFont.render(text, [screenPosition.x - size[0] / 2, screenPosition.y - size[1] / 2], game.width, 0.0, 0.0, propertyLabelNameFont.size, (isBusiness) ? toColour(0, 153, 255, 255) : toColour(17, 204, 17, 255), false, true, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
|
|
||||||
function renderPropertyExitLabel(position) {
|
function renderPropertyExitLabel(position) {
|
||||||
if(localPlayer == null) {
|
if (localPlayer == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(propertyLabelNameFont == null) {
|
if (propertyLabelNameFont == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(propertyLabelLockedFont == null) {
|
if (propertyLabelLockedFont == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getGame() == VRR_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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -220,44 +234,44 @@ function renderPropertyExitLabel(position) {
|
|||||||
let tempPosition = position;
|
let tempPosition = position;
|
||||||
tempPosition.z = tempPosition.z + 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() == VRR_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
screenPosition = natives.getViewportPositionOfCoord(tempPosition, natives.getGameViewportId());
|
screenPosition = natives.getViewportPositionOfCoord(tempPosition, natives.getGameViewportId());
|
||||||
} else {
|
} else {
|
||||||
screenPosition = getScreenFromWorldPosition(tempPosition);
|
screenPosition = getScreenFromWorldPosition(tempPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(screenPosition.x < 0 || screenPosition.x > game.width) {
|
if (screenPosition.x < 0 || screenPosition.x > game.width) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let text = "EXIT";
|
let text = "EXIT";
|
||||||
let size = propertyLabelNameFont.measure(text, game.width, 0.0, 0.0, propertyLabelNameFont.size, true, true);
|
let size = propertyLabelNameFont.measure(text, game.width, 0.0, 0.0, propertyLabelNameFont.size, true, true);
|
||||||
propertyLabelNameFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelNameFont.size, COLOUR_WHITE, false, true, false, true);
|
propertyLabelNameFont.render(text, [screenPosition.x - size[0] / 2, screenPosition.y - size[1] / 2], game.width, 0.0, 0.0, propertyLabelNameFont.size, COLOUR_WHITE, false, true, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
|
|
||||||
function renderJobLabel(name, position, jobType) {
|
function renderJobLabel(name, position, jobType) {
|
||||||
if(localPlayer == null) {
|
if (localPlayer == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(jobNameLabelFont == null) {
|
if (jobNameLabelFont == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(jobHelpLabelFont == null) {
|
if (jobHelpLabelFont == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getGame() == VRR_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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -265,25 +279,25 @@ function renderJobLabel(name, position, jobType) {
|
|||||||
let tempPosition = position;
|
let tempPosition = position;
|
||||||
tempPosition.z = tempPosition.z + 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() == VRR_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
screenPosition = natives.getViewportPositionOfCoord(tempPosition, natives.getGameViewportId());
|
screenPosition = natives.getViewportPositionOfCoord(tempPosition, natives.getGameViewportId());
|
||||||
} else {
|
} else {
|
||||||
screenPosition = getScreenFromWorldPosition(tempPosition);
|
screenPosition = getScreenFromWorldPosition(tempPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
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(jobType == localPlayerJobType) {
|
if (jobType == localPlayerJobType) {
|
||||||
if(localPlayerWorking) {
|
if (localPlayerWorking) {
|
||||||
text = getLocaleString("JobEquipAndUniformLabel", "/equip", "/uniform", "/stopwork");
|
text = getLocaleString("JobEquipAndUniformLabel", "/equip", "/uniform", "/stopwork");
|
||||||
} else {
|
} else {
|
||||||
text = getLocaleString("StartWorkLabel", "/startwork");
|
text = getLocaleString("StartWorkLabel", "/startwork");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(localPlayerJobType == 0) {
|
if (localPlayerJobType == 0) {
|
||||||
text = getLocaleString("TakeJobLabel", "/takejob");
|
text = getLocaleString("TakeJobLabel", "/takejob");
|
||||||
} else {
|
} else {
|
||||||
text = getLocaleString("NotYourJobLabel", "/quitjob");
|
text = getLocaleString("NotYourJobLabel", "/quitjob");
|
||||||
@@ -291,83 +305,102 @@ function renderJobLabel(name, position, jobType) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let size = jobHelpLabelFont.measure(text, game.width, 0.0, 0.0, jobHelpLabelFont.size, true, true);
|
let size = jobHelpLabelFont.measure(text, game.width, 0.0, 0.0, jobHelpLabelFont.size, true, true);
|
||||||
jobHelpLabelFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, jobHelpLabelFont.size, COLOUR_YELLOW, false, true, false, true);
|
jobHelpLabelFont.render(text, [screenPosition.x - size[0] / 2, screenPosition.y - size[1] / 2], game.width, 0.0, 0.0, jobHelpLabelFont.size, COLOUR_YELLOW, false, true, false, true);
|
||||||
|
|
||||||
screenPosition.y -= 18;
|
screenPosition.y -= 18;
|
||||||
|
|
||||||
text = getLocaleString("JobLabel", name);
|
text = getLocaleString("JobLabel", name);
|
||||||
size = jobNameLabelFont.measure(text, game.width, 0.0, 0.0, jobNameLabelFont.size, true, true);
|
size = jobNameLabelFont.measure(text, game.width, 0.0, 0.0, jobNameLabelFont.size, true, true);
|
||||||
jobNameLabelFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, jobNameLabelFont.size, COLOUR_WHITE, false, true, false, true);
|
jobNameLabelFont.render(text, [screenPosition.x - size[0] / 2, screenPosition.y - size[1] / 2], game.width, 0.0, 0.0, jobNameLabelFont.size, COLOUR_WHITE, false, true, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
|
|
||||||
function processLabelRendering() {
|
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) {
|
||||||
natives.drawColouredCylinder(getPosBelowPos(business.entrancePosition, 1.0), 0.0, 0.0, 0, 153, 255, 255);
|
if (getGame() == AGRP_GAME_GTA_IV || getGame() == AGRP_GAME_GTA_IV_EFLC) {
|
||||||
//renderPropertyEntranceLabel(business.name, business.entrancePosition, business.locked, true, makeLargeNumberReadable(business.price), makeLargeNumberReadable(business.rentPrice), business.labelInfoType);
|
natives.drawColouredCylinder(getPosBelowPos(business.entrancePosition, 1.0), 0.0, 0.0, 0, 153, 255, 255);
|
||||||
|
}
|
||||||
|
|
||||||
|
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) {
|
||||||
natives.drawColouredCylinder(getPosBelowPos(house.entrancePosition, 1.0), 0.0, 0.0, 0, 200, 0, 255);
|
if (getGame() == AGRP_GAME_GTA_IV || getGame() == AGRP_GAME_GTA_IV_EFLC) {
|
||||||
//renderPropertyEntranceLabel("House", house.entrancePosition, house.locked, true, makeLargeNumberReadable(house.price), makeLargeNumberReadable(house.rentPrice), 0);
|
natives.drawColouredCylinder(getPosBelowPos(house.entrancePosition, 1.0), 0.0, 0.0, 0, 200, 0, 255);
|
||||||
|
}
|
||||||
|
|
||||||
|
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) {
|
||||||
natives.drawColouredCylinder(getPosBelowPos(job.position, 1.0), 0.0, 0.0, 255, 255, 0, 255);
|
if (getGame() == AGRP_GAME_GTA_IV || getGame() == AGRP_GAME_GTA_IV_EFLC) {
|
||||||
//renderJobLabel(job.name, job.position, job.jobType);
|
natives.drawColouredCylinder(getPosBelowPos(job.position, 1.0), 0.0, 0.0, 255, 255, 0, 255);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getDistance(localPlayer.position, job.position) <= 5.0) {
|
||||||
|
renderJobLabel(job.name, job.position, job.jobType);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(areWorldLabelsSupported()) {
|
if (areWorldLabelsSupported()) {
|
||||||
if(localPlayer != null) {
|
if (localPlayer != null) {
|
||||||
let pickups = getElementsByType(ELEMENT_PICKUP);
|
let pickups = getElementsByType(ELEMENT_PICKUP);
|
||||||
for(let i in pickups) {
|
for (let i in pickups) {
|
||||||
if(pickups[i].getData("vrr.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 = VRR_PROPLABEL_INFO_NONE;
|
let labelInfoType = AGRP_PROPLABEL_INFO_NONE;
|
||||||
if(pickups[i].getData("vrr.label.price") != null) {
|
if (pickups[i].getData("agrp.label.price") != null) {
|
||||||
price = makeLargeNumberReadable(pickups[i].getData("vrr.label.price"));
|
price = pickups[i].getData("agrp.label.price");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pickups[i].getData("vrr.label.rentprice") != null) {
|
if (pickups[i].getData("agrp.label.rentprice") != null) {
|
||||||
rentPrice = makeLargeNumberReadable(pickups[i].getData("vrr.label.rentprice"));
|
rentPrice = pickups[i].getData("agrp.label.rentprice");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pickups[i].getData("vrr.label.help") != null) {
|
if (pickups[i].getData("agrp.label.help") != null) {
|
||||||
labelInfoType = pickups[i].getData("vrr.label.help");
|
labelInfoType = pickups[i].getData("agrp.label.help");
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(pickups[i].getData("vrr.label.type")) {
|
if (pickups[i].getData("agrp.label.fee") != null) {
|
||||||
case VRR_LABEL_BUSINESS: {
|
fee = pickups[i].getData("agrp.label.fee");
|
||||||
renderPropertyEntranceLabel(pickups[i].getData("vrr.label.name"), pickups[i].position, pickups[i].getData("vrr.label.locked"), true, price, rentPrice, labelInfoType);
|
}
|
||||||
|
|
||||||
|
switch (pickups[i].getData("agrp.label.type")) {
|
||||||
|
case AGRP_LABEL_BUSINESS: {
|
||||||
|
renderPropertyEntranceLabel(pickups[i].getData("agrp.label.name"), pickups[i].position, pickups[i].getData("agrp.label.locked"), true, price, rentPrice, labelInfoType, fee);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case VRR_LABEL_HOUSE: {
|
case AGRP_LABEL_HOUSE: {
|
||||||
renderPropertyEntranceLabel(pickups[i].getData("vrr.label.name"), pickups[i].position, pickups[i].getData("vrr.label.locked"), false, price, rentPrice, labelInfoType);
|
renderPropertyEntranceLabel(pickups[i].getData("agrp.label.name"), pickups[i].position, pickups[i].getData("agrp.label.locked"), false, price, rentPrice, labelInfoType);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case VRR_LABEL_JOB: {
|
case AGRP_LABEL_JOB: {
|
||||||
renderJobLabel(pickups[i].getData("vrr.label.name"), pickups[i].position, pickups[i].getData("vrr.label.jobType"));
|
renderJobLabel(pickups[i].getData("agrp.label.name"), pickups[i].position, pickups[i].getData("agrp.label.jobType"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case VRR_LABEL_EXIT: {
|
case AGRP_LABEL_EXIT: {
|
||||||
renderPropertyExitLabel(pickups[i].position);
|
renderPropertyExitLabel(pickups[i].position);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: locale.js
|
// FILE: locale.js
|
||||||
// DESC: Provides locale functions and usage
|
// DESC: Provides locale functions and usage
|
||||||
@@ -8,18 +9,18 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getLocaleString(stringName, ...args) {
|
function getLocaleString(stringName, ...args) {
|
||||||
if(typeof getServerData().localeStrings[localLocaleId][stringName] == undefined) {
|
if (typeof getServerData().localeStrings[localLocaleId][stringName] == undefined) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
let tempString = getServerData().localeStrings[localLocaleId][stringName];
|
let tempString = getServerData().localeStrings[localLocaleId][stringName];
|
||||||
|
|
||||||
if(tempString == "" || tempString == null || tempString == undefined) {
|
if (tempString == "" || tempString == null || tempString == undefined) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
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]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return tempString;
|
return tempString;
|
||||||
@@ -34,29 +35,33 @@ 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();
|
||||||
|
loadAllLocaleStrings();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: logo.js
|
// FILE: logo.js
|
||||||
// DESC: Provides logo rendering functions
|
// DESC: Provides logo rendering functions
|
||||||
@@ -8,23 +9,27 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
let logoImage = null;
|
let logoImage = null;
|
||||||
let logoPos = toVector2(game.width-132, game.height-132);
|
let logoPos = toVector2(game.width - 132, game.height - 132);
|
||||||
let logoSize = toVector2(128, 128);
|
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) {
|
||||||
tempLogoImage = graphics.loadPNG(logoStream);
|
tempLogoImage = graphics.loadPNG(logoStream);
|
||||||
logoStream.close();
|
logoStream.close();
|
||||||
}
|
}
|
||||||
@@ -35,8 +40,12 @@ function loadLogoImage() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function processLogoRendering() {
|
function processLogoRendering() {
|
||||||
if(renderLogo) {
|
if (getGame() == AGRP_GAME_MAFIA_ONE) {
|
||||||
if(logoImage != null) {
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (renderLogo) {
|
||||||
|
if (logoImage != null) {
|
||||||
graphics.drawRectangle(logoImage, logoPos, logoSize);
|
graphics.drawRectangle(logoImage, logoPos, logoSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -45,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: messaging.js
|
// FILE: messaging.js
|
||||||
// DESC: Provides messaging/textdraw functions and usage
|
// DESC: Provides messaging/textdraw functions and usage
|
||||||
@@ -22,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!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -33,11 +34,17 @@ function initMessagingScript() {
|
|||||||
function loadSmallGameMessageFonts() {
|
function loadSmallGameMessageFonts() {
|
||||||
let tempSmallGameMessageFonts = {};
|
let tempSmallGameMessageFonts = {};
|
||||||
let fontStream = openFile("files/fonts/pricedown.ttf");
|
let fontStream = openFile("files/fonts/pricedown.ttf");
|
||||||
if(fontStream != null) {
|
if (fontStream != null) {
|
||||||
tempSmallGameMessageFonts["Pricedown"] = lucasFont.createFont(fontStream, 20.0);
|
tempSmallGameMessageFonts["Pricedown"] = lucasFont.createFont(fontStream, 20.0);
|
||||||
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");
|
||||||
|
|
||||||
@@ -49,11 +56,17 @@ function loadSmallGameMessageFonts() {
|
|||||||
function loadBigGameMessageFont() {
|
function loadBigGameMessageFont() {
|
||||||
let tempBigGameMessageFonts = {};
|
let tempBigGameMessageFonts = {};
|
||||||
let fontStream = openFile("files/fonts/pricedown.ttf");
|
let fontStream = openFile("files/fonts/pricedown.ttf");
|
||||||
if(fontStream != null) {
|
if (fontStream != null) {
|
||||||
tempBigGameMessageFonts["Pricedown"] = lucasFont.createFont(fontStream, 28.0);
|
tempBigGameMessageFonts["Pricedown"] = lucasFont.createFont(fontStream, 28.0);
|
||||||
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");
|
||||||
|
|
||||||
@@ -63,10 +76,12 @@ function loadBigGameMessageFont() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function processSmallGameMessageRendering() {
|
function processSmallGameMessageRendering() {
|
||||||
if(renderSmallGameMessage) {
|
logToConsole(LOG_VERBOSE, "[AGRP.Messaging]: Processing small game message rendering ...");
|
||||||
if(smallGameMessageText != "") {
|
if (renderSmallGameMessage) {
|
||||||
if(smallGameMessageFonts[smallGameMessageFontName] != null) {
|
if (smallGameMessageText != "") {
|
||||||
smallGameMessageFonts[smallGameMessageFontName].render(smallGameMessageText, [0, game.height-90], game.width, 0.5, 0.0, smallGameMessageFonts[smallGameMessageFontName].size, smallGameMessageColour, true, true, false, true);
|
logToConsole(LOG_VERBOSE, `[AGRP.Messaging]: Rendering small game message: ${smallGameMessageText}`);
|
||||||
|
if (smallGameMessageFonts[smallGameMessageFontName] != null) {
|
||||||
|
smallGameMessageFonts[smallGameMessageFontName].render(smallGameMessageText, [0, game.height - 90], game.width, 0.5, 0.0, smallGameMessageFonts[smallGameMessageFontName].size, smallGameMessageColour, true, true, false, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -75,8 +90,8 @@ 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +99,7 @@ function showSmallGameMessage(text, colour, duration, fontName) {
|
|||||||
smallGameMessageColour = colour;
|
smallGameMessageColour = colour;
|
||||||
smallGameMessageText = text;
|
smallGameMessageText = text;
|
||||||
|
|
||||||
smallGameMessageTimer = setTimeout(function() {
|
smallGameMessageTimer = setTimeout(function () {
|
||||||
smallGameMessageText = "";
|
smallGameMessageText = "";
|
||||||
smallGameMessageColour = COLOUR_WHITE;
|
smallGameMessageColour = COLOUR_WHITE;
|
||||||
smallGameMessageTimer = null;
|
smallGameMessageTimer = null;
|
||||||
|
|||||||
@@ -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,79 +58,66 @@ 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];
|
||||||
}
|
}
|
||||||
let MouseSensitivity = game.getMouseSensitivity();
|
let MouseSensitivity = game.getMouseSensitivity();
|
||||||
return [MouseSensitivity.x,MouseSensitivity.y];
|
return [MouseSensitivity.x, MouseSensitivity.y];
|
||||||
}
|
}
|
||||||
|
|
||||||
let GetCamera;
|
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];
|
||||||
}
|
}
|
||||||
let Result = game.processLineOfSight([vecStartX, vecStartY, vecStartZ], [vecEndX, vecEndY, vecEndZ], bCheckBuildings, bCheckVehicles, bCheckPeds, bCheckObjects, bCheckDummies, bCheckSeeThroughStuff, bIgnoreSomeObjectsForCamera);
|
let Result = game.processLineOfSight([vecStartX, vecStartY, vecStartZ], [vecEndX, vecEndY, vecEndZ], bCheckBuildings, bCheckVehicles, bCheckPeds, bCheckObjects, bCheckDummies, bCheckSeeThroughStuff, bIgnoreSomeObjectsForCamera);
|
||||||
if (Result == null)
|
if (Result == null)
|
||||||
return [null];
|
return [null];
|
||||||
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
|
||||||
@@ -170,16 +148,16 @@ let GetTickCount;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function easingSinusoidalInOut(t,b,c,d)//TODO: Move this to MathUtil.js
|
function easingSinusoidalInOut(t, b, c, d)//TODO: Move this to MathUtil.js
|
||||||
{
|
{
|
||||||
return -c/2 * (Math.cos((Math.PI)*t/d) - 1) + b;
|
return -c / 2 * (Math.cos((Math.PI) * t / d) - 1) + b;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: extract
|
//TODO: extract
|
||||||
|
|
||||||
function applyMultiplierTimeStep(m,t)//TODO: Move this to MathUtil.js
|
function applyMultiplierTimeStep(m, t)//TODO: Move this to MathUtil.js
|
||||||
{
|
{
|
||||||
return Math.max(Math.min(1.0-(1.0-m)*(t),1),0);
|
return Math.max(Math.min(1.0 - (1.0 - m) * (t), 1), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: getOffset
|
//TODO: getOffset
|
||||||
@@ -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,72 +207,62 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
//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));
|
||||||
[upX,upY,upZ] = getCrossProduct(lookX, lookY, lookZ,rightX, rightY, rightZ);
|
[upX, upY, upZ] = getCrossProduct(lookX, lookY, lookZ, rightX, rightY, rightZ);
|
||||||
matrix.m11 = rightX;
|
matrix.m11 = rightX;
|
||||||
matrix.m12 = rightY;
|
matrix.m12 = rightY;
|
||||||
matrix.m13 = rightZ;
|
matrix.m13 = rightZ;
|
||||||
@@ -323,10 +290,9 @@ 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let easeCamera = false;
|
let easeCamera = false;
|
||||||
@@ -336,46 +302,41 @@ 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;
|
||||||
let matrix = GetPlaceableMatrix(GetCamera());
|
let matrix = GetPlaceableMatrix(GetCamera());
|
||||||
[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;
|
||||||
let easePosY = easeStartPosY+(newPosY-easeStartPosY)*ease;
|
let easePosY = easeStartPosY + (newPosY - easeStartPosY) * ease;
|
||||||
let easePosZ = easeStartPosZ+(newPosZ-easeStartPosZ)*ease;
|
let easePosZ = easeStartPosZ + (newPosZ - easeStartPosZ) * ease;
|
||||||
let easeLookX = easeStartLookX+(newLookX-easeStartLookX)*ease;
|
let easeLookX = easeStartLookX + (newLookX - easeStartLookX) * ease;
|
||||||
let easeLookY = easeStartLookY+(newLookY-easeStartLookY)*ease;
|
let easeLookY = easeStartLookY + (newLookY - easeStartLookY) * ease;
|
||||||
let easeLookZ = easeStartLookZ+(newLookZ-easeStartLookZ)*ease;
|
let easeLookZ = easeStartLookZ + (newLookZ - easeStartLookZ) * ease;
|
||||||
let easeUpX = easeStartUpX+(newUpX-easeStartUpX)*ease;
|
let easeUpX = easeStartUpX + (newUpX - easeStartUpX) * ease;
|
||||||
let easeUpY = easeStartUpY+(newUpY-easeStartUpY)*ease;
|
let easeUpY = easeStartUpY + (newUpY - easeStartUpY) * ease;
|
||||||
let easeUpZ = easeStartUpZ+(newUpZ-easeStartUpZ)*ease;
|
let easeUpZ = easeStartUpZ + (newUpZ - easeStartUpZ) * ease;
|
||||||
return createLookAtLHMatrix(easePosX,easePosY,easePosZ,easePosX+easeLookX,easePosY+easeLookY,easePosZ+easeLookZ,easeUpX,easeUpY,easeUpZ);
|
return createLookAtLHMatrix(easePosX, easePosY, easePosZ, easePosX + easeLookX, easePosY + easeLookY, easePosZ + easeLookZ, easeUpX, easeUpY, easeUpZ);
|
||||||
}
|
}
|
||||||
return matrix;
|
return matrix;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isCameraEasing()
|
function isCameraEasing() {
|
||||||
{
|
return easeCamera && GetTickCount(true, false) < (easeStartTicks + easeDuration);
|
||||||
return easeCamera && GetTickCount(true,false) < (easeStartTicks+easeDuration);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let oldCameraTarget = null;
|
let oldCameraTarget = null;
|
||||||
@@ -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,59 +357,52 @@ 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))
|
||||||
rotZ = 0;
|
rotZ = 0;
|
||||||
else
|
else
|
||||||
rotZ = -Math.atan2(targetMatrix.m21,targetMatrix.m22);
|
rotZ = -Math.atan2(targetMatrix.m21, targetMatrix.m22);
|
||||||
let rotY = -0.2;
|
let rotY = -0.2;
|
||||||
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;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
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,37 +410,32 @@ 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;
|
||||||
let TimeStep = game.timeStep/50*60;
|
let TimeStep = game.timeStep / 50 * 60;
|
||||||
cameraRotZ += getDifferenceBetweenAngles(cameraRotZ,TargetCameraRotZ2)*applyMultiplierTimeStep(1/20,TimeStep)*Multiplier;
|
cameraRotZ += getDifferenceBetweenAngles(cameraRotZ, TargetCameraRotZ2) * applyMultiplierTimeStep(1 / 20, TimeStep) * Multiplier;
|
||||||
cameraRotY += getDifferenceBetweenAngles(cameraRotY,TargetCameraRotY2)*applyMultiplierTimeStep(1/20,TimeStep)*Multiplier;
|
cameraRotY += getDifferenceBetweenAngles(cameraRotY, TargetCameraRotY2) * applyMultiplierTimeStep(1 / 20, TimeStep) * Multiplier;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
@@ -528,66 +473,59 @@ function getCameraOffsetInfo(target)
|
|||||||
offsetX = 0;
|
offsetX = 0;
|
||||||
offsetY = 0;
|
offsetY = 0;
|
||||||
offsetZ = 0;
|
offsetZ = 0;
|
||||||
distance = minDistance+(radius-minRadius)/(maxRadius-minRadius)*(maxDistance-minDistance);
|
distance = minDistance + (radius - minRadius) / (maxRadius - minRadius) * (maxDistance - minDistance);
|
||||||
zIncrease = minZIncrease+(radius-minRadius)/(maxRadius-minRadius)*(maxZIncrease-minZIncrease);
|
zIncrease = minZIncrease + (radius - minRadius) / (maxRadius - minRadius) * (maxZIncrease - minZIncrease);
|
||||||
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)
|
||||||
startCameraEase()
|
startCameraEase()
|
||||||
resetCameraRotation()
|
resetCameraRotation()
|
||||||
}
|
}
|
||||||
let [mouseSpeedX, mouseSpeedY] = GetMouseSpeed();
|
let [mouseSpeedX, mouseSpeedY] = GetMouseSpeed();
|
||||||
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();
|
||||||
}
|
}
|
||||||
cameraRotY = Math.max(cameraRotY,-Math.PI/2+0.01);
|
cameraRotY = Math.max(cameraRotY, -Math.PI / 2 + 0.01);
|
||||||
if (GetEntityType(target) != ENTITYTYPE_PED)
|
if (GetEntityType(target) != ENTITYTYPE_PED)
|
||||||
cameraRotY = Math.min(cameraRotY,Math.PI/8.5);//2019 Lucas was here!
|
cameraRotY = Math.min(cameraRotY, Math.PI / 8.5);//2019 Lucas was here!
|
||||||
else
|
else
|
||||||
cameraRotY = Math.min(cameraRotY,Math.PI/4);
|
cameraRotY = Math.min(cameraRotY, Math.PI / 4);
|
||||||
let camera = GetCamera();
|
let camera = GetCamera();
|
||||||
let targetMatrix = GetPlaceableMatrix(target);
|
let targetMatrix = GetPlaceableMatrix(target);
|
||||||
let [distance, zIncrease, offsetX, offsetY, offsetZ] = getCameraOffsetInfo(target);
|
let [distance, zIncrease, offsetX, offsetY, offsetZ] = getCameraOffsetInfo(target);
|
||||||
let offsetTranslationMatrix = createTranslationMatrix(offsetX, offsetY, offsetZ);
|
let offsetTranslationMatrix = createTranslationMatrix(offsetX, offsetY, offsetZ);
|
||||||
targetMatrix = createMultipliedMatrix(offsetTranslationMatrix,targetMatrix);
|
targetMatrix = createMultipliedMatrix(offsetTranslationMatrix, targetMatrix);
|
||||||
let targetPosX, targetPosY, targetPosZ;
|
let targetPosX, targetPosY, targetPosZ;
|
||||||
if (isRelativeToTarget(target))
|
if (isRelativeToTarget(target))
|
||||||
[targetPosX, targetPosY, targetPosZ] = [0,0,0];
|
[targetPosX, targetPosY, targetPosZ] = [0, 0, 0];
|
||||||
else
|
else
|
||||||
[targetPosX, targetPosY, targetPosZ] = [targetMatrix.m41,targetMatrix.m42,targetMatrix.m43];
|
[targetPosX, targetPosY, targetPosZ] = [targetMatrix.m41, targetMatrix.m42, targetMatrix.m43];
|
||||||
let distanceTranslationMatrix = createTranslationMatrix(0,-distance,0);
|
let distanceTranslationMatrix = createTranslationMatrix(0, -distance, 0);
|
||||||
targetPosZ = targetPosZ+zIncrease;
|
targetPosZ = targetPosZ + zIncrease;
|
||||||
let targetTranslationMatrix = createTranslationMatrix(targetPosX, targetPosY, targetPosZ);
|
let targetTranslationMatrix = createTranslationMatrix(targetPosX, targetPosY, targetPosZ);
|
||||||
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;
|
||||||
@@ -603,17 +541,16 @@ function update()
|
|||||||
let ignoreSomeObjectsForCamera = true;
|
let ignoreSomeObjectsForCamera = true;
|
||||||
let collisionsEnabled = AreEntityCollisionsEnabled(target);
|
let collisionsEnabled = AreEntityCollisionsEnabled(target);
|
||||||
if (collisionsEnabled)
|
if (collisionsEnabled)
|
||||||
SetEntityCollisionsEnabled(target,false);
|
SetEntityCollisionsEnabled(target, false);
|
||||||
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;
|
||||||
positionY += normalY*Distance;
|
positionY += normalY * Distance;
|
||||||
positionZ += normalZ*Distance;
|
positionZ += normalZ * Distance;
|
||||||
|
|
||||||
cameraMatrix.m41 = positionX;
|
cameraMatrix.m41 = positionX;
|
||||||
cameraMatrix.m42 = positionY;
|
cameraMatrix.m42 = positionY;
|
||||||
@@ -622,7 +559,7 @@ function update()
|
|||||||
}
|
}
|
||||||
if (isCameraEasing())
|
if (isCameraEasing())
|
||||||
cameraMatrix = applyCameraEase(cameraMatrix);
|
cameraMatrix = applyCameraEase(cameraMatrix);
|
||||||
SetPlaceableMatrix(camera,cameraMatrix);
|
SetPlaceableMatrix(camera, cameraMatrix);
|
||||||
UpdateCamera(camera);
|
UpdateCamera(camera);
|
||||||
}
|
}
|
||||||
oldCameraTarget = target;
|
oldCameraTarget = target;
|
||||||
@@ -630,9 +567,8 @@ function update()
|
|||||||
return target != null;
|
return target != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
addEventHandler("OnCameraProcess", (event) =>
|
addEventHandler("OnCameraProcess", (event) => {
|
||||||
{
|
if (mouseCameraEnabled) {
|
||||||
if(mouseCameraEnabled) {
|
|
||||||
update();
|
update();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: nametags.js
|
// FILE: nametags.js
|
||||||
// DESC: Provides nametag rendering
|
// DESC: Provides nametag rendering
|
||||||
@@ -22,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!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -43,15 +44,19 @@ function loadPausedStatusFont() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function updatePlayerNameTag(clientName, characterName, colour, paused, ping) {
|
function updatePlayerNameTag(clientName, characterName, colour, paused, ping) {
|
||||||
|
if (profanityFilterEnabled) {
|
||||||
|
characterName = replaceProfanityInMessage(characterName);
|
||||||
|
}
|
||||||
|
|
||||||
playerNames[clientName] = characterName;
|
playerNames[clientName] = characterName;
|
||||||
playerColours[clientName] = colour;
|
playerColours[clientName] = colour;
|
||||||
playerPaused[clientName] = paused;
|
playerPaused[clientName] = paused;
|
||||||
playerPing[clientName] = ping;
|
playerPing[clientName] = ping;
|
||||||
|
|
||||||
if(getGame() == VRR_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
let client = getPlayerFromParams(clientName);
|
let client = getPlayerFromParams(clientName);
|
||||||
if(client != false) {
|
if (client != false) {
|
||||||
if(getPlayerPed(client) != null) {
|
if (getPlayerPed(client) != null) {
|
||||||
getPlayerPed(client).setNametag(characterName, colour);
|
getPlayerPed(client).setNametag(characterName, colour);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -67,7 +72,7 @@ function updatePlayerPing(clientName, ping) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function drawNametag(x, y, health, armour, text, ping, alpha, distance, colour, afk, skin) {
|
function drawNametag(x, y, health, armour, text, ping, alpha, distance, colour, afk, skin) {
|
||||||
if(nametagFont == null) {
|
if (nametagFont == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,10 +85,10 @@ function drawNametag(x, y, health, armour, text, ping, alpha, distance, colour,
|
|||||||
// -------------------------------------------
|
// -------------------------------------------
|
||||||
// Health Bar
|
// Health Bar
|
||||||
|
|
||||||
if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
|
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
|
||||||
if(getGame() == VRR_GAME_GTA_III) {
|
if (getGame() == AGRP_GAME_GTA_III) {
|
||||||
// Mickey Hamfists is ridiculously tall. Raise the nametag for him a bit
|
// Mickey Hamfists is ridiculously tall. Raise the nametag for him a bit
|
||||||
if(skin == 109) {
|
if (skin == 109) {
|
||||||
y -= 20;
|
y -= 20;
|
||||||
} else {
|
} else {
|
||||||
y -= 5;
|
y -= 5;
|
||||||
@@ -95,44 +100,43 @@ function drawNametag(x, y, health, armour, text, ping, alpha, distance, colour,
|
|||||||
y -= 5;
|
y -= 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(health > 0.0) {
|
if (health > 0.0) {
|
||||||
let hx = x-width/2;
|
let hx = x - width / 2;
|
||||||
let hy = y-10/2;
|
let hy = y - 10 / 2;
|
||||||
let colourB = toColour(0, 0, 0, Math.floor(255.0*alpha)); // Background colour (black)
|
let colourB = toColour(0, 0, 0, Math.floor(255.0 * alpha)); // Background colour (black)
|
||||||
graphics.drawRectangle(null, [hx, hy], [width, 8], colourB, colourB, colourB, colourB);
|
graphics.drawRectangle(null, [hx, hy], [width, 8], colourB, colourB, colourB, colourB);
|
||||||
let colour = toColour(Math.floor(255.0-(health*255.0)), Math.floor(health*255.0), 0, Math.floor(255.0*alpha)); // Health bar colour (varies, depending on health)
|
let colour = toColour(Math.floor(255.0 - (health * 255.0)), Math.floor(health * 255.0), 0, Math.floor(255.0 * alpha)); // Health bar colour (varies, depending on health)
|
||||||
graphics.drawRectangle(null, [hx+2, hy+2], [(width-4)*health, 10-6], colour, colour, colour, colour);
|
graphics.drawRectangle(null, [hx + 2, hy + 2], [(width - 4) * health, 10 - 6], colour, colour, colour, colour);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Armour Bar
|
// Armour Bar
|
||||||
if (armour > 0.0)
|
if (armour > 0.0) {
|
||||||
{
|
|
||||||
// Go up 10 pixels to draw the next part
|
// Go up 10 pixels to draw the next part
|
||||||
y -= 10;
|
y -= 10;
|
||||||
let hx = x-width/2;
|
let hx = x - width / 2;
|
||||||
let hy = y-10/2;
|
let hy = y - 10 / 2;
|
||||||
let colourB = toColour(255, 0, 0, 0); // Background colour (black)
|
let colourB = toColour(255, 0, 0, 0); // Background colour (black)
|
||||||
graphics.drawRectangle(null, [hx, hy], [width, 8], colourB, colourB, colourB, colourB);
|
graphics.drawRectangle(null, [hx, hy], [width, 8], colourB, colourB, colourB, colourB);
|
||||||
let colour = toColour(255, 255, 255, 255); // Armour bar colour (white)
|
let colour = toColour(255, 255, 255, 255); // Armour bar colour (white)
|
||||||
graphics.drawRectangle(null, [hx+2, hy+2], [(width-4)*armour, 10-6], colour, colour, colour, colour);
|
graphics.drawRectangle(null, [hx + 2, hy + 2], [(width - 4) * armour, 10 - 6], colour, colour, colour, colour);
|
||||||
}
|
}
|
||||||
|
|
||||||
y -= 20;
|
y -= 20;
|
||||||
|
|
||||||
// Nametag
|
// Nametag
|
||||||
if(nametagFont != null) {
|
if (nametagFont != null) {
|
||||||
let size = nametagFont.measure(text, game.width, 0.0, 0.0, nametagFont.size, false, false);
|
let size = nametagFont.measure(text, game.width, 0.0, 0.0, nametagFont.size, false, false);
|
||||||
nametagFont.render(text, [x-size[0]/2, y-size[1]/2], game.width, 0.0, 0.0, nametagFont.size, colour, false, false, false, true);
|
nametagFont.render(text, [x - size[0] / 2, y - size[1] / 2], game.width, 0.0, 0.0, nametagFont.size, colour, false, false, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Go up another 10 pixels for the next part
|
// Go up another 10 pixels for the next part
|
||||||
y -= 20;
|
y -= 20;
|
||||||
|
|
||||||
// AFK Status
|
// AFK Status
|
||||||
if(afkStatusFont != null) {
|
if (afkStatusFont != null) {
|
||||||
if(afk) {
|
if (afk) {
|
||||||
let size = afkStatusFont.measure("PAUSED", game.width, 0.0, 0.0, afkStatusFont.size, false, false);
|
let size = afkStatusFont.measure(getLocaleString(client, "Paused"), game.width, 0.0, 0.0, afkStatusFont.size, false, false);
|
||||||
afkStatusFont.render("PAUSED", [x-size[0]/2, y-size[1]/2], game.width, 0.0, 0.0, afkStatusFont.size, toColour(255, 0, 0, 255), false, false, false, true);
|
afkStatusFont.render(getLocaleString(client, "Paused"), [x - size[0] / 2, y - size[1] / 2], game.width, 0.0, 0.0, afkStatusFont.size, toColour(255, 0, 0, 255), false, false, false, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -140,11 +144,11 @@ function drawNametag(x, y, health, armour, text, ping, alpha, distance, colour,
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function updateNametag(element) {
|
function updateNametag(element) {
|
||||||
if(!areWorldLabelsSupported()) {
|
if (!areWorldLabelsSupported()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(localPlayer != null) {
|
if (localPlayer != null) {
|
||||||
let playerPos = localPlayer.position;
|
let playerPos = localPlayer.position;
|
||||||
let elementPos = element.position;
|
let elementPos = element.position;
|
||||||
|
|
||||||
@@ -154,50 +158,50 @@ function updateNametag(element) {
|
|||||||
|
|
||||||
let screenPos = getScreenFromWorldPosition(elementPos);
|
let screenPos = getScreenFromWorldPosition(elementPos);
|
||||||
if (screenPos[2] >= 0.0) {
|
if (screenPos[2] >= 0.0) {
|
||||||
let health = element.health/100.0;
|
let health = element.health / 100.0;
|
||||||
if(health > 1.0) {
|
if (health > 1.0) {
|
||||||
health = 1.0;
|
health = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
let armour = element.armour/100.0;
|
let armour = element.armour / 100.0;
|
||||||
if(armour > 1.0) {
|
if (armour > 1.0) {
|
||||||
armour = 1.0;
|
armour = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
let distance = playerPos.distance(elementPos);
|
let distance = playerPos.distance(elementPos);
|
||||||
if(distance <= nametagDistance) {
|
if (distance <= nametagDistance) {
|
||||||
if(typeof game.processLineOfSight != "undefined") {
|
if (typeof game.processLineOfSight != "undefined") {
|
||||||
let losCheck = game.processLineOfSight(playerPos, elementPos, true, false, false, true, true, false, true, true);
|
let losCheck = game.processLineOfSight(playerPos, elementPos, true, false, false, true, true, false, true, true);
|
||||||
if(losCheck != null) {
|
if (losCheck != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(element.type == ELEMENT_PLAYER) {
|
if (element.type == ELEMENT_PLAYER) {
|
||||||
let name = element.name;
|
let name = element.name;
|
||||||
let colour = COLOUR_WHITE;
|
let colour = COLOUR_WHITE;
|
||||||
let paused = false;
|
let paused = false;
|
||||||
let ping = -1;
|
let ping = -1;
|
||||||
|
|
||||||
if(element.isType(ELEMENT_PLAYER)) {
|
if (element.isType(ELEMENT_PLAYER)) {
|
||||||
if(typeof playerNames[element.name] != "undefined") {
|
if (typeof playerNames[element.name] != "undefined") {
|
||||||
name = playerNames[element.name];
|
name = playerNames[element.name];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(typeof playerPaused[element.name] != "undefined") {
|
if (typeof playerPaused[element.name] != "undefined") {
|
||||||
paused = playerPaused[element.name];
|
paused = playerPaused[element.name];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(typeof playerColours[element.name] != "undefined") {
|
if (typeof playerColours[element.name] != "undefined") {
|
||||||
colour = playerColours[element.name];
|
colour = playerColours[element.name];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(typeof playerPing[element.name] != "undefined") {
|
if (typeof playerPing[element.name] != "undefined") {
|
||||||
ping = playerPing[element.name];
|
ping = playerPing[element.name];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
drawNametag(screenPos[0], screenPos[1], health, armour, name, ping, 1.0-distance/nametagDistance, distance, colour, paused, element.skin);
|
drawNametag(screenPos[0], screenPos[1], health, armour, name, ping, 1.0 - distance / nametagDistance, distance, colour, paused, element.skin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -207,8 +211,8 @@ function updateNametag(element) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getClientFromPlayer(player) {
|
function getClientFromPlayer(player) {
|
||||||
getClients().forEach(function(client) {
|
getClients().forEach(function (client) {
|
||||||
if(getPlayerPed(client) == player) {
|
if (getPlayerPed(client) == player) {
|
||||||
return client;
|
return client;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -221,8 +225,8 @@ function processNameTagRendering(event) {
|
|||||||
// return false;
|
// return false;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
getElementsByType(ELEMENT_PED).forEach(function(ped) {
|
getElementsByType(ELEMENT_PED).forEach(function (ped) {
|
||||||
if(ped != localPlayer) {
|
if (ped != localPlayer) {
|
||||||
updateNametag(ped);
|
updateNametag(ped);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: connected.js
|
// FILE: connected.js
|
||||||
// DESC: Provides wrapped natives for GTA Connected and Mafia Connected mods
|
// DESC: Provides wrapped natives for GTA Connected and Mafia Connected mods
|
||||||
@@ -37,7 +38,7 @@ function getPlayerPosition() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setPlayerPosition(position) {
|
function setPlayerPosition(position) {
|
||||||
if(getGame() == VRR_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
natives.setCharCoordinates(localPlayer, position);
|
natives.setCharCoordinates(localPlayer, position);
|
||||||
} else {
|
} else {
|
||||||
localPlayer.position = position;
|
localPlayer.position = position;
|
||||||
@@ -59,11 +60,11 @@ function getElementHeading(elementId) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setElementPosition(elementId, position) {
|
function setElementPosition(elementId, position) {
|
||||||
if(getElementFromId(elementId) == null) {
|
if (getElementFromId(elementId) == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!getElementFromId(elementId).isSyncer) {
|
if (!getElementFromId(elementId).isSyncer) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,8 +73,8 @@ function setElementPosition(elementId, position) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function deleteGameElement(elementId, position) {
|
function deleteGameElement(elementId, position = toVector3(0.0, 0.0, 0.0)) {
|
||||||
if(!getElementFromId(elementId).isOwner) {
|
if (!getElementFromId(elementId).isOwner) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,6 +83,12 @@ function deleteGameElement(elementId, position) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function deleteLocalGameElement(element) {
|
||||||
|
destroyGameElement(element);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
function createGameVehicle(modelIndex, position, heading) {
|
function createGameVehicle(modelIndex, position, heading) {
|
||||||
return game.createVehicle(getGameConfig().vehicles[getGame()][modelIndex][0], position, heading);
|
return game.createVehicle(getGameConfig().vehicles[getGame()][modelIndex][0], position, heading);
|
||||||
}
|
}
|
||||||
@@ -110,8 +117,8 @@ function getElementId(element) {
|
|||||||
|
|
||||||
function getClientFromIndex(index) {
|
function getClientFromIndex(index) {
|
||||||
let clients = getClients();
|
let clients = getClients();
|
||||||
for(let i in clients) {
|
for (let i in clients) {
|
||||||
if(clients[i].index == index) {
|
if (clients[i].index == index) {
|
||||||
return clients[i];
|
return clients[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -170,8 +177,8 @@ function is2dPositionOnScreen(pos2d) {
|
|||||||
function getVehiclesInRange(position, range) {
|
function getVehiclesInRange(position, range) {
|
||||||
let vehicles = getElementsByType(ELEMENT_VEHICLE);
|
let vehicles = getElementsByType(ELEMENT_VEHICLE);
|
||||||
let inRangeVehicles = [];
|
let inRangeVehicles = [];
|
||||||
for(let i in vehicles) {
|
for (let i in vehicles) {
|
||||||
if(getDistance(position, vehicles[i].position) <= range) {
|
if (getDistance(position, vehicles[i].position) <= range) {
|
||||||
inRangeVehicles.push(vehicles[i]);
|
inRangeVehicles.push(vehicles[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -181,13 +188,13 @@ function getVehiclesInRange(position, range) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function createGameBlip(blipModel, position, name = "") {
|
function createGameBlip(blipModel, position, name = "") {
|
||||||
if(getGame() == VRR_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
let blipId = natives.addBlipForCoord(position);
|
let blipId = natives.addBlipForCoord(position);
|
||||||
if(blipId) {
|
if (blipId) {
|
||||||
natives.changeBlipSprite(blipId, blipModel);
|
natives.changeBlipSprite(blipId, blipModel);
|
||||||
natives.setBlipMarkerLongDistance(blipId, false);
|
natives.setBlipMarkerLongDistance(blipId, false);
|
||||||
natives.setBlipAsShortRange(blipId, true);
|
natives.setBlipAsShortRange(blipId, true);
|
||||||
natives.changeBlipNameFromAscii(blipId, `${name.substr(0, 24)}${(name.length > 24) ? " ...": ""}`);
|
natives.changeBlipNameFromAscii(blipId, `${name.substr(0, 24)}${(name.length > 24) ? " ..." : ""}`);
|
||||||
return blipId;
|
return blipId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -198,7 +205,7 @@ function createGameBlip(blipModel, position, name = "") {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setEntityData(entity, dataName, dataValue, syncToClients = true) {
|
function setEntityData(entity, dataName, dataValue, syncToClients = true) {
|
||||||
if(entity != null) {
|
if (entity != null) {
|
||||||
return entity.setData(dataName, dataValue);
|
return entity.setData(dataName, dataValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -206,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,64 +232,64 @@ function repairVehicle(syncId) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function syncVehicleProperties(vehicle) {
|
function syncVehicleProperties(vehicle) {
|
||||||
if(doesEntityDataExist(vehicle, "vrr.lights")) {
|
if (doesEntityDataExist(vehicle, "agrp.lights")) {
|
||||||
let lightStatus = getEntityData(vehicle, "vrr.lights");
|
let lightStatus = getEntityData(vehicle, "agrp.lights");
|
||||||
vehicle.lights = lightStatus;
|
vehicle.lights = lightStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(vehicle, "vrr.invincible")) {
|
if (doesEntityDataExist(vehicle, "agrp.invincible")) {
|
||||||
let invincible = getEntityData(vehicle, "vrr.invincible");
|
let invincible = getEntityData(vehicle, "agrp.invincible");
|
||||||
element.setProofs(invincible, invincible, invincible, invincible, invincible);
|
element.setProofs(invincible, invincible, invincible, invincible, invincible);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(vehicle, "vrr.panelStatus")) {
|
if (doesEntityDataExist(vehicle, "agrp.panelStatus")) {
|
||||||
let panelsStatus = getEntityData(vehicle, "vrr.panelStatus");
|
let panelsStatus = getEntityData(vehicle, "agrp.panelStatus");
|
||||||
for(let i in panelsStatus) {
|
for (let i in panelsStatus) {
|
||||||
vehicle.setPanelStatus(i, panelsStatus[i]);
|
vehicle.setPanelStatus(i, panelsStatus[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(vehicle, "vrr.wheelStatus")) {
|
if (doesEntityDataExist(vehicle, "agrp.wheelStatus")) {
|
||||||
let wheelsStatus = getEntityData(vehicle, "vrr.wheelStatus");
|
let wheelsStatus = getEntityData(vehicle, "agrp.wheelStatus");
|
||||||
for(let i in wheelsStatus) {
|
for (let i in wheelsStatus) {
|
||||||
vehicle.setWheelStatus(i, wheelsStatus[i]);
|
vehicle.setWheelStatus(i, wheelsStatus[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(vehicle, "vrr.lightStatus")) {
|
if (doesEntityDataExist(vehicle, "agrp.lightStatus")) {
|
||||||
let lightStatus = getEntityData(vehicle, "vrr.lightStatus");
|
let lightStatus = getEntityData(vehicle, "agrp.lightStatus");
|
||||||
for(let i in lightStatus) {
|
for (let i in lightStatus) {
|
||||||
vehicle.setLightStatus(i, lightStatus[i]);
|
vehicle.setLightStatus(i, lightStatus[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(vehicle, "vrr.suspensionHeight")) {
|
if (doesEntityDataExist(vehicle, "agrp.suspensionHeight")) {
|
||||||
let suspensionHeight = getEntityData(vehicle, "vrr.suspensionHeight");
|
let suspensionHeight = getEntityData(vehicle, "agrp.suspensionHeight");
|
||||||
vehicle.setSuspensionHeight(suspensionHeight);
|
vehicle.setSuspensionHeight(suspensionHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getGame() == VRR_GAME_GTA_SA) {
|
if (getGame() == AGRP_GAME_GTA_SA) {
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(vehicle, "vrr.upgrades")) {
|
if (doesEntityDataExist(vehicle, "agrp.upgrades")) {
|
||||||
let upgrades = getEntityData(vehicle, "vrr.upgrades");
|
let upgrades = getEntityData(vehicle, "agrp.upgrades");
|
||||||
for(let i in upgrades) {
|
for (let i in upgrades) {
|
||||||
if(upgrades[i] != 0) {
|
if (upgrades[i] != 0) {
|
||||||
vehicle.addUpgrade(upgrades[i]);
|
vehicle.addUpgrade(upgrades[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getGame() == VRR_GAME_GTA_SA || getGame() == VRR_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_SA || getGame() == AGRP_GAME_GTA_IV) {
|
||||||
if(doesEntityDataExist(vehicle, "vrr.livery")) {
|
if (doesEntityDataExist(vehicle, "agrp.livery")) {
|
||||||
let livery = getEntityData(vehicle, "vrr.livery");
|
let livery = getEntityData(vehicle, "agrp.livery");
|
||||||
if(getGame() == VRR_GAME_GTA_SA) {
|
if (getGame() == AGRP_GAME_GTA_SA) {
|
||||||
vehicle.setPaintJob(livery);
|
vehicle.setPaintJob(livery);
|
||||||
} else if(getGame() == VRR_GAME_GTA_IV) {
|
} else if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
vehicle.livery = livery;
|
vehicle.livery = livery;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -291,7 +299,7 @@ function syncVehicleProperties(vehicle) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function removeEntityData(entity, dataName) {
|
function removeEntityData(entity, dataName) {
|
||||||
if(entity != null) {
|
if (entity != null) {
|
||||||
return entity.removeData(dataName);
|
return entity.removeData(dataName);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@@ -300,7 +308,7 @@ function removeEntityData(entity, dataName) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function doesEntityDataExist(entity, dataName) {
|
function doesEntityDataExist(entity, dataName) {
|
||||||
if(entity != null) {
|
if (entity != null) {
|
||||||
return (entity.getData(dataName) != null);
|
return (entity.getData(dataName) != null);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@@ -309,9 +317,9 @@ function doesEntityDataExist(entity, dataName) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function syncCivilianProperties(civilian) {
|
function syncCivilianProperties(civilian) {
|
||||||
if(getGame() == VRR_GAME_GTA_III) {
|
if (getGame() == AGRP_GAME_GTA_III) {
|
||||||
if(doesEntityDataExist(civilian, "vrr.scale")) {
|
if (doesEntityDataExist(civilian, "agrp.scale")) {
|
||||||
let scaleFactor = getEntityData(civilian, "vrr.scale");
|
let scaleFactor = getEntityData(civilian, "agrp.scale");
|
||||||
let tempMatrix = civilian.matrix;
|
let tempMatrix = civilian.matrix;
|
||||||
tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
|
tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
|
||||||
let tempPosition = civilian.position;
|
let tempPosition = civilian.position;
|
||||||
@@ -321,79 +329,79 @@ function syncCivilianProperties(civilian) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getGame() == VRR_GAME_GTA_SA) {
|
if (getGame() == AGRP_GAME_GTA_SA) {
|
||||||
if(doesEntityDataExist(civilian, "vrr.fightStyle")) {
|
if (doesEntityDataExist(civilian, "agrp.fightStyle")) {
|
||||||
let fightStyle = getEntityData(civilian, "vrr.fightStyle");
|
let fightStyle = getEntityData(civilian, "agrp.fightStyle");
|
||||||
civilian.setFightStyle(fightStyle[0], fightStyle[1]);
|
civilian.setFightStyle(fightStyle[0], fightStyle[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getGame() == VRR_GAME_GTA_III) {
|
if (getGame() == AGRP_GAME_GTA_III) {
|
||||||
if(doesEntityDataExist(civilian, "vrr.walkStyle")) {
|
if (doesEntityDataExist(civilian, "agrp.walkStyle")) {
|
||||||
let walkStyle = getEntityData(civilian, "vrr.walkStyle");
|
let walkStyle = getEntityData(civilian, "agrp.walkStyle");
|
||||||
civilian.walkStyle = walkStyle;
|
civilian.walkStyle = walkStyle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getGame() == VRR_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
if(doesEntityDataExist(civilian, "vrr.bodyPropHair")) {
|
if (doesEntityDataExist(civilian, "agrp.bodyPropHair")) {
|
||||||
let bodyPropHair = getEntityData(civilian, "vrr.bodyPropHair");
|
let bodyPropHair = getEntityData(civilian, "agrp.bodyPropHair");
|
||||||
civilian.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]);
|
civilian.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(civilian, "vrr.bodyPropHead")) {
|
if (doesEntityDataExist(civilian, "agrp.bodyPropHead")) {
|
||||||
let bodyPropHead = getEntityData(civilian, "vrr.bodyPropHead");
|
let bodyPropHead = getEntityData(civilian, "agrp.bodyPropHead");
|
||||||
civilian.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]);
|
civilian.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(civilian, "vrr.bodyPropEyes")) {
|
if (doesEntityDataExist(civilian, "agrp.bodyPropEyes")) {
|
||||||
let bodyPropEyes = getEntityData(civilian, "vrr.bodyPropEyes");
|
let bodyPropEyes = getEntityData(civilian, "agrp.bodyPropEyes");
|
||||||
civilian.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]);
|
civilian.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(civilian, "vrr.bodyPropLeftHand")) {
|
if (doesEntityDataExist(civilian, "agrp.bodyPropLeftHand")) {
|
||||||
let bodyPropLeftHand = getEntityData(civilian, "vrr.bodyPropLeftHand");
|
let bodyPropLeftHand = getEntityData(civilian, "agrp.bodyPropLeftHand");
|
||||||
civilian.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]);
|
civilian.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(civilian, "vrr.bodyPropRightHand")) {
|
if (doesEntityDataExist(civilian, "agrp.bodyPropRightHand")) {
|
||||||
let bodyPropRightHand = getEntityData(civilian, "vrr.bodyPropRightHand");
|
let bodyPropRightHand = getEntityData(civilian, "agrp.bodyPropRightHand");
|
||||||
civilian.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]);
|
civilian.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(civilian, "vrr.bodyPropLeftWrist")) {
|
if (doesEntityDataExist(civilian, "agrp.bodyPropLeftWrist")) {
|
||||||
let bodyPropLeftWrist = getEntityData(civilian, "vrr.bodyPropLeftWrist");
|
let bodyPropLeftWrist = getEntityData(civilian, "agrp.bodyPropLeftWrist");
|
||||||
civilian.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]);
|
civilian.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(civilian, "vrr.bodyPropRightWrist")) {
|
if (doesEntityDataExist(civilian, "agrp.bodyPropRightWrist")) {
|
||||||
let bodyPropRightWrist = getEntityData(civilian, "vrr.bodyPropRightWrist");
|
let bodyPropRightWrist = getEntityData(civilian, "agrp.bodyPropRightWrist");
|
||||||
civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
|
civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(civilian, "vrr.bodyPropRightWrist")) {
|
if (doesEntityDataExist(civilian, "agrp.bodyPropRightWrist")) {
|
||||||
let bodyPropRightWrist = getEntityData(civilian, "vrr.bodyPropRightWrist");
|
let bodyPropRightWrist = getEntityData(civilian, "agrp.bodyPropRightWrist");
|
||||||
civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
|
civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(civilian, "vrr.bodyPropHip")) {
|
if (doesEntityDataExist(civilian, "agrp.bodyPropHip")) {
|
||||||
let bodyPropHip = getEntityData(civilian, "vrr.bodyPropHip");
|
let bodyPropHip = getEntityData(civilian, "agrp.bodyPropHip");
|
||||||
civilian.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]);
|
civilian.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(civilian, "vrr.bodyPropLeftFoot")) {
|
if (doesEntityDataExist(civilian, "agrp.bodyPropLeftFoot")) {
|
||||||
let bodyPropLeftFoot = getEntityData(civilian, "vrr.bodyPropLeftFoot");
|
let bodyPropLeftFoot = getEntityData(civilian, "agrp.bodyPropLeftFoot");
|
||||||
civilian.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]);
|
civilian.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(civilian, "vrr.bodyPropRightFoot")) {
|
if (doesEntityDataExist(civilian, "agrp.bodyPropRightFoot")) {
|
||||||
let bodyPropRightFoot = getEntityData(civilian, "vrr.bodyPropRightFoot");
|
let bodyPropRightFoot = getEntityData(civilian, "agrp.bodyPropRightFoot");
|
||||||
civilian.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]);
|
civilian.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(civilian, "vrr.anim")) {
|
if (doesEntityDataExist(civilian, "agrp.anim")) {
|
||||||
let animData = getEntityData(vehicle, "vrr.anim");
|
let animData = getEntityData(vehicle, "agrp.anim");
|
||||||
civilian.addAnimation(animData[0], animData[1]);
|
civilian.addAnimation(animData[0], animData[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -407,9 +415,9 @@ function preventDefaultEventAction(event) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function syncPlayerProperties(player) {
|
function syncPlayerProperties(player) {
|
||||||
if(getGame() == VRR_GAME_GTA_III) {
|
if (getGame() == AGRP_GAME_GTA_III) {
|
||||||
if(doesEntityDataExist(player, "vrr.scale")) {
|
if (doesEntityDataExist(player, "agrp.scale")) {
|
||||||
let scaleFactor = getEntityData(player, "vrr.scale");
|
let scaleFactor = getEntityData(player, "agrp.scale");
|
||||||
let tempMatrix = player.matrix;
|
let tempMatrix = player.matrix;
|
||||||
tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
|
tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
|
||||||
let tempPosition = player.position;
|
let tempPosition = player.position;
|
||||||
@@ -419,95 +427,95 @@ function syncPlayerProperties(player) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getGame() == VRR_GAME_GTA_SA) {
|
if (getGame() == AGRP_GAME_GTA_SA) {
|
||||||
if(doesEntityDataExist(player, "vrr.fightStyle")) {
|
if (doesEntityDataExist(player, "agrp.fightStyle")) {
|
||||||
let fightStyle = getEntityData(player, "vrr.fightStyle");
|
let fightStyle = getEntityData(player, "agrp.fightStyle");
|
||||||
player.setFightStyle(fightStyle[0], fightStyle[1]);
|
player.setFightStyle(fightStyle[0], fightStyle[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//if(getGame() == VRR_GAME_GTA_SA) {
|
//if(getGame() == AGRP_GAME_GTA_SA) {
|
||||||
// if(doesEntityDataExist(player, "vrr.walkStyle")) {
|
// if(doesEntityDataExist(player, "agrp.walkStyle")) {
|
||||||
// let walkStyle = getEntityData(player, "vrr.walkStyle");
|
// let walkStyle = getEntityData(player, "agrp.walkStyle");
|
||||||
// player.walkStyle = walkStyle;
|
// player.walkStyle = walkStyle;
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
if(getGame() == VRR_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPartHair")) {
|
if (doesEntityDataExist(player, "agrp.bodyPartHair")) {
|
||||||
let bodyPartHead = getEntityData(player, "vrr.bodyPartHair");
|
let bodyPartHead = getEntityData(player, "agrp.bodyPartHair");
|
||||||
player.changeBodyPart(0, bodyPartHead[0], bodyPartHair[1]);
|
player.changeBodyPart(0, bodyPartHead[0], bodyPartHair[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPartHead")) {
|
if (doesEntityDataExist(player, "agrp.bodyPartHead")) {
|
||||||
let bodyPartHead = getEntityData(player, "vrr.bodyPartHead");
|
let bodyPartHead = getEntityData(player, "agrp.bodyPartHead");
|
||||||
player.changeBodyPart(1, bodyPartHead[0], bodyPartHead[1]);
|
player.changeBodyPart(1, bodyPartHead[0], bodyPartHead[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPartUpper")) {
|
if (doesEntityDataExist(player, "agrp.bodyPartUpper")) {
|
||||||
let bodyPartUpper = getEntityData(player, "vrr.bodyPartUpper");
|
let bodyPartUpper = getEntityData(player, "agrp.bodyPartUpper");
|
||||||
player.changeBodyPart(1, bodyPartUpper[0], bodyPartUpper[1]);
|
player.changeBodyPart(1, bodyPartUpper[0], bodyPartUpper[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPartLower")) {
|
if (doesEntityDataExist(player, "agrp.bodyPartLower")) {
|
||||||
let bodyPartLower = getEntityData(player, "vrr.bodyPartLower");
|
let bodyPartLower = getEntityData(player, "agrp.bodyPartLower");
|
||||||
player.changeBodyPart(1, bodyPartLower[0], bodyPartLower[1]);
|
player.changeBodyPart(1, bodyPartLower[0], bodyPartLower[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getGame() == VRR_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPropHair")) {
|
if (doesEntityDataExist(player, "agrp.bodyPropHair")) {
|
||||||
let bodyPropHair = getEntityData(player, "vrr.bodyPropHair");
|
let bodyPropHair = getEntityData(player, "agrp.bodyPropHair");
|
||||||
player.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]);
|
player.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPropHead")) {
|
if (doesEntityDataExist(player, "agrp.bodyPropHead")) {
|
||||||
let bodyPropHead = getEntityData(player, "vrr.bodyPropHead");
|
let bodyPropHead = getEntityData(player, "agrp.bodyPropHead");
|
||||||
player.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]);
|
player.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPropEyes")) {
|
if (doesEntityDataExist(player, "agrp.bodyPropEyes")) {
|
||||||
let bodyPropEyes = getEntityData(player, "vrr.bodyPropEyes");
|
let bodyPropEyes = getEntityData(player, "agrp.bodyPropEyes");
|
||||||
player.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]);
|
player.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPropLeftHand")) {
|
if (doesEntityDataExist(player, "agrp.bodyPropLeftHand")) {
|
||||||
let bodyPropLeftHand = getEntityData(player, "vrr.bodyPropLeftHand");
|
let bodyPropLeftHand = getEntityData(player, "agrp.bodyPropLeftHand");
|
||||||
player.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]);
|
player.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPropRightHand")) {
|
if (doesEntityDataExist(player, "agrp.bodyPropRightHand")) {
|
||||||
let bodyPropRightHand = getEntityData(player, "vrr.bodyPropRightHand");
|
let bodyPropRightHand = getEntityData(player, "agrp.bodyPropRightHand");
|
||||||
player.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]);
|
player.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPropLeftWrist")) {
|
if (doesEntityDataExist(player, "agrp.bodyPropLeftWrist")) {
|
||||||
let bodyPropLeftWrist = getEntityData(player, "vrr.bodyPropLeftWrist");
|
let bodyPropLeftWrist = getEntityData(player, "agrp.bodyPropLeftWrist");
|
||||||
player.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]);
|
player.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPropRightWrist")) {
|
if (doesEntityDataExist(player, "agrp.bodyPropRightWrist")) {
|
||||||
let bodyPropRightWrist = getEntityData(player, "vrr.bodyPropRightWrist");
|
let bodyPropRightWrist = getEntityData(player, "agrp.bodyPropRightWrist");
|
||||||
player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
|
player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPropRightWrist")) {
|
if (doesEntityDataExist(player, "agrp.bodyPropRightWrist")) {
|
||||||
let bodyPropRightWrist = getEntityData(player, "vrr.bodyPropRightWrist");
|
let bodyPropRightWrist = getEntityData(player, "agrp.bodyPropRightWrist");
|
||||||
player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
|
player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPropHip")) {
|
if (doesEntityDataExist(player, "agrp.bodyPropHip")) {
|
||||||
let bodyPropHip = getEntityData(player, "vrr.bodyPropHip");
|
let bodyPropHip = getEntityData(player, "agrp.bodyPropHip");
|
||||||
player.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]);
|
player.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPropLeftFoot")) {
|
if (doesEntityDataExist(player, "agrp.bodyPropLeftFoot")) {
|
||||||
let bodyPropLeftFoot = getEntityData(player, "vrr.bodyPropLeftFoot");
|
let bodyPropLeftFoot = getEntityData(player, "agrp.bodyPropLeftFoot");
|
||||||
player.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]);
|
player.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPropRightFoot")) {
|
if (doesEntityDataExist(player, "agrp.bodyPropRightFoot")) {
|
||||||
let bodyPropRightFoot = getEntityData(player, "vrr.bodyPropRightFoot");
|
let bodyPropRightFoot = getEntityData(player, "agrp.bodyPropRightFoot");
|
||||||
player.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]);
|
player.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -516,9 +524,9 @@ function syncPlayerProperties(player) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function syncObjectProperties(object) {
|
function syncObjectProperties(object) {
|
||||||
if(getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) {
|
if (getGame() == AGRP_GAME_GTA_III || getGame() == AGRP_GAME_GTA_VC) {
|
||||||
if(doesEntityDataExist(object, "vrr.scale")) {
|
if (doesEntityDataExist(object, "agrp.scale")) {
|
||||||
let scaleFactor = getEntityData(object, "vrr.scale");
|
let scaleFactor = getEntityData(object, "agrp.scale");
|
||||||
let tempMatrix = object.matrix;
|
let tempMatrix = object.matrix;
|
||||||
tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
|
tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
|
||||||
let tempPosition = object.position;
|
let tempPosition = object.position;
|
||||||
@@ -568,13 +576,13 @@ function getPlayerId(client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function syncElementProperties(element) {
|
function syncElementProperties(element) {
|
||||||
if(doesEntityDataExist(element, "vrr.interior")) {
|
if (doesEntityDataExist(element, "agrp.interior")) {
|
||||||
if(typeof element.interior != "undefined") {
|
if (typeof element.interior != "undefined") {
|
||||||
element.interior = getEntityData(element, "vrr.interior");
|
element.interior = getEntityData(element, "agrp.interior");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(element.type) {
|
switch (element.type) {
|
||||||
case ELEMENT_VEHICLE:
|
case ELEMENT_VEHICLE:
|
||||||
syncVehicleProperties(element);
|
syncVehicleProperties(element);
|
||||||
break;
|
break;
|
||||||
@@ -619,23 +627,23 @@ function getScreenHeight() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function openAllGarages() {
|
function openAllGarages() {
|
||||||
switch(getGame()) {
|
switch (getGame()) {
|
||||||
case VRR_GAME_GTA_III:
|
case AGRP_GAME_GTA_III:
|
||||||
for(let i=0;i<=26;i++) {
|
for (let i = 0; i <= 26; i++) {
|
||||||
openGarage(i);
|
openGarage(i);
|
||||||
game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i);
|
game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VRR_GAME_GTA_VC:
|
case AGRP_GAME_GTA_VC:
|
||||||
for(let i=0;i<=32;i++) {
|
for (let i = 0; i <= 32; i++) {
|
||||||
openGarage(i);
|
openGarage(i);
|
||||||
game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i);
|
game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VRR_GAME_GTA_SA:
|
case AGRP_GAME_GTA_SA:
|
||||||
for(let i=0;i<=44;i++) {
|
for (let i = 0; i <= 44; i++) {
|
||||||
openGarage(i);
|
openGarage(i);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -648,23 +656,23 @@ function openAllGarages() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function closeAllGarages() {
|
function closeAllGarages() {
|
||||||
switch(getGame()) {
|
switch (getGame()) {
|
||||||
case VRR_GAME_GTA_III:
|
case AGRP_GAME_GTA_III:
|
||||||
for(let i=0;i<=26;i++) {
|
for (let i = 0; i <= 26; i++) {
|
||||||
closeGarage(i);
|
closeGarage(i);
|
||||||
game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i);
|
game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VRR_GAME_GTA_VC:
|
case AGRP_GAME_GTA_VC:
|
||||||
for(let i=0;i<=32;i++) {
|
for (let i = 0; i <= 32; i++) {
|
||||||
closeGarage(i);
|
closeGarage(i);
|
||||||
game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i);
|
game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VRR_GAME_GTA_SA:
|
case AGRP_GAME_GTA_SA:
|
||||||
for(let i=0;i<=44;i++) {
|
for (let i = 0; i <= 44; i++) {
|
||||||
closeGarage(i);
|
closeGarage(i);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -683,7 +691,7 @@ function setPedInvincible(ped, state) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setPedLookAt(ped, position) {
|
function setPedLookAt(ped, position) {
|
||||||
if(getGame() == VRR_GAME_GTA_SA) {
|
if (getGame() == AGRP_GAME_GTA_SA) {
|
||||||
ped.lookAt(position, 10000);
|
ped.lookAt(position, 10000);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
@@ -698,3 +706,9 @@ function setElementHeading(elementId, heading) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function deleteLocalPlayerPed() {
|
||||||
|
destroyElement(localPlayer);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
473
scripts/client/netevents.js
Normal file
473
scripts/client/netevents.js
Normal file
@@ -0,0 +1,473 @@
|
|||||||
|
// ===========================================================================
|
||||||
|
// Asshat Gaming Roleplay
|
||||||
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
|
// ===========================================================================
|
||||||
|
// FILE: netevents.js
|
||||||
|
// DESC: Provides server communication and cross-endpoint network events
|
||||||
|
// TYPE: Client (JavaScript)
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function initNetworkEventsScript() {
|
||||||
|
logToConsole(LOG_DEBUG, "[AGRP.NetEvents]: Initializing server script ...");
|
||||||
|
logToConsole(LOG_DEBUG, "[AGRP.NetEvents]: Server script initialized!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function addAllNetworkHandlers() {
|
||||||
|
logToConsole(LOG_DEBUG, "[AGRP.Server]: Adding network handlers ...");
|
||||||
|
|
||||||
|
// Chat Box
|
||||||
|
addNetworkEventHandler("m", receiveChatBoxMessageFromServer); // Not prefixed with VRR to make it as small as possible
|
||||||
|
addNetworkEventHandler("agrp.chatScrollLines", setChatScrollLines);
|
||||||
|
addNetworkEventHandler("agrp.chatAutoHideDelay", setChatAutoHideDelay);
|
||||||
|
addNetworkEventHandler("agrp.chatTimeStamps", setChatTimeStampsState);
|
||||||
|
addNetworkEventHandler("agrp.chatEmoji", setChatEmojiState);
|
||||||
|
|
||||||
|
// Messaging (like textdraws and stuff)
|
||||||
|
addNetworkEventHandler("agrp.smallGameMessage", showSmallGameMessage);
|
||||||
|
|
||||||
|
// Job
|
||||||
|
addNetworkEventHandler("agrp.job", receiveJobFromServer);
|
||||||
|
addNetworkEventHandler("agrp.working", setLocalPlayerWorkingState);
|
||||||
|
addNetworkEventHandler("agrp.jobType", setLocalPlayerJobType);
|
||||||
|
addNetworkEventHandler("agrp.showJobRouteLocation", showJobRouteLocation);
|
||||||
|
addNetworkEventHandler("agrp.hideJobRouteLocation", hideJobRouteLocation);
|
||||||
|
|
||||||
|
// Local player states and values
|
||||||
|
addNetworkEventHandler("agrp.restoreCamera", restoreLocalCamera);
|
||||||
|
addNetworkEventHandler("agrp.cameraLookAt", setLocalCameraLookAt);
|
||||||
|
addNetworkEventHandler("agrp.freeze", setLocalPlayerFrozenState);
|
||||||
|
addNetworkEventHandler("agrp.control", setLocalPlayerControlState);
|
||||||
|
addNetworkEventHandler("agrp.fadeCamera", fadeLocalCamera);
|
||||||
|
addNetworkEventHandler("agrp.removeFromVehicle", removeLocalPlayerFromVehicle);
|
||||||
|
addNetworkEventHandler("agrp.clearWeapons", clearLocalPlayerWeapons);
|
||||||
|
addNetworkEventHandler("agrp.giveWeapon", giveLocalPlayerWeapon);
|
||||||
|
addNetworkEventHandler("agrp.position", setLocalPlayerPosition);
|
||||||
|
addNetworkEventHandler("agrp.heading", setLocalPlayerHeading);
|
||||||
|
addNetworkEventHandler("agrp.interior", setLocalPlayerInterior);
|
||||||
|
addNetworkEventHandler("agrp.spawned", onServerSpawnedLocalPlayer);
|
||||||
|
addNetworkEventHandler("agrp.money", setLocalPlayerMoney);
|
||||||
|
addNetworkEventHandler("agrp.armour", setLocalPlayerArmour);
|
||||||
|
addNetworkEventHandler("agrp.localPlayerSkin", setLocalPlayerSkin);
|
||||||
|
addNetworkEventHandler("agrp.pedSpeak", makeLocalPlayerPedSpeak);
|
||||||
|
addNetworkEventHandler("agrp.infiniteRun", setLocalPlayerInfiniteRun);
|
||||||
|
addNetworkEventHandler("agrp.playerCop", setLocalPlayerAsCopState);
|
||||||
|
addNetworkEventHandler("agrp.health", setLocalPlayerHealth);
|
||||||
|
addNetworkEventHandler("agrp.wantedLevel", setLocalPlayerWantedLevel);
|
||||||
|
addNetworkEventHandler("agrp.playerPedId", sendLocalPlayerNetworkIdToServer);
|
||||||
|
addNetworkEventHandler("agrp.ped", setLocalPlayerPedPartsAndProps);
|
||||||
|
addNetworkEventHandler("agrp.spawn", serverRequestedLocalPlayerSpawn);
|
||||||
|
addNetworkEventHandler("agrp.clearPedState", clearLocalPedState);
|
||||||
|
addNetworkEventHandler("agrp.drunkEffect", setLocalPlayerDrunkEffect);
|
||||||
|
addNetworkEventHandler("agrp.deleteLocalPlayerPed", deleteLocalPlayerPed);
|
||||||
|
|
||||||
|
// Vehicle
|
||||||
|
addNetworkEventHandler("agrp.vehicle", receiveVehicleFromServer);
|
||||||
|
addNetworkEventHandler("agrp.veh.lights", setVehicleLights);
|
||||||
|
addNetworkEventHandler("agrp.veh.engine", setVehicleEngine);
|
||||||
|
addNetworkEventHandler("agrp.veh.repair", repairVehicle);
|
||||||
|
addNetworkEventHandler("agrp.cruiseControl", toggleLocalVehicleCruiseControl);
|
||||||
|
addNetworkEventHandler("agrp.passenger", enterVehicleAsPassenger);
|
||||||
|
|
||||||
|
// Radio
|
||||||
|
addNetworkEventHandler("agrp.radioStream", playStreamingRadio);
|
||||||
|
addNetworkEventHandler("agrp.audioFileStream", playAudioFile);
|
||||||
|
addNetworkEventHandler("agrp.stopRadioStream", stopStreamingRadio);
|
||||||
|
addNetworkEventHandler("agrp.radioVolume", setStreamingRadioVolume);
|
||||||
|
|
||||||
|
// Key Bindings
|
||||||
|
addNetworkEventHandler("agrp.delKeyBind", unBindAccountKey);
|
||||||
|
addNetworkEventHandler("agrp.addKeyBind", bindAccountKey);
|
||||||
|
addNetworkEventHandler("agrp.clearKeyBinds", clearKeyBinds);
|
||||||
|
|
||||||
|
// Weapon Damage
|
||||||
|
addNetworkEventHandler("agrp.weaponDamageEnabled", setPlayerWeaponDamageEnabled);
|
||||||
|
addNetworkEventHandler("agrp.weaponDamageEvent", setPlayerWeaponDamageEvent);
|
||||||
|
|
||||||
|
// GUI
|
||||||
|
addNetworkEventHandler("agrp.showRegistration", showRegistrationGUI);
|
||||||
|
addNetworkEventHandler("agrp.showNewCharacter", showNewCharacterGUI);
|
||||||
|
addNetworkEventHandler("agrp.showLogin", showLoginGUI);
|
||||||
|
addNetworkEventHandler("agrp.2fa", showTwoFactorAuthGUI);
|
||||||
|
addNetworkEventHandler("agrp.showResetPasswordCodeInput", resetPasswordCodeInputGUI);
|
||||||
|
addNetworkEventHandler("agrp.showResetPasswordEmailInput", resetPasswordEmailInputGUI);
|
||||||
|
addNetworkEventHandler("agrp.showChangePassword", showChangePasswordGUI);
|
||||||
|
addNetworkEventHandler("agrp.showCharacterSelect", showCharacterSelectGUI);
|
||||||
|
addNetworkEventHandler("agrp.switchCharacterSelect", switchCharacterSelectGUI);
|
||||||
|
addNetworkEventHandler("agrp.showError", showErrorGUI);
|
||||||
|
addNetworkEventHandler("agrp.showInfo", showInfoGUI);
|
||||||
|
addNetworkEventHandler("agrp.showPrompt", showYesNoPromptGUI);
|
||||||
|
addNetworkEventHandler("agrp.loginSuccess", loginSuccess);
|
||||||
|
addNetworkEventHandler("agrp.characterSelectSuccess", characterSelectSuccess);
|
||||||
|
addNetworkEventHandler("agrp.loginFailed", loginFailed);
|
||||||
|
addNetworkEventHandler("agrp.registrationSuccess", registrationSuccess);
|
||||||
|
addNetworkEventHandler("agrp.registrationFailed", registrationFailed);
|
||||||
|
addNetworkEventHandler("agrp.newCharacterFailed", newCharacterFailed);
|
||||||
|
addNetworkEventHandler("agrp.changePassword", showChangePasswordGUI);
|
||||||
|
addNetworkEventHandler("agrp.showLocaleChooser", showLocaleChooserGUI);
|
||||||
|
addNetworkEventHandler("agrp.guiColour", setGUIColours);
|
||||||
|
addNetworkEventHandler("agrp.mapChangeWarning", setMapChangeWarningState);
|
||||||
|
|
||||||
|
// 2D Rendering
|
||||||
|
addNetworkEventHandler("agrp.set2DRendering", set2DRendering);
|
||||||
|
addNetworkEventHandler("agrp.logo", setServerLogoRenderState);
|
||||||
|
addNetworkEventHandler("agrp.showItemActionDelay", showItemActionDelay);
|
||||||
|
|
||||||
|
// Business
|
||||||
|
addNetworkEventHandler("agrp.business", receiveBusinessFromServer);
|
||||||
|
|
||||||
|
// House
|
||||||
|
addNetworkEventHandler("agrp.house", receiveHouseFromServer);
|
||||||
|
|
||||||
|
// GPS
|
||||||
|
addNetworkEventHandler("agrp.showGPSBlip", showGPSLocation);
|
||||||
|
|
||||||
|
// Locale
|
||||||
|
addNetworkEventHandler("agrp.locale", setLocale);
|
||||||
|
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
|
||||||
|
addNetworkEventHandler("agrp.mouseCursor", toggleMouseCursor);
|
||||||
|
addNetworkEventHandler("agrp.mouseCamera", toggleMouseCamera);
|
||||||
|
addNetworkEventHandler("agrp.clearPeds", clearLocalPlayerOwnedPeds);
|
||||||
|
addNetworkEventHandler("agrp.clearPickups", clearLocalPlayerOwnedPickups);
|
||||||
|
addNetworkEventHandler("agrp.ambience", setCityAmbienceState);
|
||||||
|
addNetworkEventHandler("agrp.runCode", runClientCode);
|
||||||
|
addNetworkEventHandler("agrp.minuteDuration", setMinuteDuration);
|
||||||
|
addNetworkEventHandler("agrp.snow", setSnowState);
|
||||||
|
addNetworkEventHandler("agrp.enterPropertyKey", setEnterPropertyKey);
|
||||||
|
addNetworkEventHandler("agrp.skinSelect", toggleSkinSelect);
|
||||||
|
addNetworkEventHandler("agrp.hotbar", updatePlayerHotBar);
|
||||||
|
addNetworkEventHandler("agrp.mouseCameraForce", setMouseCameraState);
|
||||||
|
addNetworkEventHandler("agrp.logLevel", setLogLevel);
|
||||||
|
addNetworkEventHandler("agrp.hideAllGUI", hideAllGUI);
|
||||||
|
addNetworkEventHandler("agrp.ping", updatePlayerPing);
|
||||||
|
addNetworkEventHandler("agrp.clientInfo", serverRequestedClientInfo);
|
||||||
|
addNetworkEventHandler("agrp.interiorLights", updateInteriorLightsState);
|
||||||
|
addNetworkEventHandler("agrp.scene", changeScene);
|
||||||
|
addNetworkEventHandler("agrp.syncElement", forceSyncElementProperties);
|
||||||
|
addNetworkEventHandler("agrp.elementPosition", setElementPosition);
|
||||||
|
addNetworkEventHandler("agrp.elementCollisions", setElementCollisionsEnabled);
|
||||||
|
addNetworkEventHandler("agrp.vehBuyState", setVehiclePurchaseState);
|
||||||
|
addNetworkEventHandler("agrp.holdObject", makePedHoldObject);
|
||||||
|
addNetworkEventHandler("agrp.profanityFilter", setProfanityFilterState);
|
||||||
|
addNetworkEventHandler("agrp.currencyString", receiveCurrencyStringFromServer);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function sendResourceReadySignalToServer() {
|
||||||
|
sendNetworkEventToServer("agrp.clientReady");
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function sendResourceStartedSignalToServer() {
|
||||||
|
sendNetworkEventToServer("agrp.clientStarted");
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function sendResourceStoppedSignalToServer() {
|
||||||
|
if (isConnected) {
|
||||||
|
sendNetworkEventToServer("agrp.clientStopped");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function set2DRendering(hudState, labelState, smallGameMessageState, scoreboardState, hotBarState, 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;
|
||||||
|
|
||||||
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
|
natives.displayCash(hudState);
|
||||||
|
natives.displayAmmo(hudState);
|
||||||
|
natives.displayHud(hudState);
|
||||||
|
natives.displayRadar(hudState);
|
||||||
|
natives.displayAreaName(hudState);
|
||||||
|
} else {
|
||||||
|
if (typeof setHUDEnabled != "undefined") {
|
||||||
|
setHUDEnabled(hudState);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
renderLabels = labelState;
|
||||||
|
renderSmallGameMessage = smallGameMessageState;
|
||||||
|
renderScoreBoard = scoreboardState;
|
||||||
|
renderHotBar = hotBarState;
|
||||||
|
renderItemActionDelay = itemActionDelayState;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function onServerSpawnedLocalPlayer(state) {
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Main] Setting spawned state to ${state}`);
|
||||||
|
isSpawned = state;
|
||||||
|
setUpInitialGame();
|
||||||
|
if (state) {
|
||||||
|
setTimeout(function () {
|
||||||
|
calledDeathEvent = false;
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
getElementsByType(ELEMENT_PED).filter(ped => !ped.isType(ELEMENT_PLAYER)).forEach(ped => {
|
||||||
|
syncCivilianProperties(ped);
|
||||||
|
});
|
||||||
|
|
||||||
|
getElementsByType(ELEMENT_PLAYER).forEach(player => {
|
||||||
|
syncPlayerProperties(player);
|
||||||
|
});
|
||||||
|
|
||||||
|
getElementsByType(ELEMENT_VEHICLE).forEach(vehicle => {
|
||||||
|
syncVehicleProperties(vehicle);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function tellServerPlayerUsedKeyBind(key) {
|
||||||
|
sendNetworkEventToServer("agrp.useKeyBind", key);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function tellServerPlayerArrivedAtJobRouteLocation() {
|
||||||
|
sendNetworkEventToServer("agrp.arrivedAtJobRouteLocation");
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function tellServerItemActionDelayComplete() {
|
||||||
|
sendNetworkEventToServer("agrp.itemActionDelayComplete");
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function sendServerClientInfo() {
|
||||||
|
let clientVersion = "0.0.0.0";
|
||||||
|
if (typeof CLIENT_VERSION_MAJOR != "undefined") {
|
||||||
|
clientVersion = `${CLIENT_VERSION_MAJOR}.${CLIENT_VERSION_MINOR}.${CLIENT_VERSION_PATCH}.${CLIENT_VERSION_BUILD}`;
|
||||||
|
}
|
||||||
|
sendNetworkEventToServer("agrp.clientInfo", clientVersion, game.width, game.height);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function sendServerNewAFKStatus(state) {
|
||||||
|
sendNetworkEventToServer("agrp.afk", state);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function anchorBoat(vehicleId) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setEnterPropertyKey(key) {
|
||||||
|
enterPropertyKey = key;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function serverRequestedClientInfo() {
|
||||||
|
sendServerClientInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function updateInteriorLightsState(state) {
|
||||||
|
interiorLightsEnabled = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function forceSyncElementProperties(elementId) {
|
||||||
|
if (getElementFromId(elementId) == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
syncElementProperties(getElementFromId(elementId));
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setElementCollisionsEnabled(elementId, state) {
|
||||||
|
if (getElementFromId(elementId) == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
getElementFromId(elementId).collisionsEnabled = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setLocalPlayerArmour(armour) {
|
||||||
|
if (typeof localPlayer.armour != "undefined") {
|
||||||
|
localPlayer.armour = armour;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setLocalPlayerWantedLevel(wantedLevel) {
|
||||||
|
forceWantedLevel = toInteger(wantedLevel);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setLogLevel(level) {
|
||||||
|
logLevel = level;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setLocalPlayerInfiniteRun(state) {
|
||||||
|
if (localPlayer != null) {
|
||||||
|
if (getGame() == AGRP_GAME_GTA_III || getGame() == AGRP_GAME_GTA_VC) {
|
||||||
|
game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), boolToInt(state));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setLocalPlayerSkin(skinId) {
|
||||||
|
logToConsole(LOG_INFO, `[AGRP.Server] Setting locale player skin to ${skinId}`);
|
||||||
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
|
if (natives.isModelInCdimage(skinId)) {
|
||||||
|
natives.requestModel(skinId);
|
||||||
|
natives.loadAllObjectsNow();
|
||||||
|
if (natives.hasModelLoaded(skinId)) {
|
||||||
|
natives.changePlayerModel(natives.getPlayerId(), skinId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
localPlayer.skin = skinId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function makePedHoldObject(pedId, modelIndex) {
|
||||||
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
|
natives.givePedAmbientObject(natives.getPedFromNetworkId(pedId), getGameConfig().objects[getGame()][modelIndex][1])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function sendLocalPlayerNetworkIdToServer() {
|
||||||
|
if (getGame() == AGRP_GAME_GTA_IV || getGame() == AGRP_GAME_GTA_IV_EFLC) {
|
||||||
|
sendNetworkEventToServer("agrp.playerPedId", natives.getNetworkIdFromPed(localPlayer));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function changeScene(sceneName) {
|
||||||
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
|
if (cutsceneName == "") {
|
||||||
|
natives.clearCutscene();
|
||||||
|
} else {
|
||||||
|
if (natives.isInteriorScene()) {
|
||||||
|
natives.clearCutscene();
|
||||||
|
}
|
||||||
|
natives.initCutscene(cutsceneName);
|
||||||
|
}
|
||||||
|
} else if (getGame() == AGRP_GAME_MAFIA_ONE) {
|
||||||
|
game.changeMap(sceneName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function makeLocalPlayerPedSpeak(speechName) {
|
||||||
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
|
// if player is in vehicle, allow megaphone (if last arg is "1", it will cancel megaphone echo)
|
||||||
|
// Only speeches with _MEGAPHONE will have the bullhorn effect
|
||||||
|
// Afaik it only works on police voices anyway
|
||||||
|
if (localPlayer.vehicle != null) {
|
||||||
|
natives.sayAmbientSpeech(localPlayer, speechName, true, false, 0);
|
||||||
|
} else {
|
||||||
|
natives.sayAmbientSpeech(localPlayer, speechName, true, false, 1);
|
||||||
|
}
|
||||||
|
} else if (getGame() == AGRP_GAME_GTA_III || getGame() == AGRP_GAME_GTA_VC) {
|
||||||
|
// Don't have a way to get the ped ref ID and can't use ped in arg
|
||||||
|
//game.SET_CHAR_SAY(game.GET_PLAYER_ID(), int);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setLocalPlayerAsCopState(state) {
|
||||||
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
|
natives.setPlayerAsCop(natives.getPlayerId(), state);
|
||||||
|
natives.setPoliceIgnorePlayer(natives.getPlayerId(), state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function serverRequestedLocalPlayerSpawn(skinId, position) {
|
||||||
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
|
natives.createPlayer(skinId, position);
|
||||||
|
//if(isCustomCameraSupported()) {
|
||||||
|
// game.restoreCamera(true);
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function sendLocaleSelectToServer(localeId) {
|
||||||
|
sendNetworkEventToServer("agrp.localeSelect", localeId);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function clearLocalPlayerOwnedPickups() {
|
||||||
|
let pickups = getPickups().filter(pickup => pickup.isLocal == true);
|
||||||
|
for (let i in pickups) {
|
||||||
|
deleteLocalGameElement(pickups[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: npc.js
|
// FILE: npc.js
|
||||||
// DESC: Provides NPC functions and processing
|
// DESC: Provides NPC functions and processing
|
||||||
@@ -9,10 +10,10 @@
|
|||||||
|
|
||||||
function processNPCMovement(npc) {
|
function processNPCMovement(npc) {
|
||||||
//if(npc.isSyncer == true) {
|
//if(npc.isSyncer == true) {
|
||||||
if(getEntityData(npc, "vrr.lookAtClosestPlayer") == true) {
|
if (getEntityData(npc, "agrp.lookAtClosestPlayer") == true) {
|
||||||
let closestPlayer = getClosestPlayer(getElementPosition(npc.id));
|
let closestPlayer = getClosestPlayer(getElementPosition(npc.id));
|
||||||
setPedLookAt(npc, getElementPosition(closestPlayer.id));
|
setPedLookAt(npc, getElementPosition(closestPlayer.id));
|
||||||
}
|
}
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
39
scripts/client/object.js
Normal file
39
scripts/client/object.js
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
// ===========================================================================
|
||||||
|
// Asshat Gaming Roleplay
|
||||||
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
|
// ===========================================================================
|
||||||
|
// FILE: object.js
|
||||||
|
// DESC: Provides object functions and processing
|
||||||
|
// TYPE: Client (JavaScript)
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
let movingObject = null;
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function startMovingObject(object) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function stopMovingObject(object, save = true) {
|
||||||
|
if (save) {
|
||||||
|
sendNetworkEventToServer("agrp.objectSave", object.id, object.position, object.rotation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function isMovingObject() {
|
||||||
|
return movingObject != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getMovingObject() {
|
||||||
|
return movingObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: radio.js
|
// FILE: radio.js
|
||||||
// DESC: Provides internet streaming radio functions and usage
|
// DESC: Provides internet streaming radio functions and usage
|
||||||
@@ -8,21 +9,21 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function playStreamingRadio(url, loop, volume, element = false) {
|
function playStreamingRadio(url, loop, volume, element = false) {
|
||||||
if(streamingRadio != null) {
|
if (streamingRadio != null) {
|
||||||
streamingRadio.stop();
|
streamingRadio.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
streamingRadioVolume = volume;
|
streamingRadioVolume = volume;
|
||||||
|
|
||||||
streamingRadio = audio.createSoundFromURL(url, loop);
|
streamingRadio = audio.createSoundFromURL(url, loop);
|
||||||
streamingRadio.volume = volume/100;
|
streamingRadio.volume = volume / 100;
|
||||||
streamingRadio.play();
|
streamingRadio.play();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function stopStreamingRadio() {
|
function stopStreamingRadio() {
|
||||||
if(streamingRadio != null) {
|
if (streamingRadio != null) {
|
||||||
streamingRadio.stop();
|
streamingRadio.stop();
|
||||||
}
|
}
|
||||||
streamingRadio = null;
|
streamingRadio = null;
|
||||||
@@ -31,16 +32,20 @@ function stopStreamingRadio() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setStreamingRadioVolume(volume) {
|
function setStreamingRadioVolume(volume) {
|
||||||
if(streamingRadio != null) {
|
if (streamingRadio != null) {
|
||||||
streamingRadioVolume = volume;
|
streamingRadioVolume = volume;
|
||||||
streamingRadio.volume = volume/100;
|
streamingRadio.volume = volume / 100;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function playAudioFile(audioName, loop, volume) {
|
function playAudioFile(audioName, loop, volume) {
|
||||||
findResourceByName("connectedrp-extra").exports.playCustomAudio(audioName, volume/100, loop);
|
findResourceByName("connectedrp-extra").exports.playCustomAudio(audioName, volume / 100, loop);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getStreamingRadioVolumeForPosition(position1, position2) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: scoreboard.js
|
// FILE: scoreboard.js
|
||||||
// DESC: Provides scoreboard features and rendering
|
// DESC: Provides scoreboard features and rendering
|
||||||
@@ -17,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!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -38,63 +39,63 @@ function initScoreBoardListFont() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function processScoreBoardRendering() {
|
function processScoreBoardRendering() {
|
||||||
if(isAnyGUIActive()) {
|
if (isAnyGUIActive()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(renderScoreBoard) {
|
if (renderScoreBoard) {
|
||||||
if(isKeyDown(SDLK_TAB)) {
|
if (isKeyDown(SDLK_TAB)) {
|
||||||
if(scoreBoardListFont != null && scoreBoardTitleFont != null) {
|
if (scoreBoardListFont != null && scoreBoardTitleFont != null) {
|
||||||
let scoreboardStart = (game.height/2)-(Math.floor(getClients().length/2)*20);
|
let scoreboardStart = (game.height / 2) - (Math.floor(getClients().length / 2) * 20);
|
||||||
let titleSize = scoreBoardTitleFont.measure("PLAYERS", game.width, 0.0, 1.0, 10, false, false);
|
let titleSize = scoreBoardTitleFont.measure("PLAYERS", game.width, 0.0, 1.0, 10, false, false);
|
||||||
scoreBoardTitleFont.render("PLAYERS", [game.width/2, scoreboardStart-50], 0, 0.5, 0.0, scoreBoardTitleFont.size, COLOUR_WHITE, false, false, false, true);
|
scoreBoardTitleFont.render("PLAYERS", [game.width / 2, scoreboardStart - 50], 0, 0.5, 0.0, scoreBoardTitleFont.size, COLOUR_WHITE, false, false, false, true);
|
||||||
|
|
||||||
titleSize = scoreBoardTitleFont.measure("____________________________", game.width, 0.0, 1.0, 10, false, false);
|
titleSize = scoreBoardTitleFont.measure("____________________________", game.width, 0.0, 1.0, 10, false, false);
|
||||||
scoreBoardTitleFont.render("____________________________", [game.width/2, scoreboardStart-35], 0, 0.5, 0.0, scoreBoardTitleFont.size, COLOUR_WHITE, false, false, false, true);
|
scoreBoardTitleFont.render("____________________________", [game.width / 2, scoreboardStart - 35], 0, 0.5, 0.0, scoreBoardTitleFont.size, COLOUR_WHITE, false, false, false, true);
|
||||||
|
|
||||||
let clients = getClients();
|
let clients = getClients();
|
||||||
for(let i in clients) {
|
for (let i in clients) {
|
||||||
if(!clients[i].console) {
|
if (!clients[i].console) {
|
||||||
let name = clients[i].name;
|
let name = clients[i].name;
|
||||||
let colour = COLOUR_WHITE;
|
let colour = COLOUR_WHITE;
|
||||||
let paused = false;
|
let paused = false;
|
||||||
let ping = "-1";
|
let ping = "-1";
|
||||||
|
|
||||||
if(typeof playerNames[clients[i].name] != "undefined") {
|
if (typeof playerNames[clients[i].name] != "undefined") {
|
||||||
name = playerNames[clients[i].name];
|
name = playerNames[clients[i].name];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(typeof playerPaused[clients[i].name] != "undefined") {
|
if (typeof playerPaused[clients[i].name] != "undefined") {
|
||||||
paused = playerPaused[clients[i].name];
|
paused = playerPaused[clients[i].name];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(typeof playerColours[clients[i].name] != "undefined") {
|
if (typeof playerColours[clients[i].name] != "undefined") {
|
||||||
colour = playerColours[clients[i].name];
|
colour = playerColours[clients[i].name];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(typeof playerPing[clients[i].name] != "undefined") {
|
if (typeof playerPing[clients[i].name] != "undefined") {
|
||||||
ping = toString(playerPing[clients[i].name]);
|
ping = toString(playerPing[clients[i].name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Player ID
|
// Player ID
|
||||||
let text = String(clients[i].index);
|
let text = String(clients[i].index);
|
||||||
let size = scoreBoardListFont.measure(text, 75, 0.0, 1.0, 10, false, false);
|
let size = scoreBoardListFont.measure(text, 75, 0.0, 1.0, 10, false, false);
|
||||||
scoreBoardListFont.render(text, [game.width/2-100, scoreboardStart + (i*20)], 0, 0.5, 0.0, scoreBoardListFont.size, COLOUR_WHITE, false, false, false, true);
|
scoreBoardListFont.render(text, [game.width / 2 - 100, scoreboardStart + (i * 20)], 0, 0.5, 0.0, scoreBoardListFont.size, COLOUR_WHITE, false, false, false, true);
|
||||||
|
|
||||||
// Player Name
|
// Player Name
|
||||||
text = name;
|
text = name;
|
||||||
size = scoreBoardListFont.measure(text, 100, 0.0, 1.0, 10, false, false);
|
size = scoreBoardListFont.measure(text, 100, 0.0, 1.0, 10, false, false);
|
||||||
scoreBoardListFont.render(text, [game.width/2, scoreboardStart + (i*20)], 0, 0.5, 0.0, scoreBoardListFont.size, colour, false, false, false, true);
|
scoreBoardListFont.render(text, [game.width / 2, scoreboardStart + (i * 20)], 0, 0.5, 0.0, scoreBoardListFont.size, colour, false, false, false, true);
|
||||||
|
|
||||||
// Ping
|
// Ping
|
||||||
text = ping;
|
text = ping;
|
||||||
size = scoreBoardListFont.measure(ping, 75, 0.0, 1.0, 10, false, false);
|
size = scoreBoardListFont.measure(ping, 75, 0.0, 1.0, 10, false, false);
|
||||||
scoreBoardListFont.render(ping, [game.width/2+100, scoreboardStart + (i*20)], 0, 0.5, 0.0, scoreBoardListFont.size, COLOUR_WHITE, false, false, false, true);
|
scoreBoardListFont.render(ping, [game.width / 2 + 100, scoreboardStart + (i * 20)], 0, 0.5, 0.0, scoreBoardListFont.size, COLOUR_WHITE, false, false, false, true);
|
||||||
|
|
||||||
// PAUSED Status (depends on resource "afk")
|
// PAUSED Status (depends on resource "afk")
|
||||||
if(paused == true) {
|
if (paused == true) {
|
||||||
size = scoreBoardListFont.measure("PAUSED", 100, 0.0, 1.0, 10, false, false);
|
size = scoreBoardListFont.measure("PAUSED", 100, 0.0, 1.0, 10, false, false);
|
||||||
scoreBoardListFont.render("PAUSED", [game.width/2+200, scoreboardStart + (i*20)], 0, 0.5, 0.0, scoreBoardListFont.size, pausedColour, false, false, false, true);
|
scoreBoardListFont.render("PAUSED", [game.width / 2 + 200, scoreboardStart + (i * 20)], 0, 0.5, 0.0, scoreBoardListFont.size, pausedColour, false, false, false, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,416 +0,0 @@
|
|||||||
// ===========================================================================
|
|
||||||
// Vortrex's Roleplay Resource
|
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
|
||||||
// ===========================================================================
|
|
||||||
// FILE: server.js
|
|
||||||
// DESC: Provides server communication and cross-endpoint operations
|
|
||||||
// TYPE: Client (JavaScript)
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function initServerScript() {
|
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Server]: Initializing server script ...");
|
|
||||||
addAllNetworkHandlers();
|
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Server]: Server script initialized!");
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function addAllNetworkHandlers() {
|
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Server]: Adding network handlers ...");
|
|
||||||
|
|
||||||
// Chat history
|
|
||||||
addNetworkEventHandler("m", receiveChatBoxMessageFromServer); // Not prefixed with VRR to make it as small as possible
|
|
||||||
addNetworkEventHandler("vrr.chatScrollLines", setChatScrollLines);
|
|
||||||
addNetworkEventHandler("vrr.chatAutoHideDelay", setChatAutoHideDelay);
|
|
||||||
|
|
||||||
// Messaging (like textdraws and stuff)
|
|
||||||
addNetworkEventHandler("vrr.smallGameMessage", showSmallGameMessage);
|
|
||||||
|
|
||||||
// Job
|
|
||||||
addNetworkEventHandler("vrr.job", receiveJobFromServer);
|
|
||||||
addNetworkEventHandler("vrr.working", setLocalPlayerWorkingState);
|
|
||||||
addNetworkEventHandler("vrr.jobType", setLocalPlayerJobType);
|
|
||||||
addNetworkEventHandler("vrr.showJobRouteLocation", showJobRouteLocation);
|
|
||||||
addNetworkEventHandler("vrr.hideJobRouteLocation", hideJobRouteLocation);
|
|
||||||
|
|
||||||
// Local player states and values
|
|
||||||
addNetworkEventHandler("vrr.restoreCamera", restoreLocalCamera);
|
|
||||||
addNetworkEventHandler("vrr.cameraLookAt", setLocalCameraLookAt);
|
|
||||||
addNetworkEventHandler("vrr.freeze", setLocalPlayerFrozenState);
|
|
||||||
addNetworkEventHandler("vrr.control", setLocalPlayerControlState);
|
|
||||||
addNetworkEventHandler("vrr.fadeCamera", fadeLocalCamera);
|
|
||||||
addNetworkEventHandler("vrr.removeFromVehicle", removeLocalPlayerFromVehicle);
|
|
||||||
addNetworkEventHandler("vrr.clearWeapons", clearLocalPlayerWeapons);
|
|
||||||
addNetworkEventHandler("vrr.giveWeapon", giveLocalPlayerWeapon);
|
|
||||||
addNetworkEventHandler("vrr.position", setLocalPlayerPosition);
|
|
||||||
addNetworkEventHandler("vrr.heading", setLocalPlayerHeading);
|
|
||||||
addNetworkEventHandler("vrr.interior", setLocalPlayerInterior);
|
|
||||||
addNetworkEventHandler("vrr.spawned", onServerSpawnedLocalPlayer);
|
|
||||||
addNetworkEventHandler("vrr.money", setLocalPlayerCash);
|
|
||||||
addNetworkEventHandler("vrr.armour", setLocalPlayerArmour);
|
|
||||||
addNetworkEventHandler("vrr.localPlayerSkin", setLocalPlayerSkin);
|
|
||||||
addNetworkEventHandler("vrr.pedSpeak", makeLocalPlayerPedSpeak);
|
|
||||||
addNetworkEventHandler("vrr.infiniteRun", setLocalPlayerInfiniteRun);
|
|
||||||
addNetworkEventHandler("vrr.playerCop", setLocalPlayerAsCopState);
|
|
||||||
addNetworkEventHandler("vrr.health", setLocalPlayerHealth);
|
|
||||||
addNetworkEventHandler("vrr.wantedLevel", setLocalPlayerWantedLevel);
|
|
||||||
addNetworkEventHandler("vrr.playerPedId", sendLocalPlayerNetworkIdToServer);
|
|
||||||
addNetworkEventHandler("vrr.ped", setLocalPlayerPedPartsAndProps);
|
|
||||||
addNetworkEventHandler("vrr.spawn", serverRequestedLocalPlayerSpawn);
|
|
||||||
addNetworkEventHandler("vrr.clearPedState", clearLocalPedState);
|
|
||||||
addNetworkEventHandler("vrr.drunkEffect", setLocalPlayerDrunkEffect);
|
|
||||||
|
|
||||||
// Vehicle
|
|
||||||
addNetworkEventHandler("vrr.vehicle", receiveVehicleFromServer);
|
|
||||||
addNetworkEventHandler("vrr.veh.lights", setVehicleLights);
|
|
||||||
addNetworkEventHandler("vrr.veh.engine", setVehicleEngine);
|
|
||||||
addNetworkEventHandler("vrr.veh.repair", repairVehicle);
|
|
||||||
|
|
||||||
// Radio
|
|
||||||
addNetworkEventHandler("vrr.radioStream", playStreamingRadio);
|
|
||||||
addNetworkEventHandler("vrr.audioFileStream", playAudioFile);
|
|
||||||
addNetworkEventHandler("vrr.stopRadioStream", stopStreamingRadio);
|
|
||||||
addNetworkEventHandler("vrr.radioVolume", setStreamingRadioVolume);
|
|
||||||
|
|
||||||
// Key Bindings
|
|
||||||
addNetworkEventHandler("vrr.delKeyBind", unBindAccountKey);
|
|
||||||
addNetworkEventHandler("vrr.addKeyBind", bindAccountKey);
|
|
||||||
addNetworkEventHandler("vrr.clearKeyBinds", clearKeyBinds);
|
|
||||||
|
|
||||||
// Weapon Damage
|
|
||||||
addNetworkEventHandler("vrr.weaponDamageEnabled", setPlayerWeaponDamageEnabled);
|
|
||||||
addNetworkEventHandler("vrr.weaponDamageEvent", setPlayerWeaponDamageEvent);
|
|
||||||
|
|
||||||
// GUI
|
|
||||||
addNetworkEventHandler("vrr.showRegistration", showRegistrationGUI);
|
|
||||||
addNetworkEventHandler("vrr.showNewCharacter", showNewCharacterGUI);
|
|
||||||
addNetworkEventHandler("vrr.showLogin", showLoginGUI);
|
|
||||||
addNetworkEventHandler("vrr.2fa", showTwoFactorAuthGUI);
|
|
||||||
addNetworkEventHandler("vrr.showResetPasswordCodeInput", resetPasswordCodeInputGUI);
|
|
||||||
addNetworkEventHandler("vrr.showResetPasswordEmailInput", resetPasswordEmailInputGUI);
|
|
||||||
addNetworkEventHandler("vrr.showChangePassword", showChangePasswordGUI);
|
|
||||||
addNetworkEventHandler("vrr.showCharacterSelect", showCharacterSelectGUI);
|
|
||||||
addNetworkEventHandler("vrr.switchCharacterSelect", switchCharacterSelectGUI);
|
|
||||||
addNetworkEventHandler("vrr.showError", showErrorGUI);
|
|
||||||
addNetworkEventHandler("vrr.showInfo", showInfoGUI);
|
|
||||||
addNetworkEventHandler("vrr.showPrompt", showYesNoPromptGUI);
|
|
||||||
addNetworkEventHandler("vrr.loginSuccess", loginSuccess);
|
|
||||||
addNetworkEventHandler("vrr.characterSelectSuccess", characterSelectSuccess);
|
|
||||||
addNetworkEventHandler("vrr.loginFailed", loginFailed);
|
|
||||||
addNetworkEventHandler("vrr.registrationSuccess", registrationSuccess);
|
|
||||||
addNetworkEventHandler("vrr.registrationFailed", registrationFailed);
|
|
||||||
addNetworkEventHandler("vrr.newCharacterFailed", newCharacterFailed);
|
|
||||||
addNetworkEventHandler("vrr.changePassword", showChangePasswordGUI);
|
|
||||||
addNetworkEventHandler("vrr.showLocaleChooser", showLocaleChooserGUI);
|
|
||||||
addNetworkEventHandler("vrr.guiColour", setGUIColours);
|
|
||||||
|
|
||||||
// Business
|
|
||||||
addNetworkEventHandler("vrr.business", receiveBusinessFromServer);
|
|
||||||
|
|
||||||
// House
|
|
||||||
addNetworkEventHandler("vrr.house", receiveHouseFromServer);
|
|
||||||
|
|
||||||
// GPS
|
|
||||||
addNetworkEventHandler("vrr.showGPSBlip", showGPSLocation);
|
|
||||||
|
|
||||||
// Locale
|
|
||||||
addNetworkEventHandler("vrr.locale", setLocale);
|
|
||||||
addNetworkEventHandler("vrr.localeChooser", toggleLocaleChooserGUI);
|
|
||||||
|
|
||||||
// Misc
|
|
||||||
addNetworkEventHandler("vrr.mouseCursor", toggleMouseCursor);
|
|
||||||
addNetworkEventHandler("vrr.mouseCamera", toggleMouseCamera);
|
|
||||||
addNetworkEventHandler("vrr.clearPeds", clearLocalPlayerOwnedPeds);
|
|
||||||
addNetworkEventHandler("vrr.passenger", enterVehicleAsPassenger);
|
|
||||||
addNetworkEventHandler("vrr.logo", setServerLogoRenderState);
|
|
||||||
addNetworkEventHandler("vrr.ambience", setCityAmbienceState);
|
|
||||||
addNetworkEventHandler("vrr.runCode", runClientCode);
|
|
||||||
addNetworkEventHandler("vrr.minuteDuration", setMinuteDuration);
|
|
||||||
addNetworkEventHandler("vrr.snow", setSnowState);
|
|
||||||
addNetworkEventHandler("vrr.enterPropertyKey", setEnterPropertyKey);
|
|
||||||
addNetworkEventHandler("vrr.skinSelect", toggleSkinSelect);
|
|
||||||
addNetworkEventHandler("vrr.hotbar", updatePlayerHotBar);
|
|
||||||
addNetworkEventHandler("vrr.showItemActionDelay", showItemActionDelay);
|
|
||||||
addNetworkEventHandler("vrr.set2DRendering", set2DRendering);
|
|
||||||
addNetworkEventHandler("vrr.mouseCameraForce", setMouseCameraState);
|
|
||||||
addNetworkEventHandler("vrr.logLevel", setLogLevel);
|
|
||||||
addNetworkEventHandler("vrr.hideAllGUI", hideAllGUI);
|
|
||||||
addNetworkEventHandler("vrr.nametag", updatePlayerNameTag);
|
|
||||||
addNetworkEventHandler("vrr.nametagDistance", setNameTagDistance);
|
|
||||||
addNetworkEventHandler("vrr.ping", updatePlayerPing);
|
|
||||||
addNetworkEventHandler("vrr.anim", makePedPlayAnimation);
|
|
||||||
addNetworkEventHandler("vrr.stopAnim", makePedStopAnimation);
|
|
||||||
addNetworkEventHandler("vrr.forceAnim", forcePedAnimation);
|
|
||||||
addNetworkEventHandler("vrr.clientInfo", serverRequestedClientInfo);
|
|
||||||
addNetworkEventHandler("vrr.interiorLights", updateInteriorLightsState);
|
|
||||||
addNetworkEventHandler("vrr.cutsceneInterior", setCutsceneInterior);
|
|
||||||
addNetworkEventHandler("vrr.syncElement", forceSyncElementProperties);
|
|
||||||
addNetworkEventHandler("vrr.elementPosition", setElementPosition);
|
|
||||||
addNetworkEventHandler("vrr.elementCollisions", setElementCollisionsEnabled);
|
|
||||||
addNetworkEventHandler("vrr.vehBuyState", setVehiclePurchaseState);
|
|
||||||
addNetworkEventHandler("vrr.holdObject", makePedHoldObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function sendResourceReadySignalToServer() {
|
|
||||||
sendNetworkEventToServer("vrr.clientReady");
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function sendResourceStartedSignalToServer() {
|
|
||||||
sendNetworkEventToServer("vrr.clientStarted");
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function sendResourceStoppedSignalToServer() {
|
|
||||||
if(isConnected) {
|
|
||||||
sendNetworkEventToServer("vrr.clientStopped");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function set2DRendering(hudState, labelState, smallGameMessageState, scoreboardState, hotBarState, itemActionDelayState) {
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Main] Updating render states (HUD: ${hudState}, Labels: ${labelState}, Bottom Text: ${smallGameMessageState}, Scoreboard: ${scoreboardState}, HotBar: ${hotBarState}, Item Action Delay: ${itemActionDelayState})`);
|
|
||||||
renderHUD = hudState;
|
|
||||||
|
|
||||||
if(getGame() == VRR_GAME_GTA_IV) {
|
|
||||||
natives.displayCash(hudState);
|
|
||||||
natives.displayAmmo(hudState);
|
|
||||||
natives.displayHud(hudState);
|
|
||||||
natives.displayRadar(hudState);
|
|
||||||
natives.displayAreaName(hudState);
|
|
||||||
} else {
|
|
||||||
if(typeof setHUDEnabled != "undefined") {
|
|
||||||
setHUDEnabled(hudState);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
renderLabels = labelState;
|
|
||||||
renderSmallGameMessage = smallGameMessageState;
|
|
||||||
renderScoreBoard = scoreboardState;
|
|
||||||
renderHotBar = hotBarState;
|
|
||||||
renderItemActionDelay = itemActionDelayState;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function onServerSpawnedLocalPlayer(state) {
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Main] Setting spawned state to ${state}`);
|
|
||||||
isSpawned = state;
|
|
||||||
setUpInitialGame();
|
|
||||||
if(state) {
|
|
||||||
setTimeout(function() {
|
|
||||||
calledDeathEvent = false;
|
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
getElementsByType(ELEMENT_PED).filter(ped => !ped.isType(ELEMENT_PLAYER)).forEach(ped => {
|
|
||||||
syncCivilianProperties(ped);
|
|
||||||
});
|
|
||||||
|
|
||||||
getElementsByType(ELEMENT_PLAYER).forEach(player => {
|
|
||||||
syncPlayerProperties(player);
|
|
||||||
});
|
|
||||||
|
|
||||||
getElementsByType(ELEMENT_VEHICLE).forEach(vehicle => {
|
|
||||||
syncVehicleProperties(vehicle);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function tellServerPlayerUsedKeyBind(key) {
|
|
||||||
sendNetworkEventToServer("vrr.useKeyBind", key);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function tellServerPlayerArrivedAtJobRouteLocation() {
|
|
||||||
sendNetworkEventToServer("vrr.arrivedAtJobRouteLocation");
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function tellServerItemActionDelayComplete() {
|
|
||||||
sendNetworkEventToServer("vrr.itemActionDelayComplete");
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function sendServerClientInfo() {
|
|
||||||
let clientVersion = "0.0.0.0";
|
|
||||||
if(typeof CLIENT_VERSION_MAJOR != "undefined") {
|
|
||||||
clientVersion = `${CLIENT_VERSION_MAJOR}.${CLIENT_VERSION_MINOR}.${CLIENT_VERSION_PATCH}.${CLIENT_VERSION_BUILD}`;
|
|
||||||
}
|
|
||||||
sendNetworkEventToServer("vrr.clientInfo", clientVersion, game.width, game.height);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function sendServerNewAFKStatus(state) {
|
|
||||||
sendNetworkEventToServer("vrr.afk", state);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function anchorBoat(vehicleId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function setEnterPropertyKey(key) {
|
|
||||||
enterPropertyKey = key;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function serverRequestedClientInfo() {
|
|
||||||
sendServerClientInfo();
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function updateInteriorLightsState(state) {
|
|
||||||
interiorLightsEnabled = state;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function forceSyncElementProperties(elementId) {
|
|
||||||
if(getElementFromId(elementId) == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
syncElementProperties(getElementFromId(elementId));
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function setElementCollisionsEnabled(elementId, state) {
|
|
||||||
if(getElementFromId(elementId) == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
getElementFromId(elementId).collisionsEnabled = state;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function setLocalPlayerArmour(armour) {
|
|
||||||
if(typeof localPlayer.armour != "undefined") {
|
|
||||||
localPlayer.armour = armour;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function setLocalPlayerWantedLevel(wantedLevel) {
|
|
||||||
forceWantedLevel = toInteger(wantedLevel);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function setLogLevel(level) {
|
|
||||||
logLevel = level;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function setLocalPlayerInfiniteRun(state) {
|
|
||||||
if(localPlayer != null) {
|
|
||||||
if(getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) {
|
|
||||||
game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), boolToInt(state));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function setLocalPlayerSkin(skinId) {
|
|
||||||
logToConsole(LOG_INFO, `[VRR.Server] Setting locale player skin to ${skinId}`);
|
|
||||||
if(getGame() == VRR_GAME_GTA_IV) {
|
|
||||||
natives.changePlayerModel(natives.getPlayerId(), skinId);
|
|
||||||
} else {
|
|
||||||
localPlayer.skin = skinId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function makePedHoldObject(pedId, modelIndex) {
|
|
||||||
if(getGame() == VRR_GAME_GTA_IV) {
|
|
||||||
natives.givePedAmbientObject(natives.getPedFromNetworkId(pedId), getGameConfig().objects[getGame()][modelIndex][1])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function sendLocalPlayerNetworkIdToServer() {
|
|
||||||
sendNetworkEventToServer("vrr.playerPedId", natives.getNetworkIdFromPed(localPlayer));
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function setCutsceneInterior(cutsceneName) {
|
|
||||||
if(getGame() == VRR_GAME_GTA_IV) {
|
|
||||||
if(cutsceneName == "") {
|
|
||||||
natives.clearCutscene();
|
|
||||||
} else {
|
|
||||||
if(natives.isInteriorScene()) {
|
|
||||||
natives.clearCutscene();
|
|
||||||
}
|
|
||||||
natives.initCutscene(cutsceneName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function makeLocalPlayerPedSpeak(speechName) {
|
|
||||||
if(getGame() == VRR_GAME_GTA_IV) {
|
|
||||||
// if player is in vehicle, allow megaphone (if last arg is "1", it will cancel megaphone echo)
|
|
||||||
// Only speeches with _MEGAPHONE will have the bullhorn effect
|
|
||||||
// Afaik it only works on police voices anyway
|
|
||||||
if(localPlayer.vehicle != null) {
|
|
||||||
natives.sayAmbientSpeech(localPlayer, speechName, true, false, 0);
|
|
||||||
} else {
|
|
||||||
natives.sayAmbientSpeech(localPlayer, speechName, true, false, 1);
|
|
||||||
}
|
|
||||||
} else if(getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) {
|
|
||||||
// Don't have a way to get the ped ref ID and can't use ped in arg
|
|
||||||
//game.SET_CHAR_SAY(game.GET_PLAYER_ID(), int);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function setLocalPlayerAsCopState(state) {
|
|
||||||
if(getGame() == VRR_GAME_GTA_IV) {
|
|
||||||
natives.setPlayerAsCop(natives.getPlayerId(), state);
|
|
||||||
natives.setPoliceIgnorePlayer(natives.getPlayerId(), state);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function serverRequestedLocalPlayerSpawn(skinId, position) {
|
|
||||||
if(getGame() == VRR_GAME_GTA_IV) {
|
|
||||||
natives.createPlayer(skinId, position);
|
|
||||||
//if(isCustomCameraSupported()) {
|
|
||||||
// game.restoreCamera(true);
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function sendLocaleSelectToServer(localeId) {
|
|
||||||
sendNetworkEventToServer("vrr.localeSelect", localeId);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: skin-select.js
|
// FILE: skin-select.js
|
||||||
// DESC: Provides skin-selector functions and usage
|
// DESC: Provides skin-selector functions and usage
|
||||||
@@ -10,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;
|
||||||
|
|
||||||
@@ -23,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!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -44,68 +45,49 @@ function loadSkinSelectMessageFontBottom() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function processSkinSelectKeyPress(keyCode) {
|
function processSkinSelectKeyPress(keyCode) {
|
||||||
if(usingSkinSelector) {
|
if (usingSkinSelector) {
|
||||||
if(keyCode == SDLK_PAGEUP) {
|
if (keyCode == getKeyIdFromParams("left") || keyCode == getKeyIdFromParams("a")) {
|
||||||
if(skinSelectorIndex >= allowedSkins.length-1) {
|
if (skinSelectorIndex >= allowedSkins.length - 1) {
|
||||||
skinSelectorIndex = 1;
|
skinSelectorIndex = 1;
|
||||||
} else {
|
} else {
|
||||||
skinSelectorIndex = skinSelectorIndex + 1;
|
skinSelectorIndex = skinSelectorIndex + 1;
|
||||||
}
|
}
|
||||||
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];
|
||||||
if(getGame() == VRR_GAME_GTA_IV) {
|
setLocalPlayerSkin(allowedSkins[skinSelectorIndex][0]);
|
||||||
let skinId = allowedSkins[skinSelectorIndex][0];
|
} else if (keyCode == getKeyIdFromParams("right") || keyCode == getKeyIdFromParams("d")) {
|
||||||
if(natives.isModelInCdimage(skinId)) {
|
if (skinSelectorIndex <= 0) {
|
||||||
natives.requestModel(skinId);
|
skinSelectorIndex = allowedSkins.length - 1;
|
||||||
natives.loadAllObjectsNow();
|
|
||||||
if(natives.hasModelLoaded(skinId)) {
|
|
||||||
natives.changePlayerModel(natives.getPlayerId(), skinId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
localPlayer.skin = allowedSkins[skinSelectorIndex][0];
|
|
||||||
}
|
|
||||||
} else if(keyCode == SDLK_PAGEDOWN) {
|
|
||||||
if(skinSelectorIndex <= 0) {
|
|
||||||
skinSelectorIndex = allowedSkins.length-1;
|
|
||||||
} else {
|
} else {
|
||||||
skinSelectorIndex = skinSelectorIndex - 1;
|
skinSelectorIndex = skinSelectorIndex - 1;
|
||||||
}
|
}
|
||||||
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];
|
||||||
if(getGame() == VRR_GAME_GTA_IV) {
|
setLocalPlayerSkin(allowedSkins[skinSelectorIndex][0]);
|
||||||
let skinId = allowedSkins[skinSelectorIndex][0];
|
} else if (keyCode == getKeyIdFromParams("enter")) {
|
||||||
if(natives.isModelInCdimage(skinId)) {
|
sendNetworkEventToServer("agrp.skinSelected", skinSelectorIndex);
|
||||||
natives.requestModel(skinId);
|
|
||||||
natives.loadAllObjectsNow();
|
|
||||||
if(natives.hasModelLoaded(skinId)) {
|
|
||||||
natives.changePlayerModel(natives.getPlayerId(), skinId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
localPlayer.skin = allowedSkins[skinSelectorIndex][0];
|
|
||||||
}
|
|
||||||
} else if(keyCode == SDLK_RETURN) {
|
|
||||||
sendNetworkEventToServer("vrr.skinSelected", skinSelectorIndex);
|
|
||||||
toggleSkinSelect(false);
|
toggleSkinSelect(false);
|
||||||
return true;
|
return true;
|
||||||
} else if(keyCode == SDLK_BACKSPACE) {
|
} else if (keyCode == getKeyIdFromParams("backspace")) {
|
||||||
sendNetworkEventToServer("vrr.skinSelected", -1);
|
sendNetworkEventToServer("agrp.skinSelected", -1);
|
||||||
toggleSkinSelect(false);
|
toggleSkinSelect(false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
localPlayer.heading = skinSelectHeading;
|
|
||||||
|
if (getGame() <= AGRP_GAME_GTA_SA) {
|
||||||
|
localPlayer.heading = skinSelectHeading;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function processSkinSelectRendering() {
|
function processSkinSelectRendering() {
|
||||||
if(usingSkinSelector) {
|
if (usingSkinSelector) {
|
||||||
if(skinSelectMessageFontTop != null && skinSelectMessageFontBottom != null) {
|
if (skinSelectMessageFontTop != null && skinSelectMessageFontBottom != null) {
|
||||||
if(skinSelectMessageTextTop != "" && skinSelectMessageTextBottom != "") {
|
if (skinSelectMessageTextTop != "" && skinSelectMessageTextBottom != "") {
|
||||||
skinSelectMessageFontTop.render(skinSelectMessageTextTop, [0, game.height-100], game.width, 0.5, 0.0, skinSelectMessageFontTop.size, skinSelectMessageColourTop, true, true, false, true);
|
skinSelectMessageFontTop.render(skinSelectMessageTextTop, [0, game.height - 100], game.width, 0.5, 0.0, skinSelectMessageFontTop.size, skinSelectMessageColourTop, true, true, false, true);
|
||||||
skinSelectMessageFontBottom.render(skinSelectMessageTextBottom, [0, game.height-65], game.width, 0.5, 0.0, skinSelectMessageFontBottom.size, skinSelectMessageColourBottom, true, true, false, true);
|
skinSelectMessageFontBottom.render(skinSelectMessageTextBottom, [0, game.height - 65], game.width, 0.5, 0.0, skinSelectMessageFontBottom.size, skinSelectMessageColourBottom, true, true, false, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -114,9 +96,9 @@ function processSkinSelectRendering() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function toggleSkinSelect(state) {
|
function toggleSkinSelect(state) {
|
||||||
if(state) {
|
if (state) {
|
||||||
skinSelectorIndex = getAllowedSkinIndexFromSkin(localPlayer.skin);
|
skinSelectorIndex = getAllowedSkinIndexFromSkin(localPlayer.skin);
|
||||||
if(!skinSelectorIndex) {
|
if (!skinSelectorIndex) {
|
||||||
skinSelectorIndex = 0;
|
skinSelectorIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,19 +106,27 @@ function toggleSkinSelect(state) {
|
|||||||
skinSelectPosition = localPlayer.position;
|
skinSelectPosition = localPlayer.position;
|
||||||
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() == VRR_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
let skinId = allowedSkins[skinSelectorIndex][0];
|
let skinId = allowedSkins[skinSelectorIndex][0];
|
||||||
if(natives.isModelInCdimage(skinId)) {
|
if (natives.isModelInCdimage(skinId)) {
|
||||||
natives.requestModel(skinId);
|
natives.requestModel(skinId);
|
||||||
natives.loadAllObjectsNow();
|
natives.loadAllObjectsNow();
|
||||||
if(natives.hasModelLoaded(skinId)) {
|
if (natives.hasModelLoaded(skinId)) {
|
||||||
natives.changePlayerModel(natives.getPlayerId(), skinId);
|
natives.changePlayerModel(natives.getPlayerId(), skinId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: startup.js
|
// FILE: startup.js
|
||||||
// DESC: Provides startup/shutdown procedures
|
// DESC: Provides startup/shutdown procedures
|
||||||
@@ -12,7 +13,7 @@ function initClientScripts() {
|
|||||||
initNameTagScript();
|
initNameTagScript();
|
||||||
initScoreBoardScript();
|
initScoreBoardScript();
|
||||||
initMessagingScript();
|
initMessagingScript();
|
||||||
initServerScript();
|
initNetworkEventsScript();
|
||||||
initLogoScript();
|
initLogoScript();
|
||||||
initLabelScript();
|
initLabelScript();
|
||||||
initChatBoxScript();
|
initChatBoxScript();
|
||||||
@@ -20,13 +21,16 @@ function initClientScripts() {
|
|||||||
initKeyBindScript();
|
initKeyBindScript();
|
||||||
initEventScript();
|
initEventScript();
|
||||||
initSkinSelectScript();
|
initSkinSelectScript();
|
||||||
|
initCursorScript();
|
||||||
|
|
||||||
|
addAllNetworkHandlers();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setUpInitialGame() {
|
function setUpInitialGame() {
|
||||||
if(getGame() == VRR_GAME_GTA_III) {
|
if (getGame() == AGRP_GAME_GTA_III) {
|
||||||
logToConsole(LOG_DEBUG|LOG_WARN, "Setting up initial game stuff for GTA III ...");
|
logToConsole(LOG_DEBUG | LOG_WARN, "Setting up initial game stuff for GTA III ...");
|
||||||
|
|
||||||
// Turn off unlimited sprint
|
// Turn off unlimited sprint
|
||||||
game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0);
|
game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0);
|
||||||
@@ -44,8 +48,8 @@ function setUpInitialGame() {
|
|||||||
|
|
||||||
// Provided by mouse camera script (mousecam.js)
|
// Provided by mouse camera script (mousecam.js)
|
||||||
SetStandardControlsEnabled(true);
|
SetStandardControlsEnabled(true);
|
||||||
} else if(getGame() == VRR_GAME_GTA_VC) {
|
} else if (getGame() == AGRP_GAME_GTA_VC) {
|
||||||
logToConsole(LOG_DEBUG|LOG_WARN, "Setting up initial game stuff for GTA Vice City ...");
|
logToConsole(LOG_DEBUG | LOG_WARN, "Setting up initial game stuff for GTA Vice City ...");
|
||||||
|
|
||||||
// Turn off unlimited sprint
|
// Turn off unlimited sprint
|
||||||
game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0);
|
game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0);
|
||||||
@@ -87,8 +91,8 @@ function setUpInitialGame() {
|
|||||||
|
|
||||||
// Provided by mouse camera script (mousecam.js)
|
// Provided by mouse camera script (mousecam.js)
|
||||||
SetStandardControlsEnabled(true);
|
SetStandardControlsEnabled(true);
|
||||||
} else if(getGame() == VRR_GAME_GTA_SA) {
|
} else if (getGame() == AGRP_GAME_GTA_SA) {
|
||||||
logToConsole(LOG_DEBUG|LOG_WARN, "Setting up initial game stuff for GTA San Andreas ...");
|
logToConsole(LOG_DEBUG | LOG_WARN, "Setting up initial game stuff for GTA San Andreas ...");
|
||||||
// Turn weapon skills down a bit
|
// Turn weapon skills down a bit
|
||||||
game.setGameStat(STAT_WEAPONTYPE_PISTOL_SKILL, 400);
|
game.setGameStat(STAT_WEAPONTYPE_PISTOL_SKILL, 400);
|
||||||
game.setGameStat(STAT_WEAPONTYPE_PISTOL_SILENCED_SKILL, 400);
|
game.setGameStat(STAT_WEAPONTYPE_PISTOL_SILENCED_SKILL, 400);
|
||||||
@@ -124,7 +128,7 @@ function setUpInitialGame() {
|
|||||||
|
|
||||||
// Disables taxi/vigilante/etc and other start mission triggers
|
// Disables taxi/vigilante/etc and other start mission triggers
|
||||||
game.onMission = true;
|
game.onMission = true;
|
||||||
} else if(getGame() == VRR_GAME_GTA_IV) {
|
} else if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
natives.allowEmergencyServices(false);
|
natives.allowEmergencyServices(false);
|
||||||
natives.setCreateRandomCops(true);
|
natives.setCreateRandomCops(true);
|
||||||
natives.setMaxWantedLevel(0);
|
natives.setMaxWantedLevel(0);
|
||||||
@@ -186,7 +190,7 @@ function setUpInitialGame() {
|
|||||||
|
|
||||||
// Some last steps
|
// Some last steps
|
||||||
//natives.loadAllObjectsNow();
|
//natives.loadAllObjectsNow();
|
||||||
} else if(getGame() == VRR_GAME_MAFIA_ONE) {
|
} else if (getGame() == AGRP_GAME_MAFIA_ONE) {
|
||||||
game.mapEnabled = false;
|
game.mapEnabled = false;
|
||||||
game.setTrafficEnabled(false);
|
game.setTrafficEnabled(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: sync.js
|
// FILE: sync.js
|
||||||
// DESC: Provides some elements and data sync
|
// DESC: Provides some elements and data sync
|
||||||
@@ -8,70 +9,53 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function processSync(event, deltaTime) {
|
function processSync(event, deltaTime) {
|
||||||
if(localPlayer != null) {
|
if (localPlayer != null) {
|
||||||
if(!areServerElementsSupported()) {
|
if (!areServerElementsSupported()) {
|
||||||
sendNetworkEventToServer("vrr.plr.pos", (localPlayer.vehicle != null) ? localPlayer.vehicle.position : localPlayer.position);
|
sendNetworkEventToServer("agrp.plr.pos", (localPlayer.vehicle != null) ? localPlayer.vehicle.position : localPlayer.position);
|
||||||
sendNetworkEventToServer("vrr.plr.rot", (localPlayer.vehicle != null) ? localPlayer.vehicle.heading : localPlayer.heading);
|
sendNetworkEventToServer("agrp.plr.rot", (localPlayer.vehicle != null) ? localPlayer.vehicle.heading : localPlayer.heading);
|
||||||
|
|
||||||
//if(localPlayer.vehicle != null) {
|
//if(localPlayer.vehicle != null) {
|
||||||
// sendNetworkEventToServer("vrr.veh.pos", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.position);
|
// sendNetworkEventToServer("agrp.veh.pos", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.position);
|
||||||
// sendNetworkEventToServer("vrr.veh.rot", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.heading);
|
// sendNetworkEventToServer("agrp.veh.rot", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.heading);
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(localPlayer.health <= 0) {
|
if (localPlayer.health <= 0) {
|
||||||
if(!calledDeathEvent) {
|
if (!calledDeathEvent) {
|
||||||
logToConsole(LOG_DEBUG, `Local player died`);
|
logToConsole(LOG_DEBUG, `Local player died`);
|
||||||
localPlayer.clearWeapons();
|
localPlayer.clearWeapons();
|
||||||
calledDeathEvent = true;
|
calledDeathEvent = true;
|
||||||
sendNetworkEventToServer("vrr.playerDeath");
|
sendNetworkEventToServer("agrp.playerDeath");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(localPlayer.health <= 0) {
|
if (localPlayer.health <= 0) {
|
||||||
if(!calledDeathEvent) {
|
if (!calledDeathEvent) {
|
||||||
logToConsole(LOG_DEBUG, `Local player died`);
|
logToConsole(LOG_DEBUG, `Local player died`);
|
||||||
localPlayer.clearWeapons();
|
localPlayer.clearWeapons();
|
||||||
calledDeathEvent = true;
|
calledDeathEvent = true;
|
||||||
sendNetworkEventToServer("vrr.playerDeath");
|
sendNetworkEventToServer("agrp.playerDeath");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(streamingRadioElement) {
|
if (streamingRadioElement) {
|
||||||
streamingRadio.position = getElementPosition(streamingRadioElement.id);
|
|
||||||
//streamingRadio.volume = getStreamingRadioVolumeForPosition(streamingRadio.position);
|
//streamingRadio.volume = getStreamingRadioVolumeForPosition(streamingRadio.position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setVehicleEngine(vehicleId, state) {
|
|
||||||
getElementFromId(vehicleId).engine = state;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function setVehicleLights(vehicleId, state) {
|
function setVehicleLights(vehicleId, state) {
|
||||||
if(getGame() != VRR_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() == VRR_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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -83,72 +67,73 @@ function repairVehicle(syncId) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function syncVehicleProperties(vehicle) {
|
function syncVehicleProperties(vehicle) {
|
||||||
if(!areServerElementsSupported()) {
|
if (!areServerElementsSupported()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(vehicle, "vrr.lights")) {
|
if (doesEntityDataExist(vehicle, "agrp.lights")) {
|
||||||
let lightStatus = getEntityData(vehicle, "vrr.lights");
|
let lightStatus = getEntityData(vehicle, "agrp.lights");
|
||||||
if(!lightStatus) {
|
vehicle.lights = lightStatus;
|
||||||
vehicle.lightStatus = 2;
|
|
||||||
} else {
|
|
||||||
vehicle.lightStatus = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(vehicle, "vrr.invincible")) {
|
if (doesEntityDataExist(vehicle, "agrp.locked")) {
|
||||||
let invincible = getEntityData(vehicle, "vrr.invincible");
|
let lockStatus = getEntityData(vehicle, "agrp.locked");
|
||||||
|
vehicle.locked = lockStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (doesEntityDataExist(vehicle, "agrp.invincible")) {
|
||||||
|
let invincible = getEntityData(vehicle, "agrp.invincible");
|
||||||
element.setProofs(invincible, invincible, invincible, invincible, invincible);
|
element.setProofs(invincible, invincible, invincible, invincible, invincible);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(vehicle, "vrr.panelStatus")) {
|
if (doesEntityDataExist(vehicle, "agrp.panelStatus")) {
|
||||||
let panelsStatus = getEntityData(vehicle, "vrr.panelStatus");
|
let panelsStatus = getEntityData(vehicle, "agrp.panelStatus");
|
||||||
for(let i in panelsStatus) {
|
for (let i in panelsStatus) {
|
||||||
vehicle.setPanelStatus(i, panelsStatus[i]);
|
vehicle.setPanelStatus(i, panelsStatus[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(vehicle, "vrr.wheelStatus")) {
|
if (doesEntityDataExist(vehicle, "agrp.wheelStatus")) {
|
||||||
let wheelsStatus = getEntityData(vehicle, "vrr.wheelStatus");
|
let wheelsStatus = getEntityData(vehicle, "agrp.wheelStatus");
|
||||||
for(let i in wheelsStatus) {
|
for (let i in wheelsStatus) {
|
||||||
vehicle.setWheelStatus(i, wheelsStatus[i]);
|
vehicle.setWheelStatus(i, wheelsStatus[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(vehicle, "vrr.lightStatus")) {
|
if (doesEntityDataExist(vehicle, "agrp.lightStatus")) {
|
||||||
let lightStatus = getEntityData(vehicle, "vrr.lightStatus");
|
let lightStatus = getEntityData(vehicle, "agrp.lightStatus");
|
||||||
for(let i in lightStatus) {
|
for (let i in lightStatus) {
|
||||||
vehicle.setLightStatus(i, lightStatus[i]);
|
vehicle.setLightStatus(i, lightStatus[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(vehicle, "vrr.suspensionHeight")) {
|
if (doesEntityDataExist(vehicle, "agrp.suspensionHeight")) {
|
||||||
let suspensionHeight = getEntityData(vehicle, "vrr.suspensionHeight");
|
let suspensionHeight = getEntityData(vehicle, "agrp.suspensionHeight");
|
||||||
vehicle.setSuspensionHeight(suspensionHeight);
|
vehicle.setSuspensionHeight(suspensionHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getGame() == VRR_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);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
if(doesEntityDataExist(vehicle, "vrr.upgrades")) {
|
if (doesEntityDataExist(vehicle, "agrp.upgrades")) {
|
||||||
let upgrades = getEntityData(vehicle, "vrr.upgrades");
|
let upgrades = getEntityData(vehicle, "agrp.upgrades");
|
||||||
for(let i in upgrades) {
|
for (let i in upgrades) {
|
||||||
if(upgrades[i] != 0) {
|
if (upgrades[i] != 0) {
|
||||||
vehicle.addUpgrade(upgrades[i]);
|
vehicle.addUpgrade(upgrades[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getGame() == VRR_GAME_GTA_SA || getGame() == VRR_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_SA || getGame() == AGRP_GAME_GTA_IV) {
|
||||||
if(doesEntityDataExist(vehicle, "vrr.livery")) {
|
if (doesEntityDataExist(vehicle, "agrp.livery")) {
|
||||||
let livery = getEntityData(vehicle, "vrr.livery");
|
let livery = getEntityData(vehicle, "agrp.livery");
|
||||||
if(getGame() == VRR_GAME_GTA_SA) {
|
if (getGame() == AGRP_GAME_GTA_SA) {
|
||||||
vehicle.setPaintJob(livery);
|
vehicle.setPaintJob(livery);
|
||||||
} else if(getGame() == VRR_GAME_GTA_IV) {
|
} else if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
vehicle.livery = livery;
|
vehicle.livery = livery;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -158,13 +143,13 @@ function syncVehicleProperties(vehicle) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function syncCivilianProperties(civilian) {
|
function syncCivilianProperties(civilian) {
|
||||||
if(!areServerElementsSupported()) {
|
if (!areServerElementsSupported()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getGame() == VRR_GAME_GTA_III) {
|
if (isGameFeatureSupported("pedScale")) {
|
||||||
if(doesEntityDataExist(civilian, "vrr.scale")) {
|
if (doesEntityDataExist(civilian, "agrp.scale")) {
|
||||||
let scaleFactor = getEntityData(civilian, "vrr.scale");
|
let scaleFactor = getEntityData(civilian, "agrp.scale");
|
||||||
let tempMatrix = civilian.matrix;
|
let tempMatrix = civilian.matrix;
|
||||||
tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
|
tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
|
||||||
let tempPosition = civilian.position;
|
let tempPosition = civilian.position;
|
||||||
@@ -174,79 +159,79 @@ function syncCivilianProperties(civilian) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getGame() == VRR_GAME_GTA_SA) {
|
if (getGame() == AGRP_GAME_GTA_SA) {
|
||||||
if(doesEntityDataExist(civilian, "vrr.fightStyle")) {
|
if (doesEntityDataExist(civilian, "agrp.fightStyle")) {
|
||||||
let fightStyle = getEntityData(civilian, "vrr.fightStyle");
|
let fightStyle = getEntityData(civilian, "agrp.fightStyle");
|
||||||
civilian.setFightStyle(fightStyle[0], fightStyle[1]);
|
civilian.setFightStyle(fightStyle[0], fightStyle[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getGame() == VRR_GAME_GTA_III) {
|
if (getGame() == AGRP_GAME_GTA_SA) {
|
||||||
if(doesEntityDataExist(civilian, "vrr.walkStyle")) {
|
if (doesEntityDataExist(civilian, "agrp.walkStyle")) {
|
||||||
let walkStyle = getEntityData(civilian, "vrr.walkStyle");
|
let walkStyle = getEntityData(civilian, "agrp.walkStyle");
|
||||||
civilian.walkStyle = walkStyle;
|
civilian.walkStyle = walkStyle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getGame() == VRR_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
if(doesEntityDataExist(civilian, "vrr.bodyPropHair")) {
|
if (doesEntityDataExist(civilian, "agrp.bodyPropHair")) {
|
||||||
let bodyPropHair = getEntityData(civilian, "vrr.bodyPropHair");
|
let bodyPropHair = getEntityData(civilian, "agrp.bodyPropHair");
|
||||||
civilian.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]);
|
civilian.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(civilian, "vrr.bodyPropHead")) {
|
if (doesEntityDataExist(civilian, "agrp.bodyPropHead")) {
|
||||||
let bodyPropHead = getEntityData(civilian, "vrr.bodyPropHead");
|
let bodyPropHead = getEntityData(civilian, "agrp.bodyPropHead");
|
||||||
civilian.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]);
|
civilian.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(civilian, "vrr.bodyPropEyes")) {
|
if (doesEntityDataExist(civilian, "agrp.bodyPropEyes")) {
|
||||||
let bodyPropEyes = getEntityData(civilian, "vrr.bodyPropEyes");
|
let bodyPropEyes = getEntityData(civilian, "agrp.bodyPropEyes");
|
||||||
civilian.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]);
|
civilian.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(civilian, "vrr.bodyPropLeftHand")) {
|
if (doesEntityDataExist(civilian, "agrp.bodyPropLeftHand")) {
|
||||||
let bodyPropLeftHand = getEntityData(civilian, "vrr.bodyPropLeftHand");
|
let bodyPropLeftHand = getEntityData(civilian, "agrp.bodyPropLeftHand");
|
||||||
civilian.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]);
|
civilian.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(civilian, "vrr.bodyPropRightHand")) {
|
if (doesEntityDataExist(civilian, "agrp.bodyPropRightHand")) {
|
||||||
let bodyPropRightHand = getEntityData(civilian, "vrr.bodyPropRightHand");
|
let bodyPropRightHand = getEntityData(civilian, "agrp.bodyPropRightHand");
|
||||||
civilian.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]);
|
civilian.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(civilian, "vrr.bodyPropLeftWrist")) {
|
if (doesEntityDataExist(civilian, "agrp.bodyPropLeftWrist")) {
|
||||||
let bodyPropLeftWrist = getEntityData(civilian, "vrr.bodyPropLeftWrist");
|
let bodyPropLeftWrist = getEntityData(civilian, "agrp.bodyPropLeftWrist");
|
||||||
civilian.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]);
|
civilian.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(civilian, "vrr.bodyPropRightWrist")) {
|
if (doesEntityDataExist(civilian, "agrp.bodyPropRightWrist")) {
|
||||||
let bodyPropRightWrist = getEntityData(civilian, "vrr.bodyPropRightWrist");
|
let bodyPropRightWrist = getEntityData(civilian, "agrp.bodyPropRightWrist");
|
||||||
civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
|
civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(civilian, "vrr.bodyPropRightWrist")) {
|
if (doesEntityDataExist(civilian, "agrp.bodyPropRightWrist")) {
|
||||||
let bodyPropRightWrist = getEntityData(civilian, "vrr.bodyPropRightWrist");
|
let bodyPropRightWrist = getEntityData(civilian, "agrp.bodyPropRightWrist");
|
||||||
civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
|
civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(civilian, "vrr.bodyPropHip")) {
|
if (doesEntityDataExist(civilian, "agrp.bodyPropHip")) {
|
||||||
let bodyPropHip = getEntityData(civilian, "vrr.bodyPropHip");
|
let bodyPropHip = getEntityData(civilian, "agrp.bodyPropHip");
|
||||||
civilian.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]);
|
civilian.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(civilian, "vrr.bodyPropLeftFoot")) {
|
if (doesEntityDataExist(civilian, "agrp.bodyPropLeftFoot")) {
|
||||||
let bodyPropLeftFoot = getEntityData(civilian, "vrr.bodyPropLeftFoot");
|
let bodyPropLeftFoot = getEntityData(civilian, "agrp.bodyPropLeftFoot");
|
||||||
civilian.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]);
|
civilian.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(civilian, "vrr.bodyPropRightFoot")) {
|
if (doesEntityDataExist(civilian, "agrp.bodyPropRightFoot")) {
|
||||||
let bodyPropRightFoot = getEntityData(civilian, "vrr.bodyPropRightFoot");
|
let bodyPropRightFoot = getEntityData(civilian, "agrp.bodyPropRightFoot");
|
||||||
civilian.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]);
|
civilian.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(civilian, "vrr.anim")) {
|
if (doesEntityDataExist(civilian, "agrp.anim")) {
|
||||||
let animationSlot = getEntityData(civilian, "vrr.anim");
|
let animationSlot = getEntityData(civilian, "agrp.anim");
|
||||||
let animationData = getAnimationData(animationSlot);
|
let animationData = getAnimationData(animationSlot);
|
||||||
civilian.addAnimation(animationData.groupId, animationData.animId);
|
civilian.addAnimation(animationData.groupId, animationData.animId);
|
||||||
}
|
}
|
||||||
@@ -254,14 +239,34 @@ function syncCivilianProperties(civilian) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function syncPlayerProperties(player) {
|
function syncObjectProperties(object) {
|
||||||
if(!areServerElementsSupported()) {
|
if (!areServerElementsSupported()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getGame() == VRR_GAME_GTA_III) {
|
if (isGameFeatureSupported("objectScale")) {
|
||||||
if(doesEntityDataExist(player, "vrr.scale")) {
|
if (doesEntityDataExist(object, "agrp.scale")) {
|
||||||
let scaleFactor = getEntityData(player, "vrr.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) {
|
||||||
|
if (!areServerElementsSupported()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isGameFeatureSupported("pedScale")) {
|
||||||
|
if (doesEntityDataExist(player, "agrp.scale")) {
|
||||||
|
let scaleFactor = getEntityData(player, "agrp.scale");
|
||||||
let tempMatrix = player.matrix;
|
let tempMatrix = player.matrix;
|
||||||
tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
|
tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
|
||||||
let tempPosition = player.position;
|
let tempPosition = player.position;
|
||||||
@@ -271,95 +276,95 @@ function syncPlayerProperties(player) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getGame() == VRR_GAME_GTA_SA) {
|
if (getGame() == AGRP_GAME_GTA_SA) {
|
||||||
if(doesEntityDataExist(player, "vrr.fightStyle")) {
|
if (doesEntityDataExist(player, "agrp.fightStyle")) {
|
||||||
let fightStyle = getEntityData(player, "vrr.fightStyle");
|
let fightStyle = getEntityData(player, "agrp.fightStyle");
|
||||||
player.setFightStyle(fightStyle[0], fightStyle[1]);
|
player.setFightStyle(fightStyle[0], fightStyle[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//if(getGame() == VRR_GAME_GTA_SA) {
|
//if(getGame() == AGRP_GAME_GTA_SA) {
|
||||||
// if(doesEntityDataExist(player, "vrr.walkStyle")) {
|
// if(doesEntityDataExist(player, "agrp.walkStyle")) {
|
||||||
// let walkStyle = getEntityData(player, "vrr.walkStyle");
|
// let walkStyle = getEntityData(player, "agrp.walkStyle");
|
||||||
// player.walkStyle = walkStyle;
|
// player.walkStyle = walkStyle;
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
if(getGame() == VRR_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPartHair")) {
|
if (doesEntityDataExist(player, "agrp.bodyPartHair")) {
|
||||||
let bodyPartHead = getEntityData(player, "vrr.bodyPartHair");
|
let bodyPartHead = getEntityData(player, "agrp.bodyPartHair");
|
||||||
player.changeBodyPart(0, bodyPartHead[0], bodyPartHair[1]);
|
player.changeBodyPart(0, bodyPartHead[0], bodyPartHair[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPartHead")) {
|
if (doesEntityDataExist(player, "agrp.bodyPartHead")) {
|
||||||
let bodyPartHead = getEntityData(player, "vrr.bodyPartHead");
|
let bodyPartHead = getEntityData(player, "agrp.bodyPartHead");
|
||||||
player.changeBodyPart(1, bodyPartHead[0], bodyPartHead[1]);
|
player.changeBodyPart(1, bodyPartHead[0], bodyPartHead[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPartUpper")) {
|
if (doesEntityDataExist(player, "agrp.bodyPartUpper")) {
|
||||||
let bodyPartUpper = getEntityData(player, "vrr.bodyPartUpper");
|
let bodyPartUpper = getEntityData(player, "agrp.bodyPartUpper");
|
||||||
player.changeBodyPart(1, bodyPartUpper[0], bodyPartUpper[1]);
|
player.changeBodyPart(1, bodyPartUpper[0], bodyPartUpper[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPartLower")) {
|
if (doesEntityDataExist(player, "agrp.bodyPartLower")) {
|
||||||
let bodyPartLower = getEntityData(player, "vrr.bodyPartLower");
|
let bodyPartLower = getEntityData(player, "agrp.bodyPartLower");
|
||||||
player.changeBodyPart(1, bodyPartLower[0], bodyPartLower[1]);
|
player.changeBodyPart(1, bodyPartLower[0], bodyPartLower[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getGame() == VRR_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPropHair")) {
|
if (doesEntityDataExist(player, "agrp.bodyPropHair")) {
|
||||||
let bodyPropHair = getEntityData(player, "vrr.bodyPropHair");
|
let bodyPropHair = getEntityData(player, "agrp.bodyPropHair");
|
||||||
player.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]);
|
player.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPropHead")) {
|
if (doesEntityDataExist(player, "agrp.bodyPropHead")) {
|
||||||
let bodyPropHead = getEntityData(player, "vrr.bodyPropHead");
|
let bodyPropHead = getEntityData(player, "agrp.bodyPropHead");
|
||||||
player.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]);
|
player.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPropEyes")) {
|
if (doesEntityDataExist(player, "agrp.bodyPropEyes")) {
|
||||||
let bodyPropEyes = getEntityData(player, "vrr.bodyPropEyes");
|
let bodyPropEyes = getEntityData(player, "agrp.bodyPropEyes");
|
||||||
player.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]);
|
player.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPropLeftHand")) {
|
if (doesEntityDataExist(player, "agrp.bodyPropLeftHand")) {
|
||||||
let bodyPropLeftHand = getEntityData(player, "vrr.bodyPropLeftHand");
|
let bodyPropLeftHand = getEntityData(player, "agrp.bodyPropLeftHand");
|
||||||
player.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]);
|
player.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPropRightHand")) {
|
if (doesEntityDataExist(player, "agrp.bodyPropRightHand")) {
|
||||||
let bodyPropRightHand = getEntityData(player, "vrr.bodyPropRightHand");
|
let bodyPropRightHand = getEntityData(player, "agrp.bodyPropRightHand");
|
||||||
player.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]);
|
player.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPropLeftWrist")) {
|
if (doesEntityDataExist(player, "agrp.bodyPropLeftWrist")) {
|
||||||
let bodyPropLeftWrist = getEntityData(player, "vrr.bodyPropLeftWrist");
|
let bodyPropLeftWrist = getEntityData(player, "agrp.bodyPropLeftWrist");
|
||||||
player.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]);
|
player.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPropRightWrist")) {
|
if (doesEntityDataExist(player, "agrp.bodyPropRightWrist")) {
|
||||||
let bodyPropRightWrist = getEntityData(player, "vrr.bodyPropRightWrist");
|
let bodyPropRightWrist = getEntityData(player, "agrp.bodyPropRightWrist");
|
||||||
player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
|
player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPropRightWrist")) {
|
if (doesEntityDataExist(player, "agrp.bodyPropRightWrist")) {
|
||||||
let bodyPropRightWrist = getEntityData(player, "vrr.bodyPropRightWrist");
|
let bodyPropRightWrist = getEntityData(player, "agrp.bodyPropRightWrist");
|
||||||
player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
|
player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPropHip")) {
|
if (doesEntityDataExist(player, "agrp.bodyPropHip")) {
|
||||||
let bodyPropHip = getEntityData(player, "vrr.bodyPropHip");
|
let bodyPropHip = getEntityData(player, "agrp.bodyPropHip");
|
||||||
player.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]);
|
player.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPropLeftFoot")) {
|
if (doesEntityDataExist(player, "agrp.bodyPropLeftFoot")) {
|
||||||
let bodyPropLeftFoot = getEntityData(player, "vrr.bodyPropLeftFoot");
|
let bodyPropLeftFoot = getEntityData(player, "agrp.bodyPropLeftFoot");
|
||||||
player.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]);
|
player.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(player, "vrr.bodyPropRightFoot")) {
|
if (doesEntityDataExist(player, "agrp.bodyPropRightFoot")) {
|
||||||
let bodyPropRightFoot = getEntityData(player, "vrr.bodyPropRightFoot");
|
let bodyPropRightFoot = getEntityData(player, "agrp.bodyPropRightFoot");
|
||||||
player.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]);
|
player.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -368,18 +373,26 @@ function syncPlayerProperties(player) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function syncElementProperties(element) {
|
function syncElementProperties(element) {
|
||||||
if(!areServerElementsSupported()) {
|
if (!areServerElementsSupported()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(element, "vrr.interior")) {
|
if (isGameFeatureSupported("interior")) {
|
||||||
if(typeof element.interior != "undefined") {
|
if (doesEntityDataExist(element, "agrp.interior")) {
|
||||||
element.interior = getEntityData(element, "vrr.interior");
|
if (typeof element.interior != "undefined") {
|
||||||
|
element.interior = getEntityData(element, "agrp.interior");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getGame() == VRR_GAME_MAFIA_ONE) {
|
if (isGameFeatureSupported("toggleCollision")) {
|
||||||
switch(element.type) {
|
if (doesEntityDataExist(element, "agrp.collisions")) {
|
||||||
|
element.collisionsEnabled = getEntityData(element, "agrp.collisions");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getGame() == AGRP_GAME_MAFIA_ONE) {
|
||||||
|
switch (element.type) {
|
||||||
case ELEMENT_VEHICLE:
|
case ELEMENT_VEHICLE:
|
||||||
syncVehicleProperties(element);
|
syncVehicleProperties(element);
|
||||||
break;
|
break;
|
||||||
@@ -396,7 +409,7 @@ function syncElementProperties(element) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch(element.type) {
|
switch (element.type) {
|
||||||
case ELEMENT_VEHICLE:
|
case ELEMENT_VEHICLE:
|
||||||
syncVehicleProperties(element);
|
syncVehicleProperties(element);
|
||||||
break;
|
break;
|
||||||
@@ -409,6 +422,10 @@ function syncElementProperties(element) {
|
|||||||
syncPlayerProperties(element);
|
syncPlayerProperties(element);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ELEMENT_OBJECT:
|
||||||
|
syncObjectProperties(element);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -419,7 +436,7 @@ function syncElementProperties(element) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function receiveHouseFromServer(houseId, entrancePosition, blipModel, pickupModel, hasInterior) {
|
function receiveHouseFromServer(houseId, entrancePosition, blipModel, pickupModel, hasInterior) {
|
||||||
if(getGame() == VRR_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -427,11 +444,11 @@ function receiveHouseFromServer(houseId, entrancePosition, blipModel, pickupMode
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setLocalPlayerPedPartsAndProps(parts, props) {
|
function setLocalPlayerPedPartsAndProps(parts, props) {
|
||||||
for(let i in parts) {
|
for (let i in parts) {
|
||||||
localPlayer.changeBodyPart(parts[i][0], parts[i][1], parts[i][2]);
|
localPlayer.changeBodyPart(parts[i][0], parts[i][1], parts[i][2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(let j in props) {
|
for (let j in props) {
|
||||||
localPlayer.changeBodyProp(props[j][0], props[j][1]);
|
localPlayer.changeBodyProp(props[j][0], props[j][1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: utilities.js
|
// FILE: utilities.js
|
||||||
// DESC: Provides util functions and arrays with data
|
// DESC: Provides util functions and arrays with data
|
||||||
@@ -8,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;
|
||||||
if (getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) {
|
game.setPlayerControl(controlState);
|
||||||
|
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() != VRR_GAME_GTA_IV) {
|
} else if (getGame() <= AGRP_GAME_GTA_IV) {
|
||||||
setElementCollisionsEnabled(localPlayer, controlState);
|
setElementCollisionsEnabled(localPlayer, controlState);
|
||||||
setPedInvincible(localPlayer, true);
|
setPedInvincible(localPlayer, true);
|
||||||
}
|
}
|
||||||
@@ -27,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -46,24 +49,16 @@ function removeLocalPlayerFromVehicle() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function restoreLocalCamera() {
|
function restoreLocalCamera() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Camera restored`);
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Camera restored`);
|
||||||
if (isCustomCameraSupported()) {
|
if (isGameFeatureSupported("customCamera")) {
|
||||||
game.restoreCamera(true);
|
game.restoreCamera(true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function clearLocalPlayerOwnedPeds() {
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Clearing all self-owned peds ...`);
|
|
||||||
clearSelfOwnedPeds();
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] All self-owned peds cleared`);
|
|
||||||
};
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
@@ -71,13 +66,21 @@ 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() == VRR_MPMOD_GTAC) {
|
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
|
||||||
game.setGenerateCarsAroundCamera(state);
|
game.setGenerateCarsAroundCamera(state);
|
||||||
if (getGame() != VRR_GAME_GTA_SA) {
|
if (getGame() != AGRP_GAME_GTA_SA) {
|
||||||
game.setCiviliansEnabled(state);
|
game.setCiviliansEnabled(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,7 +98,7 @@ function runClientCode(code, returnTo) {
|
|||||||
try {
|
try {
|
||||||
returnValue = eval("(" + code + ")");
|
returnValue = eval("(" + code + ")");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
sendNetworkEventToServer("vrr.runCodeFail", returnTo, error.toString());
|
sendNetworkEventToServer("agrp.runCodeFail", returnTo, error.toString());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
let returnValueString = returnValue;
|
let returnValueString = returnValue;
|
||||||
@@ -104,7 +107,7 @@ function runClientCode(code, returnTo) {
|
|||||||
} else {
|
} else {
|
||||||
returnValueString = "null/undefined";
|
returnValueString = "null/undefined";
|
||||||
}
|
}
|
||||||
sendNetworkEventToServer("vrr.runCodeSuccess", returnTo, returnValueString);
|
sendNetworkEventToServer("agrp.runCodeSuccess", returnTo, returnValueString);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -112,34 +115,35 @@ function runClientCode(code, returnTo) {
|
|||||||
function enterVehicleAsPassenger() {
|
function enterVehicleAsPassenger() {
|
||||||
if (localPlayer.vehicle == null) {
|
if (localPlayer.vehicle == null) {
|
||||||
let tempVehicle = getClosestVehicle(localPlayer.position);
|
let tempVehicle = getClosestVehicle(localPlayer.position);
|
||||||
if (getGame() != VRR_GAME_GTA_IV) {
|
if (getGame() != AGRP_GAME_GTA_IV) {
|
||||||
if (tempVehicle != null) {
|
if (tempVehicle != null) {
|
||||||
localPlayer.enterVehicle(tempVehicle, false);
|
localPlayer.enterVehicle(tempVehicle, false);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// Disable for now. GTA IV has built-in passenger entry
|
|
||||||
|
|
||||||
//for(let i = 0 ; i <= natives.getMaximumNumberOfPassengers(tempVehicle); i++) {
|
|
||||||
// if(natives.isCarPassengerSeatFree(tempVehicle, i)) {
|
|
||||||
// natives.taskEnterCarAsPassenger(localPlayer, tempVehicle, i, 10000);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
// else {
|
||||||
|
// Disable for now. GTA IV has built-in passenger entry
|
||||||
|
|
||||||
|
//for(let i = 0 ; i <= natives.getMaximumNumberOfPassengers(tempVehicle); i++) {
|
||||||
|
// if(natives.isCarPassengerSeatFree(tempVehicle, i)) {
|
||||||
|
// natives.taskEnterCarAsPassenger(localPlayer, tempVehicle, i, 10000);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function giveLocalPlayerWeapon(weaponId, ammo, active) {
|
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() == VRR_GAME_MAFIA_ONE) {
|
if (getGame() == AGRP_GAME_MAFIA_ONE) {
|
||||||
localPlayer.giveWeapon(weaponId, 0, ammo);
|
localPlayer.giveWeapon(weaponId, 0, ammo);
|
||||||
forceWeaponAmmo = 0;
|
forceWeaponAmmo = 0;
|
||||||
forceWeaponClipAmmo = ammo;
|
forceWeaponClipAmmo = ammo;
|
||||||
} else {
|
} else {
|
||||||
localPlayer.giveWeapon(weaponId, ammo, active);
|
localPlayer.giveWeapon(weaponId, ammo, active);
|
||||||
if (getGame() < VRR_GAME_GTA_IV) {
|
if (getGame() < AGRP_GAME_GTA_IV) {
|
||||||
forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(weaponId));
|
forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(weaponId));
|
||||||
forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(weaponId));
|
forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(weaponId));
|
||||||
} else {
|
} else {
|
||||||
@@ -152,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;
|
||||||
@@ -170,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);
|
||||||
}
|
}
|
||||||
@@ -183,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;
|
||||||
}
|
}
|
||||||
@@ -192,8 +196,8 @@ 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() == VRR_MPMOD_GTAC) {
|
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
|
||||||
if (!isGTAIV()) {
|
if (!isGTAIV()) {
|
||||||
localPlayer.interior = interior;
|
localPlayer.interior = interior;
|
||||||
game.cameraInterior = interior;
|
game.cameraInterior = interior;
|
||||||
@@ -211,8 +215,8 @@ function setLocalPlayerInterior(interior) {
|
|||||||
if (areServerElementsSupported() && isGameFeatureSupported("interior")) {
|
if (areServerElementsSupported() && isGameFeatureSupported("interior")) {
|
||||||
let vehicles = getElementsByType(ELEMENT_VEHICLE);
|
let vehicles = getElementsByType(ELEMENT_VEHICLE);
|
||||||
for (let i in vehicles) {
|
for (let i in vehicles) {
|
||||||
if (getEntityData(vehicles[i], "vrr.interior")) {
|
if (getEntityData(vehicles[i], "agrp.interior")) {
|
||||||
vehicles[i].interior = getEntityData(vehicles[i], "vrr.interior");
|
vehicles[i].interior = getEntityData(vehicles[i], "agrp.interior");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -220,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;
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -238,8 +245,8 @@ 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() == VRR_MPMOD_GTAC) {
|
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
|
||||||
game.SET_CHAR_SAY(int, int);
|
game.SET_CHAR_SAY(int, int);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -247,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();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -260,8 +267,8 @@ function getWeaponSlot(weaponId) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setLocalPlayerDrunkEffect(amount, duration) {
|
function setLocalPlayerDrunkEffect(amount, duration) {
|
||||||
if (getMultiplayerMod() == VRR_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;
|
||||||
@@ -311,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);
|
||||||
}
|
}
|
||||||
@@ -319,46 +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 (typeof localPlayer.money != "undefined") {
|
|
||||||
localPlayer.money = toInteger(amount);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getGame() == VRR_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) {
|
||||||
@@ -405,21 +399,24 @@ function processWantedLevelReset() {
|
|||||||
|
|
||||||
function processLocalPlayerVehicleControlState() {
|
function processLocalPlayerVehicleControlState() {
|
||||||
if (areServerElementsSupported()) {
|
if (areServerElementsSupported()) {
|
||||||
if (inVehicle && localPlayer.vehicle != null) {
|
if (localPlayer.vehicle != null) {
|
||||||
if (doesEntityDataExist(localPlayer.vehicle, "vrr.engine")) {
|
if (doesEntityDataExist(localPlayer.vehicle, "agrp.engine")) {
|
||||||
if (getEntityData(localPlayer.vehicle, "vrr.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);
|
||||||
localPlayer.vehicle.turnVelocity = toVector3(0.0, 0.0, 0.0);
|
localPlayer.vehicle.turnVelocity = toVector3(0.0, 0.0, 0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//if(parkedVehiclePosition) {
|
//if (parkedVehiclePosition) {
|
||||||
// localPlayer.vehicle.position = parkedVehiclePosition;
|
// localPlayer.vehicle.position = parkedVehiclePosition;
|
||||||
// localPlayer.vehicle.heading = parkedVehicleHeading;
|
// localPlayer.vehicle.heading = parkedVehicleHeading;
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
//localPlayer.vehicle.netFlags.sendSync = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -428,52 +425,17 @@ function processLocalPlayerVehicleControlState() {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function processLocalPlayerSphereEntryExitHandling() {
|
|
||||||
let position = getLocalPlayerPosition();
|
|
||||||
|
|
||||||
if (areMarkersSupported()) {
|
|
||||||
getElementsByType(ELEMENT_MARKER).forEach(function (sphere) {
|
|
||||||
if (getDistance(position, sphere.position) <= sphere.radius) {
|
|
||||||
if (!inSphere) {
|
|
||||||
inSphere = sphere;
|
|
||||||
triggerEvent("OnLocalPlayerEnterSphere", null, sphere);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (inSphere) {
|
|
||||||
inSphere = false;
|
|
||||||
triggerEvent("OnLocalPlayerExitSphere", null, sphere);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function processJobRouteSphere() {
|
|
||||||
if (getGame() == VRR_GAME_GTA_SA) {
|
|
||||||
let position = getLocalPlayerPosition();
|
|
||||||
if (jobRouteLocationSphere != null) {
|
|
||||||
if (getDistance(position, jobRouteLocationSphere.position) <= 2.0) {
|
|
||||||
enteredJobRouteSphere();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function forceLocalPlayerEquippedWeaponItem() {
|
function forceLocalPlayerEquippedWeaponItem() {
|
||||||
if (typeof localPlayer.weapon != "undefined") {
|
if (typeof localPlayer.weapon != "undefined") {
|
||||||
if (forceWeapon != 0) {
|
if (forceWeapon != 0) {
|
||||||
if (localPlayer.weapon != forceWeapon) {
|
if (localPlayer.weapon != forceWeapon) {
|
||||||
localPlayer.weapon = forceWeapon;
|
localPlayer.weapon = forceWeapon;
|
||||||
if (getGame() < VRR_GAME_GTA_IV) {
|
if (getGame() < AGRP_GAME_GTA_IV) {
|
||||||
localPlayer.setWeaponClipAmmunition(getWeaponSlot(forceWeapon), forceWeaponClipAmmo);
|
localPlayer.setWeaponClipAmmunition(getWeaponSlot(forceWeapon), forceWeaponClipAmmo);
|
||||||
localPlayer.setWeaponAmmunition(getWeaponSlot(forceWeapon), forceWeaponAmmo);
|
localPlayer.setWeaponAmmunition(getWeaponSlot(forceWeapon), forceWeaponAmmo);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//if(getGame() < VRR_GAME_GTA_IV) {
|
//if(getGame() < AGRP_GAME_GTA_IV) {
|
||||||
// forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(forceWeapon));
|
// forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(forceWeapon));
|
||||||
// forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(forceWeapon));
|
// forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(forceWeapon));
|
||||||
//}
|
//}
|
||||||
@@ -499,26 +461,8 @@ function getLocalPlayerPosition() {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function processLocalPlayerVehicleEntryExitHandling() {
|
|
||||||
if (localPlayer.vehicle) {
|
|
||||||
if (!inVehicle) {
|
|
||||||
inVehicle = localPlayer.vehicle;
|
|
||||||
inVehicleSeat = getLocalPlayerVehicleSeat();
|
|
||||||
triggerEvent("OnLocalPlayerEnteredVehicle", inVehicle, inVehicleSeat);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (inVehicle) {
|
|
||||||
triggerEvent("OnLocalPlayerExitedVehicle", inVehicle, inVehicleSeat);
|
|
||||||
inVehicle = false;
|
|
||||||
inVehicleSeat = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function getVehicleForNetworkEvent(vehicle) {
|
function getVehicleForNetworkEvent(vehicle) {
|
||||||
if (getGame() == VRR_GAME_GTA_IV) {
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
return natives.getNetworkIdFromVehicle(vehicle);
|
return natives.getNetworkIdFromVehicle(vehicle);
|
||||||
}
|
}
|
||||||
return vehicle.id;
|
return vehicle.id;
|
||||||
@@ -527,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;
|
||||||
@@ -590,7 +534,7 @@ function processNearbyPickups() {
|
|||||||
//if(pickups[i].interior == localPlayer.interior && pickups[i].dimension == localPlayer.dimension) {
|
//if(pickups[i].interior == localPlayer.interior && pickups[i].dimension == localPlayer.dimension) {
|
||||||
if (currentPickup != pickups[i]) {
|
if (currentPickup != pickups[i]) {
|
||||||
currentPickup = pickups[i];
|
currentPickup = pickups[i];
|
||||||
sendNetworkEventToServer("vrr.pickup", pickups[i].id);
|
sendNetworkEventToServer("agrp.pickup", pickups[i].id);
|
||||||
}
|
}
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
@@ -601,7 +545,7 @@ function processNearbyPickups() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function processGameSpecifics() {
|
function processGameSpecifics() {
|
||||||
if (getGame() < VRR_GAME_GTA_IV) {
|
if (getGame() < AGRP_GAME_GTA_IV) {
|
||||||
game.clearMessages();
|
game.clearMessages();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -615,3 +559,62 @@ function getServerData() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setProfanityFilterState(state) {
|
||||||
|
profanityFilterEnabled = state;
|
||||||
|
updateChatBox();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: vehicle.js
|
// FILE: vehicle.js
|
||||||
// DESC: Provides vehicle functions and arrays with data
|
// DESC: Provides vehicle functions and arrays with data
|
||||||
@@ -30,13 +31,13 @@ class VehicleData {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function receiveVehicleFromServer(vehicleId, 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() != VRR_GAME_GTA_IV) {
|
if (getGame() != AGRP_GAME_GTA_IV) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getVehicleData(vehicleId) != false) {
|
if (getVehicleData(vehicleId) != false) {
|
||||||
let vehicleData = getVehicleData(vehicleId);
|
let vehicleData = getVehicleData(vehicleId);
|
||||||
//vehicleData.position = position;
|
//vehicleData.position = position;
|
||||||
//vehicleData.heading = heading;
|
//vehicleData.heading = heading;
|
||||||
@@ -52,7 +53,7 @@ function receiveVehicleFromServer(vehicleId, position, model, colour1, colour2,
|
|||||||
|
|
||||||
let vehicle = natives.getVehicleFromNetworkId(vehicleId.ivNetworkId);
|
let vehicle = natives.getVehicleFromNetworkId(vehicleId.ivNetworkId);
|
||||||
} else {
|
} else {
|
||||||
//logToConsole(LOG_DEBUG, `[VRR.Vehicle] Vehicle ${vehicleId} doesn't exist. Adding ...`);
|
//logToConsole(LOG_DEBUG, `[AGRP.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);
|
||||||
@@ -63,20 +64,20 @@ function receiveVehicleFromServer(vehicleId, position, model, colour1, colour2,
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function processVehiclePurchasing() {
|
function processVehiclePurchasing() {
|
||||||
if(vehiclePurchaseState == VRR_VEHBUYSTATE_TESTDRIVE) {
|
if (vehiclePurchaseState == AGRP_VEHBUYSTATE_TESTDRIVE) {
|
||||||
if(getLocalPlayerVehicle() == false) {
|
if (getLocalPlayerVehicle() == false) {
|
||||||
vehiclePurchaseState = VRR_VEHBUYSTATE_EXITVEH;
|
vehiclePurchaseState = AGRP_VEHBUYSTATE_EXITVEH;
|
||||||
sendNetworkEventToServer("vrr.vehBuyState", VRR_VEHBUYSTATE_EXITVEH);
|
sendNetworkEventToServer("agrp.vehBuyState", AGRP_VEHBUYSTATE_EXITVEH);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
if(vehiclePurchasing == getLocalPlayerVehicle()) {
|
if (vehiclePurchasing == getLocalPlayerVehicle()) {
|
||||||
if(getDistance(getLocalPlayerVehicle().position, vehiclePurchasePosition) >= 25) {
|
if (getDistance(getLocalPlayerVehicle().position, vehiclePurchasePosition) >= 25) {
|
||||||
vehiclePurchaseState = VRR_VEHBUYSTATE_FARENOUGH;
|
vehiclePurchaseState = AGRP_VEHBUYSTATE_FARENOUGH;
|
||||||
sendNetworkEventToServer("vrr.vehBuyState", VRR_VEHBUYSTATE_FARENOUGH);
|
sendNetworkEventToServer("agrp.vehBuyState", AGRP_VEHBUYSTATE_FARENOUGH);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
vehiclePurchaseState = VRR_VEHBUYSTATE_WRONGVEH;
|
vehiclePurchaseState = AGRP_VEHBUYSTATE_WRONGVEH;
|
||||||
sendNetworkEventToServer("vrr.vehBuyState", VRR_VEHBUYSTATE_WRONGVEH);
|
sendNetworkEventToServer("agrp.vehBuyState", AGRP_VEHBUYSTATE_WRONGVEH);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -95,7 +96,7 @@ function processVehicleBurning() {
|
|||||||
function setVehiclePurchaseState(state, vehicleId, position) {
|
function setVehiclePurchaseState(state, vehicleId, position) {
|
||||||
vehiclePurchaseState = state;
|
vehiclePurchaseState = state;
|
||||||
|
|
||||||
if(vehicleId != null) {
|
if (vehicleId != null) {
|
||||||
vehiclePurchasing = getElementFromId(vehicleId);
|
vehiclePurchasing = getElementFromId(vehicleId);
|
||||||
} else {
|
} else {
|
||||||
vehiclePurchasing = null;
|
vehiclePurchasing = null;
|
||||||
@@ -110,9 +111,9 @@ function setVehiclePurchaseState(state, vehicleId, position) {
|
|||||||
* @param {number} vehicleId - The ID of the job (initially provided by server)
|
* @param {number} vehicleId - The ID of the job (initially provided by server)
|
||||||
* @return {VehicleData} The vehicle's data (class instance)
|
* @return {VehicleData} The vehicle's data (class instance)
|
||||||
*/
|
*/
|
||||||
function getVehicleData(vehicleId) {
|
function getVehicleData(vehicleId) {
|
||||||
for(let i in getServerData().vehicles) {
|
for (let i in getServerData().vehicles) {
|
||||||
if(getServerData().vehicles[i].vehicleId == vehicleId) {
|
if (getServerData().vehicles[i].vehicleId == vehicleId) {
|
||||||
return getServerData().vehicles[i];
|
return getServerData().vehicles[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,9 +124,44 @@ function setVehiclePurchaseState(state, vehicleId, position) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setAllVehicleDataIndexes() {
|
function setAllVehicleDataIndexes() {
|
||||||
for(let i in getServerData().vehicles) {
|
for (let i in getServerData().vehicles) {
|
||||||
getServerData().vehicles[i].index = i;
|
getServerData().vehicles[i].index = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function toggleLocalVehicleCruiseControl() {
|
||||||
|
if (!localPlayer.vehicle.isSyncer) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
cruiseControlEnabled = !cruiseControlEnabled;
|
||||||
|
cruiseControlSpeed = getVehicleSpeed(vehicle);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getVehicleSpeed(vehicle) {
|
||||||
|
let matrix = vehicle.matrix;
|
||||||
|
let frontSpeed = true;
|
||||||
|
let vecMoveSpeed = vehicle.velocity;
|
||||||
|
let speed;
|
||||||
|
|
||||||
|
if (frontSpeed) {
|
||||||
|
speed = getDotProduct(vecMoveSpeed[0], vecMoveSpeed[1], vecMoveSpeed[2], matrix.getElement(1 * 4 + 0), matrix.getElement(1 * 4 + 1), matrix.getElement(1 * 4 + 2));
|
||||||
|
} else {
|
||||||
|
speed = getLength(vecMoveSpeed[0], vecMoveSpeed[1], vecMoveSpeed[2]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getGame() == AGRP_GAME_GTA_IV || getGame() == AGRP_GAME_GTA_IV_EFLC) {
|
||||||
|
speed /= 40.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
speed = speed * 90;
|
||||||
|
speed = Math.abs(speed);
|
||||||
|
|
||||||
|
return speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: accent.js
|
// FILE: accent.js
|
||||||
// DESC: Provides accent functions and usage
|
// DESC: Provides accent functions and usage
|
||||||
@@ -27,7 +28,7 @@ function doesPlayerHaveAccent(client) {
|
|||||||
|
|
||||||
function getPlayerAccentInlineOutput(client) {
|
function getPlayerAccentInlineOutput(client) {
|
||||||
let outputText = "";
|
let outputText = "";
|
||||||
if(doesPlayerHaveAccent(client)) {
|
if (doesPlayerHaveAccent(client)) {
|
||||||
outputText = `[${getPlayerAccentText(client)}] `;
|
outputText = `[${getPlayerAccentText(client)}] `;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,14 +38,14 @@ function getPlayerAccentInlineOutput(client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setAccentCommand(command, params, client) {
|
function setAccentCommand(command, params, client) {
|
||||||
if(areParamsEmpty(params)) {
|
if (areParamsEmpty(params)) {
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let accentId = getAccentFromParams(params);
|
let accentId = getAccentFromParams(params);
|
||||||
|
|
||||||
if(!accentId) {
|
if (!accentId) {
|
||||||
messagePlayerError(client, getLocaleString(client, "AccentNotFound"));
|
messagePlayerError(client, getLocaleString(client, "AccentNotFound"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -64,7 +65,7 @@ function listAccentsCommand(command, params, client) {
|
|||||||
let chunkedList = splitArrayIntoChunks(accentList, 8);
|
let chunkedList = splitArrayIntoChunks(accentList, 8);
|
||||||
|
|
||||||
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "AccentsListHeader")));
|
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "AccentsListHeader")));
|
||||||
for(let i in chunkedList) {
|
for (let i in chunkedList) {
|
||||||
messagePlayerInfo(client, chunkedList[i].join(", "));
|
messagePlayerInfo(client, chunkedList[i].join(", "));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -72,14 +73,14 @@ function listAccentsCommand(command, params, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getAccentFromParams(params) {
|
function getAccentFromParams(params) {
|
||||||
if(isNaN(params)) {
|
if (isNaN(params)) {
|
||||||
for(let i in getGlobalConfig().accents) {
|
for (let i in getGlobalConfig().accents) {
|
||||||
if(toLowerCase(getGlobalConfig().accents[i]).indexOf(toLowerCase(params)) != -1) {
|
if (toLowerCase(getGlobalConfig().accents[i]).indexOf(toLowerCase(params)) != -1) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(typeof getGlobalConfig().accents[params] != "undefined") {
|
if (typeof getGlobalConfig().accents[params] != "undefined") {
|
||||||
return toInteger(params);
|
return toInteger(params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -97,14 +98,14 @@ function reloadAccentConfigurationCommand(command, params, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function addAccentCommand(command, params, client) {
|
function addAccentCommand(command, params, client) {
|
||||||
if(areParamsEmpty(params)) {
|
if (areParamsEmpty(params)) {
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let newAccentName = params;
|
let newAccentName = params;
|
||||||
|
|
||||||
if(getAccentFromParams(newAccentName) != false) {
|
if (getAccentFromParams(newAccentName) != false) {
|
||||||
messagePlayerError(client, `That accent already exists!`)
|
messagePlayerError(client, `That accent already exists!`)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -117,14 +118,14 @@ function addAccentCommand(command, params, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function removeAccentCommand(command, params, client) {
|
function removeAccentCommand(command, params, client) {
|
||||||
if(areParamsEmpty(params)) {
|
if (areParamsEmpty(params)) {
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let newAccentName = params;
|
let newAccentName = params;
|
||||||
|
|
||||||
if(!getAccentFromParams(newAccentName)) {
|
if (!getAccentFromParams(newAccentName)) {
|
||||||
messagePlayerError(client, `That accent doesn't exist!`)
|
messagePlayerError(client, `That accent doesn't exist!`)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: animation.js
|
// FILE: animation.js
|
||||||
// DESC: Provides animation functions and usage
|
// DESC: Provides animation functions and usage
|
||||||
@@ -8,14 +9,14 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
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!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function playPlayerAnimationCommand(command, params, client) {
|
function playPlayerAnimationCommand(command, params, client) {
|
||||||
if(areParamsEmpty(params)) {
|
if (areParamsEmpty(params)) {
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -23,34 +24,36 @@ function playPlayerAnimationCommand(command, params, client) {
|
|||||||
let animationSlot = getAnimationFromParams(getParam(params, " ", 1));
|
let animationSlot = getAnimationFromParams(getParam(params, " ", 1));
|
||||||
let animationPositionOffset = 1;
|
let animationPositionOffset = 1;
|
||||||
|
|
||||||
if(!animationSlot) {
|
if (!animationSlot) {
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidAnimation"));
|
messagePlayerError(client, getLocaleString(client, "InvalidAnimation"));
|
||||||
messagePlayerInfo(client, getLocaleString(client, "AnimationCommandTip", `{ALTCOLOUR}/animlist{MAINCOLOUR}`));
|
messagePlayerInfo(client, getLocaleString(client, "AnimationCommandTip", `{ALTCOLOUR}/animlist{MAINCOLOUR}`));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(toInteger(animationPositionOffset) < 0 || toInteger(animationPositionOffset) > 3) {
|
if (toInteger(animationPositionOffset) < 0 || toInteger(animationPositionOffset) > 3) {
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidAnimationDistance"));
|
messagePlayerError(client, getLocaleString(client, "InvalidAnimationDistance"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getAnimationData(animationSlot)[3] == VRR_ANIMTYPE_SURRENDER) {
|
if (getAnimationData(animationSlot)[3] == AGRP_ANIMTYPE_SURRENDER) {
|
||||||
getPlayerData(client).pedState = VRR_PEDSTATE_HANDSUP;
|
getPlayerData(client).pedState = AGRP_PEDSTATE_HANDSUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isPlayerHandCuffed(client) || isPlayerTazed(client) || isPlayerInForcedAnimation(client)) {
|
if (isPlayerHandCuffed(client) || isPlayerTazed(client) || isPlayerInForcedAnimation(client)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "UnableToDoThat"));
|
messagePlayerError(client, getLocaleString(client, "UnableToDoThat"));
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function stopPlayerAnimationCommand(command, params, client) {
|
function stopPlayerAnimationCommand(command, params, client) {
|
||||||
if(isPlayerHandCuffed(client) || isPlayerTazed(client) || isPlayerInForcedAnimation(client)) {
|
if (isPlayerHandCuffed(client) || isPlayerTazed(client) || isPlayerInForcedAnimation(client)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "UnableToDoThat"));
|
messagePlayerError(client, getLocaleString(client, "UnableToDoThat"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -65,34 +68,26 @@ function stopPlayerAnimationCommand(command, params, client) {
|
|||||||
getPlayerData(client).animationForced = false;
|
getPlayerData(client).animationForced = false;
|
||||||
|
|
||||||
//setPlayerMouseCameraState(client, false);
|
//setPlayerMouseCameraState(client, false);
|
||||||
|
|
||||||
|
markPlayerActionTipSeen(client, "AnimationStop");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showAnimationListCommand(command, params, client) {
|
function showAnimationListCommand(command, params, client) {
|
||||||
let animList = getGameConfig().animations[getGame()].map(function(x) { return x.name; });
|
let animList = getGameConfig().animations[getGame()].map(function (x) { return x.name; });
|
||||||
|
|
||||||
let chunkedList = splitArrayIntoChunks(animList, 10);
|
let chunkedList = splitArrayIntoChunks(animList, 10);
|
||||||
|
|
||||||
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderAnimationsList")));
|
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderAnimationsList")));
|
||||||
|
|
||||||
for(let i in chunkedList) {
|
for (let i in chunkedList) {
|
||||||
messagePlayerNormal(client, chunkedList[i].join(", "));
|
messagePlayerNormal(client, chunkedList[i].join(", "));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {number} animationSlot - The slot index of the animation
|
|
||||||
* @return {Array} The animation's data (array)
|
|
||||||
*/
|
|
||||||
function getAnimationData(animationSlot, gameId = getGame()) {
|
|
||||||
return getGameConfig().animations[gameId][animationSlot];
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function isPlayerInForcedAnimation(client) {
|
function isPlayerInForcedAnimation(client) {
|
||||||
return getPlayerData(client).animationForced;
|
return getPlayerData(client).animationForced;
|
||||||
}
|
}
|
||||||
@@ -107,9 +102,9 @@ 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), "vrr.anim", animationSlot, true);
|
//setEntityData(getPlayerPed(client), "agrp.anim", animationSlot, true);
|
||||||
//if(getAnimationData(animationSlot)[9] != VRR_ANIMMOVE_NONE) {
|
//if(getAnimationData(animationSlot)[9] != AGRP_ANIMMOVE_NONE) {
|
||||||
// if(getGame() < VRR_GAME_GTA_SA) {
|
// if(getGame() < AGRP_GAME_GTA_SA) {
|
||||||
// setPlayerMouseCameraState(client, true);
|
// setPlayerMouseCameraState(client, true);
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
@@ -125,7 +120,7 @@ function forcePlayerPlayAnimation(client, animationSlot, offsetPosition = 1) {
|
|||||||
getPlayerData(client).animationForced = true;
|
getPlayerData(client).animationForced = true;
|
||||||
|
|
||||||
setPlayerControlState(client, false);
|
setPlayerControlState(client, false);
|
||||||
forcePedAnimation(getPlayerPed(client), animationSlot, offsetPosition);
|
forcePedAnimation(getPlayerPed(client), animationSlot, offsetPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -142,22 +137,3 @@ function makePlayerStopAnimation(client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getAnimationFromParams(params) {
|
|
||||||
let animations = getGameConfig().animations[getGame()];
|
|
||||||
if(isNaN(params)) {
|
|
||||||
for(let i in animations) {
|
|
||||||
if(toLowerCase(animations[i].name).indexOf(toLowerCase(params)) != -1) {
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if(typeof getGameConfig().animations[getGame()][params] != "undefined") {
|
|
||||||
return toInteger(params);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: anticheat.js
|
// FILE: anticheat.js
|
||||||
// DESC: Provides anticheat functions and usage
|
// DESC: Provides anticheat functions and usage
|
||||||
@@ -8,17 +9,17 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
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!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function clearPlayerStateToEnterExitProperty(client) {
|
function clearPlayerStateToEnterExitProperty(client) {
|
||||||
if(getPlayerData(client).pedState != VRR_PEDSTATE_READY) {
|
if (getPlayerData(client).pedState != AGRP_PEDSTATE_READY) {
|
||||||
if(getPlayerData(client).pedState == VRR_PEDSTATE_ENTERINGVEHICLE) {
|
if (getPlayerData(client).pedState == AGRP_PEDSTATE_ENTERINGVEHICLE) {
|
||||||
sendPlayerClearPedState(client);
|
sendPlayerClearPedState(client);
|
||||||
getPlayerData(client).pedState = VRR_PEDSTATE_READY;
|
getPlayerData(client).pedState = AGRP_PEDSTATE_READY;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -28,7 +29,7 @@ function clearPlayerStateToEnterExitProperty(client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function isPlayerExemptFromAntiCheat(client) {
|
function isPlayerExemptFromAntiCheat(client) {
|
||||||
if(hasBitFlag(getPlayerData(client).accountData.flags.moderation, getModerationFlagValue("ExemptFromAntiCheat"))) {
|
if (hasBitFlag(getPlayerData(client).accountData.flags.moderation, getModerationFlagValue("ExemptFromAntiCheat"))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,7 +39,7 @@ function isPlayerExemptFromAntiCheat(client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function canPlayerUsePoliceJob(client) {
|
function canPlayerUsePoliceJob(client) {
|
||||||
if(getPlayerData(client).accountData.flags.moderation & getServerBitFlags().moderationFlags.policeBanned) {
|
if (getPlayerData(client).accountData.flags.moderation & getServerBitFlags().moderationFlags.policeBanned) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,7 +49,7 @@ function canPlayerUsePoliceJob(client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function canClientUseFireJob(client) {
|
function canClientUseFireJob(client) {
|
||||||
if(getPlayerData(client).accountData.flags.moderation & getServerBitFlags().moderationFlags.fireBanned) {
|
if (getPlayerData(client).accountData.flags.moderation & getServerBitFlags().moderationFlags.fireBanned) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +59,7 @@ function canClientUseFireJob(client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function canClientUseAmmunations(client) {
|
function canClientUseAmmunations(client) {
|
||||||
if(getPlayerData(client).accountData.flags.moderation & getServerBitFlags().moderationFlags.AmmuBanned) {
|
if (getPlayerData(client).accountData.flags.moderation & getServerBitFlags().moderationFlags.AmmuBanned) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,7 +69,7 @@ function canClientUseAmmunations(client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function canClientUseGuns(client) {
|
function canClientUseGuns(client) {
|
||||||
if(getPlayerData(client).accountData.flags.moderation & getServerBitFlags().moderationFlags.GunBanned) {
|
if (getPlayerData(client).accountData.flags.moderation & getServerBitFlags().moderationFlags.GunBanned) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: bans.js
|
// FILE: bans.js
|
||||||
// DESC: Provides ban functions and usage
|
// DESC: Provides ban functions and usage
|
||||||
@@ -8,18 +9,18 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
// Ban Types
|
// Ban Types
|
||||||
const VRR_BANTYPE_NONE = 0;
|
const AGRP_BANTYPE_NONE = 0;
|
||||||
const VRR_BANTYPE_ACCOUNT = 1;
|
const AGRP_BANTYPE_ACCOUNT = 1;
|
||||||
const VRR_BANTYPE_SUBACCOUNT = 2;
|
const AGRP_BANTYPE_SUBACCOUNT = 2;
|
||||||
const VRR_BANTYPE_IPADDRESS = 3;
|
const AGRP_BANTYPE_IPADDRESS = 3;
|
||||||
const VRR_BANTYPE_SUBNET = 4;
|
const AGRP_BANTYPE_SUBNET = 4;
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
class BanData {
|
class BanData {
|
||||||
constructor(dbAssoc = false) {
|
constructor(dbAssoc = false) {
|
||||||
this.databaseId = 0;
|
this.databaseId = 0;
|
||||||
this.type = VRR_BANTYPE_NONE;
|
this.type = AGRP_BANTYPE_NONE;
|
||||||
this.detail = "";
|
this.detail = "";
|
||||||
this.ipAddress = "";
|
this.ipAddress = "";
|
||||||
this.name = "";
|
this.name = "";
|
||||||
@@ -38,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!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -65,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,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);
|
||||||
}
|
}
|
||||||
@@ -164,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));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,7 +175,7 @@ function banAccount(accountId, adminAccountId, reason) {
|
|||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let safeReason = dbConnection.escapetoString(reason);
|
let safeReason = dbConnection.escapetoString(reason);
|
||||||
let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${VRR_BANTYPE_ACCOUNT}, ${accountId}, ${adminAccountId}, '${safeReason}');`);
|
let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${AGRP_BANTYPE_ACCOUNT}, ${accountId}, ${adminAccountId}, '${safeReason}');`);
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
dbConnection.close();
|
dbConnection.close();
|
||||||
return true;
|
return true;
|
||||||
@@ -189,7 +190,7 @@ function banSubAccount(subAccountId, adminAccountId, reason) {
|
|||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let safeReason = dbConnection.escapetoString(reason);
|
let safeReason = dbConnection.escapetoString(reason);
|
||||||
let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${VRR_BANTYPE_SUBACCOUNT}, ${subAccountId}, ${adminAccountId}, '${safeReason}');`);
|
let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${AGRP_BANTYPE_SUBACCOUNT}, ${subAccountId}, ${adminAccountId}, '${safeReason}');`);
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
dbConnection.close();
|
dbConnection.close();
|
||||||
return true;
|
return true;
|
||||||
@@ -204,7 +205,7 @@ function banIPAddress(ipAddress, adminAccountId, reason) {
|
|||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let safeReason = dbConnection.escapetoString(reason);
|
let safeReason = dbConnection.escapetoString(reason);
|
||||||
let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${VRR_BANTYPE_IPADDRESS}, INET_ATON(${ipAddress}), ${adminAccountId}, '${safeReason}');`);
|
let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${AGRP_BANTYPE_IPADDRESS}, INET_ATON(${ipAddress}), ${adminAccountId}, '${safeReason}');`);
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
dbConnection.close();
|
dbConnection.close();
|
||||||
return true;
|
return true;
|
||||||
@@ -219,7 +220,7 @@ function banSubNet(ipAddressStart, ipAddressEnd, adminAccountId, reason) {
|
|||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let safeReason = dbConnection.escapetoString(reason);
|
let safeReason = dbConnection.escapetoString(reason);
|
||||||
let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_ip_start, ban_ip_end, ban_who_banned, ban_reason) VALUES (${VRR_BANTYPE_SUBNET}, INET_ATON(${ipAddressStart}), INET_ATON(${ipAddressEnd}), ${adminAccountId}, '${safeReason}');`);
|
let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_ip_start, ban_ip_end, ban_who_banned, ban_reason) VALUES (${AGRP_BANTYPE_SUBNET}, INET_ATON(${ipAddressStart}), INET_ATON(${ipAddressEnd}), ${adminAccountId}, '${safeReason}');`);
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
dbConnection.close();
|
dbConnection.close();
|
||||||
return true;
|
return true;
|
||||||
@@ -233,7 +234,7 @@ function banSubNet(ipAddressStart, ipAddressEnd, adminAccountId, reason) {
|
|||||||
function unbanAccount(accountId, adminAccountId) {
|
function unbanAccount(accountId, adminAccountId) {
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${VRR_BANTYPE_ACCOUNT} AND ban_detail=${accountId}`);
|
let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${AGRP_BANTYPE_ACCOUNT} AND ban_detail=${accountId}`);
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
dbConnection.close();
|
dbConnection.close();
|
||||||
return true;
|
return true;
|
||||||
@@ -247,7 +248,7 @@ function unbanAccount(accountId, adminAccountId) {
|
|||||||
function unbanSubAccount(subAccountId, adminAccountId) {
|
function unbanSubAccount(subAccountId, adminAccountId) {
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${VRR_BANTYPE_SUBACCOUNT} AND ban_detail=${subAccountId}`);
|
let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${AGRP_BANTYPE_SUBACCOUNT} AND ban_detail=${subAccountId}`);
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
dbConnection.close();
|
dbConnection.close();
|
||||||
return true;
|
return true;
|
||||||
@@ -261,7 +262,7 @@ function unbanSubAccount(subAccountId, adminAccountId) {
|
|||||||
function unbanIPAddress(ipAddress, adminAccountId) {
|
function unbanIPAddress(ipAddress, adminAccountId) {
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${VRR_BANTYPE_IPADDRESS} AND ban_detail=INET_ATON(${ipAddress})`);
|
let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${AGRP_BANTYPE_IPADDRESS} AND ban_detail=INET_ATON(${ipAddress})`);
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
dbConnection.close();
|
dbConnection.close();
|
||||||
return true;
|
return true;
|
||||||
@@ -275,7 +276,7 @@ function unbanIPAddress(ipAddress, adminAccountId) {
|
|||||||
function unbanSubNet(ipAddressStart, ipAddressEnd, adminAccountId) {
|
function unbanSubNet(ipAddressStart, ipAddressEnd, adminAccountId) {
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if (dbConnection) {
|
if (dbConnection) {
|
||||||
let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${VRR_BANTYPE_SUBNET} AND ban_ip_start=INET_ATON(${ipAddressStart}) AND ban_ip_end=INET_ATON(${ipAddressEnd})`);
|
let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${AGRP_BANTYPE_SUBNET} AND ban_ip_start=INET_ATON(${ipAddressStart}) AND ban_ip_end=INET_ATON(${ipAddressEnd})`);
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
dbConnection.close();
|
dbConnection.close();
|
||||||
return true;
|
return true;
|
||||||
@@ -287,7 +288,7 @@ function unbanSubNet(ipAddressStart, ipAddressEnd, adminAccountId) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function isAccountBanned(accountId) {
|
function isAccountBanned(accountId) {
|
||||||
let bans = getServerData().bans.filter(ban => ban.type === VRR_BANTYPE_ACCOUNT && ban.detail === accountId);
|
let bans = getServerData().bans.filter(ban => ban.type === AGRP_BANTYPE_ACCOUNT && ban.detail === accountId);
|
||||||
if (bans.length > 0) {
|
if (bans.length > 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -298,7 +299,7 @@ function isAccountBanned(accountId) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function isSubAccountBanned(subAccountId) {
|
function isSubAccountBanned(subAccountId) {
|
||||||
let bans = getServerData().bans.filter(ban => ban.type === VRR_BANTYPE_SUBACCOUNT && ban.detail === subAccountId);
|
let bans = getServerData().bans.filter(ban => ban.type === AGRP_BANTYPE_SUBACCOUNT && ban.detail === subAccountId);
|
||||||
if (bans.length > 0) {
|
if (bans.length > 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -309,7 +310,7 @@ function isSubAccountBanned(subAccountId) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function isIpAddressBanned(ipAddress) {
|
function isIpAddressBanned(ipAddress) {
|
||||||
let bans = getServerData().bans.filter(ban => ban.type === VRR_BANTYPE_IPADDRESS && ban.detail === ipAddress);
|
let bans = getServerData().bans.filter(ban => ban.type === AGRP_BANTYPE_IPADDRESS && ban.detail === ipAddress);
|
||||||
if (bans.length > 0) {
|
if (bans.length > 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
80
scripts/server/bank.js
Normal file
80
scripts/server/bank.js
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
// ===========================================================================
|
||||||
|
// Asshat Gaming Roleplay
|
||||||
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
|
// ===========================================================================
|
||||||
|
// FILE: bank.js
|
||||||
|
// DESC: Provides banking functions and usage
|
||||||
|
// TYPE: Server (JavaScript)
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
// House Owner Types
|
||||||
|
const AGRP_BANK_ACCT_OWNER_NONE = 0; // Not owned
|
||||||
|
const AGRP_BANK_ACCT_OWNER_PLAYER = 1; // Owner is a player (character/subaccount)
|
||||||
|
const AGRP_BANK_ACCT_OWNER_JOB = 2; // Owned by a job
|
||||||
|
const AGRP_BANK_ACCT_OWNER_CLAN = 3; // Owned by a clan
|
||||||
|
const AGRP_BANK_ACCT_OWNER_FACTION = 4; // Owned by a faction
|
||||||
|
const AGRP_BANK_ACCT_OWNER_BIZ = 4; // Owned by a faction
|
||||||
|
const AGRP_BANK_ACCT_OWNER_PUBLIC = 5; // Is a public bank account. Technically not owned. This probably won't be used.
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function isPlayerAtBank(client) {
|
||||||
|
if (isPositionAtATM(getPlayerPosition(client))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
let businessId = getPlayerBusiness(client);
|
||||||
|
if (getBusinessData(client) != false) {
|
||||||
|
if (getBusinessData(businessId).type == AGRP_BIZ_TYPE_BANK) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function isPositionAtATM(position) {
|
||||||
|
let atmId = getClosestATM(position);
|
||||||
|
|
||||||
|
let atmData = getServerData().atmLocationCache[atmId];
|
||||||
|
|
||||||
|
if (getDistance(position, atmData[2]) <= getGlobalConfig().atmDistance) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getClosestATM(position) {
|
||||||
|
let atmLocations = getServerData().atmLocationCache;
|
||||||
|
let closest = 0;
|
||||||
|
|
||||||
|
for (let i in atmLocations) {
|
||||||
|
if (getDistance(position, atmLocations[i]) < getDistance(position, atmLocations[closest])) {
|
||||||
|
closest = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return closest;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function isPositionAtATM(position) {
|
||||||
|
let atmId = getClosestATM(position);
|
||||||
|
|
||||||
|
let atmData = getServerData().atmLocationCache[atmId];
|
||||||
|
|
||||||
|
if (getDistance(position, atmData[2]) <= getGlobalConfig().atmDistance) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: bitflags.js
|
// FILE: bitflags.js
|
||||||
// DESC: Provides bitwise operations, functions and usage
|
// DESC: Provides bitwise operations, functions and usage
|
||||||
@@ -15,7 +16,7 @@ let serverBitFlags = {
|
|||||||
accountSettingsFlags: {},
|
accountSettingsFlags: {},
|
||||||
subAccountSettingsFlags: {},
|
subAccountSettingsFlags: {},
|
||||||
accountFlags: {},
|
accountFlags: {},
|
||||||
seenHelpTipsFlags: {},
|
seenActionTipsFlags: {},
|
||||||
npcTriggerTypeFlags: {},
|
npcTriggerTypeFlags: {},
|
||||||
npcTriggerConditionTypesFlags: {},
|
npcTriggerConditionTypesFlags: {},
|
||||||
npcTriggerResponseTypeFlags: {},
|
npcTriggerResponseTypeFlags: {},
|
||||||
@@ -64,6 +65,7 @@ let serverBitFlagKeys = {
|
|||||||
"DontSyncClientElements",
|
"DontSyncClientElements",
|
||||||
"IsTester"
|
"IsTester"
|
||||||
],
|
],
|
||||||
|
/*
|
||||||
factionFlagKeys: [
|
factionFlagKeys: [
|
||||||
"None",
|
"None",
|
||||||
"Police",
|
"Police",
|
||||||
@@ -72,6 +74,7 @@ let serverBitFlagKeys = {
|
|||||||
"Government",
|
"Government",
|
||||||
"Generic",
|
"Generic",
|
||||||
],
|
],
|
||||||
|
*/
|
||||||
clanTypeFlagKeys: [
|
clanTypeFlagKeys: [
|
||||||
"None",
|
"None",
|
||||||
"Illegal",
|
"Illegal",
|
||||||
@@ -101,6 +104,24 @@ let serverBitFlagKeys = {
|
|||||||
"ManageRanks",
|
"ManageRanks",
|
||||||
"Owner",
|
"Owner",
|
||||||
],
|
],
|
||||||
|
clanDiscordWebhookFlagKeys: [
|
||||||
|
"None",
|
||||||
|
"ClanName",
|
||||||
|
"ClanMOTD",
|
||||||
|
"ClanTag",
|
||||||
|
"ClanRankEdit",
|
||||||
|
"ClanRankSet",
|
||||||
|
"ClanVehicleEdit",
|
||||||
|
"ClanHouseEdit",
|
||||||
|
"ClanBusinessEdit",
|
||||||
|
"ClanNPCEdit",
|
||||||
|
"ClanMemberInvite",
|
||||||
|
"ClanMemberRemove",
|
||||||
|
"ClanMemberSuspend",
|
||||||
|
"ClanRankFlagSet",
|
||||||
|
"ClanTurfWar",
|
||||||
|
"ClanPointWar",
|
||||||
|
],
|
||||||
accountSettingsFlagKeys: [
|
accountSettingsFlagKeys: [
|
||||||
"None",
|
"None",
|
||||||
"UseWhiteList",
|
"UseWhiteList",
|
||||||
@@ -117,6 +138,12 @@ let serverBitFlagKeys = {
|
|||||||
"NoKeyBinds",
|
"NoKeyBinds",
|
||||||
"NoRandomTips",
|
"NoRandomTips",
|
||||||
"NoActionTips",
|
"NoActionTips",
|
||||||
|
"ChatBoxTimestamps",
|
||||||
|
"ProfanityFilter",
|
||||||
|
"ChatAutoHide",
|
||||||
|
"NoPlayerContent",
|
||||||
|
"ChatEmoji",
|
||||||
|
//"NoBlood",
|
||||||
],
|
],
|
||||||
|
|
||||||
// Not going to be used. Use trigger, condition, and response stuff in trigger.js
|
// Not going to be used. Use trigger, condition, and response stuff in trigger.js
|
||||||
@@ -213,55 +240,87 @@ 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: [
|
||||||
|
"None",
|
||||||
|
"PublicAccess",
|
||||||
|
"WhiteList",
|
||||||
|
"BlackList",
|
||||||
|
"SetRank",
|
||||||
|
"SetPay",
|
||||||
|
"ManageUniforms",
|
||||||
|
"ManageEquipment",
|
||||||
|
"ManageVehicles",
|
||||||
|
"ManageBusinesses",
|
||||||
|
"Leader",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initBitFlagScript() {
|
function initBitFlagScript() {
|
||||||
logToConsole(LOG_INFO, "[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);
|
||||||
//serverBitFlags.subAccountSettingsFlags = createBitFlagTable(getServerData().subAccountSettingsFlagKeys);
|
//serverBitFlags.subAccountSettingsFlags = createBitFlagTable(getServerData().subAccountSettingsFlagKeys);
|
||||||
serverBitFlags.clanFlags = createBitFlagTable(serverBitFlagKeys.clanFlagKeys);
|
serverBitFlags.clanFlags = createBitFlagTable(serverBitFlagKeys.clanFlagKeys);
|
||||||
serverBitFlags.clanTypeFlagKeys = createBitFlagTable(serverBitFlagKeys.clanTypeFlagKeys);
|
serverBitFlags.clanTypeFlags = createBitFlagTable(serverBitFlagKeys.clanTypeFlagKeys);
|
||||||
serverBitFlags.factionFlags = createBitFlagTable(serverBitFlagKeys.factionFlagKeys);
|
serverBitFlags.clanDiscordWebhookFlags = createBitFlagTable(serverBitFlagKeys.clanDiscordWebhookFlagKeys);
|
||||||
|
//serverBitFlags.factionFlags = createBitFlagTable(serverBitFlagKeys.factionFlagKeys);
|
||||||
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);
|
||||||
logToConsole(LOG_INFO, "[VRR.BitFlag]: Bit flag script initialized successfully!");
|
serverBitFlags.seenActionTips = createBitFlagTable(serverBitFlagKeys.seenActionTipsKeys);
|
||||||
|
serverBitFlags.jobRankFlags = createBitFlagTable(serverBitFlagKeys.jobRankKeys);
|
||||||
|
logToConsole(LOG_INFO, "[AGRP.BitFlag]: Bit flag script initialized successfully!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function doesPlayerHaveStaffPermission(client, requiredFlags) {
|
function doesPlayerHaveStaffPermission(client, requiredFlags) {
|
||||||
if(isConsole(client)) {
|
if (isConsole(client)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(requiredFlags == getStaffFlagValue("None")) {
|
if (requiredFlags == getStaffFlagValue("None")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let staffFlags = 0;
|
let staffFlags = 0;
|
||||||
if(getPlayerData(client)) {
|
if (getPlayerData(client)) {
|
||||||
staffFlags = getPlayerData(client).accountData.flags.admin;
|
staffFlags = getPlayerData(client).accountData.flags.admin;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -1 is automatic override (having -1 for staff flags is basically god mode admin level)
|
// -1 is automatic override (having -1 for staff flags is basically god mode admin level)
|
||||||
if(staffFlags == getStaffFlagValue("All")) {
|
if (staffFlags == getStaffFlagValue("All")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hasBitFlag(staffFlags, requiredFlags)) {
|
if (hasBitFlag(staffFlags, requiredFlags)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -271,27 +330,57 @@ function doesPlayerHaveStaffPermission(client, requiredFlags) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function doesPlayerHaveClanPermission(client, requiredFlags) {
|
function doesPlayerHaveClanPermission(client, requiredFlags) {
|
||||||
if(isConsole(client)) {
|
if (isConsole(client)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(requiredFlags == getClanFlagValue("None")) {
|
if (requiredFlags == getClanFlagValue("None")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageClans"))) {
|
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageClans"))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let clanFlags = 0;
|
let clanFlags = 0;
|
||||||
clanFlags = getPlayerCurrentSubAccount(client).clanFlags | getClanRankFlags(getPlayerCurrentSubAccount(client).clanRank);
|
clanFlags = getPlayerCurrentSubAccount(client).clanFlags | getClanRankData(getPlayerClan(client), getPlayerClanRank(client)).flags;
|
||||||
|
|
||||||
// -1 is automatic override (having -1 for staff flags is basically god mode admin level)
|
// -1 is automatic override (having -1 for staff flags is basically god mode admin level)
|
||||||
if(clanFlags == getClanFlagValue("All")) {
|
if (clanFlags == getClanFlagValue("All")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hasBitFlag(clanFlags, requiredFlags)) {
|
if (hasBitFlag(clanFlags, requiredFlags)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function doesPlayerHaveJobPermission(client, requiredFlags) {
|
||||||
|
if (isConsole(client)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (requiredFlags == getClanFlagValue("None")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageJobs"))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
let jobFlags = 0;
|
||||||
|
jobFlags = getPlayerCurrentSubAccount(client).jobFlags | getJobRankData(getPlayerJob(client), getPlayerJobRank(client)).flags;
|
||||||
|
|
||||||
|
// -1 is automatic override (having -1 for staff flags is basically god mode admin level)
|
||||||
|
if (jobFlags == getJobFlagValue("All")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasBitFlag(jobFlags, requiredFlags)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -301,11 +390,11 @@ function doesPlayerHaveClanPermission(client, requiredFlags) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getStaffFlagValue(flagName) {
|
function getStaffFlagValue(flagName) {
|
||||||
if(flagName == "All") {
|
if (flagName == "All") {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(typeof serverBitFlags.staffFlags[flagName] == "undefined") {
|
if (typeof serverBitFlags.staffFlags[flagName] == "undefined") {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -315,11 +404,11 @@ function getStaffFlagValue(flagName) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getClanFlagValue(flagName) {
|
function getClanFlagValue(flagName) {
|
||||||
if(flagName == "All") {
|
if (flagName == "All") {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(typeof getServerBitFlags().clanFlags[flagName] == "undefined") {
|
if (typeof getServerBitFlags().clanFlags[flagName] == "undefined") {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -329,11 +418,11 @@ function getClanFlagValue(flagName) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getAccountSettingsFlagValue(flagName) {
|
function getAccountSettingsFlagValue(flagName) {
|
||||||
if(flagName == "All") {
|
if (flagName == "All") {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(typeof serverBitFlags.accountSettingsFlags[flagName] == "undefined") {
|
if (typeof serverBitFlags.accountSettingsFlags[flagName] == "undefined") {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -343,11 +432,11 @@ function getAccountSettingsFlagValue(flagName) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getModerationFlagValue(flagName) {
|
function getModerationFlagValue(flagName) {
|
||||||
if(flagName == "All") {
|
if (flagName == "All") {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(typeof serverBitFlags.moderationFlags[flagName] == "undefined") {
|
if (typeof serverBitFlags.moderationFlags[flagName] == "undefined") {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -356,8 +445,36 @@ function getModerationFlagValue(flagName) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getClanDiscordWebhookValue(flagName) {
|
||||||
|
if (flagName == "All") {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof serverBitFlags.clanDiscordWebhookFlags[flagName] == "undefined") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return serverBitFlags.clanDiscordWebhookFlags[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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -369,7 +486,7 @@ function givePlayerStaffFlag(client, flagName) {
|
|||||||
|
|
||||||
function takePlayerStaffFlag(client, flagName) {
|
function takePlayerStaffFlag(client, flagName) {
|
||||||
let flagValue = getStaffFlagValue(flagName);
|
let flagValue = getStaffFlagValue(flagName);
|
||||||
if(!flagValue) {
|
if (!flagValue) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -380,7 +497,7 @@ function takePlayerStaffFlag(client, flagName) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function takePlayerStaffFlag(client, flagName) {
|
function takePlayerStaffFlag(client, flagName) {
|
||||||
if(!getStaffFlagValue(flagName)) {
|
if (!getStaffFlagValue(flagName)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
175
scripts/server/casino.js
Normal file
175
scripts/server/casino.js
Normal file
@@ -0,0 +1,175 @@
|
|||||||
|
// ===========================================================================
|
||||||
|
// Asshat Gaming Roleplay
|
||||||
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
|
// ===========================================================================
|
||||||
|
// FILE: casino.js
|
||||||
|
// DESC: Provides casino games functions and commands
|
||||||
|
// TYPE: Server (JavaScript)
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
const AGRP_CASINO_GAME_NONE = 0;
|
||||||
|
const AGRP_CASINO_GAME_BLACKJACK = 1;
|
||||||
|
const AGRP_CASINO_GAME_POKER = 2;
|
||||||
|
const AGRP_CASINO_GAME_BACCARAT = 3;
|
||||||
|
const AGRP_CASINO_GAME_ROULETTE = 4;
|
||||||
|
const AGRP_CASINO_GAME_CRAPS = 5;
|
||||||
|
const AGRP_CASINO_GAME_HOLDEM = 6;
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
const AGRP_CASINO_DECK_SUIT_NONE = 1;
|
||||||
|
const AGRP_CASINO_DECK_SUIT_CLUBS = 1;
|
||||||
|
const AGRP_CASINO_DECK_SUIT_DIAMONDS = 2;
|
||||||
|
const AGRP_CASINO_DECK_SUIT_HEARTS = 3;
|
||||||
|
const AGRP_CASINO_DECK_SUIT_SPADES = 4;
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
class DeckCard {
|
||||||
|
constructor(suit, value, imageName) {
|
||||||
|
this.suit = suit;
|
||||||
|
this.value = value;
|
||||||
|
this.imageName = imageName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
let cardDeck = [
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 1, "deckCardClubAce"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 2, "deckCardClubTwo"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 3, "deckCardClubThree"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 4, "deckCardClubFour"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 5, "deckCardClubFive"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 6, "deckCardClubSix"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 7, "deckCardClubSeven"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 8, "deckCardClubEight"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 9, "deckCardClubNine"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 10, "deckCardClubTen"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 11, "deckCardClubJack"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 12, "deckCardClubQueen"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 13, "deckCardClubKing"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 1, "deckCardDiamondAce"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 2, "deckCardDiamondTwo"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 3, "deckCardDiamondThree"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 4, "deckCardDiamondFour"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 5, "deckCardDiamondFive"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 6, "deckCardDiamondSix"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 7, "deckCardDiamondSeven"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 8, "deckCardDiamondEight"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 9, "deckCardDiamondNine"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 10, "deckCardDiamondTen"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 11, "deckCardDiamondJack"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 12, "deckCardDiamondQueen"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 13, "deckCardDiamondKing"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 1, "deckCardHeartAce"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 2, "deckCardHeartTwo"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 3, "deckCardHeartThree"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 4, "deckCardHeartFour"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 5, "deckCardHeartFive"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 6, "deckCardHeartSix"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 7, "deckCardHeartSeven"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 8, "deckCardHeartEight"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 9, "deckCardHeartNine"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 10, "deckCardHeartTen"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 11, "deckCardHeartJack"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 12, "deckCardHeartQueen"),
|
||||||
|
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 13, "deckCardHeartKing"),
|
||||||
|
];
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function createBlackJackDeck() {
|
||||||
|
let deck = [];
|
||||||
|
for (let i in cardDeck) {
|
||||||
|
deck.push(cardDeck[i]);
|
||||||
|
}
|
||||||
|
return deck;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function shuffleBlackJackDeck(deck) {
|
||||||
|
// For 1000 turns, switch the values of two random cards
|
||||||
|
// This may need to be lowered for a more optimized shuffling algorithm (reduces server load)
|
||||||
|
for (var i = 0; i < 1000; i++) {
|
||||||
|
var location1 = Math.floor((Math.random() * deck.length));
|
||||||
|
var location2 = Math.floor((Math.random() * deck.length));
|
||||||
|
var tmp = deck[location1];
|
||||||
|
|
||||||
|
deck[location1] = deck[location2];
|
||||||
|
deck[location2] = tmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function blackJackHitCommand(command, params, client) {
|
||||||
|
if (!isPlayerPlayingBlackJack(client)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isPlayersTurnInBlackJack(client)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
let hand = getPlayerData(client).casinoCardHand;
|
||||||
|
|
||||||
|
hand.push(deck.pop());
|
||||||
|
|
||||||
|
let tempHandValue = getValueOfBlackJackHand(hand);
|
||||||
|
|
||||||
|
if (handValue > 21) {
|
||||||
|
playerBustBlackJack(client);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function blackJackStandCommand(command, params, client) {
|
||||||
|
if (!isPlayerPlayingBlackJack(client)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isPlayersTurnInBlackJack(client)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function dealPlayerBlackJackHand(deck, players) {
|
||||||
|
// Alternate handing cards to each player, 2 cards each
|
||||||
|
for (var i = 0; i < 2; i++) {
|
||||||
|
for (var x = 0; x < players.length; x++) {
|
||||||
|
var card = deck.pop();
|
||||||
|
getPlayerData(players[i]).casinoCardHand.push(card);
|
||||||
|
updateCasinoCardHand(players[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: chat.js
|
// FILE: chat.js
|
||||||
// DESC: Provides chat functions and usage
|
// DESC: Provides chat functions and usage
|
||||||
@@ -8,31 +9,31 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function processPlayerChat(client, messageText) {
|
function processPlayerChat(client, messageText) {
|
||||||
if(!isConsole(client)) {
|
if (!isConsole(client)) {
|
||||||
if(!getPlayerData(client)) {
|
if (!getPlayerData(client)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "MustBeLoggedInAndSpawnedToChat"));
|
messagePlayerError(client, getLocaleString(client, "MustBeLoggedInAndSpawnedToChat"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isPlayerLoggedIn(client)) {
|
if (!isPlayerLoggedIn(client)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "MustBeLoggedInAndSpawnedToChat"));
|
messagePlayerError(client, getLocaleString(client, "MustBeLoggedInAndSpawnedToChat"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isPlayerSpawned(client)) {
|
if (!isPlayerSpawned(client)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "MustBeLoggedInAndSpawnedToChat"));
|
messagePlayerError(client, getLocaleString(client, "MustBeLoggedInAndSpawnedToChat"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isPlayerMuted(client)) {
|
if (isPlayerMuted(client)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "MutedCantChat"));
|
messagePlayerError(client, getLocaleString(client, "MutedCantChat"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -61,7 +62,7 @@ function processPlayerChat(client, messageText) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function meActionCommand(command, params, client) {
|
function meActionCommand(command, params, client) {
|
||||||
if(areParamsEmpty(params)) {
|
if (areParamsEmpty(params)) {
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -73,12 +74,12 @@ function meActionCommand(command, params, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function doActionCommand(command, params, client) {
|
function doActionCommand(command, params, client) {
|
||||||
if(isPlayerMuted(client)) {
|
if (isPlayerMuted(client)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "MutedCantChat"));
|
messagePlayerError(client, getLocaleString(client, "MutedCantChat"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(areParamsEmpty(params)) {
|
if (areParamsEmpty(params)) {
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -90,12 +91,12 @@ function doActionCommand(command, params, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function shoutCommand(command, params, client) {
|
function shoutCommand(command, params, client) {
|
||||||
if(isPlayerMuted(client)) {
|
if (isPlayerMuted(client)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "MutedCantChat"));
|
messagePlayerError(client, getLocaleString(client, "MutedCantChat"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(areParamsEmpty(params)) {
|
if (areParamsEmpty(params)) {
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -107,17 +108,17 @@ function shoutCommand(command, params, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function megaphoneChatCommand(command, params, client) {
|
function megaphoneChatCommand(command, params, client) {
|
||||||
if(isPlayerMuted(client)) {
|
if (isPlayerMuted(client)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "MutedCantChat"));
|
messagePlayerError(client, getLocaleString(client, "MutedCantChat"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(areParamsEmpty(params)) {
|
if (areParamsEmpty(params)) {
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!canPlayerUseMegaphone(client)) {
|
if (!canPlayerUseMegaphone(client)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "CantUseMegaphone"));
|
messagePlayerError(client, getLocaleString(client, "CantUseMegaphone"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -129,12 +130,12 @@ function megaphoneChatCommand(command, params, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function talkCommand(command, params, client) {
|
function talkCommand(command, params, client) {
|
||||||
if(isPlayerMuted(client)) {
|
if (isPlayerMuted(client)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "MutedCantChat"));
|
messagePlayerError(client, getLocaleString(client, "MutedCantChat"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(areParamsEmpty(params)) {
|
if (areParamsEmpty(params)) {
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -146,12 +147,12 @@ function talkCommand(command, params, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function whisperCommand(command, params, client) {
|
function whisperCommand(command, params, client) {
|
||||||
if(isPlayerMuted(client)) {
|
if (isPlayerMuted(client)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "MutedCantChat"));
|
messagePlayerError(client, getLocaleString(client, "MutedCantChat"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(areParamsEmpty(params)) {
|
if (areParamsEmpty(params)) {
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -163,28 +164,35 @@ function whisperCommand(command, params, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function adminChatCommand(command, params, client) {
|
function adminChatCommand(command, params, client) {
|
||||||
if(isPlayerMuted(client)) {
|
if (isPlayerMuted(client)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "MutedCantChat"));
|
messagePlayerError(client, getLocaleString(client, "MutedCantChat"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(areParamsEmpty(params)) {
|
if (areParamsEmpty(params)) {
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
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}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function clanChatCommand(command, params, client) {
|
function clanChatCommand(command, params, client) {
|
||||||
if(isPlayerMuted(client)) {
|
if (isPlayerMuted(client)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "MutedCantChat"));
|
messagePlayerError(client, getLocaleString(client, "MutedCantChat"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(areParamsEmpty(params)) {
|
if (areParamsEmpty(params)) {
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -194,24 +202,82 @@ function clanChatCommand(command, params, client) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function privateMessageCommand(command, params, client) {
|
||||||
|
if (isPlayerMuted(client)) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "MutedCantChat"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (areParamsEmpty(params)) {
|
||||||
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
|
let targetClient = getPlayerFromParams(splitParams[0]);
|
||||||
|
let messageText = splitParams.slice(1).join(" ");
|
||||||
|
|
||||||
|
if (!targetClient) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "InvalidPlayer"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
getPlayerData(targetClient).privateMessageReplyTo = client;
|
||||||
|
messagePlayerPrivateMessage(targetClient, client, messageText);
|
||||||
|
|
||||||
|
if (!hasPlayerSeenActionTip(targetClient, "ReplyToDirectMessage")) {
|
||||||
|
messagePlayerTip(targetClient, getGroupedLocaleString(targetClient, "ActionTips", "ReplyToDirectMessage", "{ALTCOLOUR}/reply{MAINCOLOUR}"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function replyToLastPrivateMessageCommand(command, params, client) {
|
||||||
|
if (isPlayerMuted(client)) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "MutedCantChat"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (areParamsEmpty(params)) {
|
||||||
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getPlayerData(client).privateMessageReplyTo == null) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "NoPrivateMessageToReply"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
getPlayerData(targetClient).privateMessageReplyTo = client;
|
||||||
|
messagePlayerPrivateMessage(targetClient, client, messageText);
|
||||||
|
|
||||||
|
markPlayerActionTipSeen(client, "ReplyToDirectMessage");
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
function talkToNearbyPlayers(client, messageText) {
|
function talkToNearbyPlayers(client, messageText) {
|
||||||
let clients = getClients();
|
let clients = getClients();
|
||||||
for(let i in clients) {
|
for (let i in clients) {
|
||||||
if(isPlayerSpawned(clients[i])) {
|
if (isPlayerSpawned(clients[i])) {
|
||||||
if(hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || (getDistance(getPlayerPosition(client), getPlayerPosition(clients[i])) <= getGlobalConfig().talkDistance && getPlayerDimension(client) == getPlayerDimension(clients[i]))) {
|
if (hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || (getDistance(getPlayerPosition(client), getPlayerPosition(clients[i])) <= getGlobalConfig().talkDistance && getPlayerDimension(client) == getPlayerDimension(clients[i]))) {
|
||||||
messagePlayerTalk(clients[i], client, messageText);
|
messagePlayerTalk(clients[i], client, messageText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getGlobalConfig().discord.sendLocalChat) {
|
||||||
|
messageDiscordChatChannel(`🗣️ ${getPlayerAccentInlineOutput(talkingClient)}${getClientSubAccountName(talkingClient)} says: ${messageText}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function phoneOutgoingToNearbyPlayers(client, messageText) {
|
function phoneOutgoingToNearbyPlayers(client, messageText) {
|
||||||
let clients = getClients();
|
let clients = getClients();
|
||||||
for(let i in clients) {
|
for (let i in clients) {
|
||||||
if(isPlayerSpawned(clients[i])) {
|
if (isPlayerSpawned(clients[i])) {
|
||||||
if(hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || (getDistance(getPlayerPosition(client), getPlayerPosition(clients[i])) <= getGlobalConfig().talkDistance && getPlayerDimension(client) == getPlayerDimension(clients[i]))) {
|
if (hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || (getDistance(getPlayerPosition(client), getPlayerPosition(clients[i])) <= getGlobalConfig().talkDistance && getPlayerDimension(client) == getPlayerDimension(clients[i]))) {
|
||||||
messagePlayerNormal(`[#CCCCCC]${getCharacterFullName(client)} {ALTCOLOUR}(to phone): {MAINCOLOUR}${messageText}`);
|
messagePlayerNormal(`[#CCCCCC]${getCharacterFullName(client)} {ALTCOLOUR}(to phone): {MAINCOLOUR}${messageText}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -222,9 +288,9 @@ function phoneOutgoingToNearbyPlayers(client, messageText) {
|
|||||||
|
|
||||||
function phoneIncomingToNearbyPlayers(client, messageText) {
|
function phoneIncomingToNearbyPlayers(client, messageText) {
|
||||||
let clients = getClients();
|
let clients = getClients();
|
||||||
for(let i in clients) {
|
for (let i in clients) {
|
||||||
if(isPlayerSpawned(clients[i])) {
|
if (isPlayerSpawned(clients[i])) {
|
||||||
if(hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || (getDistance(getPlayerPosition(client), getPlayerPosition(clients[i])) <= getGlobalConfig().phoneSpeakerDistance && getPlayerDimension(client) == getPlayerDimension(clients[i]))) {
|
if (hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || (getDistance(getPlayerPosition(client), getPlayerPosition(clients[i])) <= getGlobalConfig().phoneSpeakerDistance && getPlayerDimension(client) == getPlayerDimension(clients[i]))) {
|
||||||
messagePlayerNormal(`[#CCCCCC]${getCharacterFullName(client)} {ALTCOLOUR}(from phone): {MAINCOLOUR}${messageText}`);
|
messagePlayerNormal(`[#CCCCCC]${getCharacterFullName(client)} {ALTCOLOUR}(from phone): {MAINCOLOUR}${messageText}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -235,91 +301,115 @@ function phoneIncomingToNearbyPlayers(client, messageText) {
|
|||||||
|
|
||||||
function whisperToNearbyPlayers(client, messageText) {
|
function whisperToNearbyPlayers(client, messageText) {
|
||||||
let clients = getClients();
|
let clients = getClients();
|
||||||
for(let i in clients) {
|
for (let i in clients) {
|
||||||
if(isPlayerSpawned(clients[i])) {
|
if (isPlayerSpawned(clients[i])) {
|
||||||
if(hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || (getDistance(getPlayerPosition(client), getPlayerPosition(clients[i])) <= getGlobalConfig().whisperDistance && getPlayerDimension(client) == getPlayerDimension(clients[i]))) {
|
if (hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || (getDistance(getPlayerPosition(client), getPlayerPosition(clients[i])) <= getGlobalConfig().whisperDistance && getPlayerDimension(client) == getPlayerDimension(clients[i]))) {
|
||||||
messagePlayerWhisper(clients[i], client, messageText);
|
messagePlayerWhisper(clients[i], client, messageText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getGlobalConfig().discord.sendLocalChat) {
|
||||||
|
messageDiscordChatChannel(`🤫 ${getPlayerAccentInlineOutput(whisperingClient)}${getClientSubAccountName(whisperingClient)} whispers: ${messageText}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function shoutToNearbyPlayers(client, messageText) {
|
function shoutToNearbyPlayers(client, messageText) {
|
||||||
let clients = getClients();
|
let clients = getClients();
|
||||||
for(let i in clients) {
|
for (let i in clients) {
|
||||||
if(isPlayerSpawned(clients[i])) {
|
if (isPlayerSpawned(clients[i])) {
|
||||||
if(hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || (getDistance(getPlayerPosition(client), getPlayerPosition(clients[i])) <= getGlobalConfig().shoutDistance && getPlayerDimension(client) == getPlayerDimension(clients[i]))) {
|
if (hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || (getDistance(getPlayerPosition(client), getPlayerPosition(clients[i])) <= getGlobalConfig().shoutDistance && getPlayerDimension(client) == getPlayerDimension(clients[i]))) {
|
||||||
messagePlayerShout(clients[i], client, messageText);
|
messagePlayerShout(clients[i], client, messageText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getGlobalConfig().discord.sendLocalChat) {
|
||||||
|
messageDiscordChatChannel(`🗣️ ${getPlayerAccentInlineOutput(shoutingClient)}${getClientSubAccountName(shoutingClient)} shouts: ${messageText}!`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function megaPhoneToNearbyPlayers(client, messageText) {
|
function megaPhoneToNearbyPlayers(client, messageText) {
|
||||||
let clients = getClients();
|
let clients = getClients();
|
||||||
for(let i in clients) {
|
for (let i in clients) {
|
||||||
if(isPlayerSpawned(clients[i])) {
|
if (isPlayerSpawned(clients[i])) {
|
||||||
if(hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || (getDistance(getPlayerPosition(client), getPlayerPosition(clients[i])) <= getGlobalConfig().megaphoneDistance && getPlayerDimension(client) == getPlayerDimension(clients[i]))) {
|
if (hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || (getDistance(getPlayerPosition(client), getPlayerPosition(clients[i])) <= getGlobalConfig().megaphoneDistance && getPlayerDimension(client) == getPlayerDimension(clients[i]))) {
|
||||||
messagePlayerMegaPhone(clients[i], client, messageText);
|
messagePlayerMegaPhone(clients[i], client, messageText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getGlobalConfig().discord.sendLocalChat) {
|
||||||
|
messageDiscordChatChannel(`📢 ${getPlayerAccentInlineOutput(shoutingClient)}${getClientSubAccountName(shoutingClient)} (megaphone): ${messageText}!`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function doActionToNearbyPlayers(client, messageText) {
|
function doActionToNearbyPlayers(client, messageText) {
|
||||||
let clients = getClients();
|
let clients = getClients();
|
||||||
for(let i in clients) {
|
for (let i in clients) {
|
||||||
if(isPlayerSpawned(clients[i])) {
|
if (isPlayerSpawned(clients[i])) {
|
||||||
if(hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || (getDistance(getPlayerPosition(client), getPlayerPosition(clients[i])) <= getGlobalConfig().doActionDistance && getPlayerDimension(client) == getPlayerDimension(clients[i]))) {
|
if (hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || (getDistance(getPlayerPosition(client), getPlayerPosition(clients[i])) <= getGlobalConfig().doActionDistance && getPlayerDimension(client) == getPlayerDimension(clients[i]))) {
|
||||||
messagePlayerDoAction(clients[i], client, messageText);
|
messagePlayerDoAction(clients[i], client, messageText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getGlobalConfig().discord.sendAction) {
|
||||||
|
messageDiscordChatChannel(`🙋 *${messageText} (${getCharacterFullName(client)})*`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function meActionToNearbyPlayers(client, messageText) {
|
function meActionToNearbyPlayers(client, messageText) {
|
||||||
let clients = getClients();
|
let clients = getClients();
|
||||||
for(let i in clients) {
|
for (let i in clients) {
|
||||||
if(isPlayerSpawned(clients[i])) {
|
if (isPlayerSpawned(clients[i])) {
|
||||||
if(hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || (getDistance(getPlayerPosition(client), getPlayerPosition(clients[i])) <= getGlobalConfig().meActionDistance && getPlayerDimension(client) == getPlayerDimension(clients[i]))) {
|
if (hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || (getDistance(getPlayerPosition(client), getPlayerPosition(clients[i])) <= getGlobalConfig().meActionDistance && getPlayerDimension(client) == getPlayerDimension(clients[i]))) {
|
||||||
messagePlayerMeAction(clients[i], client, messageText);
|
messagePlayerMeAction(clients[i], client, messageText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getGlobalConfig().discord.sendAction) {
|
||||||
|
messageDiscordChatChannel(`🙋 *${getCharacterFullName(client)} ${messageText}*`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function clanChat(client, messageText) {
|
function clanChat(client, messageText) {
|
||||||
let clients = getClients();
|
let clients = getClients();
|
||||||
for(let i in clients) {
|
for (let i in clients) {
|
||||||
if(isPlayerSpawned(clients[i])) {
|
if (isPlayerSpawned(clients[i])) {
|
||||||
if(hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || arePlayersInSameClan(client, clients[i])) {
|
if (hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || arePlayersInSameClan(client, clients[i])) {
|
||||||
messagePlayerClanChat(clients[i], client, messageText);
|
messagePlayerClanChat(clients[i], client, messageText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if (getGlobalConfig().discord.sendClan) {
|
||||||
|
// messageDiscordClanWebhook(getPlayerClan(client), getClanDiscordWebhookFlagValue("ClanChat"), fullString);
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function canPlayerUseMegaphone(client) {
|
function canPlayerUseMegaphone(client) {
|
||||||
if(getPlayerFirstItemSlotByUseType(client, VRR_ITEM_USETYPE_MEGAPHONE) != -1) {
|
if (getPlayerFirstItemSlotByUseType(client, AGRP_ITEM_USE_TYPE_MEGAPHONE) != -1) {
|
||||||
if(isPlayerActiveItemEnabled(client)) {
|
if (isPlayerActiveItemEnabled(client)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getPlayerVehicle(client)) {
|
if (getPlayerVehicle(client)) {
|
||||||
if(doesVehicleHaveMegaphone(getPlayerVehicle(client))) {
|
if (doesVehicleHaveMegaphone(getPlayerVehicle(client))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: command.js
|
// FILE: command.js
|
||||||
// DESC: Provides command data, functions and usage
|
// DESC: Provides command data, functions and usage
|
||||||
@@ -43,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!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -69,8 +70,20 @@ function loadCommands() {
|
|||||||
new CommandData("notips", toggleNoRandomTipsCommand, "", getStaffFlagValue("None"), true, false, "Turn on and off random tips"),
|
new CommandData("notips", toggleNoRandomTipsCommand, "", getStaffFlagValue("None"), true, false, "Turn on and off random tips"),
|
||||||
new CommandData("loginalert", toggleAccountLoginAttemptNotificationsCommand, "", getStaffFlagValue("None"), true, false, "Turn on and off email notifications for attempts to login to your account"),
|
new CommandData("loginalert", toggleAccountLoginAttemptNotificationsCommand, "", getStaffFlagValue("None"), true, false, "Turn on and off email notifications for attempts to login to your account"),
|
||||||
new CommandData("scrolllines", setAccountChatScrollLinesCommand, "<number of lines>", getStaffFlagValue("None"), true, false, "Sets how many chatbox lines to scroll at a time when using pageup/pagedown"),
|
new CommandData("scrolllines", setAccountChatScrollLinesCommand, "<number of lines>", getStaffFlagValue("None"), true, false, "Sets how many chatbox lines to scroll at a time when using pageup/pagedown"),
|
||||||
|
new CommandData("chatscrolllines", setAccountChatScrollLinesCommand, "<number of lines>", getStaffFlagValue("None"), true, false, "Sets how many chatbox lines to scroll at a time when using pageup/pagedown"),
|
||||||
|
new CommandData("chatscroll", setAccountChatScrollLinesCommand, "<number of lines>", getStaffFlagValue("None"), true, false, "Sets how many chatbox lines to scroll at a time when using pageup/pagedown"),
|
||||||
new CommandData("chatautohide", setAccountChatAutoHideDelayCommand, "<time in seconds>", getStaffFlagValue("None"), true, false, "Sets how long to wait to hide the chatbox after last use (in seconds)"),
|
new CommandData("chatautohide", setAccountChatAutoHideDelayCommand, "<time in seconds>", getStaffFlagValue("None"), true, false, "Sets how long to wait to hide the chatbox after last use (in seconds)"),
|
||||||
|
new CommandData("chattimestamp", 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("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("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("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"),
|
||||||
],
|
],
|
||||||
ammunation: [],
|
ammunation: [],
|
||||||
animation: [
|
animation: [
|
||||||
@@ -127,14 +140,15 @@ 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"),
|
||||||
new CommandData("bizdefaultitems", giveDefaultItemsToBusinessCommand, "<item template>", getStaffFlagValue("ManageItems"), true, true, "Gives the business the default items based on template name"),
|
new CommandData("bizdefaultitems", giveDefaultItemsToBusinessCommand, "<item template>", getStaffFlagValue("ManageItems"), true, true, "Gives the business the default items based on template name"),
|
||||||
new CommandData("bizdelflooritems", deleteBusinessFloorItemsCommand, "", getStaffFlagValue("ManageItems"), true, true, "Destroys all items on the business floor (for-sale items)"),
|
new CommandData("bizdelflooritems", deleteBusinessFloorItemsCommand, "", getStaffFlagValue("ManageItems"), true, true, "Destroys all items on the business floor (for-sale items)"),
|
||||||
new CommandData("bizdelstorageitems", deleteBusinessStorageItemsCommand, "", getStaffFlagValue("ManageItems"), true, true, "Destroys all items in the business's storage"),
|
new CommandData("bizdelstorageitems", deleteBusinessStorageItemsCommand, "", getStaffFlagValue("ManageItems"), true, true, "Destroys all items in the business's storage"),
|
||||||
new CommandData("bizdealership", setBusinessEntranceLabelToDealershipCommand, "", getStaffFlagValue("ManageBusinesses"), true, true, "Sets the business's door label to vehicle dealership"),
|
new CommandData("bizdealership", setBusinessDealershipCommand, "", getStaffFlagValue("None"), true, true, "Sets the business's door label to vehicle dealership"),
|
||||||
|
//new CommandData("bizpaintball", setBusinessPaintBallCommand, "", getStaffFlagValue("None"), true, true, "Sets the business to a paintball arena"),
|
||||||
],
|
],
|
||||||
chat: [
|
chat: [
|
||||||
new CommandData("me", meActionCommand, "<message>", getStaffFlagValue("None"), true, false, "Shows a custom action message in chat"),
|
new CommandData("me", meActionCommand, "<message>", getStaffFlagValue("None"), true, false, "Shows a custom action message in chat"),
|
||||||
@@ -149,10 +163,11 @@ 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("dm", privateMessageCommand, "<player name/id> <message>", getStaffFlagValue("None"), true, true, "Sends a private message to a player"),
|
||||||
|
new CommandData("msg", privateMessageCommand, "<player name/id> <message>", getStaffFlagValue("None"), true, true, "Sends a private message to a player"),
|
||||||
|
new CommandData("reply", replyToLastPrivateMessageCommand, "<message>", getStaffFlagValue("None"), true, true, "Replies to the last private message you received"),
|
||||||
],
|
],
|
||||||
clan: [
|
clan: [
|
||||||
new CommandData("clans", listClansCommand, "[search text]", getStaffFlagValue("None"), true, true, "List clans (search by partial name, if provided)"),
|
new CommandData("clans", listClansCommand, "[search text]", getStaffFlagValue("None"), true, true, "List clans (search by partial name, if provided)"),
|
||||||
@@ -250,6 +265,8 @@ function loadCommands() {
|
|||||||
email: [
|
email: [
|
||||||
new CommandData("testemail", testEmailCommand, "<email address>", getStaffFlagValue("Developer"), true, true),
|
new CommandData("testemail", testEmailCommand, "<email address>", getStaffFlagValue("Developer"), true, true),
|
||||||
],
|
],
|
||||||
|
fishing: [],
|
||||||
|
forensics: [],
|
||||||
gate: [
|
gate: [
|
||||||
new CommandData("gate", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"),
|
new CommandData("gate", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"),
|
||||||
new CommandData("opengate", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"),
|
new CommandData("opengate", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"),
|
||||||
@@ -258,8 +275,8 @@ function loadCommands() {
|
|||||||
new CommandData("bizgate", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"),
|
new CommandData("bizgate", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"),
|
||||||
new CommandData("businessgate", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"),
|
new CommandData("businessgate", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"),
|
||||||
new CommandData("door", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"),
|
new CommandData("door", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"),
|
||||||
new CommandData("opengate", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"),
|
//new CommandData("opengate", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"),
|
||||||
new CommandData("closegate", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"),
|
//new CommandData("closegate", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"),
|
||||||
new CommandData("opendoor", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"),
|
new CommandData("opendoor", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"),
|
||||||
new CommandData("closedoor", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"),
|
new CommandData("closedoor", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"),
|
||||||
new CommandData("garagedoor", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"),
|
new CommandData("garagedoor", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"),
|
||||||
@@ -302,6 +319,7 @@ function loadCommands() {
|
|||||||
new CommandData("houseexit", moveHouseExitCommand, "", getStaffFlagValue("ManageHouses"), true, true, "Moves a house's exit (inside/interior location to exit the house)"),
|
new CommandData("houseexit", moveHouseExitCommand, "", getStaffFlagValue("ManageHouses"), true, true, "Moves a house's exit (inside/interior location to exit the house)"),
|
||||||
new CommandData("houseinttype", setHouseInteriorTypeCommand, "<interior template name/business id>", getStaffFlagValue("ManageHouses"), true, true, "Sets a house's interior to a pre-defined type"),
|
new CommandData("houseinttype", setHouseInteriorTypeCommand, "<interior template name/business id>", getStaffFlagValue("ManageHouses"), true, true, "Sets a house's interior to a pre-defined type"),
|
||||||
],
|
],
|
||||||
|
insurance: [],
|
||||||
item: [
|
item: [
|
||||||
new CommandData("i", playerSwitchHotBarSlotCommand, "<slot id>", getStaffFlagValue("None"), true, false, "Switches to the item in the specified slot of your inventory."),
|
new CommandData("i", playerSwitchHotBarSlotCommand, "<slot id>", getStaffFlagValue("None"), true, false, "Switches to the item in the specified slot of your inventory."),
|
||||||
new CommandData("item", playerSwitchHotBarSlotCommand, "<slot id>", getStaffFlagValue("None"), true, false, "Switches to the item in the specified slot of your inventory."),
|
new CommandData("item", playerSwitchHotBarSlotCommand, "<slot id>", getStaffFlagValue("None"), true, false, "Switches to the item in the specified slot of your inventory."),
|
||||||
@@ -334,9 +352,18 @@ function loadCommands() {
|
|||||||
new CommandData("additemtype", createItemTypeCommand, "<name>", getStaffFlagValue("ManageItems"), true, false, "Adds a new item type"),
|
new CommandData("additemtype", createItemTypeCommand, "<name>", getStaffFlagValue("ManageItems"), true, false, "Adds a new item type"),
|
||||||
new CommandData("itemtypeusetype", setItemTypeUseTypeCommand, "<item type> <use type>", getStaffFlagValue("ManageItems"), true, false, "Sets an item type's use-type (what kind of action is performed when using it)"),
|
new CommandData("itemtypeusetype", setItemTypeUseTypeCommand, "<item type> <use type>", getStaffFlagValue("ManageItems"), true, false, "Sets an item type's use-type (what kind of action is performed when using it)"),
|
||||||
new CommandData("itemtypeuseval", setItemTypeUseValueCommand, "<item type> <use value>", getStaffFlagValue("ManageItems"), true, false, "Sets an item type's use-value (how much gets subtracted when using it)"),
|
new CommandData("itemtypeuseval", setItemTypeUseValueCommand, "<item type> <use value>", getStaffFlagValue("ManageItems"), true, false, "Sets an item type's use-value (how much gets subtracted when using it)"),
|
||||||
new CommandData("itemtypeorderprice", setItemTypeOrderPriceCommand, "<item type> <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("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("itemtypedropfrontdistance", setItemTypeDropFrontDistanceCommand, "<item type> <distance>", getStaffFlagValue("ManageItems"), true, false, "Sets how far in front of a player an item type will be dropped"),
|
||||||
|
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("itemtypesize", setItemTypeSizeCommand, "<item type> <order value>", getStaffFlagValue("ManageItems"), true, false, "Sets the item type's size"),
|
||||||
|
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"),
|
||||||
@@ -390,11 +417,14 @@ function loadCommands() {
|
|||||||
new CommandData("jobroutepay", setJobRoutePayCommand, "<amount>", getStaffFlagValue("ManageJobs"), true, false),
|
new CommandData("jobroutepay", setJobRoutePayCommand, "<amount>", getStaffFlagValue("ManageJobs"), true, false),
|
||||||
new CommandData("jobroutestartmsg", setJobRouteStartMessageCommand, "<new message>", getStaffFlagValue("ManageJobs"), true, false),
|
new CommandData("jobroutestartmsg", setJobRouteStartMessageCommand, "<new message>", getStaffFlagValue("ManageJobs"), true, false),
|
||||||
new CommandData("jobroutefinishmsg", setJobRouteFinishMessageCommand, "<new message>", getStaffFlagValue("ManageJobs"), true, false),
|
new CommandData("jobroutefinishmsg", setJobRouteFinishMessageCommand, "<new message>", getStaffFlagValue("ManageJobs"), true, false),
|
||||||
new CommandData("jobroutelocarrivemsg", setJobRouteLocationArriveMessageCommand, "<new message>", getStaffFlagValue("ManageJobs"), true, false),
|
new CommandData("jobroutearrivemsg", setJobRouteDefaultLocationArriveMessageCommand, "<new message>", getStaffFlagValue("ManageJobs"), true, false),
|
||||||
new CommandData("jobroutelocnextmsg", setJobRouteLocationNextMessageCommand, "<new message>", getStaffFlagValue("ManageJobs"), true, false),
|
new CommandData("jobroutenextmsg", setJobRouteDefaultLocationNextMessageCommand, "<new message>", getStaffFlagValue("ManageJobs"), true, false),
|
||||||
|
new CommandData("jobroutelocarrivemsg", setJobRouteNextLocationArriveMessageCommand, "<new message>", getStaffFlagValue("ManageJobs"), true, false),
|
||||||
|
new CommandData("jobroutelocnextmsg", setJobRouteNextLocationGotoMessageCommand, "<new message>", getStaffFlagValue("ManageJobs"), true, false),
|
||||||
new CommandData("jobrouteenabled", toggleJobRouteEnabledCommand, "", getStaffFlagValue("ManageJobs"), true, false),
|
new CommandData("jobrouteenabled", toggleJobRouteEnabledCommand, "", getStaffFlagValue("ManageJobs"), true, false),
|
||||||
new CommandData("jobroutevehcolours", setJobRouteVehicleColoursCommand, "<colour 1> <colour 2>", getStaffFlagValue("ManageJobs"), true, false),
|
new CommandData("jobroutevehcolours", setJobRouteVehicleColoursCommand, "<colour 1> <colour 2>", getStaffFlagValue("ManageJobs"), true, false),
|
||||||
new CommandData("jobroutedelays", setJobRouteAllLocationDelaysCommand, "<time in milliseconds>", getStaffFlagValue("ManageJobs"), true, false),
|
new CommandData("jobroutedelays", setJobRouteAllLocationDelaysCommand, "<time in milliseconds>", getStaffFlagValue("ManageJobs"), true, false),
|
||||||
|
new CommandData("jobroutelocdelay", setJobRouteNextLocationDelayCommand, "<time in milliseconds>", getStaffFlagValue("ManageJobs"), true, false),
|
||||||
new CommandData("jobcolour", setJobColourCommand, "<job id/name> <red> <green> <blue>", getStaffFlagValue("ManageJobs"), true, false),
|
new CommandData("jobcolour", setJobColourCommand, "<job id/name> <red> <green> <blue>", getStaffFlagValue("ManageJobs"), true, false),
|
||||||
new CommandData("jobblip", setJobBlipCommand, "<job id/name> <blip id/name>", getStaffFlagValue("ManageJobs"), true, false),
|
new CommandData("jobblip", setJobBlipCommand, "<job id/name> <blip id/name>", getStaffFlagValue("ManageJobs"), true, false),
|
||||||
new CommandData("jobpickup", setJobPickupCommand, "<job id/name> <pickup id/name>", getStaffFlagValue("ManageJobs"), true, false),
|
new CommandData("jobpickup", setJobPickupCommand, "<job id/name> <pickup id/name>", getStaffFlagValue("ManageJobs"), true, false),
|
||||||
@@ -432,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"),
|
||||||
@@ -441,7 +472,13 @@ function loadCommands() {
|
|||||||
new CommandData("gps", gpsCommand, "[item or place name]", getStaffFlagValue("None"), true, false, "Shows you locations for special places or where to buy items"),
|
new CommandData("gps", gpsCommand, "[item or place name]", getStaffFlagValue("None"), true, false, "Shows you locations for special places or where to buy items"),
|
||||||
new CommandData("speak", playerPedSpeakCommand, "<speech name>", getStaffFlagValue("None"), true, false, "Makes your ped say something in their game voice (IV only)"),
|
new CommandData("speak", playerPedSpeakCommand, "<speech name>", getStaffFlagValue("None"), true, false, "Makes your ped say something in their game voice (IV only)"),
|
||||||
new CommandData("lock", lockCommand, "", getStaffFlagValue("None"), true, false, "Locks and unlocks your vehicle, house, or business"),
|
new CommandData("lock", lockCommand, "", getStaffFlagValue("None"), true, false, "Locks and unlocks your vehicle, house, or business"),
|
||||||
|
new CommandData("locks", lockCommand, "", getStaffFlagValue("None"), true, false, "Locks and unlocks your vehicle, house, or business"),
|
||||||
|
new CommandData("doorlock", lockCommand, "", getStaffFlagValue("None"), true, false, "Locks and unlocks your vehicle, house, or business"),
|
||||||
|
new CommandData("lockdoor", lockCommand, "", getStaffFlagValue("None"), true, false, "Locks and unlocks your vehicle, house, or business"),
|
||||||
new CommandData("lights", lightsCommand, "", getStaffFlagValue("None"), true, false, "Turns on and off the lights for your vehicle, house, or business"),
|
new CommandData("lights", lightsCommand, "", getStaffFlagValue("None"), true, false, "Turns on and off the lights for your vehicle, house, or business"),
|
||||||
|
new CommandData("light", lightsCommand, "", getStaffFlagValue("None"), true, false, "Turns on and off the lights for your vehicle, house, or business"),
|
||||||
|
new CommandData("kill", suicideCommand, "", getStaffFlagValue("None"), true, false, "Kills yourself"),
|
||||||
|
new CommandData("suicide", suicideCommand, "", getStaffFlagValue("None"), true, false, "Kills yourself"),
|
||||||
],
|
],
|
||||||
npc: [
|
npc: [
|
||||||
new CommandData("addnpc", createNPCCommand, "<skin id/name>", getStaffFlagValue("ManageNPCs"), true, false, "Creates an NPC with the specified skin"),
|
new CommandData("addnpc", createNPCCommand, "<skin id/name>", getStaffFlagValue("ManageNPCs"), true, false, "Creates an NPC with the specified skin"),
|
||||||
@@ -453,6 +490,7 @@ function loadCommands() {
|
|||||||
//new CommandData("npcrespawnall", respawnAllNPCsCommand, "", getStaffFlagValue("ManageNPCs"), true, false, "Respawns all NPCs"),
|
//new CommandData("npcrespawnall", respawnAllNPCsCommand, "", getStaffFlagValue("ManageNPCs"), true, false, "Respawns all NPCs"),
|
||||||
//new CommandData("npcrespawn", respawnNPCCommand, "", getStaffFlagValue("ManageNPCs"), true, false, "Respawns the nearest NPC"),
|
//new CommandData("npcrespawn", respawnNPCCommand, "", getStaffFlagValue("ManageNPCs"), true, false, "Respawns the nearest NPC"),
|
||||||
],
|
],
|
||||||
|
paintball: [],
|
||||||
race: [
|
race: [
|
||||||
// Unfinished!
|
// Unfinished!
|
||||||
//new CommandData("addrace", createRaceCommand, "<name>", getStaffFlagValue("ManageRaces"), true, false, "Creates a race"),
|
//new CommandData("addrace", createRaceCommand, "<name>", getStaffFlagValue("ManageRaces"), true, false, "Creates a race"),
|
||||||
@@ -462,18 +500,25 @@ function loadCommands() {
|
|||||||
//new CommandData("delracestart", deleteRaceStartPositionCommand, "", getStaffFlagValue("ManageRaces"), true, false, "Deletes the closest starting position for a race"),
|
//new CommandData("delracestart", deleteRaceStartPositionCommand, "", getStaffFlagValue("ManageRaces"), true, false, "Deletes the closest starting position for a race"),
|
||||||
//new CommandData("delracecp", deleteRaceCheckPointCommand, "", getStaffFlagValue("ManageRaces"), true, false, "Deletes the closest race checkpoint"),
|
//new CommandData("delracecp", deleteRaceCheckPointCommand, "", getStaffFlagValue("ManageRaces"), true, false, "Deletes the closest race checkpoint"),
|
||||||
//new CommandData("racename", setRaceNameCommand, "<name>", getStaffFlagValue("ManageRaces"), true, false, "Sets a race's name"),
|
//new CommandData("racename", setRaceNameCommand, "<name>", getStaffFlagValue("ManageRaces"), true, false, "Sets a race's name"),
|
||||||
|
//new CommandData("racestart", startRaceCommand, "", getStaffFlagValue("None"), true, false, "Starts a race"),
|
||||||
//new CommandData("startrace", startRaceCommand, "", getStaffFlagValue("None"), true, false, "Starts a race"),
|
//new CommandData("startrace", startRaceCommand, "", getStaffFlagValue("None"), true, false, "Starts a race"),
|
||||||
|
//new CommandData("racestop", stopRaceCommand, "", getStaffFlagValue("None"), true, false, "Stops racing (forfeits if in an active race)"),
|
||||||
//new CommandData("stoprace", stopRaceCommand, "", getStaffFlagValue("None"), true, false, "Stops racing (forfeits if in an active race)"),
|
//new CommandData("stoprace", stopRaceCommand, "", getStaffFlagValue("None"), true, false, "Stops racing (forfeits if in an active race)"),
|
||||||
//new CommandData("stopAllRacesCommand", stopAllRacesCommand, "", getStaffFlagValue("ManageRaces"), true, false, "Stops a race"),
|
//new CommandData("racestopall", stopAllRacesCommand, "", getStaffFlagValue("ManageRaces"), true, false, "Stops all active races"),
|
||||||
|
//new CommandData("stopallraces", stopAllRacesCommand, "", getStaffFlagValue("ManageRaces"), true, false, "Stops all active races"),
|
||||||
],
|
],
|
||||||
radio: [
|
radio: [
|
||||||
new CommandData("radiostation", playStreamingRadioCommand, "<radio station id>", getStaffFlagValue("None"), true, false, "Plays a radio station in your vehicle, house, or business (depending on which one you're in)"),
|
new CommandData("radiostation", playStreamingRadioCommand, "<radio station id>", getStaffFlagValue("None"), true, false, "Plays a radio station in your vehicle, house, or business (depending on which one you're in)"),
|
||||||
new CommandData("radiostations", showRadioStationListCommand, "", getStaffFlagValue("None"), true, false, "Shows a list of all available radio stations"),
|
new CommandData("radiostations", showRadioStationListCommand, "", getStaffFlagValue("None"), true, false, "Shows a list of all available radio stations"),
|
||||||
new CommandData("radiovolume", setStreamingRadioVolumeCommand, "<volume level>", getStaffFlagValue("None"), true, false, "Sets the radio streaming volume (for your game only)."),
|
new CommandData("radiovolume", setStreamingRadioVolumeCommand, "<volume level 0-100>", getStaffFlagValue("None"), true, false, "Sets the radio streaming volume (for your game only)."),
|
||||||
|
new CommandData("radiovol", setStreamingRadioVolumeCommand, "<volume level 0-100>", getStaffFlagValue("None"), true, false, "Sets the radio streaming volume (for your game only)."),
|
||||||
new CommandData("radioreloadall", reloadAllRadioStationsCommand, "", getStaffFlagValue("ManageServer"), true, false, "Reloads all radio stations from database (use after making changes)"),
|
new CommandData("radioreloadall", reloadAllRadioStationsCommand, "", getStaffFlagValue("ManageServer"), true, false, "Reloads all radio stations from database (use after making changes)"),
|
||||||
],
|
],
|
||||||
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."),
|
||||||
@@ -503,18 +548,25 @@ function loadCommands() {
|
|||||||
new CommandData("int", playerInteriorCommand, "<player name/id> [interior id]", getStaffFlagValue("BasicModeration"), true, true, "Gets or sets a player's game interior."),
|
new CommandData("int", playerInteriorCommand, "<player name/id> [interior id]", getStaffFlagValue("BasicModeration"), true, true, "Gets or sets a player's game interior."),
|
||||||
new CommandData("vw", playerVirtualWorldCommand, "<player name/id> [virtual world id]", getStaffFlagValue("BasicModeration"), true, true, "Gets or sets a player's virtual world/dimension."),
|
new CommandData("vw", playerVirtualWorldCommand, "<player name/id> [virtual world id]", getStaffFlagValue("BasicModeration"), true, true, "Gets or sets a player's virtual world/dimension."),
|
||||||
new CommandData("addplrstaffflag", addPlayerStaffFlagCommand, "<player name/id> <flag name>", getStaffFlagValue("ManageAdmins"), true, true, "Gives a player a staff flag by name (this server only)."),
|
new CommandData("addplrstaffflag", addPlayerStaffFlagCommand, "<player name/id> <flag name>", getStaffFlagValue("ManageAdmins"), true, true, "Gives a player a staff flag by name (this server only)."),
|
||||||
|
new CommandData("addplayerstaffflag", addPlayerStaffFlagCommand, "<player name/id> <flag name>", getStaffFlagValue("ManageAdmins"), true, true, "Gives a player a staff flag by name (this server only)."),
|
||||||
|
new CommandData("addstaffflag", addPlayerStaffFlagCommand, "<player name/id> <flag name>", getStaffFlagValue("ManageAdmins"), true, true, "Gives a player a staff flag by name (this server only)."),
|
||||||
new CommandData("delplrstaffflag", removePlayerStaffFlagCommand, "<player name/id> <flag name>", getStaffFlagValue("ManageAdmins"), true, true, "Takes a player's staff flag by name (this server only)."),
|
new CommandData("delplrstaffflag", removePlayerStaffFlagCommand, "<player name/id> <flag name>", getStaffFlagValue("ManageAdmins"), true, true, "Takes a player's staff flag by name (this server only)."),
|
||||||
new CommandData("plrstaffflags", getPlayerStaffFlagsCommand, "<player name/id>", getStaffFlagValue("ManageAdmins"), true, true, "Shows a list of all staff flags a player has (this server only)."),
|
new CommandData("delstaffflag", removePlayerStaffFlagCommand, "<player name/id> <flag name>", getStaffFlagValue("ManageAdmins"), true, true, "Takes a player's staff flag by name (this server only)."),
|
||||||
new CommandData("clearstaffflags", removePlayerStaffFlagsCommand, "<player name/id>", getStaffFlagValue("ManageAdmins"), true, true, "Removes all staff flags for a player (this server only)."),
|
new CommandData("getplrstaffflags", getPlayerStaffFlagsCommand, "<player name/id>", getStaffFlagValue("ManageAdmins"), true, true, "Shows a list of all staff flags a player has (this server only)."),
|
||||||
|
new CommandData("delplrstaffflags", removePlayerStaffFlagsCommand, "<player name/id>", getStaffFlagValue("ManageAdmins"), true, true, "Removes all staff flags for a player (this server only)."),
|
||||||
|
new CommandData("delstaffflags", removePlayerStaffFlagsCommand, "<player name/id>", getStaffFlagValue("ManageAdmins"), true, true, "Removes all staff flags for a player (this server only)."),
|
||||||
new CommandData("allstaffflags", getStaffFlagsCommand, "", getStaffFlagValue("ManageAdmins"), true, true, "Shows a list of all valid staff flag names."),
|
new CommandData("allstaffflags", getStaffFlagsCommand, "", getStaffFlagValue("ManageAdmins"), true, true, "Shows a list of all valid staff flag names."),
|
||||||
|
new CommandData("staffflags", getStaffFlagsCommand, "", getStaffFlagValue("ManageAdmins"), true, true, "Shows a list of all valid staff flag names."),
|
||||||
new CommandData("plrstafftitle", setPlayerStaffTitleCommand, "", getStaffFlagValue("ManageAdmins"), true, true, "Sets a player's staff title."),
|
new CommandData("plrstafftitle", setPlayerStaffTitleCommand, "", getStaffFlagValue("ManageAdmins"), true, true, "Sets a player's staff title."),
|
||||||
|
new CommandData("playerstafftitle", setPlayerStaffTitleCommand, "", getStaffFlagValue("ManageAdmins"), true, true, "Sets a player's staff title."),
|
||||||
|
new CommandData("stafftitle", setPlayerStaffTitleCommand, "", getStaffFlagValue("ManageAdmins"), true, true, "Sets a player's staff title."),
|
||||||
new CommandData("givemoney", givePlayerMoneyCommand, "<player name/id> <amount>", getStaffFlagValue("serverManager"), true, true),
|
new CommandData("givemoney", givePlayerMoneyCommand, "<player name/id> <amount>", getStaffFlagValue("serverManager"), true, true),
|
||||||
new CommandData("nonrpname", forceCharacterNameChangeCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Forces a player to change their current character's name."),
|
new CommandData("nonrpname", forceCharacterNameChangeCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Forces a player to change their current character's name."),
|
||||||
new CommandData("setname", setCharacterNameCommand, "<player name/id> <first name> <last name>", getStaffFlagValue("BasicModeration"), true, true, "Changes a character's name directly."),
|
new CommandData("setname", forceCharacterNameCommand, "<player name/id> <first name> <last name>", getStaffFlagValue("BasicModeration"), true, true, "Changes a character's name directly."),
|
||||||
new CommandData("setskin", setPlayerSkinCommand, "<player name/id> <skin id/name>", getStaffFlagValue("BasicModeration"), true, true, "Changes a character's skin."),
|
new CommandData("setskin", forcePlayerSkinCommand, "<player name/id> <skin id/name>", getStaffFlagValue("BasicModeration"), true, true, "Changes a character's skin."),
|
||||||
new CommandData("setaccent", setPlayerAccentCommand, "<player name/id> <accent name>", getStaffFlagValue("BasicModeration"), true, true, "Changes a character's accent."),
|
new CommandData("setaccent", forcePlayerAccentCommand, "<player name/id> <accent name>", getStaffFlagValue("BasicModeration"), true, true, "Changes a character's accent."),
|
||||||
//new CommandData("setfightstyle", setPlayerFightStyleCommand, "<player name/id> <fight style name>", getStaffFlagValue("BasicModeration"), true, true, "Changes a character's fight style."),
|
new CommandData("setfightstyle", forcePlayerFightStyleCommand, "<player name/id> <fight style name>", getStaffFlagValue("BasicModeration"), true, true, "Changes a character's fight style."),
|
||||||
new CommandData("setstars", setPlayerWantedLevelCommand, "<player name/id> <wanted level>", getStaffFlagValue("BasicModeration"), true, true, "Forces a player to have a wanted level"),
|
new CommandData("setstars", forcePlayerWantedLevelCommand, "<player name/id> <wanted level>", getStaffFlagValue("BasicModeration"), true, true, "Forces a player to have a wanted level"),
|
||||||
new CommandData("plrinfo", getPlayerInfoCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Shows basic info about the specified player"),
|
new CommandData("plrinfo", getPlayerInfoCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Shows basic info about the specified player"),
|
||||||
new CommandData("playerinfo", getPlayerInfoCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Shows basic info about the specified player"),
|
new CommandData("playerinfo", getPlayerInfoCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Shows basic info about the specified player"),
|
||||||
new CommandData("getplrhouses", getHousesOwnedByPlayerCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Shows a list of all houses owned by the player"),
|
new CommandData("getplrhouses", getHousesOwnedByPlayerCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Shows a list of all houses owned by the player"),
|
||||||
@@ -529,13 +581,21 @@ function loadCommands() {
|
|||||||
new CommandData("getplayervehicles", getVehiclesOwnedByPlayerCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Shows a list of all vehicles owned by the player"),
|
new CommandData("getplayervehicles", getVehiclesOwnedByPlayerCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Shows a list of all vehicles owned by the player"),
|
||||||
new CommandData("geoip", getPlayerGeoIPInformationCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Retrieves GeoIP information on a player (country & city)"),
|
new CommandData("geoip", getPlayerGeoIPInformationCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Retrieves GeoIP information on a player (country & city)"),
|
||||||
new CommandData("ip", getPlayerIPInformationCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Retrieves IP information on a player"),
|
new CommandData("ip", getPlayerIPInformationCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Retrieves IP information on a player"),
|
||||||
|
new CommandData("getgeoip", getPlayerGeoIPInformationCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Retrieves GeoIP information on a player (country & city)"),
|
||||||
|
new CommandData("getip", getPlayerIPInformationCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Retrieves IP information on a player"),
|
||||||
new CommandData("plrsync", toggleSyncForElementsSpawnedByPlayerCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Sets whether elements spawned by a player are synced (traffic, peds, etc)"),
|
new CommandData("plrsync", toggleSyncForElementsSpawnedByPlayerCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Sets whether elements spawned by a player are synced (traffic, peds, etc)"),
|
||||||
new CommandData("health", setPlayerHealthCommand, "<player name/id> <health", getStaffFlagValue("BasicModeration"), true, true, "Sets a player's health"),
|
new CommandData("health", forcePlayerHealthCommand, "<player name/id> <health", getStaffFlagValue("BasicModeration"), true, true, "Sets a player's health"),
|
||||||
new CommandData("armour", setPlayerArmourCommand, "<player name/id> <armour>", getStaffFlagValue("BasicModeration"), true, true, "Sets a player's armour"),
|
new CommandData("armour", forcePlayerArmourCommand, "<player name/id> <armour>", getStaffFlagValue("BasicModeration"), true, true, "Sets a player's armour"),
|
||||||
|
new CommandData("sethealth", forcePlayerHealthCommand, "<player name/id> <health", getStaffFlagValue("BasicModeration"), true, true, "Sets a player's health"),
|
||||||
|
new CommandData("setarmour", forcePlayerArmourCommand, "<player name/id> <armour>", getStaffFlagValue("BasicModeration"), true, true, "Sets a player's armour"),
|
||||||
new CommandData("infiniterun", setPlayerInfiniteRunCommand, "<player name/id> <state>", getStaffFlagValue("BasicModeration"), true, true, "Toggles a player's infinite sprint"),
|
new CommandData("infiniterun", setPlayerInfiniteRunCommand, "<player name/id> <state>", getStaffFlagValue("BasicModeration"), true, true, "Toggles a player's infinite sprint"),
|
||||||
new CommandData("atbiz", getPlayerCurrentBusinessCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Gets which business a player is at/in"),
|
new CommandData("atbiz", getPlayerCurrentBusinessCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Gets which business a player is at/in"),
|
||||||
new CommandData("atbusiness", getPlayerCurrentBusinessCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Gets which business a player is at/in"),
|
new CommandData("atbusiness", getPlayerCurrentBusinessCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Gets which business a player is at/in"),
|
||||||
new CommandData("athouse", getPlayerCurrentHouseCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Gets which house a player is at/in"),
|
new CommandData("athouse", getPlayerCurrentHouseCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Gets which house 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("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: [
|
||||||
@@ -578,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),
|
||||||
@@ -634,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"),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
@@ -649,17 +708,23 @@ 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++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_INFO, `[VRR.Command] ${commandCount} command handlers added!`);
|
removeCommandHandler("help");
|
||||||
|
addCommandHandler("help", helpCommand);
|
||||||
|
|
||||||
|
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) {
|
||||||
@@ -676,6 +741,9 @@ function getCommand(command) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {CommandData} command
|
||||||
|
*/
|
||||||
function getCommandData(command) {
|
function getCommandData(command) {
|
||||||
return getCommand(command);
|
return getCommand(command);
|
||||||
}
|
}
|
||||||
@@ -727,12 +795,12 @@ function disableCommand(command, params, client) {
|
|||||||
params = toLowerCase(params);
|
params = toLowerCase(params);
|
||||||
|
|
||||||
if (!getCommand(params)) {
|
if (!getCommand(params)) {
|
||||||
messagePlayerError(client, `The command {ALTCOLOUR}/${params} {MAINCOLOUR} does not exist!`);
|
messagePlayerError(client, `The command {ALTCOLOUR}/${params}{MAINCOLOUR} does not exist!`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -747,12 +815,12 @@ function enableCommand(command, params, client) {
|
|||||||
params = toLowerCase(params);
|
params = toLowerCase(params);
|
||||||
|
|
||||||
if (!getCommand(params)) {
|
if (!getCommand(params)) {
|
||||||
messagePlayerError(client, `The command {ALTCOLOUR}/${params} {MAINCOLOUR} does not exist!`);
|
messagePlayerError(client, `The command {ALTCOLOUR}/${params}{MAINCOLOUR} does not exist!`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -767,7 +835,7 @@ function disableAllCommandsByType(command, params, client) {
|
|||||||
params = toLowerCase(params);
|
params = toLowerCase(params);
|
||||||
|
|
||||||
if (isNull(getServerData().commands[params])) {
|
if (isNull(getServerData().commands[params])) {
|
||||||
messagePlayerError(client, `Command type {ALTCOLOUR}${params} {MAINCOLOUR}does not exist!`);
|
messagePlayerError(client, `Command type {ALTCOLOUR}${params}{MAINCOLOUR} does not exist!`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -775,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -790,7 +858,7 @@ function enableAllCommandsByType(command, params, client) {
|
|||||||
params = toLowerCase(params);
|
params = toLowerCase(params);
|
||||||
|
|
||||||
if (isNull(getServerData().commands[params])) {
|
if (isNull(getServerData().commands[params])) {
|
||||||
messagePlayerError(client, `Command type {ALTCOLOUR}${params} {MAINCOLOUR}does not exist!`);
|
messagePlayerError(client, `Command type {ALTCOLOUR}${params}{MAINCOLOUR} does not exist!`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -798,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -823,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)))) {
|
||||||
@@ -835,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;
|
||||||
@@ -843,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;
|
||||||
}
|
}
|
||||||
@@ -851,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;
|
||||||
}
|
}
|
||||||
@@ -859,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -970,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;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: config.js
|
// FILE: config.js
|
||||||
// DESC: Provides server configuration
|
// DESC: Provides server configuration
|
||||||
@@ -35,6 +36,8 @@ class ServerConfigData {
|
|||||||
this.characterSelectInterior = 0;
|
this.characterSelectInterior = 0;
|
||||||
this.characterSelectDimension = 0;
|
this.characterSelectDimension = 0;
|
||||||
|
|
||||||
|
this.name = "";
|
||||||
|
this.password = "";
|
||||||
this.hour = 0;
|
this.hour = 0;
|
||||||
this.minute = 0
|
this.minute = 0
|
||||||
this.minuteDuration = 1000;
|
this.minuteDuration = 1000;
|
||||||
@@ -49,7 +52,8 @@ class ServerConfigData {
|
|||||||
this.showLogo = true;
|
this.showLogo = true;
|
||||||
this.inflationMultiplier = 1;
|
this.inflationMultiplier = 1;
|
||||||
this.testerOnly = false;
|
this.testerOnly = false;
|
||||||
this.settings = 0;
|
this.devServer = false;
|
||||||
|
this.nameTagDistance = 50.0;
|
||||||
|
|
||||||
this.antiCheat = {
|
this.antiCheat = {
|
||||||
enabled: false,
|
enabled: false,
|
||||||
@@ -78,12 +82,9 @@ class ServerConfigData {
|
|||||||
this.realTimeZone = 0;
|
this.realTimeZone = 0;
|
||||||
|
|
||||||
this.discordConfig = {
|
this.discordConfig = {
|
||||||
eventChannelWebHookURL: "",
|
|
||||||
chatChannelWebHookURL: "",
|
|
||||||
adminChannelWebHookURL: "",
|
|
||||||
sendEvents: true,
|
sendEvents: true,
|
||||||
sendChat: true,
|
sendChat: true,
|
||||||
sendAdminEvents: true,
|
sendAdmin: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (dbAssoc) {
|
if (dbAssoc) {
|
||||||
@@ -94,34 +95,54 @@ class ServerConfigData {
|
|||||||
money: dbAssoc["svr_newchar_money"],
|
money: dbAssoc["svr_newchar_money"],
|
||||||
bank: dbAssoc["svr_newchar_bank"],
|
bank: dbAssoc["svr_newchar_bank"],
|
||||||
skin: dbAssoc["svr_newchar_skin"],
|
skin: dbAssoc["svr_newchar_skin"],
|
||||||
},
|
};
|
||||||
this.settings = toInteger(dbAssoc["svr_settings"]);
|
|
||||||
|
|
||||||
this.connectCameraPosition = toVector3(dbAssoc["svr_connectcam_pos_x"], dbAssoc["svr_connectcam_pos_y"], dbAssoc["svr_connectcam_pos_z"]);
|
this.connectCameraPosition = toVector3(dbAssoc["svr_connectcam_pos_x"], dbAssoc["svr_connectcam_pos_y"], dbAssoc["svr_connectcam_pos_z"]);
|
||||||
this.connectCameraLookAt = toVector3(dbAssoc["svr_connectcam_lookat_x"], dbAssoc["svr_connectcam_lookat_y"], dbAssoc["svr_connectcam_lookat_z"]);
|
this.connectCameraLookAt = toVector3(dbAssoc["svr_connectcam_lookat_x"], dbAssoc["svr_connectcam_lookat_y"], dbAssoc["svr_connectcam_lookat_z"]);
|
||||||
|
|
||||||
|
this.name = toInteger(dbAssoc["svr_name"]);
|
||||||
|
this.password = toInteger(dbAssoc["svr_password"]);
|
||||||
this.hour = toInteger(dbAssoc["svr_start_time_hour"]);
|
this.hour = toInteger(dbAssoc["svr_start_time_hour"]);
|
||||||
this.minute = toInteger(dbAssoc["svr_start_time_min"]);
|
this.minute = toInteger(dbAssoc["svr_start_time_min"]);
|
||||||
this.minuteDuration = toInteger(dbAssoc["svr_time_min_duration"]);
|
this.minuteDuration = toInteger(dbAssoc["svr_time_min_duration"]);
|
||||||
this.weather = toInteger(dbAssoc["svr_start_weather"]);
|
this.weather = toInteger(dbAssoc["svr_start_weather"]);
|
||||||
|
this.fallingSnow = intToBool(toInteger(dbAssoc["svr_snow_falling"]));
|
||||||
|
this.groundSnow = intToBool(toInteger(dbAssoc["svr_snow_ground"]));
|
||||||
|
this.useGUI = intToBool(toInteger(dbAssoc["svr_gui"]));
|
||||||
|
this.showLogo = intToBool(toInteger(dbAssoc["svr_logo"]));
|
||||||
|
this.createJobPickups = intToBool(toInteger(dbAssoc["svr_job_pickups"]));
|
||||||
|
this.createBusinessPickups = intToBool(toInteger(dbAssoc["svr_biz_pickups"]));
|
||||||
|
this.createHousePickups = intToBool(toInteger(dbAssoc["svr_house_pickups"]));
|
||||||
|
this.createJobBlips = intToBool(toInteger(dbAssoc["svr_job_blips"]));
|
||||||
|
this.createBusinessBlips = intToBool(toInteger(dbAssoc["svr_biz_blips"]));
|
||||||
|
this.createHouseBlips = intToBool(toInteger(dbAssoc["svr_house_blips"]));
|
||||||
|
this.createPlayerBlips = intToBool(toInteger(dbAssoc["svr_player_blips"]));
|
||||||
this.guiColourPrimary = [toInteger(dbAssoc["svr_gui_col1_r"]), toInteger(dbAssoc["svr_gui_col1_g"]), toInteger(dbAssoc["svr_gui_col1_b"])];
|
this.guiColourPrimary = [toInteger(dbAssoc["svr_gui_col1_r"]), toInteger(dbAssoc["svr_gui_col1_g"]), toInteger(dbAssoc["svr_gui_col1_b"])];
|
||||||
this.guiColourSecondary = [toInteger(dbAssoc["svr_gui_col2_r"]), toInteger(dbAssoc["svr_gui_col2_g"]), toInteger(dbAssoc["svr_gui_col2_b"])];
|
this.guiColourSecondary = [toInteger(dbAssoc["svr_gui_col2_r"]), toInteger(dbAssoc["svr_gui_col2_g"]), toInteger(dbAssoc["svr_gui_col2_b"])];
|
||||||
this.guiTextColourPrimary = [toInteger(dbAssoc["svr_gui_textcol1_r"]), toInteger(dbAssoc["svr_gui_textcol1_g"]), toInteger(dbAssoc["svr_gui_textcol1_b"])];
|
this.guiTextColourPrimary = [toInteger(dbAssoc["svr_gui_textcol1_r"]), toInteger(dbAssoc["svr_gui_textcol1_g"]), toInteger(dbAssoc["svr_gui_textcol1_b"])];
|
||||||
//this.guiTextColourSecondary = [toInteger(dbAssoc["svr_gui_textcol2_r"]), toInteger(dbAssoc["svr_gui_textcol2_g"]), toInteger(dbAssoc["svr_gui_textcol2_b"])];
|
//this.guiTextColourSecondary = [toInteger(dbAssoc["svr_gui_textcol2_r"]), toInteger(dbAssoc["svr_gui_textcol2_g"]), toInteger(dbAssoc["svr_gui_textcol2_b"])];
|
||||||
this.inflationMultiplier = toFloat(dbAssoc["svr_inflation_multiplier"]);
|
this.inflationMultiplier = toFloat(dbAssoc["svr_inflation_multiplier"]);
|
||||||
|
this.nameTagDistance = toFloat(dbAssoc["svr_nametag_distance"]);
|
||||||
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.realTimeZone = dbAssoc["svr_time_realtime_timezone"];
|
|
||||||
|
|
||||||
this.discordConfig = {
|
this.useRealTime = intToBool(toInteger(dbAssoc["svr_real_time_enabled"]));
|
||||||
eventChannelWebHookURL: dbAssoc["svr_discord_event_webhook"],
|
this.realTimeZone = dbAssoc["svr_real_time_timezone"];
|
||||||
chatChannelWebHookURL: dbAssoc["svr_discord_chat_webhook"],
|
|
||||||
adminChannelWebHookURL: dbAssoc["svr_discord_admin_webhook"],
|
this.discord = {
|
||||||
sendEvents: true,
|
sendEvents: intToBool(dbAssoc["svr_discord_send_events"]),
|
||||||
sendChat: true,
|
sendChat: intToBool(dbAssoc["svr_discord_send_chat"]),
|
||||||
sendAdminEvents: true,
|
sendAdmin: intToBool(dbAssoc["svr_discord_send_admin"]),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.economy = {
|
||||||
|
inflationMultiplier: toFloat(dbAssoc["svr_inflation_multiplier"]),
|
||||||
|
incomeTaxRate: toFloat(dbAssoc["svr_income_tax_rate"]),
|
||||||
|
passiveIncome: toFloat(dbAssoc["svr_passive_income"]),
|
||||||
|
}
|
||||||
|
|
||||||
|
this.devServer = intToBool(toInteger(server.getCVar("agrp_devserver")));
|
||||||
|
this.testerOnly = intToBool(toInteger(server.getCVar("agrp_testeronly")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -173,22 +194,22 @@ 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: [
|
||||||
VRR_ITEM_USETYPE_WEAPON,
|
AGRP_ITEM_USE_TYPE_WEAPON,
|
||||||
VRR_ITEM_USETYPE_TAZER,
|
AGRP_ITEM_USE_TYPE_TAZER,
|
||||||
VRR_ITEM_USETYPE_EXTINGUISHER,
|
AGRP_ITEM_USE_TYPE_EXTINGUISHER,
|
||||||
VRR_ITEM_USETYPE_SPRAYPAINT,
|
AGRP_ITEM_USE_TYPE_SPRAYPAINT,
|
||||||
VRR_ITEM_USETYPE_PEPPERSPRAY,
|
AGRP_ITEM_USE_TYPE_PEPPERSPRAY,
|
||||||
],
|
],
|
||||||
onFootOnlyItems: [
|
onFootOnlyItems: [
|
||||||
VRR_ITEM_USETYPE_VEHREPAIR,
|
AGRP_ITEM_USE_TYPE_VEHREPAIR,
|
||||||
VRR_ITEM_USETYPE_VEHCOLOUR,
|
AGRP_ITEM_USE_TYPE_VEHCOLOUR,
|
||||||
VRR_ITEM_USETYPE_VEHUPGRADE_PART,
|
AGRP_ITEM_USE_TYPE_VEHUPGRADE_PART,
|
||||||
VRR_ITEM_USETYPE_VEHLIVERY,
|
AGRP_ITEM_USE_TYPE_VEHLIVERY,
|
||||||
VRR_ITEM_USETYPE_VEHTIRE,
|
AGRP_ITEM_USE_TYPE_VEHTIRE,
|
||||||
],
|
],
|
||||||
vehicleInactiveRespawnDelay: 1800000, // 20 minutes
|
vehicleInactiveRespawnDelay: 1800000, // 20 minutes
|
||||||
chatSectionHeaderLength: 96,
|
chatSectionHeaderLength: 96,
|
||||||
@@ -206,6 +227,8 @@ let globalConfig = {
|
|||||||
houseBlipStreamOutDistance: 120,
|
houseBlipStreamOutDistance: 120,
|
||||||
jobBlipStreamInDistance: -1,
|
jobBlipStreamInDistance: -1,
|
||||||
jobBlipStreamOutDistance: -1,
|
jobBlipStreamOutDistance: -1,
|
||||||
|
playerStreamInDistance: -1,
|
||||||
|
playerStreamOutDistance: -1,
|
||||||
playerBlipStreamInDistance: -1,
|
playerBlipStreamInDistance: -1,
|
||||||
playerBlipStreamOutDistance: -1,
|
playerBlipStreamOutDistance: -1,
|
||||||
handcuffPlayerDistance: 3,
|
handcuffPlayerDistance: 3,
|
||||||
@@ -216,85 +239,89 @@ let globalConfig = {
|
|||||||
passwordRequiredSymbols: 0,
|
passwordRequiredSymbols: 0,
|
||||||
minChatLines: 1,
|
minChatLines: 1,
|
||||||
maxChatLines: 6,
|
maxChatLines: 6,
|
||||||
|
vehicleTrunkDistance: 2.0,
|
||||||
|
fishingSpotDistance: 10.0,
|
||||||
|
atmDistance: 1.5,
|
||||||
|
loginTimeout: 60000,
|
||||||
|
fishingCastMaxStrength: 100,
|
||||||
|
fishingCastMinStrength: 30,
|
||||||
|
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);
|
return tempServerConfigData;
|
||||||
let tempServerConfigData = new ServerConfigData(dbAssoc);
|
|
||||||
freeDatabaseQuery(dbQuery);
|
|
||||||
return tempServerConfigData;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
@@ -303,18 +330,15 @@ function loadServerConfigFromGameAndPort(gameId, port) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadServerConfigFromId(tempServerId) {
|
async function loadServerConfigFromGame(gameId) {
|
||||||
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_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);
|
return tempServerConfigData;
|
||||||
freeDatabaseQuery(dbQuery);
|
|
||||||
return tempServerConfigData;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
@@ -323,18 +347,36 @@ function loadServerConfigFromId(tempServerId) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
async function loadServerConfigFromId(tempServerId) {
|
||||||
|
let dbConnection = connectToDatabase();
|
||||||
|
if (dbConnection) {
|
||||||
|
let dbQueryString = `SELECT * FROM svr_main WHERE svr_id = ${tempServerId} LIMIT 1;`;
|
||||||
|
let dbAssoc = await fetchQueryAssoc(dbConnection, dbQueryString);
|
||||||
|
if (dbAssoc.length > 0) {
|
||||||
|
let tempServerConfigData = new ServerConfigData(dbAssoc[0]);
|
||||||
|
return tempServerConfigData;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
disconnectFromDatabase(dbConnection);
|
||||||
|
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();
|
||||||
@@ -343,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) {
|
||||||
@@ -407,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!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -530,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;
|
||||||
}
|
}
|
||||||
@@ -881,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;
|
||||||
}
|
}
|
||||||
@@ -929,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;
|
||||||
}
|
}
|
||||||
@@ -939,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;
|
||||||
}
|
}
|
||||||
@@ -949,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;
|
||||||
}
|
}
|
||||||
@@ -959,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;
|
||||||
}
|
}
|
||||||
@@ -970,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;
|
||||||
}
|
}
|
||||||
@@ -981,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;
|
||||||
}
|
}
|
||||||
@@ -992,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;
|
||||||
}
|
}
|
||||||
@@ -1075,15 +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) {
|
||||||
|
serverConfig = loadServerConfigFromGame(getGame());
|
||||||
|
|
||||||
|
if (serverConfig == false) {
|
||||||
|
logToConsole(LOG_ERROR, `[AGRP.Config] Could not load server configuration for game ${getGame()}`);
|
||||||
|
server.shutdown();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
serverConfig = loadServerConfigFromGameAndPort(getGame(), getServerPort());
|
serverConfig = loadServerConfigFromGameAndPort(getGame(), getServerPort());
|
||||||
} catch (error) {
|
|
||||||
logToConsole(LOG_ERROR, `[VRR.Config] Could not load server configuration for game ${getGame()} and port ${getServerPort}`);
|
if (serverConfig == false) {
|
||||||
thisResource.stop();
|
logToConsole(LOG_ERROR, `[AGRP.Config] Could not load server configuration for game ${getGame()} and port ${getServerPort()}`);
|
||||||
|
server.shutdown();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG | LOG_WARN, `Server ID: ${serverConfig.databaseId}`);
|
//logToConsole(LOG_DEBUG | LOG_WARN, `Server ID: ${serverConfig.databaseId}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1,20 +1,22 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: core.js
|
// FILE: core.js
|
||||||
// DESC: Provides core data structures, function, and operations
|
// DESC: Provides core data structures, function, and operations
|
||||||
// TYPE: Server (JavaScript)
|
// TYPE: Server (JavaScript)
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
let scriptVersion = "1.1";
|
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);
|
||||||
let playerInitialized = new Array(server.maxClients).fill(false);
|
let playerInitialized = new Array(server.maxClients).fill(false);
|
||||||
let playerGUI = new Array(server.maxClients).fill(false);
|
let playerGUI = new Array(server.maxClients).fill(false);
|
||||||
|
let defaultNoAccountId = 479;
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
@@ -28,15 +30,19 @@ let playerGUI = new Array(server.maxClients).fill(false);
|
|||||||
* @property {Array.<ItemData>} items
|
* @property {Array.<ItemData>} items
|
||||||
* @property {Array.<ItemTypeData>} itemTypes
|
* @property {Array.<ItemTypeData>} itemTypes
|
||||||
* @property {Array.<ClanData>} clans
|
* @property {Array.<ClanData>} clans
|
||||||
* @property {Array} localeStrings
|
* @property {Array.<TriggerData>} triggers
|
||||||
* @property {Array.<NPCData>} npcs
|
* @property {Array.<NPCData>} npcs
|
||||||
* @property {Array.<RaceData>} races
|
* @property {Array.<RaceData>} races
|
||||||
* @property {Array.<JobData>} jobs
|
* @property {Array.<JobData>} jobs
|
||||||
* @property {Array.<Gates>} gates
|
* @property {Array.<GateData>} gates
|
||||||
|
* @property {Array.<RadioStationData>} radioStations
|
||||||
|
* @property {Array} locales
|
||||||
|
* @property {Array} localeStrings
|
||||||
* @property {Array} groundItemCache
|
* @property {Array} groundItemCache
|
||||||
* @property {Array} groundPlantCache
|
* @property {Array} groundPlantCache
|
||||||
* @property {Array} purchasingVehicleCache
|
* @property {Array} purchasingVehicleCache
|
||||||
* @property {Array} rentingVehicleCache
|
* @property {Array} rentingVehicleCache
|
||||||
|
* @property {Array} atmLocationCache
|
||||||
*/
|
*/
|
||||||
let serverData = {
|
let serverData = {
|
||||||
vehicles: [],
|
vehicles: [],
|
||||||
@@ -47,26 +53,26 @@ let serverData = {
|
|||||||
items: [],
|
items: [],
|
||||||
itemTypes: [],
|
itemTypes: [],
|
||||||
clans: [],
|
clans: [],
|
||||||
localeStrings: {},
|
|
||||||
cachedTranslations: [],
|
cachedTranslations: [],
|
||||||
cachedTranslationFrom: [],
|
cachedTranslationFrom: [],
|
||||||
//triggers: [],
|
triggers: [],
|
||||||
npcs: [],
|
npcs: [],
|
||||||
races: [],
|
races: [],
|
||||||
jobs: [],
|
jobs: [],
|
||||||
gates: [],
|
gates: [],
|
||||||
|
radioStations: [],
|
||||||
|
localeStrings: {},
|
||||||
groundItemCache: [],
|
groundItemCache: [],
|
||||||
groundPlantCache: [],
|
groundPlantCache: [],
|
||||||
purchasingVehicleCache: [],
|
purchasingVehicleCache: [],
|
||||||
rentingVehicleCache: [],
|
rentingVehicleCache: [],
|
||||||
|
atmLocationCache: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* @return {ServerData} serverData
|
||||||
* @return {ServerData}
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
function getServerData() {
|
function getServerData() {
|
||||||
return serverData;
|
return serverData;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: crime.js
|
// FILE: crime.js
|
||||||
// DESC: Provides crime data structures, functions, and operations
|
// DESC: Provides crime data structures, functions, and operations
|
||||||
@@ -10,7 +11,7 @@
|
|||||||
/**
|
/**
|
||||||
* @class Representing a crime's data. Loaded and saved in the database
|
* @class Representing a crime's data. Loaded and saved in the database
|
||||||
*/
|
*/
|
||||||
class CrimeData {
|
class CrimeData {
|
||||||
constructor(suspectId, crimeType, reporterId = 0) {
|
constructor(suspectId, crimeType, reporterId = 0) {
|
||||||
this.crimeType = crimeType;
|
this.crimeType = crimeType;
|
||||||
this.suspectId = suspectId;
|
this.suspectId = suspectId;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: database.js
|
// FILE: database.js
|
||||||
// DESC: Provides database handling, functions and usage
|
// DESC: Provides database handling, functions and usage
|
||||||
@@ -14,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!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -24,13 +25,13 @@ function createDatabaseInsertQuery(tableName, data) {
|
|||||||
let fields = [];
|
let fields = [];
|
||||||
let values = [];
|
let values = [];
|
||||||
|
|
||||||
for(let i in data) {
|
for (let i in data) {
|
||||||
if(data[i][1] != "undefined" && data[i][1] != NaN && data[i][0] != 'NaN') {
|
if (data[i][1] != "undefined" && data[i][1] != NaN && data[i][0] != 'NaN') {
|
||||||
if(data[i][1] != "undefined" && data[i][1] != NaN && data[i][1] != 'NaN') {
|
if (data[i][1] != "undefined" && data[i][1] != NaN && data[i][1] != 'NaN') {
|
||||||
fields.push(data[i][0]);
|
fields.push(data[i][0]);
|
||||||
|
|
||||||
if(typeof data[i][1] == "string") {
|
if (typeof data[i][1] == "string") {
|
||||||
if(data[i][1] == "{UNIXTIMESTAMP}") {
|
if (data[i][1] == "{UNIXTIMESTAMP}") {
|
||||||
values.push("UNIX_TIMESTAMP()");
|
values.push("UNIX_TIMESTAMP()");
|
||||||
} else {
|
} else {
|
||||||
values.push(`'${data[i][1]}'`);
|
values.push(`'${data[i][1]}'`);
|
||||||
@@ -51,11 +52,11 @@ function createDatabaseInsertQuery(tableName, data) {
|
|||||||
function createDatabaseUpdateQuery(tableName, data, whereClause) {
|
function createDatabaseUpdateQuery(tableName, data, whereClause) {
|
||||||
let values = [];
|
let values = [];
|
||||||
|
|
||||||
for(let i in data) {
|
for (let i in data) {
|
||||||
if(data[i][0] != "undefined" && data[i][0] != NaN && data[i][0] != 'NaN') {
|
if (data[i][0] != "undefined" && data[i][0] != NaN && data[i][0] != 'NaN') {
|
||||||
if(data[i][1] != "undefined" && data[i][1] != NaN && data[i][1] != 'NaN') {
|
if (data[i][1] != "undefined" && data[i][1] != NaN && data[i][1] != 'NaN') {
|
||||||
if(typeof data[i][1] == "string") {
|
if (typeof data[i][1] == "string") {
|
||||||
if(data[i][1] == "{UNIXTIMESTAMP}") {
|
if (data[i][1] == "{UNIXTIMESTAMP}") {
|
||||||
values.push(`${data[i][0]}=UNIX_TIMESTAMP()`);
|
values.push(`${data[i][0]}=UNIX_TIMESTAMP()`);
|
||||||
} else {
|
} else {
|
||||||
values.push(`${data[i][0]}='${data[i][1]}'`);
|
values.push(`${data[i][0]}='${data[i][1]}'`);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: developer.js
|
// FILE: developer.js
|
||||||
// DESC: Provides developer operation, commands, functions and usage
|
// DESC: Provides developer operation, commands, functions and usage
|
||||||
@@ -8,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);
|
||||||
@@ -17,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,12 +121,12 @@ function pvd(params) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function addLogLevelCommand(command, params, client) {
|
function addLogLevelCommand(command, params, client) {
|
||||||
if(areParamsEmpty(params)) {
|
if (areParamsEmpty(params)) {
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(toLowerCase(params)) {
|
switch (toLowerCase(params)) {
|
||||||
case "debug":
|
case "debug":
|
||||||
logLevel = logLevel | LOG_DEBUG;
|
logLevel = logLevel | LOG_DEBUG;
|
||||||
break;
|
break;
|
||||||
@@ -151,9 +152,7 @@ function addLogLevelCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sendPlayerLogLevel(null, logLevel);
|
sendPlayerLogLevel(null, logLevel);
|
||||||
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)}{MAINCOLOUR} enabled log level {ALTCOLOUR}${toLowerCase(params)}`);
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} {MAINCOLOUR}enabled log level {ALTCOLOUR}${toLowerCase(params)}`);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,40 +161,39 @@ function addLogLevelCommand(command, params, client) {
|
|||||||
function getLogLevelCommand(command, params, client) {
|
function getLogLevelCommand(command, params, client) {
|
||||||
let logLevels = [];
|
let logLevels = [];
|
||||||
|
|
||||||
if(hasBitFlag(logLevel, LOG_DEBUG)) {
|
if (hasBitFlag(logLevel, LOG_DEBUG)) {
|
||||||
logLevels.push("debug");
|
logLevels.push("debug");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hasBitFlag(logLevel, LOG_WARN)) {
|
if (hasBitFlag(logLevel, LOG_WARN)) {
|
||||||
logLevels.push("warn");
|
logLevels.push("warn");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hasBitFlag(logLevel, LOG_ERROR)) {
|
if (hasBitFlag(logLevel, LOG_ERROR)) {
|
||||||
logLevels.push("error");
|
logLevels.push("error");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hasBitFlag(logLevel, LOG_INFO)) {
|
if (hasBitFlag(logLevel, LOG_INFO)) {
|
||||||
logLevels.push("info");
|
logLevels.push("info");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hasBitFlag(logLevel, LOG_VERBOSE)) {
|
if (hasBitFlag(logLevel, LOG_VERBOSE)) {
|
||||||
logLevels.push("verbose");
|
logLevels.push("verbose");
|
||||||
}
|
}
|
||||||
|
|
||||||
messagePlayerAlert(`{MAINCOLOUR}Current log levels: {ALTCOLOUR}${toLowerCase(logLevels.join(", "))}`);
|
messagePlayerAlert(client, `{MAINCOLOUR}Current log levels: {ALTCOLOUR}${toLowerCase(logLevels.join(", "))}`);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function removeLogLevelCommand(command, params, client) {
|
function removeLogLevelCommand(command, params, client) {
|
||||||
if(areParamsEmpty(params)) {
|
if (areParamsEmpty(params)) {
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(toLowerCase(params)) {
|
switch (toLowerCase(params)) {
|
||||||
case "debug":
|
case "debug":
|
||||||
logLevel = logLevel & ~LOG_DEBUG;
|
logLevel = logLevel & ~LOG_DEBUG;
|
||||||
break;
|
break;
|
||||||
@@ -221,28 +219,26 @@ function removeLogLevelCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sendPlayerLogLevel(null, logLevel);
|
sendPlayerLogLevel(null, logLevel);
|
||||||
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)}{MAINCOLOUR} disabled log level {ALTCOLOUR}${toLowerCase(params)}`);
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} {MAINCOLOUR}disabled log level {ALTCOLOUR}${toLowerCase(params)}`);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function simulateCommandForPlayerCommand(command, params, client) {
|
function simulateCommandForPlayerCommand(command, params, client) {
|
||||||
if(getCommand(command).requireLogin) {
|
if (getCommand(command).requireLogin) {
|
||||||
if(!isPlayerLoggedIn(client)) {
|
if (!isPlayerLoggedIn(client)) {
|
||||||
messagePlayerError(client, "You must be logged in to use this command!");
|
messagePlayerError(client, "You must be logged in to use this command!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!doesPlayerHaveStaffPermission(client, getCommandRequiredPermissions(command))) {
|
if (!doesPlayerHaveStaffPermission(client, getCommandRequiredPermissions(command))) {
|
||||||
messagePlayerError(client, "You do not have permission to use this command!");
|
messagePlayerError(client, "You do not have permission to use this command!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(areParamsEmpty(params) || !areThereEnoughParams(params, 2)) {
|
if (areParamsEmpty(params) || !areThereEnoughParams(params, 2)) {
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -252,13 +248,13 @@ function simulateCommandForPlayerCommand(command, params, client) {
|
|||||||
tempCommand.replace("/", "");
|
tempCommand.replace("/", "");
|
||||||
let tempParams = splitParams.slice(2).join(" ");
|
let tempParams = splitParams.slice(2).join(" ");
|
||||||
|
|
||||||
if(!targetClient) {
|
if (!targetClient) {
|
||||||
messagePlayerError(client, "Invalid player name or ID");
|
messagePlayerError(client, "Invalid player name or ID");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!getCommand(tempCommand)) {
|
if (!getCommand(tempCommand)) {
|
||||||
messagePlayerError(client, `The command {ALTCOLOUR}/${command} {MAINCOLOUR}does not exist! Use /help for commands and information.`);
|
messagePlayerError(client, `The command {ALTCOLOUR}/${command}{MAINCOLOUR} does not exist! Use /help for commands and information.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -270,19 +266,19 @@ function simulateCommandForPlayerCommand(command, params, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function simulateCommandForAllPlayersCommand(command, params, client) {
|
function simulateCommandForAllPlayersCommand(command, params, client) {
|
||||||
if(getCommand(command).requireLogin) {
|
if (getCommand(command).requireLogin) {
|
||||||
if(!isPlayerLoggedIn(client)) {
|
if (!isPlayerLoggedIn(client)) {
|
||||||
messagePlayerError(client, "You must be logged in to use this command!");
|
messagePlayerError(client, "You must be logged in to use this command!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!doesPlayerHaveStaffPermission(client, getCommandRequiredPermissions(command))) {
|
if (!doesPlayerHaveStaffPermission(client, getCommandRequiredPermissions(command))) {
|
||||||
messagePlayerError(client, "You do not have permission to use this command!");
|
messagePlayerError(client, "You do not have permission to use this command!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(areParamsEmpty(params) || !areThereEnoughParams(params, 2)) {
|
if (areParamsEmpty(params) || !areThereEnoughParams(params, 2)) {
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -291,14 +287,14 @@ function simulateCommandForAllPlayersCommand(command, params, client) {
|
|||||||
tempCommand.replace("/", "");
|
tempCommand.replace("/", "");
|
||||||
let tempParams = splitParams.slice(1).join(" ");
|
let tempParams = splitParams.slice(1).join(" ");
|
||||||
|
|
||||||
if(!getCommand(tempCommand)) {
|
if (!getCommand(tempCommand)) {
|
||||||
messagePlayerError(client, `The command {ALTCOLOUR}/${command} {MAINCOLOUR}does not exist! Use /help for commands and information.`);
|
messagePlayerError(client, `The command {ALTCOLOUR}/${command}{MAINCOLOUR} does not exist! Use /help for commands and information.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let clients = getClients();
|
let clients = getClients();
|
||||||
for(let i in clients) {
|
for (let i in clients) {
|
||||||
if(!clients[i].console) {
|
if (!clients[i].console) {
|
||||||
getCommand(toLowerCase(tempCommand)).handlerFunction(tempCommand, tempParams, clients[i]);
|
getCommand(toLowerCase(tempCommand)).handlerFunction(tempCommand, tempParams, clients[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -309,7 +305,7 @@ function simulateCommandForAllPlayersCommand(command, params, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function executeServerCodeCommand(command, params, client) {
|
function executeServerCodeCommand(command, params, client) {
|
||||||
if(areParamsEmpty(params)) {
|
if (areParamsEmpty(params)) {
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -317,7 +313,7 @@ function executeServerCodeCommand(command, params, client) {
|
|||||||
let returnValue = "Nothing";
|
let returnValue = "Nothing";
|
||||||
try {
|
try {
|
||||||
returnValue = eval("(" + params + ")");
|
returnValue = eval("(" + params + ")");
|
||||||
} catch(error) {
|
} catch (error) {
|
||||||
messagePlayerError(client, "The code could not be executed!");
|
messagePlayerError(client, "The code could not be executed!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -332,7 +328,7 @@ function executeServerCodeCommand(command, params, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function executeClientCodeCommand(command, params, client) {
|
function executeClientCodeCommand(command, params, client) {
|
||||||
if(areParamsEmpty(params)) {
|
if (areParamsEmpty(params)) {
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -341,12 +337,12 @@ function executeClientCodeCommand(command, params, client) {
|
|||||||
let targetClient = getPlayerFromParams(getParam(params, " ", 1));
|
let targetClient = getPlayerFromParams(getParam(params, " ", 1));
|
||||||
let targetCode = splitParams.slice(1).join(" ");
|
let targetCode = splitParams.slice(1).join(" ");
|
||||||
|
|
||||||
if(!targetClient) {
|
if (!targetClient) {
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidPlayer"));
|
messagePlayerError(client, getLocaleString(client, "InvalidPlayer"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(targetCode == "") {
|
if (targetCode == "") {
|
||||||
messagePlayerError(client, "You didn't enter any code!");
|
messagePlayerError(client, "You didn't enter any code!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -361,19 +357,19 @@ function executeClientCodeCommand(command, params, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setPlayerTesterStatusCommand(command, params, client) {
|
function setPlayerTesterStatusCommand(command, params, client) {
|
||||||
if(areParamsEmpty(params)) {
|
if (areParamsEmpty(params)) {
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let targetClient = getPlayerFromParams(params);
|
let targetClient = getPlayerFromParams(params);
|
||||||
|
|
||||||
if(!targetClient) {
|
if (!targetClient) {
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidPlayer"));
|
messagePlayerError(client, getLocaleString(client, "InvalidPlayer"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!hasBitFlag(getPlayerData(targetClient).accountData.flags.moderation, getModerationFlagValue("IsTester"))) {
|
if (!hasBitFlag(getPlayerData(targetClient).accountData.flags.moderation, getModerationFlagValue("IsTester"))) {
|
||||||
getPlayerData(targetClient).accountData.flags.moderation = addBitFlag(getPlayerData(targetClient).accountData.flags.moderation, getModerationFlagValue("IsTester"));
|
getPlayerData(targetClient).accountData.flags.moderation = addBitFlag(getPlayerData(targetClient).accountData.flags.moderation, getModerationFlagValue("IsTester"));
|
||||||
} else {
|
} else {
|
||||||
getPlayerData(targetClient).accountData.flags.moderation = removeBitFlag(getPlayerData(targetClient).accountData.flags.moderation, getModerationFlagValue("IsTester"));
|
getPlayerData(targetClient).accountData.flags.moderation = removeBitFlag(getPlayerData(targetClient).accountData.flags.moderation, getModerationFlagValue("IsTester"));
|
||||||
@@ -388,14 +384,14 @@ function setPlayerTesterStatusCommand(command, params, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function testPromptGUICommand(command, params, client) {
|
function testPromptGUICommand(command, params, client) {
|
||||||
if(areParamsEmpty(params)) {
|
if (areParamsEmpty(params)) {
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let targetClient = getPlayerFromParams(params);
|
let targetClient = getPlayerFromParams(params);
|
||||||
|
|
||||||
if(!targetClient) {
|
if (!targetClient) {
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidPlayer"));
|
messagePlayerError(client, getLocaleString(client, "InvalidPlayer"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -407,14 +403,14 @@ function testPromptGUICommand(command, params, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function testInfoGUICommand(command, params, client) {
|
function testInfoGUICommand(command, params, client) {
|
||||||
if(areParamsEmpty(params)) {
|
if (areParamsEmpty(params)) {
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let targetClient = getPlayerFromParams(params);
|
let targetClient = getPlayerFromParams(params);
|
||||||
|
|
||||||
if(!targetClient) {
|
if (!targetClient) {
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidPlayer"));
|
messagePlayerError(client, getLocaleString(client, "InvalidPlayer"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -426,14 +422,14 @@ function testInfoGUICommand(command, params, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function testErrorGUICommand(command, params, client) {
|
function testErrorGUICommand(command, params, client) {
|
||||||
if(areParamsEmpty(params)) {
|
if (areParamsEmpty(params)) {
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let targetClient = getPlayerFromParams(params);
|
let targetClient = getPlayerFromParams(params);
|
||||||
|
|
||||||
if(!targetClient) {
|
if (!targetClient) {
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidPlayer"));
|
messagePlayerError(client, getLocaleString(client, "InvalidPlayer"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -445,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;
|
||||||
}
|
}
|
||||||
@@ -477,7 +467,7 @@ function restartGameModeCommand(command, params, client) {
|
|||||||
|
|
||||||
function clientRunCodeFail(client, returnTo, error) {
|
function clientRunCodeFail(client, returnTo, error) {
|
||||||
let returnClient = getClientFromIndex(returnTo);
|
let returnClient = getClientFromIndex(returnTo);
|
||||||
if(!returnClient) {
|
if (!returnClient) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -488,7 +478,7 @@ function clientRunCodeFail(client, returnTo, error) {
|
|||||||
|
|
||||||
function clientRunCodeSuccess(client, returnTo, returnVal) {
|
function clientRunCodeSuccess(client, returnTo, returnVal) {
|
||||||
let returnClient = getClientFromIndex(returnTo);
|
let returnClient = getClientFromIndex(returnTo);
|
||||||
if(!returnClient) {
|
if (!returnClient) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -500,19 +490,25 @@ function clientRunCodeSuccess(client, returnTo, returnVal) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function submitIdea(client, ideaText) {
|
function submitIdea(client, ideaText) {
|
||||||
let position = (getPlayerVehicle(client)) ? getVehiclePosition(getPlayerVehicle(client)) : getPlayerPosition(client);
|
let position = toVector3(0.0, 0.0, 0.0);
|
||||||
let heading = (getPlayerVehicle(client)) ? getVehicleHeading(getPlayerVehicle(client)) : getPlayerHeading(client);
|
let heading = 0.0;
|
||||||
let session = 0;
|
let session = 0;
|
||||||
let databaseId = 0;
|
let databaseId = 0;
|
||||||
|
|
||||||
if(isConsole(client)) {
|
if (client != null) {
|
||||||
databaseId = -1;
|
if (isConsole(client)) {
|
||||||
|
databaseId = -1;
|
||||||
|
} else {
|
||||||
|
databaseId = getPlayerData(client).accountData.databaseId;
|
||||||
|
position = (getPlayerVehicle(client)) ? getVehiclePosition(getPlayerVehicle(client)) : getPlayerPosition(client);
|
||||||
|
heading = (getPlayerVehicle(client)) ? getVehicleHeading(getPlayerVehicle(client)) : getPlayerHeading(client);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
databaseId = getPlayerData(client).accountData.databaseId;
|
databaseId = defaultNoAccountId;
|
||||||
}
|
}
|
||||||
|
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if(dbConnection) {
|
if (dbConnection) {
|
||||||
let safeIdeaMessage = escapeDatabaseString(dbConnection, ideaText);
|
let safeIdeaMessage = escapeDatabaseString(dbConnection, ideaText);
|
||||||
queryDatabase(dbConnection, `INSERT INTO idea_main (idea_server, idea_script_ver, idea_who_added, idea_when_added, idea_message, idea_pos_x, idea_pos_y, idea_pos_z, idea_rot_z, idea_svr_start, idea_session) VALUES (${getServerId()}, '${scriptVersion}', ${databaseId}, NOW(), '${safeIdeaMessage}',${position.x}, ${position.y}, ${position.z}, ${heading}, ${serverStartTime}, ${session})`);
|
queryDatabase(dbConnection, `INSERT INTO idea_main (idea_server, idea_script_ver, idea_who_added, idea_when_added, idea_message, idea_pos_x, idea_pos_y, idea_pos_z, idea_rot_z, idea_svr_start, idea_session) VALUES (${getServerId()}, '${scriptVersion}', ${databaseId}, NOW(), '${safeIdeaMessage}',${position.x}, ${position.y}, ${position.z}, ${heading}, ${serverStartTime}, ${session})`);
|
||||||
}
|
}
|
||||||
@@ -521,19 +517,25 @@ function submitIdea(client, ideaText) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function submitBugReport(client, bugText) {
|
function submitBugReport(client, bugText) {
|
||||||
let position = (getPlayerVehicle(client)) ? getVehiclePosition(getPlayerVehicle(client)) : getPlayerPosition(client);
|
let position = toVector3(0.0, 0.0, 0.0);
|
||||||
let heading = (getPlayerVehicle(client)) ? getVehicleHeading(getPlayerVehicle(client)) : getPlayerHeading(client);
|
let heading = 0.0;
|
||||||
let session = 0;
|
let session = 0;
|
||||||
let databaseId = 0;
|
let databaseId = 0;
|
||||||
|
|
||||||
if(isConsole(client)) {
|
if (client != null) {
|
||||||
databaseId = -1;
|
if (isConsole(client)) {
|
||||||
|
databaseId = -1;
|
||||||
|
} else {
|
||||||
|
databaseId = getPlayerData(client).accountData.databaseId;
|
||||||
|
position = (getPlayerVehicle(client)) ? getVehiclePosition(getPlayerVehicle(client)) : getPlayerPosition(client);
|
||||||
|
heading = (getPlayerVehicle(client)) ? getVehicleHeading(getPlayerVehicle(client)) : getPlayerHeading(client);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
databaseId = getPlayerData(client).accountData.databaseId;
|
databaseId = defaultNoAccountId;
|
||||||
}
|
}
|
||||||
|
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if(dbConnection) {
|
if (dbConnection) {
|
||||||
let safeBugMessage = escapeDatabaseString(dbConnection, bugText);
|
let safeBugMessage = escapeDatabaseString(dbConnection, bugText);
|
||||||
queryDatabase(dbConnection, `INSERT INTO bug_main (bug_server, bug_script_ver, bug_who_added, bug_when_added, bug_message, bug_pos_x, bug_pos_y, bug_pos_z, bug_rot_z, bug_svr_start, bug_session) VALUES (${getServerId()}, '${scriptVersion}', ${databaseId}, NOW(), '${safeBugMessage}', ${position.x}, ${position.y}, ${position.z}, ${heading}, ${serverStartTime}, ${session})`);
|
queryDatabase(dbConnection, `INSERT INTO bug_main (bug_server, bug_script_ver, bug_who_added, bug_when_added, bug_message, bug_pos_x, bug_pos_y, bug_pos_z, bug_rot_z, bug_svr_start, bug_session) VALUES (${getServerId()}, '${scriptVersion}', ${databaseId}, NOW(), '${safeBugMessage}', ${position.x}, ${position.y}, ${position.z}, ${heading}, ${serverStartTime}, ${session})`);
|
||||||
}
|
}
|
||||||
@@ -551,14 +553,14 @@ function migrateSubAccountsToPerServerData() {
|
|||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
let dbQuery = false;
|
let dbQuery = false;
|
||||||
let dbAssoc = false;
|
let dbAssoc = false;
|
||||||
if(dbConnection) {
|
if (dbConnection) {
|
||||||
dbQuery = queryDatabase(dbConnection, `SELECT * FROM sacct_main`);
|
dbQuery = queryDatabase(dbConnection, `SELECT * FROM sacct_main`);
|
||||||
if(dbQuery) {
|
if (dbQuery) {
|
||||||
while(dbAssoc = fetchQueryAssoc(dbQuery)) {
|
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
||||||
createDefaultSubAccountServerData(dbAssoc["sacct_id"]);
|
createDefaultSubAccountServerData(dbAssoc["sacct_id"]);
|
||||||
|
|
||||||
let dbQuery2 = queryDatabase(dbConnection, `UPDATE sacct_svr SET sacct_svr_skin = ${dbAssoc["sacct_skin"]}, sacct_svr_job = ${dbAssoc["sacct_job"]} WHERE sacct_svr_sacct=${dbAssoc["sacct_id"]} AND sacct_svr_server=${dbAssoc["sacct_server"]}`);
|
let dbQuery2 = queryDatabase(dbConnection, `UPDATE sacct_svr SET sacct_svr_skin = ${dbAssoc["sacct_skin"]}, sacct_svr_job = ${dbAssoc["sacct_job"]} WHERE sacct_svr_sacct=${dbAssoc["sacct_id"]} AND sacct_svr_server=${dbAssoc["sacct_server"]}`);
|
||||||
if(dbQuery2) {
|
if (dbQuery2) {
|
||||||
freeDatabaseQuery(dbQuery2);
|
freeDatabaseQuery(dbQuery2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -573,10 +575,10 @@ function resetAllAccountsHotkeysToDefault() {
|
|||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
let dbQuery = false;
|
let dbQuery = false;
|
||||||
let dbAssoc = false;
|
let dbAssoc = false;
|
||||||
if(dbConnection) {
|
if (dbConnection) {
|
||||||
dbQuery = queryDatabase(dbConnection, `SELECT acct_id FROM acct_main`);
|
dbQuery = queryDatabase(dbConnection, `SELECT acct_id FROM acct_main`);
|
||||||
if(dbQuery) {
|
if (dbQuery) {
|
||||||
while(dbAssoc = fetchQueryAssoc(dbQuery)) {
|
while (dbAssoc = fetchQueryAssoc(dbQuery)) {
|
||||||
createDefaultKeybindsForAccount(dbAssoc["acct_id"]);
|
createDefaultKeybindsForAccount(dbAssoc["acct_id"]);
|
||||||
}
|
}
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
@@ -595,9 +597,9 @@ function togglePauseSavingToDatabaseCommand(command, params, client) {
|
|||||||
function createAccountDataForNewServer(serverId) {
|
function createAccountDataForNewServer(serverId) {
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
let dbQuery = false;
|
let dbQuery = false;
|
||||||
if(dbConnection) {
|
if (dbConnection) {
|
||||||
dbQuery = queryDatabase(dbConnection, `SELECT * FROM acct_main`);
|
dbQuery = queryDatabase(dbConnection, `SELECT * FROM acct_main`);
|
||||||
if(dbQuery) {
|
if (dbQuery) {
|
||||||
let dbQueryString = `INSERT INTO acct_svr (acct_svr_acct, acct_svr_svr) VALUES (${accountDatabaseId}, ${serverId})`;
|
let dbQueryString = `INSERT INTO acct_svr (acct_svr_acct, acct_svr_svr) VALUES (${accountDatabaseId}, ${serverId})`;
|
||||||
quickDatabaseQuery(dbQueryString);
|
quickDatabaseQuery(dbQueryString);
|
||||||
}
|
}
|
||||||
@@ -607,7 +609,7 @@ function createAccountDataForNewServer(serverId) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function streamAudioURLToAllPlayersCommand(command, params, client) {
|
function streamAudioURLToAllPlayersCommand(command, params, client) {
|
||||||
if(areParamsEmpty(params)) {
|
if (areParamsEmpty(params)) {
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -621,7 +623,7 @@ function streamAudioURLToAllPlayersCommand(command, params, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function streamAudioNameToAllPlayersCommand(command, params, client) {
|
function streamAudioNameToAllPlayersCommand(command, params, client) {
|
||||||
if(areParamsEmpty(params)) {
|
if (areParamsEmpty(params)) {
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -685,28 +687,28 @@ function showLocalePickerTestCommand(command, params, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function executeDatabaseQueryCommand(command, params, client) {
|
function executeDatabaseQueryCommand(command, params, client) {
|
||||||
if(areParamsEmpty(params)) {
|
if (areParamsEmpty(params)) {
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!targetClient) {
|
if (!targetClient) {
|
||||||
messagePlayerError(client, "That player was not found!");
|
messagePlayerError(client, "That player was not found!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(targetCode == "") {
|
if (targetCode == "") {
|
||||||
messagePlayerError(client, "You didn't enter any code!");
|
messagePlayerError(client, "You didn't enter any code!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let success = quickDatabaseQuery(params);
|
let results = quickDatabaseQueryWithResults(params);
|
||||||
|
|
||||||
if(!success) {
|
if (results == false || results == null || results == undefined) {
|
||||||
messagePlayerAlert(client, `Database query failed to execute: {ALTCOLOUR}${query}`);
|
messagePlayerAlert(client, `Database query failed to execute: {ALTCOLOUR}${query}`);
|
||||||
} else if(typeof success != "boolean") {
|
} else if (typeof results == "boolean") {
|
||||||
messagePlayeSuccess(client, `Database query successful: {ALTCOLOUR}${query}`);
|
messagePlayerSuccess(client, `Database query successful: {ALTCOLOUR}${query}`);
|
||||||
messagePlayerInfo(client, `Returns: ${success}`);
|
messagePlayerInfo(client, `Returns: ${getTrueFalseFromBool(results)}`);
|
||||||
} else {
|
} else {
|
||||||
messagePlayerSuccess(client, `Database query successful: {ALTCOLOUR}${query}`);
|
messagePlayerSuccess(client, `Database query successful: {ALTCOLOUR}${query}`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,23 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: discord.js
|
// FILE: discord.js
|
||||||
// DESC: Provides discord bridging and connection functions and usage
|
// DESC: Provides discord bridging and connection functions and usage
|
||||||
// TYPE: Server (JavaScript)
|
// TYPE: Server (JavaScript)
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
// Discord Webhook Types
|
||||||
|
const AGRP_DISCORD_WEBHOOK_NONE = 0;
|
||||||
|
const AGRP_DISCORD_WEBHOOK_LOG = 1;
|
||||||
|
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!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -102,7 +110,8 @@ function messageDiscordChatChannel(messageString) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
messageString = removeColoursInMessage(messageString);
|
messageString = removeColoursInMessage(messageString);
|
||||||
triggerDiscordWebHook(messageString, getServerId(), VRR_DISCORD_WEBHOOK_LOG);
|
messageString = replaceProfanityInMessage(messageString);
|
||||||
|
triggerDiscordWebHook(messageString, getServerId(), AGRP_DISCORD_WEBHOOK_LOG);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -121,7 +130,8 @@ function messageDiscordEventChannel(messageString) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
messageString = removeColoursInMessage(messageString);
|
messageString = removeColoursInMessage(messageString);
|
||||||
triggerDiscordWebHook(messageString, getServerId(), VRR_DISCORD_WEBHOOK_LOG);
|
messageString = replaceProfanityInMessage(messageString);
|
||||||
|
triggerDiscordWebHook(messageString, getServerId(), AGRP_DISCORD_WEBHOOK_LOG);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -140,18 +150,41 @@ function messageDiscordAdminChannel(messageString) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
messageString = removeColoursInMessage(messageString);
|
messageString = removeColoursInMessage(messageString);
|
||||||
triggerDiscordWebHook(messageString, getServerId(), VRR_DISCORD_WEBHOOK_ADMIN);
|
triggerDiscordWebHook(messageString, getServerId(), AGRP_DISCORD_WEBHOOK_ADMIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function triggerDiscordWebHook(messageString, serverId = getServerId(), type = VRR_DISCORD_WEBHOOK_LOG) {
|
function messageDiscordClanWebhook(clanIndex, requiredFlagValue, messageString) {
|
||||||
|
if (getServerConfig().devServer == true) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!getGlobalConfig().discord.sendClan) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!getServerConfig().discord.sendClan) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!hasBitFlag(getClanData(clanIndex).discordWebhookFlags, requiredFlagValue)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
messageString = removeColoursInMessage(messageString);
|
||||||
|
triggerClanDiscordWebHook(clanIndex, messageString);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function triggerDiscordWebHook(messageString, serverId = getServerId(), type = AGRP_DISCORD_WEBHOOK_LOG) {
|
||||||
if (!getGlobalConfig().discord.webhook.enabled) {
|
if (!getGlobalConfig().discord.webhook.enabled) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
||||||
@@ -168,3 +201,31 @@ function triggerDiscordWebHook(messageString, serverId = getServerId(), type = V
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function triggerClanDiscordWebHook(clanIndex, messageString) {
|
||||||
|
if (!getGlobalConfig().discord.webhook.enabled) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
let webhookURL = getClanData(clanIndex).discordWebhookURL;
|
||||||
|
|
||||||
|
let tempURL = getGlobalConfig().discord.webhook.webhookBaseURL;
|
||||||
|
tempURL = tempURL.replace("{0}", encodeURIComponent(messageString));
|
||||||
|
tempURL = tempURL.replace("{1}", serverId);
|
||||||
|
tempURL = tempURL.replace("{2}", type);
|
||||||
|
tempURL = tempURL.replace("{3}", getGlobalConfig().discord.webhook.pass);
|
||||||
|
|
||||||
|
httpGet(
|
||||||
|
tempURL,
|
||||||
|
"",
|
||||||
|
function (data) {
|
||||||
|
|
||||||
|
},
|
||||||
|
function (data) {
|
||||||
|
}
|
||||||
|
);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: economy.js
|
// FILE: economy.js
|
||||||
// DESC: Provides economy/financial utils, functions and usage
|
// DESC: Provides economy/financial utils, functions and usage
|
||||||
@@ -8,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!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -46,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 {
|
||||||
@@ -140,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}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -187,19 +188,19 @@ function repossessFirstAsset(client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getAllVehiclesOwnedByPlayer(client) {
|
function getAllVehiclesOwnedByPlayer(client) {
|
||||||
return getServerData().vehicles.filter((v) => v.ownerType == VRR_VEHOWNER_PLAYER && v.ownerId == getPlayerCurrentSubAccount(client).databaseId);
|
return getServerData().vehicles.filter((v) => v.ownerType == AGRP_VEHOWNER_PLAYER && v.ownerId == getPlayerCurrentSubAccount(client).databaseId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getAllBusinessesOwnedByPlayer(client) {
|
function getAllBusinessesOwnedByPlayer(client) {
|
||||||
return getServerData().businesses.filter((b) => b.ownerType == VRR_BIZOWNER_PLAYER && b.ownerId == getPlayerCurrentSubAccount(client).databaseId);
|
return getServerData().businesses.filter((b) => b.ownerType == AGRP_BIZ_OWNER_PLAYER && b.ownerId == getPlayerCurrentSubAccount(client).databaseId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getAllHousesOwnedByPlayer(client) {
|
function getAllHousesOwnedByPlayer(client) {
|
||||||
return getServerData().houses.filter((h) => h.ownerType == VRR_HOUSEOWNER_PLAYER && h.ownerId == getPlayerCurrentSubAccount(client).databaseId);
|
return getServerData().houses.filter((h) => h.ownerType == AGRP_HOUSE_OWNER_PLAYER && h.ownerId == getPlayerCurrentSubAccount(client).databaseId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -213,3 +214,11 @@ function isDoubleBonusActive() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getCurrencyString(amount) {
|
||||||
|
let tempString = getGlobalConfig().economy.currencyString;
|
||||||
|
tempString = tempString.replace("{AMOUNT}", toString(makeLargeNumberReadable(amount)));
|
||||||
|
return tempString;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -1,39 +1,75 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: email.js
|
// FILE: email.js
|
||||||
// DESC: Provides email handling, functions and usage
|
// DESC: Provides email handling, functions and usage
|
||||||
// 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) {
|
||||||
if (!checkForSMTPModule()) {
|
switch (getEmailConfig().method) {
|
||||||
return false;
|
case AGRP_EMAIL_METHOD_SMTP_MODULE:
|
||||||
|
if (!checkForSMTPModule()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Promise.resolve().then(() => {
|
||||||
|
module.smtp.send(
|
||||||
|
getEmailConfig().smtp.host,
|
||||||
|
getEmailConfig().smtp.port,
|
||||||
|
intToBool(getEmailConfig().smtp.useTLS),
|
||||||
|
getEmailConfig().smtp.username,
|
||||||
|
getEmailConfig().smtp.password,
|
||||||
|
toEmail,
|
||||||
|
toName,
|
||||||
|
subject,
|
||||||
|
body,
|
||||||
|
getEmailConfig().smtp.from,
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
Promise.resolve().then(() => {
|
return true;
|
||||||
module.smtp.send(
|
|
||||||
getEmailConfig().smtp.host,
|
|
||||||
getEmailConfig().smtp.port,
|
|
||||||
intToBool(getEmailConfig().smtp.useTLS),
|
|
||||||
getEmailConfig().smtp.username,
|
|
||||||
getEmailConfig().smtp.password,
|
|
||||||
toEmail,
|
|
||||||
toName,
|
|
||||||
subject,
|
|
||||||
body,
|
|
||||||
getEmailConfig().smtp.from,
|
|
||||||
getEmailConfig().smtp.fromName
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,15 +1,209 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: fishing.js
|
// FILE: fishing.js
|
||||||
// DESC: Provides fishing functions and commands
|
// DESC: Provides fishing functions and commands
|
||||||
// TYPE: Server (JavaScript)
|
// TYPE: Server (JavaScript)
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
// Fishing Catch Types (Probably not going to be used, in favor of items and their use type)
|
||||||
|
const AGRP_FISHING_CATCH_TYPE_NONE = 0;
|
||||||
|
const AGRP_FISHING_CATCH_TYPE_FISH = 1;
|
||||||
|
const AGRP_FISHING_CATCH_TYPE_JUNK = 2;
|
||||||
|
|
||||||
|
// Fishing Line States
|
||||||
|
const AGRP_FISHING_LINE_STATE_NONE = 0;
|
||||||
|
const AGRP_FISHING_LINE_STATE_READY = 1;
|
||||||
|
const AGRP_FISHING_LINE_STATE_CASTING = 2;
|
||||||
|
const AGRP_FISHING_LINE_STATE_CASTED = 3;
|
||||||
|
const AGRP_FISHING_LINE_STATE_REELING = 4;
|
||||||
|
const AGRP_FISHING_LINE_STATE_HOOKED = 5;
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
let fishingCollectables = [
|
||||||
|
// Fish
|
||||||
|
["Salmon", AGRP_FISHING_CATCH_TYPE_FISH],
|
||||||
|
["Tuna", AGRP_FISHING_CATCH_TYPE_FISH],
|
||||||
|
["Crab", AGRP_FISHING_CATCH_TYPE_FISH],
|
||||||
|
["Trout", AGRP_FISHING_CATCH_TYPE_FISH],
|
||||||
|
["Sea Bass", AGRP_FISHING_CATCH_TYPE_FISH],
|
||||||
|
["Shark", AGRP_FISHING_CATCH_TYPE_FISH],
|
||||||
|
["Turtle", AGRP_FISHING_CATCH_TYPE_FISH],
|
||||||
|
["Manta Ray", AGRP_FISHING_CATCH_TYPE_FISH],
|
||||||
|
["Cat Fish", AGRP_FISHING_CATCH_TYPE_FISH],
|
||||||
|
["Blue Marlin", AGRP_FISHING_CATCH_TYPE_FISH],
|
||||||
|
|
||||||
|
// Junk
|
||||||
|
["Rusty Can", AGRP_FISHING_CATCH_TYPE_JUNK],
|
||||||
|
["Old Pants", AGRP_FISHING_CATCH_TYPE_JUNK],
|
||||||
|
["Old Shoes", AGRP_FISHING_CATCH_TYPE_JUNK],
|
||||||
|
["Garbage", AGRP_FISHING_CATCH_TYPE_JUNK],
|
||||||
|
["Baby Diaper", AGRP_FISHING_CATCH_TYPE_JUNK],
|
||||||
|
["Old Tire", AGRP_FISHING_CATCH_TYPE_JUNK],
|
||||||
|
["Old Car Battery", AGRP_FISHING_CATCH_TYPE_JUNK],
|
||||||
|
["Horse Hoove", AGRP_FISHING_CATCH_TYPE_JUNK],
|
||||||
|
["Soggy Log", AGRP_FISHING_CATCH_TYPE_JUNK],
|
||||||
|
["Soggy Dildo", AGRP_FISHING_CATCH_TYPE_JUNK],
|
||||||
|
["Clump of Seaweed", AGRP_FISHING_CATCH_TYPE_JUNK],
|
||||||
|
];
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
let fishingAnimations = {
|
||||||
|
[AGRP_GAME_GTA_III]: {
|
||||||
|
"fishingLineCasting": "bathit1",
|
||||||
|
"fishingLineReeling": "aimdown",
|
||||||
|
},
|
||||||
|
[AGRP_GAME_GTA_VC]: {
|
||||||
|
"fishingLineCasting": "frontpunch",
|
||||||
|
"fishingLineReeling": "aimdown",
|
||||||
|
},
|
||||||
|
[AGRP_GAME_GTA_SA]: {
|
||||||
|
"fishingLineCasting": "none",
|
||||||
|
"fishingLineReeling": "none",
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
let fishingParticleEffects = {
|
||||||
|
[AGRP_GAME_GTA_III]: {
|
||||||
|
"fishingLineCast": [
|
||||||
|
"MediumSprayingWater",
|
||||||
|
0.2,
|
||||||
|
500
|
||||||
|
],
|
||||||
|
"fishingLineReel": [
|
||||||
|
"MediumSprayingWater",
|
||||||
|
0.2,
|
||||||
|
500
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
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!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function castFishingLineCommand(command, params, client) {
|
||||||
|
if (!isPlayerInFishingSpot(client)) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "CantFishHere"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (doesPlayerHaveItemOfUseTypeEquipped(client, AGRP_ITEM_USE_TYPE_FISHINGROD)) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "NeedFishingRod"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (doesPlayerHaveFishingLineCast(client)) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "FishingLineAlreadyCast"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
let maxStrength = getGlobalConfig().fishingCastMaxStrength;
|
||||||
|
let minStrength = getGlobalConfig().fishingCastMinStrength;
|
||||||
|
let keyDuration = getPlayerData(client).keyBindDuration;
|
||||||
|
|
||||||
|
let strength = Math.round((maxStrength - minStrength) * (keyDuration / getGlobalConfig().fishingLineCastDuration));
|
||||||
|
|
||||||
|
castPlayerFishingLine(client, strength);
|
||||||
|
|
||||||
|
let messageText = getLocaleString(client, "FishingCastCommandHelp");
|
||||||
|
if (doesPlayerHaveKeyBindForCommand(client, "fish")) {
|
||||||
|
messageText = getLocaleString(client, "FishingCastKeyPressHelp");
|
||||||
|
}
|
||||||
|
showSmallGameMessage(client, messageText);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function resetFishingLineCommand(client) {
|
||||||
|
if (doesPlayerHaveFishingLineCast(client)) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "FishingLineNotCast"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (doesPlayerHaveItemOfUseTypeEquipped(client, AGRP_ITEM_USE_TYPE_FISHINGROD)) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "NeedFishingRod"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isPlayerInFishingSpot(client)) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "CantFishHere"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
makePedStopAnimation(getPlayerPed(client));
|
||||||
|
|
||||||
|
let messageText = getLocaleString(client, "FishingCastCommandHelp");
|
||||||
|
if (doesPlayerHaveKeyBindForCommand(client, "fish")) {
|
||||||
|
messageText = getLocaleString(client, "FishingCastKeyPressHelp");
|
||||||
|
}
|
||||||
|
|
||||||
|
showSmallGameMessage(client, messageText);
|
||||||
|
|
||||||
|
getPlayerData(client).fishingLineState = AGRP_FISHING_LINE_STATE_NONE;
|
||||||
|
getPlayerData(client).fishingLineCastStart = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function doesPlayerHaveFishingLineCast(client) {
|
||||||
|
return getPlayerData(client).fishingLineCastStart != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function castPlayerFishingLine(client, strength) {
|
||||||
|
let frontPosition = getPosInFrontOfPos(getPlayerPosition(client), getPlayerHeading(client), strength * 2);
|
||||||
|
|
||||||
|
makePlayerPlayAnimation(client, getAnimationFromParams(fishingAnimations[getGame()]["fishingLineCasting"]));
|
||||||
|
|
||||||
|
setTimeout(function () {
|
||||||
|
let particleEffectName = fishingParticleEffects[getGame()].fishingLineCast[1];
|
||||||
|
showParticleEffect(frontPosition, getGameConfig().particleEffects[getGame()][particleEffectName], fishingParticleEffects[getGame()].fishingLineCast[1], fishingParticleEffects[getGame()].fishingLineCast[2]);
|
||||||
|
|
||||||
|
getPlayerData(client).fishingLineCastPosition = frontPosition;
|
||||||
|
getPlayerData(client).fishingLineState = AGRP_FISHING_LINE_STATE_CASTED;
|
||||||
|
}, strength * 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function isPlayerInFishingSpot(client) {
|
||||||
|
if (isPlayerOnBoat(client)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
let closestFishingLocation = getClosestFishingLocation(getPlayerPosition(client));
|
||||||
|
if (closestFishingLocation != false) {
|
||||||
|
if (getDistance(getPlayerPosition(client), closestFishingLocation) < getGlobalConfig().fishingSpotDistance) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function isPlayerFishing(client) {
|
||||||
|
return (getPlayerData(client).fishingLineState != AGRP_FISHING_LINE_STATE_NONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function isPlayerFishing(client) {
|
||||||
|
return (getPlayerData(client).fishingLineState != AGRP_FISHING_LINE_STATE_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: forensics.js
|
// FILE: forensics.js
|
||||||
// DESC: Provides forensics functions and commands (bullet casings, blood, etc)
|
// DESC: Provides forensics functions and commands (bullet casings, blood, etc)
|
||||||
@@ -8,13 +9,13 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
// Forensic Types
|
// Forensic Types
|
||||||
const VRR_FORENSICS_NONE = 0;
|
const AGRP_FORENSICS_NONE = 0;
|
||||||
const VRR_FORENSICS_BULLET = 1; // Bullet. The actual tip that hits a target. Has rifling and ballistics information of the weapon.
|
const AGRP_FORENSICS_BULLET = 1; // Bullet. The actual tip that hits a target. Has rifling and ballistics information of the weapon.
|
||||||
const VRR_FORENSICS_BLOOD = 2; // Blood. Automatically applied to ground and bullets that hit when somebody is shot
|
const AGRP_FORENSICS_BLOOD = 2; // Blood. Automatically applied to ground and bullets that hit and outfit worn when somebody is shot
|
||||||
const VRR_FORENSICS_BODY = 3; // Body. A dead body lol
|
const AGRP_FORENSICS_BODY = 3; // Body. A dead body lol
|
||||||
const VRR_FORENSICS_HAIR = 4; // Hair. Automatically applied to
|
const AGRP_FORENSICS_HAIR = 4; // Hair.
|
||||||
const VRR_FORENSICS_SWEAT = 5; // Sweat. Automatically applied to clothing when worn
|
const AGRP_FORENSICS_SWEAT = 5; // Sweat. Automatically applied to clothing when worn
|
||||||
const VRR_FORENSICS_SALIVA = 6; // Saliva. Automatically applied to drinks when drank
|
const AGRP_FORENSICS_SALIVA = 6; // Saliva. Automatically applied to drinks when drank and unfinished food items when eaten
|
||||||
const VRR_FORENSICS_BULLETCASINGS = 7; // Bullet casings. Automatically dropped when fired from a weapon except when used in a vehicle (driveby)
|
const AGRP_FORENSICS_BULLETCASINGS = 7; // Bullet casings. Automatically dropped when fired from a weapon except when used in a vehicle (driveby)
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: gate.js
|
// FILE: gate.js
|
||||||
// DESC: Provides gate functions and commands
|
// DESC: Provides gate functions and commands
|
||||||
@@ -8,14 +9,14 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
// Gate Owner Types
|
// Gate Owner Types
|
||||||
const VRR_GATEOWNER_NONE = 0; // Not owned
|
const AGRP_GATEOWNER_NONE = 0; // Not owned
|
||||||
const VRR_GATEOWNER_PLAYER = 1; // Owner is a player (character/subaccount)
|
const AGRP_GATEOWNER_PLAYER = 1; // Owner is a player (character/subaccount)
|
||||||
const VRR_GATEOWNER_JOB = 2; // Owned by a job
|
const AGRP_GATEOWNER_JOB = 2; // Owned by a job
|
||||||
const VRR_GATEOWNER_CLAN = 3; // Owned by a clan
|
const AGRP_GATEOWNER_CLAN = 3; // Owned by a clan
|
||||||
const VRR_GATEOWNER_FACTION = 4; // Owned by a faction
|
const AGRP_GATEOWNER_FACTION = 4; // Owned by a faction
|
||||||
const VRR_GATEOWNER_PUBLIC = 5; // Public gate. Technically not owned. This probably won't be used.
|
const AGRP_GATEOWNER_PUBLIC = 5; // Public gate. Technically not owned. This probably won't be used.
|
||||||
const VRR_GATEOWNER_BUSINESS = 6; // Owned by a business. Back lots, unloading areas, and other stuff like that
|
const AGRP_GATEOWNER_BUSINESS = 6; // Owned by a business. Back lots, unloading areas, and other stuff like that
|
||||||
const VRR_GATEOWNER_HOUSE = 7; // Owned by a house. Like for mansions with closed private areas.
|
const AGRP_GATEOWNER_HOUSE = 7; // Owned by a house. Like for mansions with closed private areas.
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
@@ -27,7 +28,7 @@ class GateData {
|
|||||||
this.enabled = false;
|
this.enabled = false;
|
||||||
this.position = toVector3(0.0, 0.0, 0.0);
|
this.position = toVector3(0.0, 0.0, 0.0);
|
||||||
this.locked = true;
|
this.locked = true;
|
||||||
this.ownerType = VRR_GATEOWNER_NONE;
|
this.ownerType = AGRP_GATEOWNER_NONE;
|
||||||
this.ownerId = 0;
|
this.ownerId = 0;
|
||||||
|
|
||||||
if (dbAssoc) {
|
if (dbAssoc) {
|
||||||
@@ -45,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!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -54,17 +55,17 @@ function initGateScript() {
|
|||||||
function doesPlayerHaveGateKeys(client, vehicle) {
|
function doesPlayerHaveGateKeys(client, vehicle) {
|
||||||
let gateData = getGateData(vehicle);
|
let gateData = getGateData(vehicle);
|
||||||
|
|
||||||
if (gateData.ownerType == VRR_GATEOWNER_PUBLIC) {
|
if (gateData.ownerType == AGRP_GATEOWNER_PUBLIC) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gateData.ownerType == VRR_GATEOWNER_PLAYER) {
|
if (gateData.ownerType == AGRP_GATEOWNER_PLAYER) {
|
||||||
if (gateData.ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
if (gateData.ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gateData.ownerType == VRR_GATEOWNER_CLAN) {
|
if (gateData.ownerType == AGRP_GATEOWNER_CLAN) {
|
||||||
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageClans"))) {
|
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageClans"))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -76,7 +77,7 @@ function doesPlayerHaveGateKeys(client, vehicle) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gateData.ownerType == VRR_GATEOWNER_FACTION) {
|
if (gateData.ownerType == AGRP_GATEOWNER_FACTION) {
|
||||||
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageFactions"))) {
|
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageFactions"))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -88,7 +89,7 @@ function doesPlayerHaveGateKeys(client, vehicle) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gateData.ownerType == VRR_GATEOWNER_JOB) {
|
if (gateData.ownerType == AGRP_GATEOWNER_JOB) {
|
||||||
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageJobs"))) {
|
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageJobs"))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -98,7 +99,7 @@ function doesPlayerHaveGateKeys(client, vehicle) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gateData.ownerType == VRR_GATEOWNER_BUSINESS) {
|
if (gateData.ownerType == AGRP_GATEOWNER_BUSINESS) {
|
||||||
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageBusinesses"))) {
|
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageBusinesses"))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -108,7 +109,7 @@ function doesPlayerHaveGateKeys(client, vehicle) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gateData.ownerType == VRR_GATEOWNER_HOUSE) {
|
if (gateData.ownerType == AGRP_GATEOWNER_HOUSE) {
|
||||||
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageHouses"))) {
|
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageHouses"))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -193,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);
|
||||||
@@ -227,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;
|
||||||
}
|
}
|
||||||
@@ -235,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();
|
||||||
@@ -248,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);
|
||||||
@@ -256,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: gps.js
|
// FILE: gps.js
|
||||||
// DESC: Provides GPS functions and commands
|
// DESC: Provides GPS functions and commands
|
||||||
@@ -8,36 +9,36 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
// GPS State Types
|
// GPS State Types
|
||||||
const VRR_GPS_TYPE_NONE = 0; // None (invalid)
|
const AGRP_GPS_TYPE_NONE = 0; // None (invalid)
|
||||||
const VRR_GPS_TYPE_BUSINESS = 1; // Business
|
const AGRP_GPS_TYPE_BUSINESS = 1; // Business
|
||||||
const VRR_GPS_TYPE_POLICE = 2; // Police Station
|
const AGRP_GPS_TYPE_POLICE = 2; // Police Station
|
||||||
const VRR_GPS_TYPE_HOSPITAL = 3; // Hospital
|
const AGRP_GPS_TYPE_HOSPITAL = 3; // Hospital
|
||||||
const VRR_GPS_TYPE_JOB = 4; // Job
|
const AGRP_GPS_TYPE_JOB = 4; // Job
|
||||||
const VRR_GPS_TYPE_GAMELOC = 5; // Game Location
|
const AGRP_GPS_TYPE_GAMELOC = 5; // Game Location
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function gpsCommand(command, params, client) {
|
function gpsCommand(command, params, client) {
|
||||||
messagePlayerNormal(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderBusinessList")));
|
messagePlayerNormal(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderBusinessList")));
|
||||||
|
|
||||||
let locationType = VRR_GPS_TYPE_NONE;
|
let locationType = AGRP_GPS_TYPE_NONE;
|
||||||
let useType = VRR_ITEM_USETYPE_NONE;
|
let useType = AGRP_ITEM_USE_TYPE_NONE;
|
||||||
let blipColour = "white";
|
let blipColour = "white";
|
||||||
|
|
||||||
switch(toLowerCase(params)) {
|
switch (toLowerCase(params)) {
|
||||||
case "police":
|
case "police":
|
||||||
blipColour = "businessBlue"
|
blipColour = "businessBlue"
|
||||||
locationType = VRR_GPS_TYPE_POLICE;
|
locationType = AGRP_GPS_TYPE_POLICE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "hospital":
|
case "hospital":
|
||||||
blipColour = "businessBlue"
|
blipColour = "businessBlue"
|
||||||
locationType = VRR_GPS_TYPE_HOSPITAL;
|
locationType = AGRP_GPS_TYPE_HOSPITAL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "job":
|
case "job":
|
||||||
blipColour = "businessBlue"
|
blipColour = "businessBlue"
|
||||||
locationType = VRR_GPS_TYPE_JOB;
|
locationType = AGRP_GPS_TYPE_JOB;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "skin":
|
case "skin":
|
||||||
@@ -45,8 +46,8 @@ function gpsCommand(command, params, client) {
|
|||||||
case "clothes":
|
case "clothes":
|
||||||
case "player":
|
case "player":
|
||||||
blipColour = "businessBlue"
|
blipColour = "businessBlue"
|
||||||
locationType = VRR_GPS_TYPE_BUSINESS;
|
locationType = AGRP_GPS_TYPE_BUSINESS;
|
||||||
useType = VRR_ITEM_USETYPE_SKIN;
|
useType = AGRP_ITEM_USE_TYPE_SKIN;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "gun":
|
case "gun":
|
||||||
@@ -56,29 +57,29 @@ function gpsCommand(command, params, client) {
|
|||||||
case "wep":
|
case "wep":
|
||||||
case "weps":
|
case "weps":
|
||||||
blipColour = "businessBlue"
|
blipColour = "businessBlue"
|
||||||
locationType = VRR_GPS_TYPE_BUSINESS;
|
locationType = AGRP_GPS_TYPE_BUSINESS;
|
||||||
useType = VRR_ITEM_USETYPE_WEAPON;
|
useType = AGRP_ITEM_USE_TYPE_WEAPON;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "food":
|
case "food":
|
||||||
case "eat":
|
case "eat":
|
||||||
blipColour = "businessBlue"
|
blipColour = "businessBlue"
|
||||||
locationType = VRR_GPS_TYPE_BUSINESS;
|
locationType = AGRP_GPS_TYPE_BUSINESS;
|
||||||
useType = VRR_ITEM_USETYPE_FOOD;
|
useType = AGRP_ITEM_USE_TYPE_FOOD;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "drink":
|
case "drink":
|
||||||
blipColour = "businessBlue"
|
blipColour = "businessBlue"
|
||||||
locationType = VRR_GPS_TYPE_BUSINESS;
|
locationType = AGRP_GPS_TYPE_BUSINESS;
|
||||||
useType = VRR_ITEM_USETYPE_DRINK;
|
useType = AGRP_ITEM_USE_TYPE_DRINK;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "alcohol":
|
case "alcohol":
|
||||||
case "booze":
|
case "booze":
|
||||||
case "bar":
|
case "bar":
|
||||||
blipColour = "businessBlue"
|
blipColour = "businessBlue"
|
||||||
locationType = VRR_GPS_TYPE_BUSINESS;
|
locationType = AGRP_GPS_TYPE_BUSINESS;
|
||||||
useType = VRR_ITEM_USETYPE_ALCOHOL;
|
useType = AGRP_ITEM_USE_TYPE_ALCOHOL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "repair":
|
case "repair":
|
||||||
@@ -87,8 +88,8 @@ function gpsCommand(command, params, client) {
|
|||||||
case "spray":
|
case "spray":
|
||||||
case "fix":
|
case "fix":
|
||||||
blipColour = "businessBlue"
|
blipColour = "businessBlue"
|
||||||
locationType = VRR_GPS_TYPE_BUSINESS;
|
locationType = AGRP_GPS_TYPE_BUSINESS;
|
||||||
useType = VRR_ITEM_USETYPE_VEHREPAIR;
|
useType = AGRP_ITEM_USE_TYPE_VEHREPAIR;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "vehiclecolour":
|
case "vehiclecolour":
|
||||||
@@ -96,53 +97,53 @@ function gpsCommand(command, params, client) {
|
|||||||
case "carcolour":
|
case "carcolour":
|
||||||
case "colour":
|
case "colour":
|
||||||
blipColour = "businessBlue"
|
blipColour = "businessBlue"
|
||||||
locationType = VRR_GPS_TYPE_BUSINESS;
|
locationType = AGRP_GPS_TYPE_BUSINESS;
|
||||||
useType = VRR_ITEM_USETYPE_VEHCOLOUR;
|
useType = AGRP_ITEM_USE_TYPE_VEHCOLOUR;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
let itemTypeId = getItemTypeFromParams(params);
|
let itemTypeId = getItemTypeFromParams(params);
|
||||||
if(getItemTypeData(itemTypeId) != false) {
|
if (getItemTypeData(itemTypeId) != false) {
|
||||||
locationType = VRR_GPS_TYPE_BUSINESS;
|
locationType = AGRP_GPS_TYPE_BUSINESS;
|
||||||
blipColour = "businessBlue";
|
blipColour = "businessBlue";
|
||||||
useType = getItemTypeData(itemTypeId).useType;
|
useType = getItemTypeData(itemTypeId).useType;
|
||||||
} else {
|
} else {
|
||||||
let gameLocationId = getGameLocationFromParams(params);
|
let gameLocationId = getGameLocationFromParams(params);
|
||||||
if(gameLocationId != false) {
|
if (gameLocationId != false) {
|
||||||
position = getGameConfig().locations[getServerGame()][gameLocationId][1]
|
position = getGameConfig().locations[getServerGame()][gameLocationId][1]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(locationType == VRR_GPS_TYPE_NONE) {
|
if (locationType == AGRP_GPS_TYPE_NONE) {
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidGPSLocation"));
|
messagePlayerError(client, getLocaleString(client, "InvalidGPSLocation"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(locationType == VRR_GPS_TYPE_BUSINESS) {
|
if (locationType == AGRP_GPS_TYPE_BUSINESS) {
|
||||||
let businessId = getClosestBusinessWithBuyableItemOfUseType(useType);
|
let businessId = getClosestBusinessWithBuyableItemOfUseType(useType);
|
||||||
if(!businessId) {
|
if (!businessId) {
|
||||||
messagePlayerError(client, getLocaleString(client, "NoBusinessWithItemType"));
|
messagePlayerError(client, getLocaleString(client, "NoBusinessWithItemType"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!getBusinessData(businessId)) {
|
if (!getBusinessData(businessId)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "NoBusinessWithItemType"));
|
messagePlayerError(client, getLocaleString(client, "NoBusinessWithItemType"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
hideAllBlipsForPlayerGPS(client);
|
hideAllBlipsForPlayerGPS(client);
|
||||||
blinkGenericGPSBlipForPlayer(client, getBusinessData(businessId).entrancePosition, getBusinessData(businessId).entranceBlipModel, getColourByType(blipColour), 10);
|
blinkGenericGPSBlipForPlayer(client, getBusinessData(businessId).entrancePosition, getBusinessData(businessId).entranceBlipModel, getColourByType(blipColour), 10);
|
||||||
messagePlayerSuccess(client, "Look for the blinking icon on your mini map");
|
messagePlayerSuccess(client, "Look for the blinking icon on your mini map");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(locationType == VRR_GPS_TYPE_GAMELOC) {
|
if (locationType == AGRP_GPS_TYPE_GAMELOC) {
|
||||||
hideAllBlipsForPlayerGPS(client);
|
hideAllBlipsForPlayerGPS(client);
|
||||||
blinkGenericGPSBlipForPlayer(client, position, 0, getColourByType(blipColour), 10);
|
blinkGenericGPSBlipForPlayer(client, position, 0, getColourByType(blipColour), 10);
|
||||||
messagePlayerSuccess(client, "Look for the blinking icon on your mini map");
|
messagePlayerSuccess(client, "Look for the blinking icon on your mini map");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1,272 +1,28 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: gui.js
|
// FILE: gui.js
|
||||||
// DESC: Provides GUI functions and usage
|
// DESC: Provides GUI functions and usage
|
||||||
// TYPE: Server (JavaScript)
|
// TYPE: Server (JavaScript)
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
// Prompts (used for client GUI prompt responses)
|
|
||||||
const VRR_PROMPT_NONE = 0;
|
|
||||||
const VRR_PROMPT_CREATEFIRSTCHAR = 1;
|
|
||||||
const VRR_PROMPT_BIZORDER = 2;
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
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 == VRR_PROMPT_NONE) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} answered NO to their prompt (${getPlayerData(client).promptType})`);
|
|
||||||
|
|
||||||
switch (getPlayerData(client).promptType) {
|
|
||||||
case VRR_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 VRR_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 = VRR_PROMPT_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function playerPromptAnswerYes(client) {
|
|
||||||
if (getPlayerData(client).promptType == VRR_PROMPT_NONE) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} answered YES to their prompt (${getPlayerData(client).promptType})`);
|
|
||||||
|
|
||||||
switch (getPlayerData(client).promptType) {
|
|
||||||
case VRR_PROMPT_CREATEFIRSTCHAR: {
|
|
||||||
showPlayerNewCharacterGUI(client);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case VRR_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, VRR_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 VRR_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 != VRR_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 = VRR_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 VRR_PROMPT_GIVEHOUSETOCLAN: {
|
|
||||||
let houseId = getPlayerHouse(client);
|
|
||||||
if (!houseId) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidHouse"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getHouseData(houseId).ownerType != VRR_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 = VRR_HOUSEOWNER_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 VRR_PROMPT_GIVEBIZTOCLAN: {
|
|
||||||
let businessId = getPlayerBusiness(client);
|
|
||||||
if (!businessId) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidBusiness"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getBusinessData(businessId).ownerType != VRR_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 = VRR_BIZOWNER_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 VRR_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 = VRR_HOUSEOWNER_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 VRR_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 = VRR_BIZOWNER_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;
|
|
||||||
}
|
|
||||||
|
|
||||||
default: {
|
|
||||||
submitBugReport(client, `[AUTOMATED REPORT] Unknown prompt type: ${getPlayerData(client).promptType}`);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
getPlayerData(client).promptType = VRR_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("vrr.2fa", client);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: help.js
|
// FILE: help.js
|
||||||
// DESC: Provides update info, help commands, and documentation
|
// DESC: Provides update info, help commands, and documentation
|
||||||
@@ -8,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!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -48,14 +49,12 @@ let randomTips = [
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function helpCommand(command, params, client) {
|
function helpCommand(command, params, client) {
|
||||||
if(areParamsEmpty(params)) {
|
if (areParamsEmpty(params)) {
|
||||||
showMainHelpMessage(client);
|
showMainHelpMessage(client);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let splitParams = params.split(" ");
|
switch (toLowerCase(getParam(params, " ", 1))) {
|
||||||
|
|
||||||
switch(toLowerCase(getParam(params, " ", 1))) {
|
|
||||||
case "account":
|
case "account":
|
||||||
showAccountHelpMessage(client);
|
showAccountHelpMessage(client);
|
||||||
break;
|
break;
|
||||||
@@ -195,8 +194,8 @@ function showMainHelpMessage(client) {
|
|||||||
function showAccountHelpMessage(client) {
|
function showAccountHelpMessage(client) {
|
||||||
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderAccountHelp")));
|
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderAccountHelp")));
|
||||||
|
|
||||||
messagePlayerHelpContent(client, getGroupedLocaleString(client, "AccountHelp", 0));
|
messagePlayerHelpContent(client, getGroupedLocaleString(client, "AccountHelp", 0, getServerName()));
|
||||||
messagePlayerHelpContent(client, getGroupedLocaleString(client, "AccountHelp", 1, `{ALTCOLOUR}/changepass{MAINCOLOUR}`));
|
messagePlayerHelpContent(client, getGroupedLocaleString(client, "AccountHelp", 1, `{ALTCOLOUR}/changepass{MAINCOLOUR}`, `{ALTCOLOUR}/resetpass{MAINCOLOUR}`));
|
||||||
messagePlayerHelpContent(client, getGroupedLocaleString(client, "AccountHelp", 2, `{ALTCOLOUR}/gui, /logo, /iplogin, /autolastchar, /2fa, /loginalert{MAINCOLOUR}`));
|
messagePlayerHelpContent(client, getGroupedLocaleString(client, "AccountHelp", 2, `{ALTCOLOUR}/gui, /logo, /iplogin, /autolastchar, /2fa, /loginalert{MAINCOLOUR}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,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}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,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));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -244,7 +243,7 @@ function showChatHelpMessage(client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showRulesHelpMessage(client) {
|
function showRulesHelpMessage(client) {
|
||||||
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderServerRulesList")));
|
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderServerRules")));
|
||||||
messagePlayerHelpContent(client, getGroupedLocaleString(client, "RulesHelp", 0));
|
messagePlayerHelpContent(client, getGroupedLocaleString(client, "RulesHelp", 0));
|
||||||
messagePlayerHelpContent(client, getGroupedLocaleString(client, "RulesHelp", 1));
|
messagePlayerHelpContent(client, getGroupedLocaleString(client, "RulesHelp", 1));
|
||||||
messagePlayerHelpContent(client, getGroupedLocaleString(client, "RulesHelp", 2));
|
messagePlayerHelpContent(client, getGroupedLocaleString(client, "RulesHelp", 2));
|
||||||
@@ -328,7 +327,7 @@ function showRadioHelpMessage(client) {
|
|||||||
|
|
||||||
function showWealthAndTaxHelpMessage(client) {
|
function showWealthAndTaxHelpMessage(client) {
|
||||||
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderWealthandTaxHelp")));
|
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderWealthandTaxHelp")));
|
||||||
messagePlayerHelpContent(client, getGroupedLocaleString(client, "WealthAndTaxHelp", 0, `{ALTCOLOUR}${100*getGlobalConfig().economy.incomeTaxRate}%{MAINCOLOUR}`));
|
messagePlayerHelpContent(client, getGroupedLocaleString(client, "WealthAndTaxHelp", 0, `{ALTCOLOUR}${100 * getGlobalConfig().economy.incomeTaxRate}%{MAINCOLOUR}`));
|
||||||
messagePlayerHelpContent(client, getGroupedLocaleString(client, "WealthAndTaxHelp", 1));
|
messagePlayerHelpContent(client, getGroupedLocaleString(client, "WealthAndTaxHelp", 1));
|
||||||
messagePlayerHelpContent(client, getGroupedLocaleString(client, "WealthAndTaxHelp", 2, `{ALTCOLOUR}${getGlobalConfig().economy.upKeepCosts.upKeepPerVehicle}{MAINCOLOUR}`, `{ALTCOLOUR}${getGlobalConfig().economy.upKeepCosts.upKeepPerHouse}{MAINCOLOUR}`, `{ALTCOLOUR}${getGlobalConfig().economy.upKeepCosts.upKeepPerBusiness}{MAINCOLOUR}`));
|
messagePlayerHelpContent(client, getGroupedLocaleString(client, "WealthAndTaxHelp", 2, `{ALTCOLOUR}${getGlobalConfig().economy.upKeepCosts.upKeepPerVehicle}{MAINCOLOUR}`, `{ALTCOLOUR}${getGlobalConfig().economy.upKeepCosts.upKeepPerHouse}{MAINCOLOUR}`, `{ALTCOLOUR}${getGlobalConfig().economy.upKeepCosts.upKeepPerBusiness}{MAINCOLOUR}`));
|
||||||
messagePlayerHelpContent(client, getGroupedLocaleString(client, "WealthAndTaxHelp", 3, `{ALTCOLOUR}/wealth{MAINCOLOUR}`, `{ALTCOLOUR}/tax{MAINCOLOUR}`));
|
messagePlayerHelpContent(client, getGroupedLocaleString(client, "WealthAndTaxHelp", 3, `{ALTCOLOUR}/wealth{MAINCOLOUR}`, `{ALTCOLOUR}/tax{MAINCOLOUR}`));
|
||||||
@@ -337,7 +336,7 @@ function showWealthAndTaxHelpMessage(client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showCommandHelpMessage(client, commandName) {
|
function showCommandHelpMessage(client, commandName) {
|
||||||
if(!commandName) {
|
if (!commandName) {
|
||||||
messagePlayerSyntax(client, `${getCommandSyntaxText("help")}command <command name>`);
|
messagePlayerSyntax(client, `${getCommandSyntaxText("help")}command <command name>`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -345,26 +344,27 @@ function showCommandHelpMessage(client, commandName) {
|
|||||||
commandName = toLowerCase(commandName);
|
commandName = toLowerCase(commandName);
|
||||||
commandName = commandName.trim();
|
commandName = commandName.trim();
|
||||||
|
|
||||||
if(commandName.slice(0, 1) == "/") {
|
if (commandName.slice(0, 1) == "/") {
|
||||||
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)}`);
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -394,9 +394,29 @@ function helpGetCarCommand(command, params, client) {
|
|||||||
* @return {bool} Whether or not the command was successful
|
* @return {bool} Whether or not the command was successful
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function helpGetSkinCommand(command, params, client) {
|
function helpGetSkinCommand(command, params, client) {
|
||||||
messagePlayerAlert(client, getLocaleString(client, "SkinCommandHelp", `{ALTCOLOUR}/info skin{MAINCOLOUR}`));
|
messagePlayerAlert(client, getLocaleString(client, "SkinCommandHelp", `{ALTCOLOUR}/info skin{MAINCOLOUR}`));
|
||||||
messagePlayerAlert(client, ``);
|
messagePlayerAlert(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);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: house.js
|
// FILE: house.js
|
||||||
// DESC: Provides house commands, functions, and usage
|
// DESC: Provides house commands, functions, and usage
|
||||||
@@ -8,30 +9,30 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
// House Location Types
|
// House Location Types
|
||||||
const VRR_HOUSELOC_NONE = 0; // None
|
const AGRP_HOUSE_LOC_NONE = 0; // None
|
||||||
const VRR_HOUSELOC_GATE = 1; // Center of any moveable gate that belongs to the house
|
const AGRP_HOUSE_LOC_GATE = 1; // Center of any moveable gate that belongs to the house
|
||||||
const VRR_HOUSELOC_GARAGE = 2; // Location for garage (pos1 = outside, pos2 = inside). Use pos to teleport or spawn veh/ped
|
const AGRP_HOUSE_LOC_GARAGE = 2; // Location for garage (pos1 = outside, pos2 = inside). Use pos to teleport or spawn veh/ped
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
// House Owner Types
|
// House Owner Types
|
||||||
const VRR_HOUSEOWNER_NONE = 0; // Not owned
|
const AGRP_HOUSE_OWNER_NONE = 0; // Not owned
|
||||||
const VRR_HOUSEOWNER_PLAYER = 1; // Owner is a player (character/subaccount)
|
const AGRP_HOUSE_OWNER_PLAYER = 1; // Owner is a player (character/subaccount)
|
||||||
const VRR_HOUSEOWNER_JOB = 2; // Owned by a job
|
const AGRP_HOUSE_OWNER_JOB = 2; // Owned by a job
|
||||||
const VRR_HOUSEOWNER_CLAN = 3; // Owned by a clan
|
const AGRP_HOUSE_OWNER_CLAN = 3; // Owned by a clan
|
||||||
const VRR_HOUSEOWNER_FACTION = 4; // Owned by a faction
|
const AGRP_HOUSE_OWNER_FACTION = 4; // Owned by a faction
|
||||||
const VRR_HOUSEOWNER_PUBLIC = 5; // Is a public house. Technically not owned. This probably won't be used.
|
const AGRP_HOUSE_OWNER_PUBLIC = 5; // Is a public house. Technically not owned. This probably won't be used.
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class Representing a house's data. Loaded and saved in the database
|
* @class Representing a house's data. Loaded and saved in the database
|
||||||
*/
|
*/
|
||||||
class HouseData {
|
class HouseData {
|
||||||
constructor(dbAssoc = false) {
|
constructor(dbAssoc = false) {
|
||||||
this.databaseId = 0
|
this.databaseId = 0
|
||||||
this.description = "";
|
this.description = "";
|
||||||
this.ownerType = VRR_HOUSEOWNER_NONE;
|
this.ownerType = AGRP_HOUSE_OWNER_NONE;
|
||||||
this.ownerId = 0;
|
this.ownerId = 0;
|
||||||
this.buyPrice = 0;
|
this.buyPrice = 0;
|
||||||
this.rentPrice = 0;
|
this.rentPrice = 0;
|
||||||
@@ -41,6 +42,7 @@ const VRR_HOUSEOWNER_PUBLIC = 5; // Is a public house. Technical
|
|||||||
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 = [];
|
||||||
@@ -54,6 +56,7 @@ const VRR_HOUSEOWNER_PUBLIC = 5; // Is a public house. Technical
|
|||||||
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;
|
||||||
@@ -63,10 +66,12 @@ const VRR_HOUSEOWNER_PUBLIC = 5; // Is a public house. Technical
|
|||||||
this.exitBlipModel = -1;
|
this.exitBlipModel = -1;
|
||||||
this.exitPickup = null;
|
this.exitPickup = null;
|
||||||
this.exitBlip = null;
|
this.exitBlip = null;
|
||||||
|
this.exitScene = "";
|
||||||
|
|
||||||
this.streamingRadioStation = -1;
|
this.streamingRadioStation = 0;
|
||||||
|
this.streamingRadioStationIndex = -1;
|
||||||
|
|
||||||
if(dbAssoc) {
|
if (dbAssoc) {
|
||||||
this.databaseId = toInteger(dbAssoc["house_id"]);
|
this.databaseId = toInteger(dbAssoc["house_id"]);
|
||||||
this.description = toString(dbAssoc["house_description"]);
|
this.description = toString(dbAssoc["house_description"]);
|
||||||
this.ownerType = toInteger(dbAssoc["house_owner_type"]);
|
this.ownerType = toInteger(dbAssoc["house_owner_type"]);
|
||||||
@@ -84,6 +89,7 @@ const VRR_HOUSEOWNER_PUBLIC = 5; // Is a public house. Technical
|
|||||||
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"]);
|
||||||
@@ -91,6 +97,7 @@ const VRR_HOUSEOWNER_PUBLIC = 5; // Is a public house. Technical
|
|||||||
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"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -115,7 +122,7 @@ class HouseLocationData {
|
|||||||
this.interior = 0;
|
this.interior = 0;
|
||||||
this.dimension = 0;
|
this.dimension = 0;
|
||||||
|
|
||||||
if(dbAssoc) {
|
if (dbAssoc) {
|
||||||
this.databaseId = toInteger(dbAssoc["house_loc_id"]);
|
this.databaseId = toInteger(dbAssoc["house_loc_id"]);
|
||||||
this.name = toString(dbAssoc["house_loc_name"]);
|
this.name = toString(dbAssoc["house_loc_name"]);
|
||||||
this.type = toInteger(dbAssoc["house_loc_type"]);
|
this.type = toInteger(dbAssoc["house_loc_type"]);
|
||||||
@@ -149,7 +156,7 @@ class HouseGameScriptData {
|
|||||||
this.houseIndex = -1;
|
this.houseIndex = -1;
|
||||||
this.needsSaved = false;
|
this.needsSaved = false;
|
||||||
|
|
||||||
if(dbAssoc) {
|
if (dbAssoc) {
|
||||||
this.databaseId = toInteger(dbAssoc["house_script_id"]);
|
this.databaseId = toInteger(dbAssoc["house_script_id"]);
|
||||||
this.name = toString(dbAssoc["house_script_name"]);
|
this.name = toString(dbAssoc["house_script_name"]);
|
||||||
this.state = toInteger(dbAssoc["house_script_state"]);
|
this.state = toInteger(dbAssoc["house_script_state"]);
|
||||||
@@ -161,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;
|
||||||
@@ -181,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -264,11 +271,11 @@ function setHouseDescriptionCommand(command, params, client) {
|
|||||||
let oldDescription = getHouseData(houseId).description;
|
let oldDescription = getHouseData(houseId).description;
|
||||||
getHouseData(houseId).description = newHouseDescription;
|
getHouseData(houseId).description = newHouseDescription;
|
||||||
|
|
||||||
setEntityData(getHouseData(houseId).entrancePickup, "vrr.label.name", getHouseData(houseId).description, true);
|
setEntityData(getHouseData(houseId).entrancePickup, "agrp.label.name", getHouseData(houseId).description, true);
|
||||||
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -297,17 +304,18 @@ function setHouseOwnerCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageHouses"))) {
|
if (!doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageHouses"))) {
|
||||||
if (getHouseData(houseId).ownerType == VRR_HOUSEOWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
||||||
messagePlayerError(client, getLocaleString(client, "CantModifyHouse"));
|
messagePlayerError(client, getLocaleString(client, "CantModifyHouse"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_PLAYER;
|
||||||
|
getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(newHouseOwner).databaseId;
|
||||||
|
|
||||||
getHouseData(houseId).needsSaved = true;
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
getHouseData(houseId).ownerType = VRR_HOUSEOWNER_PLAYER;
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} gave house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} to {ALTCOLOUR}${getCharacterFullName(newHouseOwner)}`);
|
||||||
getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(newHouseOwner).databaseId;
|
|
||||||
messagePlayerSuccess(`{MAINCOLOUR}You gave house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} to {ALTCOLOUR}${newHouseOwner.name}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -328,17 +336,17 @@ function removeHouseOwnerCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageHouses"))) {
|
if (!doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageHouses"))) {
|
||||||
if (getHouseData(houseId).ownerType == VRR_HOUSEOWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
||||||
messagePlayerError(client, getLocaleString(client, "CantModifyHouse"));
|
messagePlayerError(client, getLocaleString(client, "CantModifyHouse"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getHouseData(houseId).ownerType = VRR_HOUSEOWNER_NONE;
|
getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_NONE;
|
||||||
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`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -367,7 +375,7 @@ function setHouseClanCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getHouseData(houseId).ownerType != VRR_VEHOWNER_PLAYER) {
|
if (getHouseData(houseId).ownerType != AGRP_VEHOWNER_PLAYER) {
|
||||||
messagePlayerError(client, getLocaleString(client, "MustOwnHouse"));
|
messagePlayerError(client, getLocaleString(client, "MustOwnHouse"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -378,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 = VRR_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!`);
|
||||||
}
|
}
|
||||||
@@ -461,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -497,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -527,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -578,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -614,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -654,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -690,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;
|
||||||
@@ -704,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -730,6 +743,29 @@ function removePlayerFromHouse(client) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Forces all players to exit a house
|
||||||
|
*
|
||||||
|
* @param {Number} houseId - The data index of the house to force all players inside to exit from
|
||||||
|
* @return {Boolean} Whether or not the players were forced to exit
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
function removePlayersFromHouse(houseIndex) {
|
||||||
|
getClients().forEach(function (client) {
|
||||||
|
if (doesHouseHaveInterior(houseIndex)) {
|
||||||
|
if (getPlayerHouse(client) == houseIndex) {
|
||||||
|
if (getPlayerInterior(client) == getHouseData(houseIndex).exitInterior && getPlayerDimension(client) == getHouseData(houseIndex).exitDimension) {
|
||||||
|
exitHouse(client);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function creates a house
|
* This function creates a house
|
||||||
*
|
*
|
||||||
@@ -738,7 +774,7 @@ function removePlayerFromHouse(client) {
|
|||||||
* @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;
|
||||||
|
|
||||||
@@ -748,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;
|
||||||
@@ -756,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;
|
||||||
|
|
||||||
@@ -774,6 +810,10 @@ function createHouse(description, entrancePosition, exitPosition, entrancePickup
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getHouseDataFromDatabaseId(databaseId) {
|
function getHouseDataFromDatabaseId(databaseId) {
|
||||||
|
if (databaseId <= 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
let matchingHouses = getServerData().houses.filter(b => b.databaseId == databaseId)
|
let matchingHouses = getServerData().houses.filter(b => b.databaseId == databaseId)
|
||||||
if (matchingHouses.length == 1) {
|
if (matchingHouses.length == 1) {
|
||||||
return matchingHouses[0];
|
return matchingHouses[0];
|
||||||
@@ -840,17 +880,18 @@ function getPlayerHouse(client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function saveAllHousesToDatabase() {
|
function saveAllHousesToDatabase() {
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.House]: Saving all server houses to database ...`);
|
||||||
if (getServerConfig().devServer) {
|
if (getServerConfig().devServer) {
|
||||||
|
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.House]: Aborting save all houses to database, dev server is enabled.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_INFO, `[VRR.House]: Saving all server houses to database ...`);
|
|
||||||
for (let i in getServerData().houses) {
|
for (let i in getServerData().houses) {
|
||||||
if (getServerData().houses[i].needsSaved) {
|
if (getServerData().houses[i].needsSaved) {
|
||||||
saveHouseToDatabase(i);
|
saveHouseToDatabase(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logToConsole(LOG_INFO, `[VRR.House]: Saving all server houses to database ...`);
|
logToConsole(LOG_INFO, `[AGRP.House]: Saved all server houses to database`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -862,7 +903,7 @@ function saveHouseToDatabase(houseId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.House]: Saving house '${tempHouseData.databaseId}' 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);
|
||||||
@@ -882,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],
|
||||||
@@ -891,12 +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", (getRadioStationData(tempHouseData.streamingRadioStationIndex) != false) ? getRadioStationData(tempHouseData.streamingRadioStationIndex) : -1],
|
||||||
];
|
];
|
||||||
|
|
||||||
let dbQuery = null;
|
let dbQuery = null;
|
||||||
@@ -915,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;
|
||||||
}
|
}
|
||||||
@@ -929,11 +971,9 @@ function saveHouseLocationToDatabase(houseId, locationId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logToConsole(LOG_VERBOSE, `[VRR.House]: Saving house location '${locationId}' for house '${getHouseData(houseId).databaseId}' 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 safeHouseDescription = escapeDatabaseString(dbConnection, getHouseData(houseId).description);
|
|
||||||
|
|
||||||
let data = [
|
let data = [
|
||||||
["house_loc_house", getHouseData(houseId).databaseId],
|
["house_loc_house", getHouseData(houseId).databaseId],
|
||||||
["house_loc_type", tempHouseLocationData.type],
|
["house_loc_type", tempHouseLocationData.type],
|
||||||
@@ -972,7 +1012,7 @@ function saveHouseLocationToDatabase(houseId, locationId) {
|
|||||||
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 location ${locationId} for house ${houseId} to database`);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1002,10 +1042,6 @@ function createHouseEntrancePickup(houseId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isGameFeatureSupported("pickups")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!getHouseData(houseId)) {
|
if (!getHouseData(houseId)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1020,14 +1056,20 @@ function createHouseEntrancePickup(houseId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let pickupModelId = getGameConfig().pickupModels[getGame()].House;
|
if (areServerElementsSupported() && getGame() != AGRP_GAME_MAFIA_ONE && getGame() != AGRP_GAME_GTA_IV) {
|
||||||
|
let entrancePickup = null;
|
||||||
|
if (isGameFeatureSupported("pickup")) {
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
entrancePickup = createGamePickup(pickupModelId, houseData.entrancePosition, getGameConfig().pickupTypes[getGame()].house);
|
||||||
|
} else if (isGameFeatureSupported("dummyElement")) {
|
||||||
|
entrancePickup = createGameDummyElement(houseData.exitPosition);
|
||||||
|
}
|
||||||
|
|
||||||
if (areServerElementsSupported()) {
|
|
||||||
let entrancePickup = createGamePickup(pickupModelId, getHouseData(houseId).entrancePosition, getGameConfig().pickupTypes[getGame()].house);
|
|
||||||
if (entrancePickup != null) {
|
if (entrancePickup != null) {
|
||||||
setElementOnAllDimensions(entrancePickup, false);
|
setElementOnAllDimensions(entrancePickup, false);
|
||||||
setElementDimension(entrancePickup, getHouseData(houseId).entranceDimension);
|
setElementDimension(entrancePickup, getHouseData(houseId).entranceDimension);
|
||||||
@@ -1038,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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1059,7 +1094,7 @@ function createHouseEntranceBlip(houseId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isGameFeatureSupported("blips")) {
|
if (!isGameFeatureSupported("blip")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1098,8 +1133,8 @@ function createHouseEntranceBlip(houseId) {
|
|||||||
setElementStreamOutDistance(entranceBlip, getGlobalConfig().houseBlipStreamOutDistance);
|
setElementStreamOutDistance(entranceBlip, getGlobalConfig().houseBlipStreamOutDistance);
|
||||||
}
|
}
|
||||||
|
|
||||||
setEntityData(entranceBlip, "vrr.owner.type", VRR_BLIP_HOUSE_ENTRANCE, false);
|
setEntityData(entranceBlip, "agrp.owner.type", AGRP_BLIP_HOUSE_ENTRANCE, false);
|
||||||
setEntityData(entranceBlip, "vrr.owner.id", houseId, false);
|
setEntityData(entranceBlip, "agrp.owner.id", houseId, false);
|
||||||
|
|
||||||
houseData.entranceBlip = entranceBlip;
|
houseData.entranceBlip = entranceBlip;
|
||||||
}
|
}
|
||||||
@@ -1116,10 +1151,6 @@ function createHouseExitPickup(houseId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isGameFeatureSupported("pickups")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!getHouseData(houseId)) {
|
if (!getHouseData(houseId)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1134,13 +1165,19 @@ function createHouseExitPickup(houseId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let pickupModelId = getGameConfig().pickupModels[getGame()].Exit;
|
let exitPickup = null;
|
||||||
|
if (isGameFeatureSupported("pickup")) {
|
||||||
|
let pickupModelId = getGameConfig().pickupModels[getGame()].Exit;
|
||||||
|
|
||||||
if (getServerData().houses[houseId].exitPickupModel != 0) {
|
if (getServerData().houses[houseId].exitPickupModel != 0) {
|
||||||
pickupModelId = houseData.exitPickupModel;
|
pickupModelId = houseData.exitPickupModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
exitPickup = createGamePickup(pickupModelId, houseData.exitPosition, getGameConfig().pickupTypes[getGame()].house);
|
||||||
|
} else if (isGameFeatureSupported("dummyElement")) {
|
||||||
|
//exitPickup = createGameDummyElement(houseData.exitPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
let exitPickup = createGamePickup(pickupModelId, houseData.exitPosition, getGameConfig().pickupTypes[getGame()].house);
|
|
||||||
if (exitPickup != null) {
|
if (exitPickup != null) {
|
||||||
setElementDimension(exitPickup, houseData.exitDimension);
|
setElementDimension(exitPickup, houseData.exitDimension);
|
||||||
setElementOnAllDimensions(exitPickup, false);
|
setElementOnAllDimensions(exitPickup, false);
|
||||||
@@ -1164,7 +1201,7 @@ function createHouseExitBlip(houseId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isGameFeatureSupported("blips")) {
|
if (!isGameFeatureSupported("blip")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1204,8 +1241,8 @@ function createHouseExitBlip(houseId) {
|
|||||||
setElementStreamOutDistance(exitBlip, getGlobalConfig().houseBlipStreamOutDistance);
|
setElementStreamOutDistance(exitBlip, getGlobalConfig().houseBlipStreamOutDistance);
|
||||||
}
|
}
|
||||||
setElementTransient(exitBlip, false);
|
setElementTransient(exitBlip, false);
|
||||||
setEntityData(exitBlip, "vrr.owner.type", VRR_BLIP_HOUSE_EXIT, false);
|
setEntityData(exitBlip, "agrp.owner.type", AGRP_BLIP_HOUSE_EXIT, false);
|
||||||
setEntityData(exitBlip, "vrr.owner.id", houseId, false);
|
setEntityData(exitBlip, "agrp.owner.id", houseId, false);
|
||||||
getHouseData(houseId).exitBlip = exitBlip;
|
getHouseData(houseId).exitBlip = exitBlip;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1214,22 +1251,22 @@ function createHouseExitBlip(houseId) {
|
|||||||
|
|
||||||
function getHouseOwnerTypeText(ownerType) {
|
function getHouseOwnerTypeText(ownerType) {
|
||||||
switch (ownerType) {
|
switch (ownerType) {
|
||||||
case VRR_HOUSEOWNER_CLAN:
|
case AGRP_HOUSE_OWNER_CLAN:
|
||||||
return "clan";
|
return "clan";
|
||||||
|
|
||||||
case VRR_HOUSEOWNER_PLAYER:
|
case AGRP_HOUSE_OWNER_PLAYER:
|
||||||
return "player";
|
return "player";
|
||||||
|
|
||||||
case VRR_HOUSEOWNER_NONE:
|
case AGRP_HOUSE_OWNER_NONE:
|
||||||
return "not owned";
|
return "not owned";
|
||||||
|
|
||||||
case VRR_HOUSEOWNER_PUBLIC:
|
case AGRP_HOUSE_OWNER_PUBLIC:
|
||||||
return "not owned";
|
return "not owned";
|
||||||
|
|
||||||
case VRR_HOUSEOWNER_JOB:
|
case AGRP_HOUSE_OWNER_JOB:
|
||||||
return "job";
|
return "job";
|
||||||
|
|
||||||
case VRR_HOUSEOWNER_BIZ:
|
case AGRP_HOUSE_OWNER_BIZ:
|
||||||
return "business";
|
return "business";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -1264,28 +1301,28 @@ function getHouseInfoCommand(command, params, client) {
|
|||||||
|
|
||||||
let ownerName = "Unknown";
|
let ownerName = "Unknown";
|
||||||
switch (getHouseData(houseId).ownerType) {
|
switch (getHouseData(houseId).ownerType) {
|
||||||
case VRR_HOUSEOWNER_CLAN:
|
case AGRP_HOUSE_OWNER_CLAN:
|
||||||
ownerName = getClanData(houseData).name;
|
ownerName = getClanData(houseData).name;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VRR_HOUSEOWNER_PLAYER:
|
case AGRP_HOUSE_OWNER_PLAYER:
|
||||||
let subAccountData = loadSubAccountFromId(houseData.ownerId);
|
let subAccountData = loadSubAccountFromId(houseData.ownerId);
|
||||||
ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`;
|
ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VRR_HOUSEOWNER_NONE:
|
case AGRP_HOUSE_OWNER_NONE:
|
||||||
ownerName = "None";
|
ownerName = "None";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VRR_HOUSEOWNER_PUBLIC:
|
case AGRP_HOUSE_OWNER_PUBLIC:
|
||||||
ownerName = "Public";
|
ownerName = "Public";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VRR_HOUSEOWNER_BIZ:
|
case AGRP_HOUSE_OWNER_BIZ:
|
||||||
ownerName = getBusinessDataFromDatabaseId(houseData.ownerId).name;
|
ownerName = getBusinessDataFromDatabaseId(houseData.ownerId).name;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VRR_HOUSEOWNER_JOB:
|
case AGRP_HOUSE_OWNER_JOB:
|
||||||
ownerName = getJobData(houseData.ownerId).name;
|
ownerName = getJobData(houseData.ownerId).name;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1350,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)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1388,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)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1420,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 = VRR_PROMPT_HOUSEBUY;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1431,6 +1468,10 @@ function buyHouseCommand(command, params, client) {
|
|||||||
* @return {HouseData} The house's data (class instance)
|
* @return {HouseData} The house's data (class instance)
|
||||||
*/
|
*/
|
||||||
function getHouseData(houseId) {
|
function getHouseData(houseId) {
|
||||||
|
if (houseId == -1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof getServerData().houses[houseId] != "undefined") {
|
if (typeof getServerData().houses[houseId] != "undefined") {
|
||||||
return getServerData().houses[houseId];
|
return getServerData().houses[houseId];
|
||||||
}
|
}
|
||||||
@@ -1537,9 +1578,9 @@ function reloadAllHousesCommand(command, params, client) {
|
|||||||
function exitHouse(client) {
|
function exitHouse(client) {
|
||||||
let houseId = getPlayerHouse(client);
|
let houseId = getPlayerHouse(client);
|
||||||
if (isPlayerSpawned(client)) {
|
if (isPlayerSpawned(client)) {
|
||||||
setPlayerInterior(client, getServerData().house[houseId].entranceInterior);
|
setPlayerInterior(client, getServerData().houses[houseId].entranceInterior);
|
||||||
setPlayerDimension(client, getServerData().house[houseId].entranceDimension);
|
setPlayerDimension(client, getServerData().houses[houseId].entranceDimension);
|
||||||
setPlayerPosition(client, getServerData().house[houseId].entrancePosition);
|
setPlayerPosition(client, getServerData().houses[houseId].entrancePosition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1575,7 +1616,7 @@ function cacheHouseItems(houseId) {
|
|||||||
getHouseData(houseId).itemCache = [];
|
getHouseData(houseId).itemCache = [];
|
||||||
|
|
||||||
for (let i in getServerData().items) {
|
for (let i in getServerData().items) {
|
||||||
if (getItemData(i).ownerType == VRR_ITEM_OWNER_HOUSE && getItemData(i).ownerId == getHouseData(houseId).databaseId) {
|
if (getItemData(i).ownerType == AGRP_ITEM_OWNER_HOUSE && getItemData(i).ownerId == getHouseData(houseId).databaseId) {
|
||||||
getHouseData(houseId).itemCache.push(i);
|
getHouseData(houseId).itemCache.push(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1604,7 +1645,7 @@ function getHouseIdFromDatabaseId(databaseId) {
|
|||||||
|
|
||||||
//function clearPlayerHouseGameScripts(client, houseId) {
|
//function clearPlayerHouseGameScripts(client, houseId) {
|
||||||
// for(let i in getHouseData(houseId).gameScripts) {
|
// for(let i in getHouseData(houseId).gameScripts) {
|
||||||
// sendPlayerGameScriptState(client, VRR_GAMESCRIPT_DENY);
|
// sendPlayerGameScriptState(client, AGRP_GAMESCRIPT_DENY);
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
@@ -1626,11 +1667,11 @@ function canPlayerSetHouseInteriorLights(client, houseId) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getHouseData(houseId).ownerType == VRR_HOUSEOWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getHouseData(houseId).ownerType == VRR_HOUSEOWNER_CLAN && getHouseData(houseId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
|
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_CLAN && getHouseData(houseId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
|
||||||
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageHouses"))) {
|
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageHouses"))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1646,11 +1687,11 @@ function canPlayerLockUnlockHouse(client, houseId) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getHouseData(houseId).ownerType == VRR_HOUSEOWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getHouseData(houseId).ownerType == VRR_HOUSEOWNER_CLAN && getHouseData(houseId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
|
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_CLAN && getHouseData(houseId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
|
||||||
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageHouses"))) {
|
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageHouses"))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1700,13 +1741,13 @@ function canPlayerManageHouse(client, houseId) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getHouseData(houseId).ownerType == VRR_HOUSEOWNER_PLAYER) {
|
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER) {
|
||||||
if (getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
if (getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getHouseData(houseId).ownerType == VRR_HOUSEOWNER_CLAN) {
|
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_CLAN) {
|
||||||
if (getHouseData(houseId).ownerId == getPlayerClan(client)) {
|
if (getHouseData(houseId).ownerId == getPlayerClan(client)) {
|
||||||
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageHouses"))) {
|
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageHouses"))) {
|
||||||
return true;
|
return true;
|
||||||
@@ -1740,33 +1781,34 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
let houseData = getHouseData(houseId);
|
let houseData = getHouseData(houseId);
|
||||||
|
|
||||||
if (houseData.entrancePickup != null) {
|
if (houseData.entrancePickup != null) {
|
||||||
setEntityData(houseData.entrancePickup, "vrr.owner.type", VRR_PICKUP_HOUSE_ENTRANCE, false);
|
setEntityData(houseData.entrancePickup, "agrp.owner.type", AGRP_PICKUP_HOUSE_ENTRANCE, false);
|
||||||
setEntityData(houseData.entrancePickup, "vrr.owner.id", houseId, false);
|
setEntityData(houseData.entrancePickup, "agrp.owner.id", houseId, false);
|
||||||
setEntityData(houseData.entrancePickup, "vrr.label.type", VRR_LABEL_HOUSE, true);
|
setEntityData(houseData.entrancePickup, "agrp.label.type", AGRP_LABEL_HOUSE, true);
|
||||||
setEntityData(houseData.entrancePickup, "vrr.label.name", houseData.description, true);
|
setEntityData(houseData.entrancePickup, "agrp.label.name", houseData.description, true);
|
||||||
setEntityData(houseData.entrancePickup, "vrr.label.locked", houseData.locked, true);
|
setEntityData(houseData.entrancePickup, "agrp.label.locked", houseData.locked, true);
|
||||||
|
setEntityData(houseData.entrancePickup, "agrp.label.price", houseData.buyPrice, true);
|
||||||
|
setEntityData(houseData.entrancePickup, "agrp.label.rentprice", houseData.rentPrice, true);
|
||||||
|
setEntityData(houseData.entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTER, true);
|
||||||
|
|
||||||
if (houseData.buyPrice > 0) {
|
if (houseData.buyPrice > 0) {
|
||||||
setEntityData(houseData.entrancePickup, "vrr.label.price", houseData.buyPrice, true);
|
setEntityData(houseData.entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_BUYHOUSE, true);
|
||||||
setEntityData(houseData.entrancePickup, "vrr.label.help", VRR_PROPLABEL_INFO_BUYHOUSE, true);
|
} else if (houseData.rentPrice > 0) {
|
||||||
} else {
|
setEntityData(houseData.entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_RENTHOUSE, true);
|
||||||
if (houseData.rentPrice > 0) {
|
|
||||||
setEntityData(houseData.entrancePickup, "vrr.label.rentprice", houseData.rentPrice, true);
|
|
||||||
setEntityData(houseData.entrancePickup, "vrr.label.help", VRR_PROPLABEL_INFO_RENTHOUSE, true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (houseData.exitPickup != null) {
|
if (houseData.exitPickup != null) {
|
||||||
setEntityData(houseData.exitPickup, "vrr.owner.type", VRR_PICKUP_HOUSE_EXIT, false);
|
setEntityData(houseData.exitPickup, "agrp.owner.type", AGRP_PICKUP_HOUSE_EXIT, false);
|
||||||
setEntityData(houseData.exitPickup, "vrr.owner.id", houseId, false);
|
setEntityData(houseData.exitPickup, "agrp.owner.id", houseId, false);
|
||||||
setEntityData(houseData.exitPickup, "vrr.label.type", VRR_LABEL_EXIT, true);
|
setEntityData(houseData.exitPickup, "agrp.label.type", AGRP_LABEL_EXIT, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1803,3 +1845,52 @@ function createHousePickups(houseId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets whether or not a client is in a business
|
||||||
|
*
|
||||||
|
* @param {Client} client - The client to check whether or not is in a business
|
||||||
|
* @return {Boolean} Whether or not the client is in a business
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
function isPlayerInAnyHouse(client) {
|
||||||
|
for (let i in getServerData().houses) {
|
||||||
|
if (getServerData().houses[i].hasInterior && getServerData().houses[i].exitDimension == getPlayerDimension(client)) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
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");
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// Vortrex's Roleplay Resource
|
// Asshat Gaming Roleplay
|
||||||
// https://github.com/VortrexFTW/gtac_roleplay
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// FILE: insurance.js
|
// FILE: insurance.js
|
||||||
// DESC: Provides insurance commands, functions, and usage
|
// DESC: Provides insurance commands, functions, and usage
|
||||||
@@ -8,33 +9,33 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
// Insurance Account Owner Types
|
// Insurance Account Owner Types
|
||||||
const VRR_INS_ACCT_OWNER_NONE = 0; // None
|
const AGRP_INS_ACCT_OWNER_NONE = 0; // None
|
||||||
const VRR_INS_ACCT_OWNER_PLAYER = 1; // Player owns insurance company
|
const AGRP_INS_ACCT_OWNER_PLAYER = 1; // Player owns insurance company
|
||||||
const VRR_INS_ACCT_OWNER_BIZ = 2; // Business owns insurance company
|
const AGRP_INS_ACCT_OWNER_BIZ = 2; // Business owns insurance company
|
||||||
const VRR_INS_ACCT_OWNER_CLAN = 3; // Clan owns insurance company
|
const AGRP_INS_ACCT_OWNER_CLAN = 3; // Clan owns insurance company
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
// Insurance Account Entity Types
|
// Insurance Account Entity Types
|
||||||
const VRR_INS_ACCT_ENTITY_NONE = 0; // None
|
const AGRP_INS_ACCT_ENTITY_NONE = 0; // None
|
||||||
const VRR_INS_ACCT_ENTITY_PLAYER_HEALTH = 1; // Health Insurance
|
const AGRP_INS_ACCT_ENTITY_PLAYER_HEALTH = 1; // Health Insurance
|
||||||
const VRR_INS_ACCT_ENTITY_PLAYER_LIFE = 2; // Life Insurance
|
const AGRP_INS_ACCT_ENTITY_PLAYER_LIFE = 2; // Life Insurance
|
||||||
const VRR_INS_ACCT_ENTITY_VEH = 3; // Vehicle Insurance
|
const AGRP_INS_ACCT_ENTITY_VEH = 3; // Vehicle Insurance
|
||||||
const VRR_INS_ACCT_ENTITY_BIZ = 4; // Business Insurance
|
const AGRP_INS_ACCT_ENTITY_BIZ = 4; // Business Insurance
|
||||||
const VRR_INS_ACCT_ENTITY_HOUSE = 5; // House Insurance
|
const AGRP_INS_ACCT_ENTITY_HOUSE = 5; // House Insurance
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
// Insurance Account History Types
|
// Insurance Account History Types
|
||||||
const VRR_INS_ACCT_HISTORY_NONE = 0; // None
|
const AGRP_INS_ACCT_HISTORY_NONE = 0; // None
|
||||||
const VRR_INS_ACCT_HISTORY_PLAYER_MEDICAL = 1; // Medical insurance was used (player disease/injury)
|
const AGRP_INS_ACCT_HISTORY_PLAYER_MEDICAL = 1; // Medical insurance was used (player disease/injury)
|
||||||
const VRR_INS_ACCT_HISTORY_PLAYER_DEATH = 2; // Life insurance was used (player death)
|
const AGRP_INS_ACCT_HISTORY_PLAYER_DEATH = 2; // Life insurance was used (player death)
|
||||||
const VRR_INS_ACCT_HISTORY_VEH_DAMAGE = 3; // Vehicle was damaged, but not destroyed
|
const AGRP_INS_ACCT_HISTORY_VEH_DAMAGE = 3; // Vehicle was damaged, but not destroyed
|
||||||
const VRR_INS_ACCT_HISTORY_VEH_WRECKED = 4; // Vehicle was completely destroyed
|
const AGRP_INS_ACCT_HISTORY_VEH_WRECKED = 4; // Vehicle was completely destroyed
|
||||||
const VRR_INS_ACCT_HISTORY_VEH_THEFT = 5; // Vehicle was stolen
|
const AGRP_INS_ACCT_HISTORY_VEH_THEFT = 5; // Vehicle was stolen
|
||||||
const VRR_INS_ACCT_HISTORY_BIZ_DAMAGE = 6; // Business was damaged (broken items/window/door)
|
const AGRP_INS_ACCT_HISTORY_BIZ_DAMAGE = 6; // Business was damaged (broken items/window/door)
|
||||||
const VRR_INS_ACCT_HISTORY_BIZ_THEFT = 7; // Business was stolen from
|
const AGRP_INS_ACCT_HISTORY_BIZ_THEFT = 7; // Business was stolen from
|
||||||
const VRR_INS_ACCT_HISTORY_HOUSE_DAMAGE = 8; // House was damaged
|
const AGRP_INS_ACCT_HISTORY_HOUSE_DAMAGE = 8; // House was damaged
|
||||||
const VRR_INS_ACCT_HISTORY_HOUSE_THEFT = 9; // House was stolen from
|
const AGRP_INS_ACCT_HISTORY_HOUSE_THEFT = 9; // House was stolen from
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user