296 Commits

Author SHA1 Message Date
Vortrex
3740ce97f9 Merge branch 'nightly' into patch-1 2023-03-08 23:43:48 -06:00
Vortrex
8cae128353 Remove old walkie talkie stuff (moved to radio) 2023-03-08 23:42:38 -06:00
Vortrex
8eae93210a Radio distance 2023-03-08 23:42:06 -06:00
Vortrex
5ab29e84e0 Radio data 2023-03-08 23:41:57 -06:00
Vortrex
c71e16c873 Radio command 2023-03-08 23:41:42 -06:00
Vortrex
0ba6bb770e New locale strings 2023-03-08 23:40:37 -06:00
Vortrex
244b1e94e7 Vehicle transmit radio distance (for next to car) 2023-03-08 22:42:42 -06:00
Vortrex
86bb681ba0 Vehicle transmit radio util 2023-03-08 22:42:24 -06:00
Vortrex
4999ab3ac5 Check job/clan rank, remove if fucked 2023-03-08 22:42:07 -06:00
Vortrex
bd4681aa9b Unable to call player message 2023-03-08 22:41:40 -06:00
Vortrex
259eb3346c Workaround for player pos in veh (Mafia 1) 2023-03-08 22:41:24 -06:00
Vortrex
6f0937360f Add job uniform cmds + WL/BL utils 2023-03-08 22:26:25 -06:00
Vortrex
4581de603b Add search cmd handler 2023-03-08 22:24:50 -06:00
Vortrex
2d66d08113 Send house to player test 2023-03-08 22:24:32 -06:00
Vortrex
573201834d Some dev utils stuff 2023-03-08 22:24:13 -06:00
Vortrex
d7b4ce86e5 Add job uniform name/rank + search cmds 2023-03-08 22:23:55 -06:00
Vortrex
6af7339ac7 Check if player data is false when kicking all 2023-03-08 22:23:33 -06:00
Vortrex
3b28340c72 Check for payphone sounds before trying to use 2023-03-08 22:22:56 -06:00
Vortrex
2a56241c60 Init house script 2023-03-08 22:22:41 -06:00
Vortrex
85388f0cb8 Improve client script load a bit 2023-03-08 22:22:25 -06:00
Vortrex
fd02988d5d Move local money 2023-03-08 22:21:26 -06:00
Vortrex
8728d1a324 New locale strings 2023-03-08 22:21:04 -06:00
Vortrex
17e6bef100 Who/when added business 2023-03-08 12:10:06 -06:00
Vortrex
695e729c41 GTA SA won't load sounds for some reason 2023-03-08 12:07:33 -06:00
Vortrex
d578b1a083 House stuff 2023-03-08 12:07:01 -06:00
Grzelciu
bb5731dd06 Update for polish.json
Correcting syntax errors, and translating new lines of code.
2023-03-08 17:42:17 +01:00
Vortrex
be29c02960 Remove duplicate locale strings 2023-03-07 21:05:08 -06:00
Vortrex
79e351cf8f Fix veh min rank + add who/when added 2023-03-07 21:01:23 -06:00
Vortrex
1cc54d4dd9 Set and remove password on start/reload (disabled) 2023-03-07 21:00:34 -06:00
Vortrex
b4aca0257f Save player payday 2023-03-07 20:59:53 -06:00
Vortrex
a11560b5b9 Add job and clan invite prompt types (unfinished) 2023-03-07 20:59:40 -06:00
Vortrex
0368ea3371 Check if payphone & player valid for desync fix 2023-03-07 20:59:23 -06:00
Vortrex
ea4cd87202 Fix send biz to client args 2023-03-07 20:58:40 -06:00
Vortrex
af2de3455e Remove set server password 2023-03-07 20:58:17 -06:00
Vortrex
785e506d69 Public job val + JSDoc + logging + invite cmd 2023-03-07 20:57:55 -06:00
Vortrex
eb30c616af Remove website/discord help categories (crashes) 2023-03-07 20:56:56 -06:00
Vortrex
a2eca84f52 Fix error when pay too low for tax + add eco cmds 2023-03-07 20:56:34 -06:00
Vortrex
a92fc14570 Save server chat type to database 2023-03-07 20:55:56 -06:00
Vortrex
063b2aab4f Allow manager cmd disable + add job/eco commands 2023-03-07 20:55:14 -06:00
Vortrex
242210bc9d Add prompt value to player data 2023-03-07 20:54:23 -06:00
Vortrex
9ab6bf2700 Check if global OOC enabled + add local OOC cmd 2023-03-07 20:54:09 -06:00
Vortrex
99da6df3ee Check for gun ban + show proper cost difference 2023-03-07 20:53:44 -06:00
Vortrex
bf88a14b23 Add new entries to job flags 2023-03-07 20:53:15 -06:00
Vortrex
72adf16515 Fix business labels 2023-03-07 20:52:26 -06:00
Vortrex
f6cb20b4ff Fix admin info category 2023-03-05 23:26:54 -06:00
Vortrex
9a06d7e7ba Mark inventory action tip seen 2023-03-05 23:26:34 -06:00
Vortrex
3de60247c6 Add job name to uniform list header 2023-03-05 23:26:19 -06:00
Vortrex
36c074ee3d Fix initial business label stuff 2023-03-05 23:26:05 -06:00
Vortrex
cbb820ec9f Woops wrong locale name 2023-03-05 23:25:56 -06:00
Vortrex
cf38abac7f Fix vehicle job/clan rank 2023-03-05 23:25:33 -06:00
Vortrex
f0d0384a41 Map change warning (unfinished) 2023-03-05 23:25:21 -06:00
Vortrex
37d485a7c3 Change word in local strings 2023-03-05 23:24:49 -06:00
Vortrex
1b04c60576 Chat type 2023-03-05 20:49:53 -06:00
Vortrex
0fcd38dd51 Update business.js 2023-03-05 20:49:47 -06:00
Vortrex
5c2320adea New locale strings 2023-03-05 20:48:25 -06:00
Vortrex
9713ecaf63 A few new commands 2023-03-05 20:48:16 -06:00
Vortrex
c1aaf8af53 Set inactive vehicle respawn to 60 minutes 2023-03-05 20:48:06 -06:00
Vortrex
5dbc93f38c Don't delete from database + fix job rank cmd 2023-03-05 20:47:29 -06:00
Vortrex
96586f6be0 More staff commands and fixes 2023-03-05 20:47:08 -06:00
Vortrex
4b63689f6e New locale strings 2023-03-05 20:46:55 -06:00
Vortrex
5d3119f051 Allow "all" payphone state set in net event 2023-03-05 20:46:39 -06:00
Vortrex
ec4a35d7bb Check for null vehicle 2023-03-05 20:46:22 -06:00
Vortrex
4e10158b29 Reset action tips command 2023-03-05 20:46:12 -06:00
Vortrex
b15964e763 Add job flag value util 2023-03-05 20:46:00 -06:00
Vortrex
0a9866ac9e Disable GUI prompts for now 2023-03-05 20:45:47 -06:00
Vortrex
7bb7775898 Admin-set chat type 2023-03-05 20:45:23 -06:00
Vortrex
c664e40d1e Don't delete from database 2023-03-05 20:45:09 -06:00
Vortrex
0d9388afa7 Net event rename 2023-03-05 20:44:45 -06:00
Vortrex
07cd95b861 Scene stuff 2023-03-05 20:44:34 -06:00
Vortrex
dbef2a2d5d Fix desynced payphones in timer 2023-03-05 20:44:13 -06:00
Vortrex
4cb1639461 Fix unoccupied veh util 2023-03-05 20:43:59 -06:00
Vortrex
f70021a4f2 Only give 20 default biz items 2023-03-05 20:43:42 -06:00
Vortrex
c54b0abf07 Use databaseId member when logging item buy 2023-03-04 23:46:04 -06:00
Vortrex
f843e43d66 Don't show nametags if in vehicle on Mafia 1 2023-03-04 23:45:42 -06:00
Vortrex
38e60a4837 Don't show labels if in vehicle on Mafia 1 2023-03-04 23:45:32 -06:00
Vortrex
90caff03a6 Add revision args to account hash/salts 2023-03-04 23:45:14 -06:00
Vortrex
eb7512f75c Add security config util 2023-03-04 23:45:00 -06:00
Vortrex
cdb67fa7e6 Reset payday after getting paid 2023-03-04 23:44:51 -06:00
Vortrex
d8b35d9aa9 Fix timestamp, remove extra strings in job route info 2023-03-04 23:44:38 -06:00
Vortrex
e0ae0793db Fix payphone database ID not being set 2023-03-04 23:44:18 -06:00
Vortrex
d87dfb0b05 Save next payday (in case of crash) 2023-03-04 23:43:56 -06:00
Vortrex
7193e349df Fix timestamp in veh info 2023-03-04 23:43:41 -06:00
Vortrex
7f6945f402 Check for null string 2023-03-04 23:43:33 -06:00
Vortrex
ef4c64f722 Check for empty string 2023-03-04 23:42:56 -06:00
Vortrex
992cc53dfd Job routes list and info commands 2023-03-04 08:36:48 -06:00
Vortrex
c6e1fb7f6d More JSDoc 2023-03-04 08:36:37 -06:00
Vortrex
16549d5042 Security config 2023-03-04 08:36:24 -06:00
Vortrex
e34d24033e Use british time format 2023-03-04 08:36:18 -06:00
Vortrex
738cd55e75 Add who/when added info to veh 2023-03-04 08:36:01 -06:00
Vortrex
1d0cbbd176 Use security config 2023-03-04 08:35:32 -06:00
Vortrex
d01a413ecc More JSDoc 2023-03-04 08:35:18 -06:00
Vortrex
72ae8aeead Load security config 2023-03-04 08:35:06 -06:00
Vortrex
6b3651f660 Check for job and rank on payday 2023-03-04 08:34:57 -06:00
Vortrex
77ef9dab35 New locale strings 2023-03-04 08:33:26 -06:00
Vortrex
802a489fee Fix wrong locale string in add key bind examples 2023-03-03 03:07:01 -06:00
Vortrex
f1d53734d3 Don't give arg to universal number locale string 2023-03-03 03:06:40 -06:00
Vortrex
1da6b82af5 Wrong del item util (fixes infinite veh fix item) 2023-03-03 03:06:23 -06:00
Vortrex
fef84bf75b Some fishing stuff (unfinished) 2023-03-03 03:05:48 -06:00
Vortrex
1782b6af2c Fix wrong command locale message 2023-03-03 03:05:35 -06:00
Vortrex
c61eee4197 Add new locale string 2023-03-03 03:05:18 -06:00
Vortrex
b695b3d9d0 Merge branch 'nightly' of https://github.com/VortrexFTW/v-roleplay into nightly 2023-03-03 01:32:50 -06:00
Vortrex
2ee939cc2c Merge branch 'master' into nightly 2023-03-03 01:32:19 -06:00
Vortrex
732940e56f Force add config files 2023-03-03 01:31:57 -06:00
Vortrex
19b433e7fb Remove config files (gitignore reset) 2023-03-03 01:28:45 -06:00
Vortrex
1d281256a1 Update .gitignore 2023-03-03 01:27:21 -06:00
Vortrex
e1137b728b Update .gitignore 2023-03-03 01:24:53 -06:00
Vortrex
908c5980e7 Set new payphone enabled 2023-03-03 00:51:31 -06:00
Vortrex
a8637692ee Number detective uniforms 2023-03-02 08:17:33 -06:00
Vortrex
e2f7b5403a Fix payphones 2023-03-02 08:17:20 -06:00
Vortrex
880de94677 Incoming damage multiplier network event handler 2023-03-02 08:17:07 -06:00
Vortrex
ef62513115 Woops wrong name 2023-03-02 08:16:52 -06:00
Vortrex
f2166cc804 Fix job uniforms not saving 2023-03-02 08:16:39 -06:00
Vortrex
b7cd14c654 Update incoming damage multiplier on drug use 2023-03-02 08:16:30 -06:00
Vortrex
c4a2f0aeda Use despawn functions + house labels 2023-03-02 08:16:12 -06:00
Vortrex
e27521761f Use new tax income field 2023-03-02 08:15:46 -06:00
Vortrex
0c936d4a8f Nearby businesses command 2023-03-02 08:15:35 -06:00
Vortrex
ea8efdc70a Add info files 2023-03-02 08:12:21 -06:00
Vortrex
23c8acae21 Woops wrong variable for chat message 2023-03-02 08:09:28 -06:00
Vortrex
868bb10091 Show job blips on edge when off of screen 2023-03-02 08:09:14 -06:00
Vortrex
453a946a1c Init job script on start 2023-03-02 08:08:52 -06:00
Vortrex
8a206bcaf8 Add weapon damage multiplier 2023-03-02 08:08:44 -06:00
Vortrex
b27305e788 Don't log item move if dev server 2023-03-01 01:22:46 -06:00
Vortrex
f6ce6105e2 Biz nearby list cmd + buy log 2023-03-01 01:22:28 -06:00
Vortrex
ff2d416539 Remove economy config reload command 2023-03-01 01:20:32 -06:00
Vortrex
9f8d4cf034 Use server config for economy settings 2023-03-01 01:20:22 -06:00
Vortrex
3f925a4a44 Locate player command 2023-03-01 01:19:15 -06:00
Vortrex
b4d8acc07b Use server config for currency string 2023-03-01 01:18:56 -06:00
Vortrex
623434d70f More payphone commands & utils 2023-03-01 01:18:43 -06:00
Vortrex
f603d71062 Don't require args or player for staff flags list 2023-03-01 01:18:22 -06:00
Vortrex
f9d6f9eff3 Despawn all elements util + starting state 2023-03-01 01:18:06 -06:00
Vortrex
793b764469 Fix day/night cycle element spawning 2023-03-01 01:17:27 -06:00
Vortrex
3da2507cf7 Re-enabled day/night rule text 2023-03-01 01:17:14 -06:00
Vortrex
d7bbe1748e Dealership vehicle fix 2023-03-01 01:16:56 -06:00
Vortrex
e36d366f84 Add MafiaC train stations + fix vehicle names 2023-03-01 01:16:33 -06:00
Vortrex
b7eac224c5 Payphone state 2023-03-01 01:16:14 -06:00
Vortrex
67b8266a71 Add admin help category (needs finished) 2023-02-28 22:37:28 -06:00
Vortrex
f39697bf29 Commands is not a HouseData array lol 2023-02-28 22:37:10 -06:00
Vortrex
abea95a909 Use svr_main table for server economy settings 2023-02-28 22:36:57 -06:00
Vortrex
a9007338af Payphone + locate player commands 2023-02-28 22:36:42 -06:00
Vortrex
d55ae9ea6b Add world icons for businesses, house, and jobs 2023-02-28 22:36:20 -06:00
Vortrex
16a8014920 Move job objective icon image 2023-02-28 22:36:06 -06:00
Vortrex
cb54cc9aa5 Show debug logging in client console 2023-02-28 22:35:55 -06:00
Vortrex
b463c9f71f Remove economy.json (moved to database) 2023-02-28 22:35:43 -06:00
Vortrex
c8b2dca8de Add world icon images 2023-02-28 22:35:30 -06:00
Vortrex
4e0565eefe New locale strings 2023-02-28 22:35:10 -06:00
Vortrex
edcc063d8c Item type commands and output fixes 2023-02-26 20:08:49 -06:00
Vortrex
da578f40d9 Woops wrong game select 2023-02-26 20:08:27 -06:00
Vortrex
0900b0637a Save job rank + add JSDoc 2023-02-26 20:07:56 -06:00
Vortrex
84a55d76fb Fixes for some vehicle data ID issues 2023-02-26 20:07:43 -06:00
Vortrex
12f9a66349 Logging changes 2023-02-26 20:06:49 -06:00
Vortrex
081f78e53b Lower nametag height for MafiaC 2023-02-26 20:06:40 -06:00
Vortrex
272cfd9a3f Simple queueing script (needs finished) 2023-02-25 04:44:56 -06:00
Vortrex
d15ed19401 Add ammo items to Mafia 1 legal gun store + veh name fixes 2023-02-25 04:44:42 -06:00
Vortrex
57d274b334 Payphone state constants 2023-02-25 04:44:20 -06:00
Vortrex
1c5d2669fc Delete from table, don't update 2023-02-25 04:44:02 -06:00
Vortrex
896cb75591 Save veh positions + save payphones 2023-02-25 04:43:54 -06:00
Vortrex
920cfbd2ae Set payphone indexes in startup util 2023-02-25 04:43:33 -06:00
Vortrex
9205f07dbe Respawn vehicle on getveh, dont teleport 2023-02-25 04:43:18 -06:00
Vortrex
a388d94244 Payphone script fixes 2023-02-25 04:43:04 -06:00
Vortrex
0c7b25d0a8 Payphone net events 2023-02-25 04:42:39 -06:00
Vortrex
f4a2425fce Phone messaging functions 2023-02-25 04:42:29 -06:00
Vortrex
796072daab Send all payphones on spawn 2023-02-25 04:41:54 -06:00
Vortrex
085173d807 Add payphone distances to global config 2023-02-25 04:41:44 -06:00
Vortrex
11f034698b Add payphone commands to array 2023-02-25 04:41:29 -06:00
Vortrex
0762e4ac52 Add payphone data to client class 2023-02-25 04:41:11 -06:00
Vortrex
3fdc038242 Use payphone chat if on a call 2023-02-25 04:40:53 -06:00
Vortrex
9c9d242ae4 Init timers and payphone script 2023-02-25 04:39:37 -06:00
Vortrex
69317b3b1f Add client timers script 2023-02-25 04:39:27 -06:00
Vortrex
e14d7170aa Add payphone client script 2023-02-25 04:39:00 -06:00
Vortrex
d7b911004b Payphone net events 2023-02-25 04:38:51 -06:00
Vortrex
14fe451c83 Job route location check 2023-02-25 04:38:44 -06:00
Vortrex
9c86ad0e2c Process payphone and job route location 2023-02-25 04:38:01 -06:00
Vortrex
a8802c0c7e Add payphone array 2023-02-25 04:37:45 -06:00
Vortrex
c4fc123d75 Organize + add new files 2023-02-25 04:37:37 -06:00
Vortrex
64a9280fe6 New locale strings 2023-02-25 04:37:22 -06:00
Vortrex
b11510005a Add payphone sound files 2023-02-25 04:36:58 -06:00
Vortrex
85b934064e Move logo to lower left 2023-02-23 01:17:44 -06:00
Vortrex
542d1384db Use utils for vehicle delete/despawn 2023-02-23 01:17:33 -06:00
Vortrex
93e48df39a Add passive income to business till if players are on 2023-02-23 01:17:16 -06:00
Vortrex
52e8d6c1db Payphone array is camel case 2023-02-23 01:16:40 -06:00
Vortrex
b632e1d26b Add vehicle occupants native wrap 2023-02-23 01:16:16 -06:00
Vortrex
efea8a015f Add job pay 2023-02-23 01:16:05 -06:00
Vortrex
a0d03a0aab Check for clan before clan chat 2023-02-23 01:15:49 -06:00
Vortrex
c225c4d130 Move local player vehicle control state to vehicle.js 2023-02-23 01:15:41 -06:00
Vortrex
8532aa74ca Fix remove player from veh 2023-02-23 01:15:29 -06:00
Vortrex
0f788068c1 Job route indicator 2023-02-23 01:13:48 -06:00
Vortrex
d07a890a10 Process job route location rendering 2023-02-23 01:13:39 -06:00
Vortrex
b746970b9f Move fade camera func to camera.js 2023-02-23 01:13:24 -06:00
Vortrex
64a3d2daf8 Add objective icon to meta.xml 2023-02-23 01:13:12 -06:00
Vortrex
56ce5b7846 Make objective icon white 2023-02-23 01:13:04 -06:00
Vortrex
d940d6033e Don't respawn vehicle on job route finish 2023-02-22 16:45:43 -06:00
Vortrex
49026b7faf Only set job vehicle colour if supported 2023-02-22 16:27:26 -06:00
Vortrex
b9f47539a8 Fixes for interior scene change 2023-02-22 16:27:13 -06:00
Vortrex
51194882c1 Fixes for interior scene change 2023-02-22 16:26:59 -06:00
Vortrex
998dbf33f8 Load payphone script and data 2023-02-22 16:26:47 -06:00
Vortrex
dff8b8b8db Payphone array 2023-02-22 16:26:00 -06:00
Vortrex
21b2429536 Add ManagePayphones staff permission 2023-02-22 16:25:53 -06:00
Vortrex
520164269b Add payphone script and commands 2023-02-22 16:24:56 -06:00
Vortrex
44cbdc07ac Fix duplicate vehicle spawning 2023-02-22 05:27:03 -06:00
Vortrex
ac397a9011 Rename main world scene 2023-02-22 05:26:53 -06:00
Vortrex
8e11b9337b Disable day/night cycle on Mafia 1 for now 2023-02-22 05:26:42 -06:00
Vortrex
d2335e7bec Woops removed stuff from wrong native file 2023-02-22 05:26:07 -06:00
Vortrex
b39abaab6c Use util for main world scene 2023-02-22 05:25:51 -06:00
Vortrex
150d3f10b0 Add job rank command 2023-02-22 05:25:40 -06:00
Vortrex
810acd8036 Send correct job type 2023-02-22 05:25:28 -06:00
Vortrex
339ec0808c Add job rank command 2023-02-22 05:25:17 -06:00
Vortrex
d1e9b6f08b Fix clan owner command 2023-02-22 05:24:34 -06:00
Vortrex
f6d1ee189c Convert scoreboard key to int 2023-02-22 05:24:20 -06:00
Vortrex
549f8a3c59 Convert enter property key to int 2023-02-22 05:24:07 -06:00
Vortrex
e8d7b9312a Fix nametags for Mafia 1 2023-02-22 05:23:54 -06:00
Vortrex
fcdf8542d6 Fix job type 2023-02-22 05:23:46 -06:00
Vortrex
5401bb33c2 New string 2023-02-22 05:23:31 -06:00
Vortrex
7b9a41f8d1 Scoreboard command 2023-02-21 20:28:46 -06:00
Vortrex
a5008bdbf5 Use job index, not database ID 2023-02-21 20:28:37 -06:00
Vortrex
e3a0b27c4e Scoreboard error checking 2023-02-21 20:28:27 -06:00
Vortrex
697ccd860f Use label distance, not pickup distance 2023-02-21 20:28:17 -06:00
Vortrex
9536ed9aa9 Comment unfinished stuff 2023-02-21 20:28:06 -06:00
Vortrex
5ebbe17920 Fix biz label not showing buy info 2023-02-21 19:49:28 -06:00
Vortrex
d8dde07845 Change HUD money colour to white (will add more to HUD) 2023-02-21 19:49:13 -06:00
Vortrex
9c16ceeb3a Fix job label rendering 2023-02-21 19:49:00 -06:00
Vortrex
faf4a1569c Nametag fixes 2023-02-21 19:48:49 -06:00
Vortrex
d70a8d451a Make scoreboard key re-bindable 2023-02-21 19:48:38 -06:00
Vortrex
a0477b10fe Woops wrong variable name for chat message 2023-02-21 19:44:28 -06:00
Vortrex
700e98768e Make default chat global (will add config for this later) 2023-02-21 19:44:18 -06:00
Vortrex
adb8975c6a Colour for client code execute 2023-02-21 19:44:01 -06:00
Vortrex
c76459e777 Move setup all event handlers to native files 2023-02-21 19:43:51 -06:00
Vortrex
961670687f Move locked state to bottom 2023-02-21 19:43:31 -06:00
Vortrex
eaa0f3a563 Enable world labels on Mafia 1 2023-02-21 19:43:23 -06:00
Vortrex
4dcbcf5658 Wtf extra character inserted 2023-02-21 14:42:23 -06:00
Vortrex
77fbc48f4e Fix names and enable nametags on Mafia 2023-02-21 14:40:01 -06:00
Vortrex
b4ac02f9ec Remove all async/await stuff 2023-02-21 14:39:45 -06:00
Vortrex
1cb02b9ab1 Update database.sql 2023-02-20 21:36:38 -06:00
Vortrex
b42f98917d Update name 2023-02-18 15:43:36 -06:00
Vortrex
a39acd67d0 Disable timezone stuff for now (needs finished) 2023-02-18 14:40:30 -06:00
Vortrex
f6e452ee0e Update vehicle saved positions 2023-02-18 14:40:14 -06:00
Vortrex
e8c658acff Use chat list index colour for character list 2023-02-18 14:39:48 -06:00
Vortrex
06bb1d2c61 Use chat list index colour for staff notes 2023-02-18 14:39:29 -06:00
Vortrex
902072b6a2 Use chat list index colour for radio stations 2023-02-18 14:39:14 -06:00
Vortrex
441eaca65d Start working on custom classes for native wrapping 2023-02-18 14:38:52 -06:00
Vortrex
e4221198c6 Allow slashes in bindkey, fix bindkey 2023-02-18 14:38:13 -06:00
Vortrex
3eaf6f2452 Fix wrong skin info for job uniform cmd 2023-02-18 14:37:57 -06:00
Vortrex
2b17deb25a Debug logging 2023-02-18 14:37:26 -06:00
Vortrex
9e4ae75fbe Fix reply command 2023-02-18 14:37:13 -06:00
Vortrex
ad8c459839 Custom command aliases (needs finished) 2023-02-18 14:36:57 -06:00
Vortrex
889d7898c3 Make enter key removable for label 2023-02-18 14:36:20 -06:00
Vortrex
a374702da2 Check if enter key is null for label 2023-02-18 14:36:09 -06:00
Vortrex
1b2168c39d Use primary text colour on char select GUI 2023-02-18 14:35:57 -06:00
Vortrex
3ab59fa3f8 Old util 2023-02-15 21:56:38 -06:00
Vortrex
ae96568c0a Couple error checks 2023-02-15 21:56:32 -06:00
Vortrex
c0f7d1ce02 New default chat state 2023-02-15 03:20:37 -06:00
Vortrex
0ed30452f6 Fix timezone saving/loading issue 2023-02-15 03:20:18 -06:00
Vortrex
68f7bb1db7 Event fixes 2023-02-15 03:19:49 -06:00
Vortrex
ce73e81f89 Net event fixes 2023-02-15 03:19:39 -06:00
Vortrex
297ce51323 Use new custom fade camera 2023-02-15 03:19:32 -06:00
Vortrex
8ca2e84e62 Rename create game element funcs to "spawn" 2023-02-15 03:19:00 -06:00
Vortrex
ae0178717c Function to remove vehicles 2023-02-15 03:18:04 -06:00
Vortrex
9322d793e6 Small fixes 2023-02-15 03:17:50 -06:00
Vortrex
f755de8de6 Get rid of old death handling 2023-02-15 03:17:37 -06:00
Vortrex
fd703e969a New netevents to clear stuff 2023-02-15 03:17:25 -06:00
Vortrex
f3df3a37e6 Use property label render distance 2023-02-15 03:17:12 -06:00
Vortrex
711c429363 Process custom fade camera 2023-02-15 03:16:56 -06:00
Vortrex
736857e120 Fix custom fade camera 2023-02-15 03:16:43 -06:00
Vortrex
f23a98f182 Send deleted job 2023-02-15 03:16:25 -06:00
Vortrex
350a42eef5 Send deleted house 2023-02-15 03:16:18 -06:00
Vortrex
a098fec203 Add support for sending deleted biz 2023-02-15 03:16:03 -06:00
Vortrex
2028d34a0c Add camera script to meta.xml 2023-02-15 03:15:47 -06:00
Vortrex
4db0882d4c Fix position for SalieriBar interior 2023-02-12 13:12:42 -06:00
Vortrex
7169dc65ba Make vehicle chat indicator color lighter 2023-02-12 13:12:28 -06:00
Vortrex
3b509da887 Wrong util name 2023-02-12 13:12:07 -06:00
Vortrex
2d7e7f5a6e Check if dimension and interior supported 2023-02-12 13:11:58 -06:00
Vortrex
89118b8426 Use radio utils 2023-02-12 13:11:43 -06:00
Vortrex
c168e80258 Re-enable 2D rendering after map switch 2023-02-12 13:11:31 -06:00
Vortrex
82f4d31b3b Prefix 2023-02-12 13:11:15 -06:00
Vortrex
0934a86023 Check pickup is supported 2023-02-12 13:11:06 -06:00
Vortrex
afce71dd19 Check animation exists 2023-02-12 13:10:56 -06:00
Vortrex
734446c4f0 Not an async function 2023-02-12 13:10:27 -06:00
Vortrex
03e939a4af Enable game map 2023-02-12 13:10:11 -06:00
Vortrex
ba3c5533e7 Disable rendering before switching scenes 2023-02-12 13:10:03 -06:00
Vortrex
8aa8e843b7 Need event object 2023-02-12 13:09:49 -06:00
Vortrex
ea9135e898 Fix job and uniform create + optional use admin's skin 2023-02-09 11:08:41 -06:00
Vortrex
4d13ab33e4 Fix Mafia font size for big game message 2023-02-09 11:08:12 -06:00
Vortrex
1553d19fdd Add optional custom HUD (money only for now, more later) 2023-02-09 11:07:55 -06:00
Vortrex
bca6816fad Different method for removing players from veh 2023-02-09 10:05:57 -06:00
Vortrex
5c2cb68bb7 Use pre-enter/exit veh events for Mafia 1 2023-02-09 10:05:44 -06:00
Vortrex
436bbc753a Use v prefix 2023-02-09 10:05:29 -06:00
Vortrex
2ce7d35971 Add default account settings when saving data 2023-02-09 10:05:22 -06:00
Vortrex
42c31ed2ef Using pre-enter/exit veh events for Mafia 1 2023-02-09 10:04:55 -06:00
Vortrex
bacdc063d4 Prefix 2023-02-08 18:04:27 -06:00
Vortrex
77114a14a3 Merge branch 'master' into nightly 2023-02-08 18:00:29 -06:00
Vortrex
66109a8fe9 Use in vehicle seat var instead of loop 2023-02-08 17:59:52 -06:00
Vortrex
07187b99ce Use non-ex events for Mafia 1 2023-02-08 17:59:34 -06:00
Vortrex
dd04ec0bb3 Send -1 blip/pickup for deleted biz 2023-02-08 17:59:24 -06:00
Vortrex
9004e51928 Use v prefix for server config cvars 2023-02-08 17:59:00 -06:00
Vortrex
094387dc41 Use non-ex events on Mafia 1 2023-02-08 17:58:46 -06:00
Vortrex
145906042b Add melee weapons array for Mafia 1 2023-02-08 17:58:19 -06:00
Vortrex
1e91698e05 Update from master (merge error) 2023-02-07 15:11:56 -06:00
128 changed files with 7812 additions and 3559 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
.vs/
.git/
*.code-workspace
config

View File

@@ -1,27 +1,27 @@
[
"English",
"French",
"Russian",
"Scottish",
"Irish",
"Spanish",
"Southern American",
"Italian",
"Australian",
"Jamaican",
"Israeli",
"Dutch",
"Brazilian",
"Portuguese",
"German",
"Canadian",
"Chinese",
"Japanese",
"Turkish",
"Korean",
"Estonian",
"Sicilian",
"Indian",
"Rough",
"Swedish"
[
"English",
"French",
"Russian",
"Scottish",
"Irish",
"Spanish",
"Southern American",
"Italian",
"Australian",
"Jamaican",
"Israeli",
"Dutch",
"Brazilian",
"Portuguese",
"German",
"Canadian",
"Chinese",
"Japanese",
"Turkish",
"Korean",
"Estonian",
"Sicilian",
"Indian",
"Rough",
"Swedish"
]

View File

@@ -1,145 +1,145 @@
[
{
"id": 0,
"englishName": "English",
"stringsFile": "english.json",
"isoCode": "en",
"flagImageFile": "uk.png",
"countries": ["gb", "us", "au", "bz", "ca", "ie", "jm", "nz", "za", "tt"],
"requiresUnicode": false,
"contributor": "Vortrex",
"enabled": true
},
{
"id": 1,
"englishName": "Russian",
"stringsFile": "russian.json",
"isoCode": "ru",
"flagImageFile": "ru.png",
"countries": ["ru", "ua"],
"requiresUnicode": false,
"contributor": "VNDTTS",
"enabled": true
},
{
"id": 2,
"englishName": "Polish",
"stringsFile": "polish.json",
"isoCode": "pl",
"flagImageFile": "pl.png",
"countries": ["pl"],
"requiresUnicode": false,
"contributor": "Suprise444",
"enabled": true
},
{
"id": 3,
"englishName": "Spanish",
"stringsFile": "spanish.json",
"isoCode": "es",
"flagImageFile": "es.png",
"countries": ["es", "ar", "bo", "cl", "co", "cr", "do", "ec", "sv", "gt", "hn", "mx", "ni", "pa", "py", "pe", "pr", "uy", "ve"],
"requiresUnicode": false,
"contributor": "PerikiyoXD",
"enabled": true
},
{
"id": 4,
"englishName": "Chinese",
"stringsFile": "chinese.json",
"isoCode": "zh",
"flagImageFile": "cn.png",
"countries": ["cn", "hk", "sg", "tw"],
"requiresUnicode": true,
"contributor": "Renzuko_Ctone",
"enabled": true
},
{
"id": 5,
"englishName": "Arabic",
"stringsFile": "arabic.json",
"isoCode": "ar",
"flagImageFile": "sa.png",
"countries": ["dz", "bh", "eg", "iq", "jo", "kw", "lb", "ly", "ma", "om", "qa", "sa", "sy", "tn", "ae", "ye"],
"requiresUnicode": true,
"contributor": "! KASIR",
"enabled": true
},
{
"id": 6,
"englishName": "Slovak",
"stringsFile": "slovak.json",
"isoCode": "sk",
"flagImageFile": "sk.png",
"countries": ["sk"],
"requiresUnicode": false,
"contributor": "UAKLAUS",
"enabled": false
},
{
"id": 7,
"englishName": "German",
"stringsFile": "german.json",
"isoCode": "de",
"flagImageFile": "de.png",
"countries": ["de", "at", "be", "ch", "li", "lu"],
"requiresUnicode": false,
"contributor": "Sladernimo",
"enabled": true
},
{
"id": 8,
"englishName": "French",
"stringsFile": "french.json",
"isoCode": "fr",
"flagImageFile": "fr.png",
"countries": ["fr", "cd", "bj", "bf", "cd", "cg", "ga", "gn", "ml", "mc", "ne", "sn"],
"requiresUnicode": false,
"contributor": "Cocam",
"enabled": false
},
{
"id": 9,
"englishName": "Japanese",
"stringsFile": "japanese.json",
"isoCode": "jp",
"flagImageFile": "jp.png",
"countries": ["jp"],
"requiresUnicode": true,
"contributor": "Cocam",
"enabled": false
},
{
"id": 10,
"englishName": "Finnish",
"stringsFile": "finnish.json",
"isoCode": "fi",
"flagImageFile": "fi.png",
"countries": ["fi"],
"requiresUnicode": false,
"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
}
[
{
"id": 0,
"englishName": "English",
"stringsFile": "english.json",
"isoCode": "en",
"flagImageFile": "uk.png",
"countries": ["gb", "us", "au", "bz", "ca", "ie", "jm", "nz", "za", "tt"],
"requiresUnicode": false,
"contributor": "Vortrex",
"enabled": true
},
{
"id": 1,
"englishName": "Russian",
"stringsFile": "russian.json",
"isoCode": "ru",
"flagImageFile": "ru.png",
"countries": ["ru", "ua"],
"requiresUnicode": false,
"contributor": "VNDTTS",
"enabled": true
},
{
"id": 2,
"englishName": "Polish",
"stringsFile": "polish.json",
"isoCode": "pl",
"flagImageFile": "pl.png",
"countries": ["pl"],
"requiresUnicode": false,
"contributor": "Suprise444",
"enabled": true
},
{
"id": 3,
"englishName": "Spanish",
"stringsFile": "spanish.json",
"isoCode": "es",
"flagImageFile": "es.png",
"countries": ["es", "ar", "bo", "cl", "co", "cr", "do", "ec", "sv", "gt", "hn", "mx", "ni", "pa", "py", "pe", "pr", "uy", "ve"],
"requiresUnicode": false,
"contributor": "PerikiyoXD",
"enabled": true
},
{
"id": 4,
"englishName": "Chinese",
"stringsFile": "chinese.json",
"isoCode": "zh",
"flagImageFile": "cn.png",
"countries": ["cn", "hk", "sg", "tw"],
"requiresUnicode": true,
"contributor": "Renzuko_Ctone",
"enabled": true
},
{
"id": 5,
"englishName": "Arabic",
"stringsFile": "arabic.json",
"isoCode": "ar",
"flagImageFile": "sa.png",
"countries": ["dz", "bh", "eg", "iq", "jo", "kw", "lb", "ly", "ma", "om", "qa", "sa", "sy", "tn", "ae", "ye"],
"requiresUnicode": true,
"contributor": "! KASIR",
"enabled": true
},
{
"id": 6,
"englishName": "Slovak",
"stringsFile": "slovak.json",
"isoCode": "sk",
"flagImageFile": "sk.png",
"countries": ["sk"],
"requiresUnicode": false,
"contributor": "UAKLAUS",
"enabled": false
},
{
"id": 7,
"englishName": "German",
"stringsFile": "german.json",
"isoCode": "de",
"flagImageFile": "de.png",
"countries": ["de", "at", "be", "ch", "li", "lu"],
"requiresUnicode": false,
"contributor": "Sladernimo",
"enabled": true
},
{
"id": 8,
"englishName": "French",
"stringsFile": "french.json",
"isoCode": "fr",
"flagImageFile": "fr.png",
"countries": ["fr", "cd", "bj", "bf", "cd", "cg", "ga", "gn", "ml", "mc", "ne", "sn"],
"requiresUnicode": false,
"contributor": "Cocam",
"enabled": false
},
{
"id": 9,
"englishName": "Japanese",
"stringsFile": "japanese.json",
"isoCode": "jp",
"flagImageFile": "jp.png",
"countries": ["jp"],
"requiresUnicode": true,
"contributor": "Cocam",
"enabled": false
},
{
"id": 10,
"englishName": "Finnish",
"stringsFile": "finnish.json",
"isoCode": "fi",
"flagImageFile": "fi.png",
"countries": ["fi"],
"requiresUnicode": false,
"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
}
]

View File

@@ -1,8 +1,8 @@
{
"host": "",
"user": "",
"pass": "",
"name": "",
"port": 3306,
"usePersistentConnection": false
{
"host": "",
"user": "",
"pass": "",
"name": "",
"port": 3306,
"usePersistentConnection": false
}

View File

@@ -1,15 +1,15 @@
{
"sendChat": false,
"sendEvents": false,
"sendConnectEvents": false,
"sendVehicleEvents": false,
"sendDeathEvents": false,
"sendAdmin": false,
"sendClan": false,
"sendAction": false,
"webhook": {
"enabled": false,
"webhookBaseURL": "",
"pass": ""
}
{
"sendChat": false,
"sendEvents": false,
"sendConnectEvents": false,
"sendVehicleEvents": false,
"sendDeathEvents": false,
"sendAdmin": false,
"sendClan": false,
"sendAction": false,
"webhook": {
"enabled": false,
"webhookBaseURL": "",
"pass": ""
}
}

View File

@@ -1,13 +0,0 @@
{
"passiveIncomePerPayDay": 2000,
"applyTax": true,
"applyUpkeep": true,
"grossIncomeMultiplier": 1.0,
"incomeTaxRate": 0.7,
"currencyString": "${AMOUNT}",
"upKeepCosts": {
"upKeepPerVehicle": 250,
"upKeepPerHouse": 350,
"upKeepPerBusiness": 600
}
}

View File

@@ -1,27 +1,27 @@
{
"enabled": false,
"method": "http",
"smtp": {
"host": "",
"port": 0,
"username": "",
"password": "",
"from": "",
"fromName": "",
"useTLS": true
},
"http": {
"password": "",
"baseURL": ""
},
"bodyContent": {
"confirmEmail": "Welcome to {SERVERNAME}!\nPlease confirm your email by using the command /verifyemail in-game.\n\nYour verification code is: {VERIFICATIONCODE}",
"emailConfirmed": "Your email has been confirmed on {SERVERNAME}!\nYou may now use this email to reset your password, require two-factor authentication on login, receive offline notifications, and more!",
"twoFactorAuthentication": "Please enter the following code to login on {SERVERNAME} for {GAMENAME}: {2FACODE}",
"accountAuthSuccessAlert": "You or someone else has successfully logged in to your account on {SERVERNAME} for {GAMENAME}.\nIP Address: {IPADDRESS}\nLocation: {LOCATION}\nTimestamp: {TIMESTAMP}",
"accountAuthFailAlert": "You or someone else has failed to login to your account on {SERVERNAME} for {GAMENAME}.\nIP Address: {IPADDRESS}\nLocation: {LOCATION}\nTimestamp: {TIMESTAMP}",
"offlineMessageAlert": "You have received a private message on {SERVERNAME} for {GAMENAME}. \nYou are receiving this notification because you enabled email message notifications when you're not connected to the server.\nFrom: {FROMNAME}\nTimestamp: {TIMESTAMP}\nMessage: {MESSAGE}",
"confirmPasswordReset": "You (or someone else) requested to reset your password on {SERVERNAME}!\nPlease confirm this request by entering the code below into the password reset window in-game.\n\nYour verification code is: {VERIFICATIONCODE}\n\n\nIf you did not request a password reset, then there's nothing to worry about since your password can only be reset with the code above.",
"passwordChanged": "Your password on {SERVERNAME} has been changed successfully!"
}
{
"enabled": false,
"method": "http",
"smtp": {
"host": "",
"port": 0,
"username": "",
"password": "",
"from": "",
"fromName": "",
"useTLS": true
},
"http": {
"password": "",
"baseURL": ""
},
"bodyContent": {
"confirmEmail": "Welcome to {SERVERNAME}!\nPlease confirm your email by using the command /verifyemail in-game.\n\nYour verification code is: {VERIFICATIONCODE}",
"emailConfirmed": "Your email has been confirmed on {SERVERNAME}!\nYou may now use this email to reset your password, require two-factor authentication on login, receive offline notifications, and more!",
"twoFactorAuthentication": "Please enter the following code to login on {SERVERNAME} for {GAMENAME}: {2FACODE}",
"accountAuthSuccessAlert": "You or someone else has successfully logged in to your account on {SERVERNAME} for {GAMENAME}.\nIP Address: {IPADDRESS}\nLocation: {LOCATION}\nTimestamp: {TIMESTAMP}",
"accountAuthFailAlert": "You or someone else has failed to login to your account on {SERVERNAME} for {GAMENAME}.\nIP Address: {IPADDRESS}\nLocation: {LOCATION}\nTimestamp: {TIMESTAMP}",
"offlineMessageAlert": "You have received a private message on {SERVERNAME} for {GAMENAME}. \nYou are receiving this notification because you enabled email message notifications when you're not connected to the server.\nFrom: {FROMNAME}\nTimestamp: {TIMESTAMP}\nMessage: {MESSAGE}",
"confirmPasswordReset": "You (or someone else) requested to reset your password on {SERVERNAME}!\nPlease confirm this request by entering the code below into the password reset window in-game.\n\nYour verification code is: {VERIFICATIONCODE}\n\n\nIf you did not request a password reset, then there's nothing to worry about since your password can only be reset with the code above.",
"passwordChanged": "Your password on {SERVERNAME} has been changed successfully!"
}
}

View File

@@ -1,109 +1,114 @@
{
"config": {
"shortHoldDuration": 500,
"longHoldDuration": 1500,
"coolDownBetweenUse": 500
},
"defaultKeyBinds": [
{
"keyName": "k",
"commandString": "engine",
"keyState": 1
},
{
"keyName": "l",
"commandString": "lights",
"keyState": 1
},
{
"keyName": "j",
"commandString": "lock",
"keyState": 1
},
{
"keyName": "f",
"commandString": "enter",
"keyState": 1
},
{
"keyName": "g",
"commandString": "passenger",
"keyState": 1
},
{
"keyName": "m",
"commandString": "cursor",
"keyState": 1
},
{
"keyName": "o",
"commandString": "drop",
"keyState": 1
},
{
"keyName": "p",
"commandString": "pickup",
"keyState": 1
},
{
"keyName": "u",
"commandString": "use",
"keyState": 1
},
{
"keyName": "i",
"commandString": "inv",
"keyState": 1
},
{
"keyName": "0",
"commandString": "item 0",
"keyState": 1
},
{
"keyName": "1",
"commandString": "item 1",
"keyState": 1
},
{
"keyName": "2",
"commandString": "item 2",
"keyState": 1
},
{
"keyName": "3",
"commandString": "item 3",
"keyState": 1
},
{
"keyName": "4",
"commandString": "item 4",
"keyState": 1
},
{
"keyName": "5",
"commandString": "item 5",
"keyState": 1
},
{
"keyName": "6",
"commandString": "item 6",
"keyState": 1
},
{
"keyName": "7",
"commandString": "item 7",
"keyState": 1
},
{
"keyName": "8",
"commandString": "item 8",
"keyState": 1
},
{
"keyName": "9",
"commandString": "item 9",
"keyState": 1
}
]
{
"config": {
"shortHoldDuration": 500,
"longHoldDuration": 1500,
"coolDownBetweenUse": 500
},
"defaultKeyBinds": [
{
"keyName": "k",
"commandString": "engine",
"keyState": 1
},
{
"keyName": "l",
"commandString": "lights",
"keyState": 1
},
{
"keyName": "j",
"commandString": "lock",
"keyState": 1
},
{
"keyName": "f",
"commandString": "enter",
"keyState": 1
},
{
"keyName": "g",
"commandString": "passenger",
"keyState": 1
},
{
"keyName": "m",
"commandString": "cursor",
"keyState": 1
},
{
"keyName": "o",
"commandString": "drop",
"keyState": 1
},
{
"keyName": "p",
"commandString": "pickup",
"keyState": 1
},
{
"keyName": "u",
"commandString": "use",
"keyState": 1
},
{
"keyName": "i",
"commandString": "inv",
"keyState": 1
},
{
"keyName": "0",
"commandString": "item 0",
"keyState": 1
},
{
"keyName": "1",
"commandString": "item 1",
"keyState": 1
},
{
"keyName": "2",
"commandString": "item 2",
"keyState": 1
},
{
"keyName": "3",
"commandString": "item 3",
"keyState": 1
},
{
"keyName": "4",
"commandString": "item 4",
"keyState": 1
},
{
"keyName": "5",
"commandString": "item 5",
"keyState": 1
},
{
"keyName": "6",
"commandString": "item 6",
"keyState": 1
},
{
"keyName": "7",
"commandString": "item 7",
"keyState": 1
},
{
"keyName": "8",
"commandString": "item 8",
"keyState": 1
},
{
"keyName": "9",
"commandString": "item 9",
"keyState": 1
},
{
"keyName": "f5",
"commandString": "scoreboard",
"keyState": 1
}
]
}

View File

@@ -1,150 +1,150 @@
{
"apiEmail": "example@example.com",
"defaultLanguageId": 0,
"translateURL": "http://api.mymemory.translated.net/get?de={3}&q={0}&langpair={1}|{2}",
"locales": [
{
"id": 0,
"englishName": "English",
"stringsFile": "english.json",
"isoCode": "en",
"flagImageFile": "uk.png",
"countries": ["gb", "us", "au", "bz", "ca", "ie", "jm", "nz", "za", "tt"],
"requiresUnicode": false,
"contributor": "Vortrex",
"enabled": true
},
{
"id": 1,
"englishName": "Russian",
"stringsFile": "russian.json",
"isoCode": "ru",
"flagImageFile": "ru.png",
"countries": ["ru", "ua"],
"requiresUnicode": false,
"contributor": "VNDTTS",
"enabled": true
},
{
"id": 2,
"englishName": "Polish",
"stringsFile": "polish.json",
"isoCode": "pl",
"flagImageFile": "pl.png",
"countries": ["pl"],
"requiresUnicode": false,
"contributor": "Suprise444",
"enabled": true
},
{
"id": 3,
"englishName": "Spanish",
"stringsFile": "spanish.json",
"isoCode": "es",
"flagImageFile": "es.png",
"countries": ["es", "ar", "bo", "cl", "co", "cr", "do", "ec", "sv", "gt", "hn", "mx", "ni", "pa", "py", "pe", "pr", "uy", "ve"],
"requiresUnicode": false,
"contributor": "PerikiyoXD",
"enabled": true
},
{
"id": 4,
"englishName": "Chinese",
"stringsFile": "chinese.json",
"isoCode": "zh",
"flagImageFile": "cn.png",
"countries": ["cn", "hk", "sg", "tw"],
"requiresUnicode": true,
"contributor": "Renzuko_Ctone",
"enabled": true
},
{
"id": 5,
"englishName": "Arabic",
"stringsFile": "arabic.json",
"isoCode": "ar",
"flagImageFile": "sa.png",
"countries": ["dz", "bh", "eg", "iq", "jo", "kw", "lb", "ly", "ma", "om", "qa", "sa", "sy", "tn", "ae", "ye"],
"requiresUnicode": true,
"contributor": "! KASIR",
"enabled": true
},
{
"id": 6,
"englishName": "Slovak",
"stringsFile": "slovak.json",
"isoCode": "sk",
"flagImageFile": "sk.png",
"countries": ["sk"],
"requiresUnicode": false,
"contributor": "UAKLAUS",
"enabled": false
},
{
"id": 7,
"englishName": "German",
"stringsFile": "german.json",
"isoCode": "de",
"flagImageFile": "de.png",
"countries": ["de", "at", "be", "ch", "li", "lu"],
"requiresUnicode": false,
"contributor": "Sladernimo",
"enabled": true
},
{
"id": 8,
"englishName": "French",
"stringsFile": "french.json",
"isoCode": "fr",
"flagImageFile": "fr.png",
"countries": ["fr", "cd", "bj", "bf", "cd", "cg", "ga", "gn", "ml", "mc", "ne", "sn"],
"requiresUnicode": false,
"contributor": "Cocam",
"enabled": false
},
{
"id": 9,
"englishName": "Japanese",
"stringsFile": "japanese.json",
"isoCode": "jp",
"flagImageFile": "jp.png",
"countries": ["jp"],
"requiresUnicode": true,
"contributor": "Cocam",
"enabled": false
},
{
"id": 10,
"englishName": "Finnish",
"stringsFile": "finnish.json",
"isoCode": "fi",
"flagImageFile": "fi.png",
"countries": ["fi"],
"requiresUnicode": false,
"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
}
]
{
"apiEmail": "example@example.com",
"defaultLanguageId": 0,
"translateURL": "http://api.mymemory.translated.net/get?de={3}&q={0}&langpair={1}|{2}",
"locales": [
{
"id": 0,
"englishName": "English",
"stringsFile": "english.json",
"isoCode": "en",
"flagImageFile": "uk.png",
"countries": ["gb", "us", "au", "bz", "ca", "ie", "jm", "nz", "za", "tt"],
"requiresUnicode": false,
"contributor": "Vortrex",
"enabled": true
},
{
"id": 1,
"englishName": "Russian",
"stringsFile": "russian.json",
"isoCode": "ru",
"flagImageFile": "ru.png",
"countries": ["ru", "ua"],
"requiresUnicode": false,
"contributor": "VNDTTS",
"enabled": true
},
{
"id": 2,
"englishName": "Polish",
"stringsFile": "polish.json",
"isoCode": "pl",
"flagImageFile": "pl.png",
"countries": ["pl"],
"requiresUnicode": false,
"contributor": "Suprise444",
"enabled": true
},
{
"id": 3,
"englishName": "Spanish",
"stringsFile": "spanish.json",
"isoCode": "es",
"flagImageFile": "es.png",
"countries": ["es", "ar", "bo", "cl", "co", "cr", "do", "ec", "sv", "gt", "hn", "mx", "ni", "pa", "py", "pe", "pr", "uy", "ve"],
"requiresUnicode": false,
"contributor": "PerikiyoXD",
"enabled": true
},
{
"id": 4,
"englishName": "Chinese",
"stringsFile": "chinese.json",
"isoCode": "zh",
"flagImageFile": "cn.png",
"countries": ["cn", "hk", "sg", "tw"],
"requiresUnicode": true,
"contributor": "Renzuko_Ctone",
"enabled": true
},
{
"id": 5,
"englishName": "Arabic",
"stringsFile": "arabic.json",
"isoCode": "ar",
"flagImageFile": "sa.png",
"countries": ["dz", "bh", "eg", "iq", "jo", "kw", "lb", "ly", "ma", "om", "qa", "sa", "sy", "tn", "ae", "ye"],
"requiresUnicode": true,
"contributor": "! KASIR",
"enabled": true
},
{
"id": 6,
"englishName": "Slovak",
"stringsFile": "slovak.json",
"isoCode": "sk",
"flagImageFile": "sk.png",
"countries": ["sk"],
"requiresUnicode": false,
"contributor": "UAKLAUS",
"enabled": false
},
{
"id": 7,
"englishName": "German",
"stringsFile": "german.json",
"isoCode": "de",
"flagImageFile": "de.png",
"countries": ["de", "at", "be", "ch", "li", "lu"],
"requiresUnicode": false,
"contributor": "Sladernimo",
"enabled": true
},
{
"id": 8,
"englishName": "French",
"stringsFile": "french.json",
"isoCode": "fr",
"flagImageFile": "fr.png",
"countries": ["fr", "cd", "bj", "bf", "cd", "cg", "ga", "gn", "ml", "mc", "ne", "sn"],
"requiresUnicode": false,
"contributor": "Cocam",
"enabled": false
},
{
"id": 9,
"englishName": "Japanese",
"stringsFile": "japanese.json",
"isoCode": "jp",
"flagImageFile": "jp.png",
"countries": ["jp"],
"requiresUnicode": true,
"contributor": "Cocam",
"enabled": false
},
{
"id": 10,
"englishName": "Finnish",
"stringsFile": "finnish.json",
"isoCode": "fi",
"flagImageFile": "fi.png",
"countries": ["fi"],
"requiresUnicode": false,
"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
}
]
}

8
config/security.json Normal file
View File

@@ -0,0 +1,8 @@
{
"accountSaltHash": [
"LGj6w8SRwJEJ95XH"
],
"accountPasswordSaltAlgorithm": [
"v.roleplay.{SALTHASH}.{NAME}.{PASSWORD}"
]
}

View File

@@ -66,6 +66,22 @@ CREATE TABLE IF NOT EXISTS `acct_contact` (
-- Dumping data for table v-roleplay.acct_contact: ~0 rows (approximately)
-- Dumping structure for table v-roleplay.acct_cmd
CREATE TABLE `acct_cmd` (
`acct_cmd_id` int(11) NOT NULL,
`acct_cmd_acct` int(11) NOT NULL DEFAULT '1',
`acct_cmd_for_cmd` varchar(128) NOT NULL DEFAULT '',
`acct_cmd_alias_cmd` varchar(128) NOT NULL DEFAULT '',
`acct_cmd_deleted` tinyint(1) NOT NULL DEFAULT '0',
`acct_cmd_enabled` tinyint(1) NOT NULL DEFAULT '0',
`acct_cmd_when_added` bigint(32) NOT NULL DEFAULT '0'
PRIMARY KEY (`acct_cmd_id`),
KEY `acct_cmd_acct` (`acct_cmd_acct`),
CONSTRAINT `fk_acct_cmd_acct` FOREIGN KEY (`acct_cmd_acct`) REFERENCES `acct_main` (`acct_id`) ON DELETE CASCADE ON UPDATE CASCADE,
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Account - Command Aliases';
-- Dumping data for table v-roleplay.acct_cmd: ~0 rows (approximately)
-- Dumping structure for table v-roleplay.acct_hotkey
CREATE TABLE IF NOT EXISTS `acct_hotkey` (
`acct_hotkey_id` int(11) NOT NULL AUTO_INCREMENT,

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

41
info/ECONOMY.md Normal file
View File

@@ -0,0 +1,41 @@
# Economy Information
### Basic Information
Each server has it's own independent economy with simulated inflation and is designed to slowly self-repair over time, assuming nothing is affecting it too heavily.
---
### Asset Ownership
Any player or clan is allowed to own as many businesses, vehicles, and houses as they want. However, it should be noted that the more you own, the more upkeep (via taxes, insurance, etc) is required. Failure to maintain this upkeep for too long will automatically force you to lose the unmaintained assets. Vehicle owners can park their car anywhere (subject to IC parking laws), store items in the trunk or dash compartment, give anybody access, and set the price if they want to make it available to buy, and more. Business owners can stock their store with any item they want, set what prices they want for any item for sale, close/open the business, keep a stock of items in the business's storage, force people to pay a fee to enter, and more. House owners can store items in their house, purchase a safe, decorate with furniture, give anybody access, and more.
---
### Ordering Items for a Business
Ordering items is simple: just use the /bizorder command.
You'll need to specify which item you want to order and how many.
Remember, the prices will vary depending on certain circumstances.
The formula is as follows:
> Base price * server inflation * demand * risk * amount
**Here's a breakdown on how the above formula works:**
* First, each item has a base price. This value will never change.
* Next, the base price is multiplied by the server's current inflation value. When the servers were first opened, the inflation value is 100%, which means no inflation. Everything cost 100% of it's calculated price. However, the inflation will slowly increase over time, simulating realistic economy inflation.
* Next, the inflated price is then multiplied by the demand factor, which is determined by how much demand there is for the item you want. Every 10 of the item ordered increases the demand value by 10%, and this will slowly go back down over time. If another business just ordered 100 of the item you want, the demand has forced the item's order price to increase by 100%, which means it's now double the original price. This simulates the things involved with increased demand, such as the extra manufacturing and shipping needed to get this item imported to your business.
* Next, the cost is multiplied by a risk value. This value never changes, and varies depending on the item. For illegal items, the risk value will be lower for less-risky items and higher as they get worse. For example, a shotgun versus an AK-47 have different risk levels, as an AK-47 is a far deadlier and a harder to get weapon, and is more difficult to conceal through customs. This simulates the "risk" of ordering items like these. For legal items, there is no risk so the risk price won't increase for those.
* Finally, the order cost is multiplied by the amount you want to order.
**An example of this formula in action is below ... shown for an order for 10 AK-47's with no inflation**
*The demand is increased by 10% since you're ordering 10 of them. 1 = 100% of the normal cost, 1.1 = 110%, and so on.*
> Base price $1000
> x inflation 1 = $1000
> x demand 1.1 = $1100
> x risk 5 = $5500
> x amount 10 = $55000
So as you can see, the total cost to order 10 AK-47's in this scenario is $55,000. Remember, an AK-47 is a deadly and uncommon weapon (and highly illegal!) so it's a very risky and costly thing to do business with.

View File

@@ -17,12 +17,9 @@
"AnimationStopCommandTip": "استخدم {1} لإيقاف الرسوم المتحركة",
"CantBanClient": "لا يمكنك حظر هذا الإعب",
"PlayerAccountBanned": "تم حظر حساب {1}",
"ClanNotFound": "لم يتم العثور على المجموعة",
"ClanNameTaken": "توجد مجموعة بهذا الاسم بالفعل",
"PlayerNotFound": "الاعب غير موجود",
"ClanCantRemoveRanks": "لا يمكنك إزالة رتب المجموعة",
"ClanCantAddRanks": "لأ يمكنك إضافة رتب",
"ClanRankNotFound": "رتبة غير موجودهـ",
"ClanCantChangeMemberTag": "ليس لديك الصلاحيات لتعديل على علامات رتب الاعضاء",
"ClanPlayerNotInSameClan": "الاعب غير موجود بمجموعتك",
"ClanCantChangeRankLevel": "ليس لديك صلاحيات لتغيير مستوى رتبة المجموعة",
@@ -655,28 +652,6 @@
"LeftWrist": "معصم اليد اليسرى",
"RightWrist": "معصم اليد اليمنى"
},
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "استخدم {1} لتشغيل أو إيقاف تشغيل محرك السيارة",
"VehicleLockedAfterEntryAttempt": "استخدم {1} لقفل أو إلغاء تأمين مركبة",
"ShowItemsAfterPurchase": "استخدم {1} لمشاهدة مخزونك",
"BuyCommandAfterEnterBusiness": "استخدم {1} لشراء عناصر من شركة",
"UseItemKeyAfterEquipping": "استخدم {1} لاستخدام العنصر المجهز الخاص بك",
"UseItemKeyAfterEquippingWalkieTalkie": "استخدم {1} لتشغيل الراديو أو إيقاف تشغيله",
"RadioCommandAfterEnablingWalkieTalkie": "استخدم {1} للتحدث في الراديو الخاص بك",
"ReplyToDirectMessage": "استخدم {1} للرد بسهولة على رسالة خاصة",
"UseItemKeyAmmoAfterEquippingWeapon": "استخدم {1} لتحميل ذخيرة في سلاحك المجهز",
"AnimationStop": "استخدم {1} لإيقاف الرسم المتحرك",
"JobEquipmentInventory": "معدات العمل موجودة في مخزونك. استخدم {1} لمشاهدتها.",
"ViewInventory": "استخدم {1} لمشاهدة عناصرك",
"VehicleRepairItemUsage": "قف بجانب سيارة واستخدم {1} لإصلاحها",
"VehicleColourItemUsage": "قف بجوار سيارة واستخدم {1} لتغيير لونها",
"VehiclePartItemUsage": "قف بجوار سيارة واستخدم {1} للترقية باستخدام {2}",
"AmmoClipItemUsage": "جهز السلاح واستخدم {1} لتحميل الذخيرة فيه",
"GenericItemUsage": "استخدم {1} لاستخدام {2}",
"EnterJobVehicleForRoute": "أدخل سيارة عمل قريبة لبدء مسار عمل",
"JobLocations": "قم بزيارة موقع العمل للحصول على وظيفة. استخدم {1} للعثور على موقع عمل",
"JobRouteStart": "استخدم {1} لبدء مسار عمل بهذه السيارة"
},
"DisconnectReasons": {
"Unknown": "غير معروف",
"LostConnection": "انقطع الإتصال",
@@ -752,5 +727,68 @@
"Cancel": "Cancel",
"AlreadyOwnVehicle": "You already own this vehicle!",
"PropertyEntranceFeeLabel": "Entrance Fee: {1}",
"NeedToBeInJobVehicle": "You need to be in a job vehicle!"
}
"NeedToBeInJobVehicle": "You need to be in a job vehicle!",
"InvalidJobRank": "Job rank not found!",
"PayPhoneRecipientAnswered": "Somebody answered the call. Use normal chat to talk to them.",
"PayPhoneAnswered": "You answered the phone. Use normal chat to talk to the caller.",
"PayPhoneRecipientHangup": "The line was disconnected. You have been charged {1}",
"PayPhoneHangup": "You hung up the phone.",
"AlreadyUsingPayPhone": "You are already using a payphone!",
"NotUsingPayPhone": "You are not using a payphone!",
"NoPayPhoneCloseEnough": "There is no payphone close enough!",
"PayPhoneNotRinging": "This payphone is not ringing!",
"PayPhoneOccupied": "This payphone is already being used by someone else!",
"PayPhoneOccupantSwitched": "A different voice is now on the line",
"PayPhoneGiven": "You gave the phone to {1}",
"PayPhoneReceived": "{1} gave you the phone",
"PayPhoneUnableToCallPlayer": "You can't call {1} at this time. Please try again later.",
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "استخدم {1} لتشغيل أو إيقاف تشغيل محرك السيارة",
"VehicleLockedAfterEntryAttempt": "استخدم {1} لقفل أو إلغاء تأمين مركبة",
"ShowItemsAfterPurchase": "استخدم {1} لمشاهدة مخزونك",
"BuyCommandAfterEnterBusiness": "استخدم {1} لشراء عناصر من شركة",
"UseItemKeyAfterEquipping": "استخدم {1} لاستخدام العنصر المجهز الخاص بك",
"UseItemKeyAfterEquippingWalkieTalkie": "استخدم {1} لتشغيل الراديو أو إيقاف تشغيله",
"RadioCommandAfterEnablingWalkieTalkie": "استخدم {1} للتحدث في الراديو الخاص بك",
"ReplyToDirectMessage": "استخدم {1} للرد بسهولة على رسالة خاصة",
"UseItemKeyAmmoAfterEquippingWeapon": "استخدم {1} لتحميل ذخيرة في سلاحك المجهز",
"AnimationStop": "استخدم {1} لإيقاف الرسم المتحرك",
"JobEquipmentInventory": "معدات العمل موجودة في مخزونك. استخدم {1} لمشاهدتها.",
"ViewInventory": "استخدم {1} لمشاهدة عناصرك",
"VehicleRepairItemUsage": "قف بجانب سيارة واستخدم {1} لإصلاحها",
"VehicleColourItemUsage": "قف بجوار سيارة واستخدم {1} لتغيير لونها",
"VehiclePartItemUsage": "قف بجوار سيارة واستخدم {1} للترقية باستخدام {2}",
"AmmoClipItemUsage": "جهز السلاح واستخدم {1} لتحميل الذخيرة فيه",
"GenericItemUsage": "استخدم {1} لاستخدام {2}",
"EnterJobVehicleForRoute": "أدخل سيارة عمل قريبة لبدء مسار عمل",
"JobLocations": "قم بزيارة موقع العمل للحصول على وظيفة. استخدم {1} للعثور على موقع عمل",
"JobRouteStart": "استخدم {1} لبدء مسار عمل بهذه السيارة",
"PayPhoneFirstUse": "Use {1} to end the call, and {2} to give the phone to somebody nearby"
},
"NoBusinessesWithinRange": "There are no businesses within {1} meters",
"NoHousesWithinRange": "There are no houses within {1} meters",
"NoPayPhonesWithinRange": "There are no payphones within {1} meters",
"HeaderBusinessesInRangeList": "Businesses (within {1} meters)",
"HeaderHousesInRangeList": "Businesses (within {1} meters)",
"HeaderPayPhonesInRangeList": "Businesses (within {1} meters)",
"HeaderCommandsForStaffFlagList": "Admin Commands ({1})",
"PlayerLocateDistanceAndDirection": "{1} is {2} meters {3}",
"MustBeNumber": "You need to use a number!",
"HeaderJobRoutesList": "Job Routes ({1})",
"HeaderJobRouteInfo": "Job Route Information (${1})",
"InvalidJobRoute": "Job route not found!",
"PayPhoneDeleted": "The payphone was deleted",
"PayPhoneAnswer": "Use {1} to answer the payphone",
"ResetActionTipsConfirm": "Are you sure you want to reset all seen action tips?",
"ActionTipsReset": "All seen action tips have been reset.",
"NormalChatDisabled": "Normal chat is disabled by server admin. Use chat commands instead.",
"GlobalChatDisabled": "Global out-of-character chat is disabled by server admin",
"CantEditJobUniforms": "You can't edit job uniforms!",
"PlayerNotSurrendered": "The player must be surrendered (hands up, be knocked out, or tazed)!",
"PlayerRemovedFromJob": "You removed {1} from the job",
"RemovedFromJob": "You were removed from the job by {1}",
"UnableToCallPlayer": "{1} can't be called right now",
"NoRadioToUse": "You must have a radio, or be in a vehicle with a radio!",
"FrequencyMustBeNumber": "The radio channel must be a number!",
"FrequencyMustBeBetween": "The radio channel must be between {1} and {2}!"
}

View File

@@ -16,12 +16,9 @@
"InvalidAnimationDistance": "The distance must be between 0 and 3",
"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",
@@ -653,28 +650,6 @@
"LeftWrist": "Left Wrist",
"RightWrist": "Right Wrist"
},
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Use {1} to turn on or off a vehicle's engine",
"VehicleLockedAfterEntryAttempt": "Use {1} to lock or unlock a vehicle",
"ShowItemsAfterPurchase": "Use {1} to see your inventory",
"BuyCommandAfterEnterBusiness": "Use {1} to buy items from a business",
"UseItemKeyAfterEquipping": "Use {1} to use your equipped item",
"UseItemKeyAfterEquippingWalkieTalkie": "Use {1} to turn on or off your radio",
"RadioCommandAfterEnablingWalkieTalkie": "Use {1} to talk on your radio",
"ReplyToDirectMessage": "Use {1} to easily reply to a private message",
"UseItemKeyAmmoAfterEquippingWeapon": "Use {1} to load an ammo item into your equipped weapon",
"AnimationStop": "Use {1} to stop your animation",
"JobEquipmentInventory": "The job equipment is in your inventory. Use {1} to see them.",
"ViewInventory": "Use {1} to see your items",
"VehicleRepairItemUsage": "Stand next to a vehicle and use {1} to repair it",
"VehicleColourItemUsage": "Stand next to a vehicle and use {1} to change it's colour",
"VehiclePartItemUsage": "Stand next to a vehicle and use {1} to upgrade with {2}",
"AmmoClipItemUsage": "Equip the weapon and use {1} to load ammo into it",
"GenericItemUsage": "Use {1} to use the {2}",
"EnterJobVehicleForRoute": "Enter a job vehicle nearby to start a job route",
"JobLocations": "Visit a job location to get a job. Use {1} to find a job location",
"JobRouteStart": "Use {1} to start a job route with this vehicle"
},
"DisconnectReasons": {
"Unknown": "Unknown",
"LostConnection": "Lost Connection",
@@ -750,5 +725,68 @@
"Cancel": "Cancel",
"AlreadyOwnVehicle": "You already own this vehicle!",
"PropertyEntranceFeeLabel": "Entrance Fee: {1}",
"NeedToBeInJobVehicle": "You need to be in a job vehicle!"
}
"NeedToBeInJobVehicle": "You need to be in a job vehicle!",
"InvalidJobRank": "Job rank not found!",
"PayPhoneRecipientAnswered": "Somebody answered the call. Use normal chat to talk to them.",
"PayPhoneAnswered": "You answered the phone. Use normal chat to talk to the caller.",
"PayPhoneRecipientHangup": "The line was disconnected. You have been charged {1}",
"PayPhoneHangup": "You hung up the phone.",
"AlreadyUsingPayPhone": "You are already using a payphone!",
"NotUsingPayPhone": "You are not using a payphone!",
"NoPayPhoneCloseEnough": "There is no payphone close enough!",
"PayPhoneNotRinging": "This payphone is not ringing!",
"PayPhoneOccupied": "This payphone is already being used by someone else!",
"PayPhoneOccupantSwitched": "A different voice is now on the line",
"PayPhoneGiven": "You gave the phone to {1}",
"PayPhoneReceived": "{1} gave you the phone",
"PayPhoneUnableToCallPlayer": "You can't call {1} at this time. Please try again later.",
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Use {1} to turn on or off a vehicle's engine",
"VehicleLockedAfterEntryAttempt": "Use {1} to lock or unlock a vehicle",
"ShowItemsAfterPurchase": "Use {1} to see your inventory",
"BuyCommandAfterEnterBusiness": "Use {1} to buy items from a business",
"UseItemKeyAfterEquipping": "Use {1} to use your equipped item",
"UseItemKeyAfterEquippingWalkieTalkie": "Use {1} to turn on or off your radio",
"RadioCommandAfterEnablingWalkieTalkie": "Use {1} to talk on your radio",
"ReplyToDirectMessage": "Use {1} to easily reply to a private message",
"UseItemKeyAmmoAfterEquippingWeapon": "Use {1} to load an ammo item into your equipped weapon",
"AnimationStop": "Use {1} to stop your animation",
"JobEquipmentInventory": "The job equipment is in your inventory. Use {1} to see them.",
"ViewInventory": "Use {1} to see your items",
"VehicleRepairItemUsage": "Stand next to a vehicle and use {1} to repair it",
"VehicleColourItemUsage": "Stand next to a vehicle and use {1} to change it's colour",
"VehiclePartItemUsage": "Stand next to a vehicle and use {1} to upgrade with {2}",
"AmmoClipItemUsage": "Equip the weapon and use {1} to load ammo into it",
"GenericItemUsage": "Use {1} to use the {2}",
"EnterJobVehicleForRoute": "Enter a job vehicle nearby to start a job route",
"JobLocations": "Visit a job location to get a job. Use {1} to find a job location",
"JobRouteStart": "Use {1} to start a job route with this vehicle",
"PayPhoneFirstUse": "Use {1} to end the call, and {2} to give the phone to somebody nearby"
},
"NoBusinessesWithinRange": "There are no businesses within {1} meters",
"NoHousesWithinRange": "There are no houses within {1} meters",
"NoPayPhonesWithinRange": "There are no payphones within {1} meters",
"HeaderBusinessesInRangeList": "Businesses (within {1} meters)",
"HeaderHousesInRangeList": "Businesses (within {1} meters)",
"HeaderPayPhonesInRangeList": "Businesses (within {1} meters)",
"HeaderCommandsForStaffFlagList": "Admin Commands ({1})",
"PlayerLocateDistanceAndDirection": "{1} is {2} meters {3}",
"MustBeNumber": "You need to use a number!",
"HeaderJobRoutesList": "Job Routes ({1})",
"HeaderJobRouteInfo": "Job Route Information (${1})",
"InvalidJobRoute": "Job route not found!",
"PayPhoneDeleted": "The payphone was deleted",
"PayPhoneAnswer": "Use {1} to answer the payphone",
"ResetActionTipsConfirm": "Are you sure you want to reset all seen action tips?",
"ActionTipsReset": "All seen action tips have been reset.",
"NormalChatDisabled": "Normal chat is disabled by server admin. Use chat commands instead.",
"GlobalChatDisabled": "Global out-of-character chat is disabled by server admin",
"CantEditJobUniforms": "You can't edit job uniforms!",
"PlayerNotSurrendered": "The player must be surrendered (hands up, be knocked out, or tazed)!",
"PlayerRemovedFromJob": "You removed {1} from the job",
"RemovedFromJob": "You were removed from the job by {1}",
"UnableToCallPlayer": "{1} can't be called right now",
"NoRadioToUse": "You must have a radio, or be in a vehicle with a radio!",
"FrequencyMustBeNumber": "The radio channel must be a number!",
"FrequencyMustBeBetween": "The radio channel must be between {1} and {2}!"
}

View File

@@ -16,12 +16,9 @@
"AnimationStopCommandTip": "使用 {1} 以停止当前动作",
"CantBanClient": "你无法封禁该玩家",
"PlayerAccountBanned": "{1} 的账户已被封禁",
"ClanNotFound": "帮派不存在",
"ClanNameTaken": "该帮派名称已被占用",
"PlayerNotFound": "玩家不存在",
"ClanCantRemoveRanks": "无法清除帮派等级",
"ClanCantAddRanks": "无法增加帮派等级",
"ClanRankNotFound": "帮派等级不存在",
"ClanCantChangeMemberTag": "你无法更改帮派成员的标签",
"ClanPlayerNotInSameClan": "该玩家并不属于你的帮派",
"ClanCantChangeRankLevel": "你无法更改帮派等级",
@@ -651,28 +648,6 @@
"LeftWrist": "Left Wrist",
"RightWrist": "Right Wrist"
},
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Use {1} to turn on or off a vehicle's engine",
"VehicleLockedAfterEntryAttempt": "Use {1} to lock or unlock a vehicle",
"ShowItemsAfterPurchase": "Use {1} to see your inventory",
"BuyCommandAfterEnterBusiness": "Use {1} to buy items from a business",
"UseItemKeyAfterEquipping": "Use {1} to use your equipped item",
"UseItemKeyAfterEquippingWalkieTalkie": "Use {1} to turn on or off your radio",
"RadioCommandAfterEnablingWalkieTalkie": "Use {1} to talk on your radio",
"ReplyToDirectMessage": "Use {1} to easily reply to a private message",
"UseItemKeyAmmoAfterEquippingWeapon": "Use {1} to load an ammo item into your equipped weapon",
"AnimationStop": "Use {1} to stop your animation",
"JobEquipmentInventory": "The job equipment is in your inventory. Use {1} to see them.",
"ViewInventory": "Use {1} to see your items",
"VehicleRepairItemUsage": "Stand next to a vehicle and use {1} to repair it",
"VehicleColourItemUsage": "Stand next to a vehicle and use {1} to change it's colour",
"VehiclePartItemUsage": "Stand next to a vehicle and use {1} to upgrade with {2}",
"AmmoClipItemUsage": "Equip the weapon and use {1} to load ammo into it",
"GenericItemUsage": "Use {1} to use the {2}",
"EnterJobVehicleForRoute": "Enter a job vehicle nearby to start a job route",
"JobLocations": "Visit a job location to get a job. Use {1} to find a job location",
"JobRouteStart": "Use {1} to start a job route with this vehicle"
},
"DisconnectReasons": {
"Unknown": "Unknown",
"LostConnection": "Lost Connection",
@@ -748,5 +723,68 @@
"Cancel": "Cancel",
"AlreadyOwnVehicle": "You already own this vehicle!",
"PropertyEntranceFeeLabel": "Entrance Fee: {1}",
"NeedToBeInJobVehicle": "You need to be in a job vehicle!"
"NeedToBeInJobVehicle": "You need to be in a job vehicle!",
"InvalidJobRank": "Job rank not found!",
"PayPhoneRecipientAnswered": "Somebody answered the call. Use normal chat to talk to them.",
"PayPhoneAnswered": "You answered the phone. Use normal chat to talk to the caller.",
"PayPhoneRecipientHangup": "The line was disconnected. You have been charged {1}",
"PayPhoneHangup": "You hung up the phone.",
"AlreadyUsingPayPhone": "You are already using a payphone!",
"NotUsingPayPhone": "You are not using a payphone!",
"NoPayPhoneCloseEnough": "There is no payphone close enough!",
"PayPhoneNotRinging": "This payphone is not ringing!",
"PayPhoneOccupied": "This payphone is already being used by someone else!",
"PayPhoneOccupantSwitched": "A different voice is now on the line",
"PayPhoneGiven": "You gave the phone to {1}",
"PayPhoneReceived": "{1} gave you the phone",
"PayPhoneUnableToCallPlayer": "You can't call {1} at this time. Please try again later.",
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Use {1} to turn on or off a vehicle's engine",
"VehicleLockedAfterEntryAttempt": "Use {1} to lock or unlock a vehicle",
"ShowItemsAfterPurchase": "Use {1} to see your inventory",
"BuyCommandAfterEnterBusiness": "Use {1} to buy items from a business",
"UseItemKeyAfterEquipping": "Use {1} to use your equipped item",
"UseItemKeyAfterEquippingWalkieTalkie": "Use {1} to turn on or off your radio",
"RadioCommandAfterEnablingWalkieTalkie": "Use {1} to talk on your radio",
"ReplyToDirectMessage": "Use {1} to easily reply to a private message",
"UseItemKeyAmmoAfterEquippingWeapon": "Use {1} to load an ammo item into your equipped weapon",
"AnimationStop": "Use {1} to stop your animation",
"JobEquipmentInventory": "The job equipment is in your inventory. Use {1} to see them.",
"ViewInventory": "Use {1} to see your items",
"VehicleRepairItemUsage": "Stand next to a vehicle and use {1} to repair it",
"VehicleColourItemUsage": "Stand next to a vehicle and use {1} to change it's colour",
"VehiclePartItemUsage": "Stand next to a vehicle and use {1} to upgrade with {2}",
"AmmoClipItemUsage": "Equip the weapon and use {1} to load ammo into it",
"GenericItemUsage": "Use {1} to use the {2}",
"EnterJobVehicleForRoute": "Enter a job vehicle nearby to start a job route",
"JobLocations": "Visit a job location to get a job. Use {1} to find a job location",
"JobRouteStart": "Use {1} to start a job route with this vehicle",
"PayPhoneFirstUse": "Use {1} to end the call, and {2} to give the phone to somebody nearby"
},
"NoBusinessesWithinRange": "There are no businesses within {1} meters",
"NoHousesWithinRange": "There are no houses within {1} meters",
"NoPayPhonesWithinRange": "There are no payphones within {1} meters",
"HeaderBusinessesInRangeList": "Businesses (within {1} meters)",
"HeaderHousesInRangeList": "Businesses (within {1} meters)",
"HeaderPayPhonesInRangeList": "Businesses (within {1} meters)",
"HeaderCommandsForStaffFlagList": "Admin Commands ({1})",
"PlayerLocateDistanceAndDirection": "{1} is {2} meters {3}",
"MustBeNumber": "You need to use a number!",
"HeaderJobRoutesList": "Job Routes ({1})",
"HeaderJobRouteInfo": "Job Route Information (${1})",
"InvalidJobRoute": "Job route not found!",
"PayPhoneDeleted": "The payphone was deleted",
"PayPhoneAnswer": "Use {1} to answer the payphone",
"ResetActionTipsConfirm": "Are you sure you want to reset all seen action tips?",
"ActionTipsReset": "All seen action tips have been reset.",
"NormalChatDisabled": "Normal chat is disabled by server admin. Use chat commands instead.",
"GlobalChatDisabled": "Global out-of-character chat is disabled by server admin",
"CantEditJobUniforms": "You can't edit job uniforms!",
"PlayerNotSurrendered": "The player must be surrendered (hands up, be knocked out, or tazed)!",
"PlayerRemovedFromJob": "You removed {1} from the job",
"RemovedFromJob": "You were removed from the job by {1}",
"UnableToCallPlayer": "{1} can't be called right now",
"NoRadioToUse": "You must have a radio, or be in a vehicle with a radio!",
"FrequencyMustBeNumber": "The radio channel must be a number!",
"FrequencyMustBeBetween": "The radio channel must be between {1} and {2}!"
}

View File

@@ -16,9 +16,7 @@
"InvalidAnimationDistance": "The distance must be between 0 and 3",
"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",
@@ -653,28 +651,6 @@
"LeftWrist": "Left Wrist",
"RightWrist": "Right Wrist"
},
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Use {1} to turn on or off a vehicle's engine",
"VehicleLockedAfterEntryAttempt": "Use {1} to lock or unlock a vehicle",
"ShowItemsAfterPurchase": "Use {1} to see your inventory",
"BuyCommandAfterEnterBusiness": "Use {1} to buy items from a business",
"UseItemKeyAfterEquipping": "Use {1} to use your equipped item",
"UseItemKeyAfterEquippingWalkieTalkie": "Use {1} to turn on or off your radio",
"RadioCommandAfterEnablingWalkieTalkie": "Use {1} to talk on your radio",
"ReplyToDirectMessage": "Use {1} to easily reply to a private message",
"UseItemKeyAmmoAfterEquippingWeapon": "Use {1} to load an ammo item into your equipped weapon",
"AnimationStop": "Use {1} to stop your animation",
"JobEquipmentInventory": "The job equipment is in your inventory. Use {1} to see them.",
"ViewInventory": "Use {1} to see your items",
"VehicleRepairItemUsage": "Stand next to a vehicle and use {1} to repair it",
"VehicleColourItemUsage": "Stand next to a vehicle and use {1} to change it's colour",
"VehiclePartItemUsage": "Stand next to a vehicle and use {1} to upgrade with {2}",
"AmmoClipItemUsage": "Equip the weapon and use {1} to load ammo into it",
"GenericItemUsage": "Use {1} to use the {2}",
"EnterJobVehicleForRoute": "Enter a job vehicle nearby to start a job route",
"JobLocations": "Visit a job location to get a job. Use {1} to find a job location",
"JobRouteStart": "Use {1} to start a job route with this vehicle"
},
"DisconnectReasons": {
"Unknown": "Unknown",
"LostConnection": "Lost Connection",
@@ -750,5 +726,76 @@
"Cancel": "Cancel",
"AlreadyOwnVehicle": "You already own this vehicle!",
"PropertyEntranceFeeLabel": "Entrance Fee: {1}",
"NeedToBeInJobVehicle": "You need to be in a job vehicle!"
"NeedToBeInJobVehicle": "You need to be in a job vehicle!",
"InvalidJobRank": "Job rank not found!",
"NoPlayerCloseEnough": "There is no player close enough!",
"PayPhoneRecipientAnswered": "Somebody answered the call. Use normal chat to talk to them.",
"PayPhoneAnswered": "You answered the phone. Use normal chat to talk to the caller.",
"PayPhoneRecipientHangup": "The line was disconnected. You have been charged {1}",
"PayPhoneHangup": "You hung up the phone.",
"AlreadyUsingPayPhone": "You are already using a payphone!",
"NotUsingPayPhone": "You are not using a payphone!",
"NoPayPhoneCloseEnough": "There is no payphone close enough!",
"PayPhoneNotRinging": "This payphone is not ringing!",
"PayPhoneOccupied": "This payphone is already being used by someone else!",
"PayPhoneOccupantSwitched": "A different voice is now on the line",
"PayPhoneGiven": "You gave the phone to {1}",
"PayPhoneReceived": "{1} gave you the phone",
"PayPhoneUnableToCallPlayer": "You can't call {1} at this time. Please try again later.",
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Use {1} to turn on or off a vehicle's engine",
"VehicleLockedAfterEntryAttempt": "Use {1} to lock or unlock a vehicle",
"ShowItemsAfterPurchase": "Use {1} to see your inventory",
"BuyCommandAfterEnterBusiness": "Use {1} to buy items from a business",
"UseItemKeyAfterEquipping": "Use {1} to use your equipped item",
"UseItemKeyAfterEquippingWalkieTalkie": "Use {1} to turn on or off your radio",
"RadioCommandAfterEnablingWalkieTalkie": "Use {1} to talk on your radio",
"ReplyToDirectMessage": "Use {1} to easily reply to a private message",
"UseItemKeyAmmoAfterEquippingWeapon": "Use {1} to load an ammo item into your equipped weapon",
"AnimationStop": "Use {1} to stop your animation",
"JobEquipmentInventory": "The job equipment is in your inventory. Use {1} to see them.",
"ViewInventory": "Use {1} to see your items",
"VehicleRepairItemUsage": "Stand next to a vehicle and use {1} to repair it",
"VehicleColourItemUsage": "Stand next to a vehicle and use {1} to change it's colour",
"VehiclePartItemUsage": "Stand next to a vehicle and use {1} to upgrade with {2}",
"AmmoClipItemUsage": "Equip the weapon and use {1} to load ammo into it",
"GenericItemUsage": "Use {1} to use the {2}",
"EnterJobVehicleForRoute": "Enter a job vehicle nearby to start a job route",
"JobLocations": "Visit a job location to get a job. Use {1} to find a job location",
"JobRouteStart": "Use {1} to start a job route with this vehicle",
"PayPhoneFirstUse": "Use {1} to end the call, and {2} to give the phone to somebody nearby",
"BusinessOwnerHelp": "Use {1} to see commands and information for business owners"
},
"NoBusinessesWithinRange": "There are no businesses within {1} meters",
"NoHousesWithinRange": "There are no houses within {1} meters",
"NoPayPhonesWithinRange": "There are no payphones within {1} meters",
"HeaderBusinessesInRangeList": "Businesses (within {1} meters)",
"HeaderHousesInRangeList": "Businesses (within {1} meters)",
"HeaderPayPhonesInRangeList": "Businesses (within {1} meters)",
"HeaderCommandsForStaffFlagList": "Admin Commands ({1})",
"PlayerLocateDistanceAndDirection": "{1} is {2} meters {3}",
"MustBeNumber": "You need to use a number!",
"HeaderJobRoutesList": "Job Routes ({1})",
"HeaderJobRouteInfo": "Job Route Information (${1})",
"InvalidJobRoute": "Job route not found!",
"PayPhoneDeleted": "The payphone was deleted",
"PayPhoneAnswer": "Use {1} to answer the payphone",
"ResetActionTipsConfirm": "Are you sure you want to reset all seen action tips?",
"ActionTipsReset": "All seen action tips have been reset.",
"NormalChatDisabled": "Normal chat is disabled by server admin. Use chat commands instead.",
"GlobalChatDisabled": "Global out-of-character chat is disabled by server admin",
"GUIAlertTitle": "Alert!",
"JobInviteSent": "You sent a job invite to {1}",
"JobInviteAlreadyHasJob": "That player already has a job!",
"JobInviteRequest": "{1} invited you to the {2} job.",
"CantAddJobMembers": "You can't invite new members to the job!",
"CantRemoveJobMembers": "You can't remove members from the job!",
"CantEditJobUniforms": "You can't edit job uniforms!",
"PlayerNotSurrendered": "The player must be surrendered (hands up, be knocked out, or tazed)!",
"PlayerRemovedFromJob": "You removed {1} from the job",
"RemovedFromJob": "You were removed from the job by {1}",
"UnableToCallPlayer": "{1} can't be called right now",
"NoRadioToUse": "You must have a radio, or be in a vehicle with a radio!",
"FrequencyMustBeNumber": "The radio channel must be a number!",
"FrequencyMustBeBetween": "The radio channel must be between {1} and {2}!"
}

View File

@@ -16,12 +16,9 @@
"InvalidAnimationDistance": "etäisyyden pitää olla väliin 0 ja 3",
"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ä",
@@ -650,28 +647,6 @@
"LeftWrist": "Vasempi Ranne",
"RightWrist": "Oikeampi Ranne"
},
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Käytä {1} laittaksesi päälle tai kiinni ajoneuvon moottori",
"VehicleLockedAfterEntryAttempt": "Käytä {1} Lukitaaksesi tai aukaaksesi ajoneuvosi",
"ShowItemsAfterPurchase": "Käytä {1} Nähdääksesi Tavarasi",
"BuyCommandAfterEnterBusiness": "Käytä {1} tuotteiden ostamiseen yrityksestä",
"UseItemKeyAfterEquipping": "Käytä {1} käyttääksesi varustetasi",
"UseItemKeyAfterEquippingWalkieTalkie": "Käytä {1} kytkeäksesi radion päälle tai pois",
"RadioCommandAfterEnablingWalkieTalkie": "Käytä {1} puhuaksesi radiossasi",
"ReplyToDirectMessage": "Käytä {1} vastataksesi helposti yksityisviestiin",
"UseItemKeyAmmoAfterEquippingWeapon": "Käytä {1} ladataksesi ammuksia varustetulle aseesesi",
"AnimationStop": "Pysäytä animaatio painamalla {1}",
"JobEquipmentInventory": "Työvälineet ovat varastossasi. Käytä {1} nähdäksesi ne.",
"ViewInventory": "Käytä {1} nähdäksesi kohteesi",
"VehicleRepairItemUsage": "Seiso ajoneuvon vieressä ja käytä {1} Korjaaksesi sen",
"VehicleColourItemUsage": "Seiso ajoneuvon vieressä ja käytä {1} Vaihtaaksesi sen väriä",
"VehiclePartItemUsage": "Seiso ajoneuvon vieressä ja käytä {1} tuunatakseen {2}",
"AmmoClipItemUsage": "Varusta ase ja käytä {1} ladataaksesi panoksia",
"GenericItemUsage": "Käytä {1} käyttääksesi {2}",
"EnterJobVehicleForRoute": "Enter a job vehicle nearby to start a job route",
"JobLocations": "Visit a job location to get a job. Use {1} to find a job location",
"JobRouteStart": "Use {1} to start a job route with this vehicle"
},
"DisconnectReasons": {
"Unknown": "Tuntematon",
"LostConnection": "Yhteys menetetty",
@@ -747,5 +722,68 @@
"Cancel": "Cancel",
"AlreadyOwnVehicle": "You already own this vehicle!",
"PropertyEntranceFeeLabel": "Entrance Fee: {1}",
"NeedToBeInJobVehicle": "You need to be in a job vehicle!"
"NeedToBeInJobVehicle": "You need to be in a job vehicle!",
"InvalidJobRank": "Job rank not found!",
"PayPhoneRecipientAnswered": "Somebody answered the call. Use normal chat to talk to them.",
"PayPhoneAnswered": "You answered the phone. Use normal chat to talk to the caller.",
"PayPhoneRecipientHangup": "The line was disconnected. You have been charged {1}",
"PayPhoneHangup": "You hung up the phone.",
"AlreadyUsingPayPhone": "You are already using a payphone!",
"NotUsingPayPhone": "You are not using a payphone!",
"NoPayPhoneCloseEnough": "There is no payphone close enough!",
"PayPhoneNotRinging": "This payphone is not ringing!",
"PayPhoneOccupied": "This payphone is already being used by someone else!",
"PayPhoneOccupantSwitched": "A different voice is now on the line",
"PayPhoneGiven": "You gave the phone to {1}",
"PayPhoneReceived": "{1} gave you the phone",
"PayPhoneUnableToCallPlayer": "You can't call {1} at this time. Please try again later.",
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Käytä {1} laittaksesi päälle tai kiinni ajoneuvon moottori",
"VehicleLockedAfterEntryAttempt": "Käytä {1} Lukitaaksesi tai aukaaksesi ajoneuvosi",
"ShowItemsAfterPurchase": "Käytä {1} Nähdääksesi Tavarasi",
"BuyCommandAfterEnterBusiness": "Käytä {1} tuotteiden ostamiseen yrityksestä",
"UseItemKeyAfterEquipping": "Käytä {1} käyttääksesi varustetasi",
"UseItemKeyAfterEquippingWalkieTalkie": "Käytä {1} kytkeäksesi radion päälle tai pois",
"RadioCommandAfterEnablingWalkieTalkie": "Käytä {1} puhuaksesi radiossasi",
"ReplyToDirectMessage": "Käytä {1} vastataksesi helposti yksityisviestiin",
"UseItemKeyAmmoAfterEquippingWeapon": "Käytä {1} ladataksesi ammuksia varustetulle aseesesi",
"AnimationStop": "Pysäytä animaatio painamalla {1}",
"JobEquipmentInventory": "Työvälineet ovat varastossasi. Käytä {1} nähdäksesi ne.",
"ViewInventory": "Käytä {1} nähdäksesi kohteesi",
"VehicleRepairItemUsage": "Seiso ajoneuvon vieressä ja käytä {1} Korjaaksesi sen",
"VehicleColourItemUsage": "Seiso ajoneuvon vieressä ja käytä {1} Vaihtaaksesi sen väriä",
"VehiclePartItemUsage": "Seiso ajoneuvon vieressä ja käytä {1} tuunatakseen {2}",
"AmmoClipItemUsage": "Varusta ase ja käytä {1} ladataaksesi panoksia",
"GenericItemUsage": "Käytä {1} käyttääksesi {2}",
"EnterJobVehicleForRoute": "Enter a job vehicle nearby to start a job route",
"JobLocations": "Visit a job location to get a job. Use {1} to find a job location",
"JobRouteStart": "Use {1} to start a job route with this vehicle",
"PayPhoneFirstUse": "Use {1} to end the call, and {2} to give the phone to somebody nearby"
},
"NoBusinessesWithinRange": "There are no businesses within {1} meters",
"NoHousesWithinRange": "There are no houses within {1} meters",
"NoPayPhonesWithinRange": "There are no payphones within {1} meters",
"HeaderBusinessesInRangeList": "Businesses (within {1} meters)",
"HeaderHousesInRangeList": "Businesses (within {1} meters)",
"HeaderPayPhonesInRangeList": "Businesses (within {1} meters)",
"HeaderCommandsForStaffFlagList": "Admin Commands ({1})",
"PlayerLocateDistanceAndDirection": "{1} is {2} meters {3}",
"MustBeNumber": "You need to use a number!",
"HeaderJobRoutesList": "Job Routes ({1})",
"HeaderJobRouteInfo": "Job Route Information (${1})",
"InvalidJobRoute": "Job route not found!",
"PayPhoneDeleted": "The payphone was deleted",
"PayPhoneAnswer": "Use {1} to answer the payphone",
"ResetActionTipsConfirm": "Are you sure you want to reset all seen action tips?",
"ActionTipsReset": "All seen action tips have been reset.",
"NormalChatDisabled": "Normal chat is disabled by server admin. Use chat commands instead.",
"GlobalChatDisabled": "Global out-of-character chat is disabled by server admin",
"CantEditJobUniforms": "You can't edit job uniforms!",
"PlayerNotSurrendered": "The player must be surrendered (hands up, be knocked out, or tazed)!",
"PlayerRemovedFromJob": "You removed {1} from the job",
"RemovedFromJob": "You were removed from the job by {1}",
"UnableToCallPlayer": "{1} can't be called right now",
"NoRadioToUse": "You must have a radio, or be in a vehicle with a radio!",
"FrequencyMustBeNumber": "The radio channel must be a number!",
"FrequencyMustBeBetween": "The radio channel must be between {1} and {2}!"
}

View File

@@ -16,12 +16,9 @@
"InvalidAnimationDistance": "La distance doit être entre 0 et 3",
"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",
@@ -651,28 +648,6 @@
"LeftWrist": "Left Wrist",
"RightWrist": "Right Wrist"
},
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Use {1} to turn on or off a vehicle's engine",
"VehicleLockedAfterEntryAttempt": "Use {1} to lock or unlock a vehicle",
"ShowItemsAfterPurchase": "Use {1} to see your inventory",
"BuyCommandAfterEnterBusiness": "Use {1} to buy items from a business",
"UseItemKeyAfterEquipping": "Use {1} to use your equipped item",
"UseItemKeyAfterEquippingWalkieTalkie": "Use {1} to turn on or off your radio",
"RadioCommandAfterEnablingWalkieTalkie": "Use {1} to talk on your radio",
"ReplyToDirectMessage": "Use {1} to easily reply to a private message",
"UseItemKeyAmmoAfterEquippingWeapon": "Use {1} to load an ammo item into your equipped weapon",
"AnimationStop": "Use {1} to stop your animation",
"JobEquipmentInventory": "The job equipment is in your inventory. Use {1} to see them.",
"ViewInventory": "Use {1} to see your items",
"VehicleRepairItemUsage": "Stand next to a vehicle and use {1} to repair it",
"VehicleColourItemUsage": "Stand next to a vehicle and use {1} to change it's colour",
"VehiclePartItemUsage": "Stand next to a vehicle and use {1} to upgrade with {2}",
"AmmoClipItemUsage": "Equip the weapon and use {1} to load ammo into it",
"GenericItemUsage": "Use {1} to use the {2}",
"EnterJobVehicleForRoute": "Enter a job vehicle nearby to start a job route",
"JobLocations": "Visit a job location to get a job. Use {1} to find a job location",
"JobRouteStart": "Use {1} to start a job route with this vehicle"
},
"DisconnectReasons": {
"Unknown": "Unknown",
"LostConnection": "Lost Connection",
@@ -748,5 +723,68 @@
"Cancel": "Cancel",
"AlreadyOwnVehicle": "You already own this vehicle!",
"PropertyEntranceFeeLabel": "Entrance Fee: {1}",
"NeedToBeInJobVehicle": "You need to be in a job vehicle!"
"NeedToBeInJobVehicle": "You need to be in a job vehicle!",
"InvalidJobRank": "Job rank not found!",
"PayPhoneRecipientAnswered": "Somebody answered the call. Use normal chat to talk to them.",
"PayPhoneAnswered": "You answered the phone. Use normal chat to talk to the caller.",
"PayPhoneRecipientHangup": "The line was disconnected. You have been charged {1}",
"PayPhoneHangup": "You hung up the phone.",
"AlreadyUsingPayPhone": "You are already using a payphone!",
"NotUsingPayPhone": "You are not using a payphone!",
"NoPayPhoneCloseEnough": "There is no payphone close enough!",
"PayPhoneNotRinging": "This payphone is not ringing!",
"PayPhoneOccupied": "This payphone is already being used by someone else!",
"PayPhoneOccupantSwitched": "A different voice is now on the line",
"PayPhoneGiven": "You gave the phone to {1}",
"PayPhoneReceived": "{1} gave you the phone",
"PayPhoneUnableToCallPlayer": "You can't call {1} at this time. Please try again later.",
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Use {1} to turn on or off a vehicle's engine",
"VehicleLockedAfterEntryAttempt": "Use {1} to lock or unlock a vehicle",
"ShowItemsAfterPurchase": "Use {1} to see your inventory",
"BuyCommandAfterEnterBusiness": "Use {1} to buy items from a business",
"UseItemKeyAfterEquipping": "Use {1} to use your equipped item",
"UseItemKeyAfterEquippingWalkieTalkie": "Use {1} to turn on or off your radio",
"RadioCommandAfterEnablingWalkieTalkie": "Use {1} to talk on your radio",
"ReplyToDirectMessage": "Use {1} to easily reply to a private message",
"UseItemKeyAmmoAfterEquippingWeapon": "Use {1} to load an ammo item into your equipped weapon",
"AnimationStop": "Use {1} to stop your animation",
"JobEquipmentInventory": "The job equipment is in your inventory. Use {1} to see them.",
"ViewInventory": "Use {1} to see your items",
"VehicleRepairItemUsage": "Stand next to a vehicle and use {1} to repair it",
"VehicleColourItemUsage": "Stand next to a vehicle and use {1} to change it's colour",
"VehiclePartItemUsage": "Stand next to a vehicle and use {1} to upgrade with {2}",
"AmmoClipItemUsage": "Equip the weapon and use {1} to load ammo into it",
"GenericItemUsage": "Use {1} to use the {2}",
"EnterJobVehicleForRoute": "Enter a job vehicle nearby to start a job route",
"JobLocations": "Visit a job location to get a job. Use {1} to find a job location",
"JobRouteStart": "Use {1} to start a job route with this vehicle",
"PayPhoneFirstUse": "Use {1} to end the call, and {2} to give the phone to somebody nearby"
},
"NoBusinessesWithinRange": "There are no businesses within {1} meters",
"NoHousesWithinRange": "There are no houses within {1} meters",
"NoPayPhonesWithinRange": "There are no payphones within {1} meters",
"HeaderBusinessesInRangeList": "Businesses (within {1} meters)",
"HeaderHousesInRangeList": "Businesses (within {1} meters)",
"HeaderPayPhonesInRangeList": "Businesses (within {1} meters)",
"HeaderCommandsForStaffFlagList": "Admin Commands ({1})",
"PlayerLocateDistanceAndDirection": "{1} is {2} meters {3}",
"MustBeNumber": "You need to use a number!",
"HeaderJobRoutesList": "Job Routes ({1})",
"HeaderJobRouteInfo": "Job Route Information (${1})",
"InvalidJobRoute": "Job route not found!",
"PayPhoneDeleted": "The payphone was deleted",
"PayPhoneAnswer": "Use {1} to answer the payphone",
"ResetActionTipsConfirm": "Are you sure you want to reset all seen action tips?",
"ActionTipsReset": "All seen action tips have been reset.",
"NormalChatDisabled": "Normal chat is disabled by server admin. Use chat commands instead.",
"GlobalChatDisabled": "Global out-of-character chat is disabled by server admin",
"CantEditJobUniforms": "You can't edit job uniforms!",
"PlayerNotSurrendered": "The player must be surrendered (hands up, be knocked out, or tazed)!",
"PlayerRemovedFromJob": "You removed {1} from the job",
"RemovedFromJob": "You were removed from the job by {1}",
"UnableToCallPlayer": "{1} can't be called right now",
"NoRadioToUse": "You must have a radio, or be in a vehicle with a radio!",
"FrequencyMustBeNumber": "The radio channel must be a number!",
"FrequencyMustBeBetween": "The radio channel must be between {1} and {2}!"
}

View File

@@ -16,12 +16,9 @@
"InvalidAnimationDistance": "The distance must be between 0 and 3",
"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",
@@ -650,28 +647,6 @@
"LeftWrist": "Left Wrist",
"RightWrist": "Right Wrist"
},
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Use {1} to turn on or off a vehicle's engine",
"VehicleLockedAfterEntryAttempt": "Use {1} to lock or unlock a vehicle",
"ShowItemsAfterPurchase": "Use {1} to see your inventory",
"BuyCommandAfterEnterBusiness": "Use {1} to buy items from a business",
"UseItemKeyAfterEquipping": "Use {1} to use your equipped item",
"UseItemKeyAfterEquippingWalkieTalkie": "Use {1} to turn on or off your radio",
"RadioCommandAfterEnablingWalkieTalkie": "Use {1} to talk on your radio",
"ReplyToDirectMessage": "Use {1} to easily reply to a private message",
"UseItemKeyAmmoAfterEquippingWeapon": "Use {1} to load an ammo item into your equipped weapon",
"AnimationStop": "Use {1} to stop your animation",
"JobEquipmentInventory": "The job equipment is in your inventory. Use {1} to see them.",
"ViewInventory": "Use {1} to see your items",
"VehicleRepairItemUsage": "Stand next to a vehicle and use {1} to repair it",
"VehicleColourItemUsage": "Stand next to a vehicle and use {1} to change it's colour",
"VehiclePartItemUsage": "Stand next to a vehicle and use {1} to upgrade with {2}",
"AmmoClipItemUsage": "Equip the weapon and use {1} to load ammo into it",
"GenericItemUsage": "Use {1} to use the {2}",
"EnterJobVehicleForRoute": "Enter a job vehicle nearby to start a job route",
"JobLocations": "Visit a job location to get a job. Use {1} to find a job location",
"JobRouteStart": "Use {1} to start a job route with this vehicle"
},
"DisconnectReasons": {
"Unknown": "Unknown",
"LostConnection": "Lost Connection",
@@ -747,5 +722,68 @@
"Cancel": "Cancel",
"AlreadyOwnVehicle": "You already own this vehicle!",
"PropertyEntranceFeeLabel": "Entrance Fee: {1}",
"NeedToBeInJobVehicle": "You need to be in a job vehicle!"
"NeedToBeInJobVehicle": "You need to be in a job vehicle!",
"InvalidJobRank": "Job rank not found!",
"PayPhoneRecipientAnswered": "Somebody answered the call. Use normal chat to talk to them.",
"PayPhoneAnswered": "You answered the phone. Use normal chat to talk to the caller.",
"PayPhoneRecipientHangup": "The line was disconnected. You have been charged {1}",
"PayPhoneHangup": "You hung up the phone.",
"AlreadyUsingPayPhone": "You are already using a payphone!",
"NotUsingPayPhone": "You are not using a payphone!",
"NoPayPhoneCloseEnough": "There is no payphone close enough!",
"PayPhoneNotRinging": "This payphone is not ringing!",
"PayPhoneOccupied": "This payphone is already being used by someone else!",
"PayPhoneOccupantSwitched": "A different voice is now on the line",
"PayPhoneGiven": "You gave the phone to {1}",
"PayPhoneReceived": "{1} gave you the phone",
"PayPhoneUnableToCallPlayer": "You can't call {1} at this time. Please try again later.",
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Use {1} to turn on or off a vehicle's engine",
"VehicleLockedAfterEntryAttempt": "Use {1} to lock or unlock a vehicle",
"ShowItemsAfterPurchase": "Use {1} to see your inventory",
"BuyCommandAfterEnterBusiness": "Use {1} to buy items from a business",
"UseItemKeyAfterEquipping": "Use {1} to use your equipped item",
"UseItemKeyAfterEquippingWalkieTalkie": "Use {1} to turn on or off your radio",
"RadioCommandAfterEnablingWalkieTalkie": "Use {1} to talk on your radio",
"ReplyToDirectMessage": "Use {1} to easily reply to a private message",
"UseItemKeyAmmoAfterEquippingWeapon": "Use {1} to load an ammo item into your equipped weapon",
"AnimationStop": "Use {1} to stop your animation",
"JobEquipmentInventory": "The job equipment is in your inventory. Use {1} to see them.",
"ViewInventory": "Use {1} to see your items",
"VehicleRepairItemUsage": "Stand next to a vehicle and use {1} to repair it",
"VehicleColourItemUsage": "Stand next to a vehicle and use {1} to change it's colour",
"VehiclePartItemUsage": "Stand next to a vehicle and use {1} to upgrade with {2}",
"AmmoClipItemUsage": "Equip the weapon and use {1} to load ammo into it",
"GenericItemUsage": "Use {1} to use the {2}",
"EnterJobVehicleForRoute": "Enter a job vehicle nearby to start a job route",
"JobLocations": "Visit a job location to get a job. Use {1} to find a job location",
"JobRouteStart": "Use {1} to start a job route with this vehicle",
"PayPhoneFirstUse": "Use {1} to end the call, and {2} to give the phone to somebody nearby"
},
"NoBusinessesWithinRange": "There are no businesses within {1} meters",
"NoHousesWithinRange": "There are no houses within {1} meters",
"NoPayPhonesWithinRange": "There are no payphones within {1} meters",
"HeaderBusinessesInRangeList": "Businesses (within {1} meters)",
"HeaderHousesInRangeList": "Businesses (within {1} meters)",
"HeaderPayPhonesInRangeList": "Businesses (within {1} meters)",
"HeaderCommandsForStaffFlagList": "Admin Commands ({1})",
"PlayerLocateDistanceAndDirection": "{1} is {2} meters {3}",
"MustBeNumber": "You need to use a number!",
"HeaderJobRoutesList": "Job Routes ({1})",
"HeaderJobRouteInfo": "Job Route Information (${1})",
"InvalidJobRoute": "Job route not found!",
"PayPhoneDeleted": "The payphone was deleted",
"PayPhoneAnswer": "Use {1} to answer the payphone",
"ResetActionTipsConfirm": "Are you sure you want to reset all seen action tips?",
"ActionTipsReset": "All seen action tips have been reset.",
"NormalChatDisabled": "Normal chat is disabled by server admin. Use chat commands instead.",
"GlobalChatDisabled": "Global out-of-character chat is disabled by server admin",
"CantEditJobUniforms": "You can't edit job uniforms!",
"PlayerNotSurrendered": "The player must be surrendered (hands up, be knocked out, or tazed)!",
"PlayerRemovedFromJob": "You removed {1} from the job",
"RemovedFromJob": "You were removed from the job by {1}",
"UnableToCallPlayer": "{1} can't be called right now",
"NoRadioToUse": "You must have a radio, or be in a vehicle with a radio!",
"FrequencyMustBeNumber": "The radio channel must be a number!",
"FrequencyMustBeBetween": "The radio channel must be between {1} and {2}!"
}

View File

@@ -16,12 +16,9 @@
"InvalidAnimationDistance": "The distance must be between 0 and 3",
"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",
@@ -651,28 +648,6 @@
"LeftWrist": "Left Wrist",
"RightWrist": "Right Wrist"
},
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Use {1} to turn on or off a vehicle's engine",
"VehicleLockedAfterEntryAttempt": "Use {1} to lock or unlock a vehicle",
"ShowItemsAfterPurchase": "Use {1} to see your inventory",
"BuyCommandAfterEnterBusiness": "Use {1} to buy items from a business",
"UseItemKeyAfterEquipping": "Use {1} to use your equipped item",
"UseItemKeyAfterEquippingWalkieTalkie": "Use {1} to turn on or off your radio",
"RadioCommandAfterEnablingWalkieTalkie": "Use {1} to talk on your radio",
"ReplyToDirectMessage": "Use {1} to easily reply to a private message",
"UseItemKeyAmmoAfterEquippingWeapon": "Use {1} to load an ammo item into your equipped weapon",
"AnimationStop": "Use {1} to stop your animation",
"JobEquipmentInventory": "The job equipment is in your inventory. Use {1} to see them.",
"ViewInventory": "Use {1} to see your items",
"VehicleRepairItemUsage": "Stand next to a vehicle and use {1} to repair it",
"VehicleColourItemUsage": "Stand next to a vehicle and use {1} to change it's colour",
"VehiclePartItemUsage": "Stand next to a vehicle and use {1} to upgrade with {2}",
"AmmoClipItemUsage": "Equip the weapon and use {1} to load ammo into it",
"GenericItemUsage": "Use {1} to use the {2}",
"EnterJobVehicleForRoute": "Enter a job vehicle nearby to start a job route",
"JobLocations": "Visit a job location to get a job. Use {1} to find a job location",
"JobRouteStart": "Use {1} to start a job route with this vehicle"
},
"DisconnectReasons": {
"Unknown": "Unknown",
"LostConnection": "Lost Connection",
@@ -748,5 +723,68 @@
"Cancel": "Cancel",
"AlreadyOwnVehicle": "You already own this vehicle!",
"PropertyEntranceFeeLabel": "Entrance Fee: {1}",
"NeedToBeInJobVehicle": "You need to be in a job vehicle!"
"NeedToBeInJobVehicle": "You need to be in a job vehicle!",
"InvalidJobRank": "Job rank not found!",
"PayPhoneRecipientAnswered": "Somebody answered the call. Use normal chat to talk to them.",
"PayPhoneAnswered": "You answered the phone. Use normal chat to talk to the caller.",
"PayPhoneRecipientHangup": "The line was disconnected. You have been charged {1}",
"PayPhoneHangup": "You hung up the phone.",
"AlreadyUsingPayPhone": "You are already using a payphone!",
"NotUsingPayPhone": "You are not using a payphone!",
"NoPayPhoneCloseEnough": "There is no payphone close enough!",
"PayPhoneNotRinging": "This payphone is not ringing!",
"PayPhoneOccupied": "This payphone is already being used by someone else!",
"PayPhoneOccupantSwitched": "A different voice is now on the line",
"PayPhoneGiven": "You gave the phone to {1}",
"PayPhoneReceived": "{1} gave you the phone",
"PayPhoneUnableToCallPlayer": "You can't call {1} at this time. Please try again later.",
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Use {1} to turn on or off a vehicle's engine",
"VehicleLockedAfterEntryAttempt": "Use {1} to lock or unlock a vehicle",
"ShowItemsAfterPurchase": "Use {1} to see your inventory",
"BuyCommandAfterEnterBusiness": "Use {1} to buy items from a business",
"UseItemKeyAfterEquipping": "Use {1} to use your equipped item",
"UseItemKeyAfterEquippingWalkieTalkie": "Use {1} to turn on or off your radio",
"RadioCommandAfterEnablingWalkieTalkie": "Use {1} to talk on your radio",
"ReplyToDirectMessage": "Use {1} to easily reply to a private message",
"UseItemKeyAmmoAfterEquippingWeapon": "Use {1} to load an ammo item into your equipped weapon",
"AnimationStop": "Use {1} to stop your animation",
"JobEquipmentInventory": "The job equipment is in your inventory. Use {1} to see them.",
"ViewInventory": "Use {1} to see your items",
"VehicleRepairItemUsage": "Stand next to a vehicle and use {1} to repair it",
"VehicleColourItemUsage": "Stand next to a vehicle and use {1} to change it's colour",
"VehiclePartItemUsage": "Stand next to a vehicle and use {1} to upgrade with {2}",
"AmmoClipItemUsage": "Equip the weapon and use {1} to load ammo into it",
"GenericItemUsage": "Use {1} to use the {2}",
"EnterJobVehicleForRoute": "Enter a job vehicle nearby to start a job route",
"JobLocations": "Visit a job location to get a job. Use {1} to find a job location",
"JobRouteStart": "Use {1} to start a job route with this vehicle",
"PayPhoneFirstUse": "Use {1} to end the call, and {2} to give the phone to somebody nearby"
},
"NoBusinessesWithinRange": "There are no businesses within {1} meters",
"NoHousesWithinRange": "There are no houses within {1} meters",
"NoPayPhonesWithinRange": "There are no payphones within {1} meters",
"HeaderBusinessesInRangeList": "Businesses (within {1} meters)",
"HeaderHousesInRangeList": "Businesses (within {1} meters)",
"HeaderPayPhonesInRangeList": "Businesses (within {1} meters)",
"HeaderCommandsForStaffFlagList": "Admin Commands ({1})",
"PlayerLocateDistanceAndDirection": "{1} is {2} meters {3}",
"MustBeNumber": "You need to use a number!",
"HeaderJobRoutesList": "Job Routes ({1})",
"HeaderJobRouteInfo": "Job Route Information (${1})",
"InvalidJobRoute": "Job route not found!",
"PayPhoneDeleted": "The payphone was deleted",
"PayPhoneAnswer": "Use {1} to answer the payphone",
"ResetActionTipsConfirm": "Are you sure you want to reset all seen action tips?",
"ActionTipsReset": "All seen action tips have been reset.",
"NormalChatDisabled": "Normal chat is disabled by server admin. Use chat commands instead.",
"GlobalChatDisabled": "Global out-of-character chat is disabled by server admin",
"CantEditJobUniforms": "You can't edit job uniforms!",
"PlayerNotSurrendered": "The player must be surrendered (hands up, be knocked out, or tazed)!",
"PlayerRemovedFromJob": "You removed {1} from the job",
"RemovedFromJob": "You were removed from the job by {1}",
"UnableToCallPlayer": "{1} can't be called right now",
"NoRadioToUse": "You must have a radio, or be in a vehicle with a radio!",
"FrequencyMustBeNumber": "The radio channel must be a number!",
"FrequencyMustBeBetween": "The radio channel must be between {1} and {2}!"
}

View File

@@ -16,12 +16,9 @@
"InvalidAnimationDistance": "The distance must be between 0 and 3",
"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",
@@ -653,28 +650,6 @@
"LeftWrist": "Left Wrist",
"RightWrist": "Right Wrist"
},
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Use {1} to turn on or off a vehicle's engine",
"VehicleLockedAfterEntryAttempt": "Use {1} to lock or unlock a vehicle",
"ShowItemsAfterPurchase": "Use {1} to see your inventory",
"BuyCommandAfterEnterBusiness": "Use {1} to buy items from a business",
"UseItemKeyAfterEquipping": "Use {1} to use your equipped item",
"UseItemKeyAfterEquippingWalkieTalkie": "Use {1} to turn on or off your radio",
"RadioCommandAfterEnablingWalkieTalkie": "Use {1} to talk on your radio",
"ReplyToDirectMessage": "Use {1} to easily reply to a private message",
"UseItemKeyAmmoAfterEquippingWeapon": "Use {1} to load an ammo item into your equipped weapon",
"AnimationStop": "Use {1} to stop your animation",
"JobEquipmentInventory": "The job equipment is in your inventory. Use {1} to see them.",
"ViewInventory": "Use {1} to see your items",
"VehicleRepairItemUsage": "Stand next to a vehicle and use {1} to repair it",
"VehicleColourItemUsage": "Stand next to a vehicle and use {1} to change it's colour",
"VehiclePartItemUsage": "Stand next to a vehicle and use {1} to upgrade with {2}",
"AmmoClipItemUsage": "Equip the weapon and use {1} to load ammo into it",
"GenericItemUsage": "Use {1} to use the {2}",
"EnterJobVehicleForRoute": "Enter a job vehicle nearby to start a job route",
"JobLocations": "Visit a job location to get a job. Use {1} to find a job location",
"JobRouteStart": "Use {1} to start a job route with this vehicle"
},
"DisconnectReasons": {
"Unknown": "Unknown",
"LostConnection": "Lost Connection",
@@ -750,5 +725,68 @@
"Cancel": "Cancel",
"AlreadyOwnVehicle": "You already own this vehicle!",
"PropertyEntranceFeeLabel": "Entrance Fee: {1}",
"NeedToBeInJobVehicle": "You need to be in a job vehicle!"
"NeedToBeInJobVehicle": "You need to be in a job vehicle!",
"InvalidJobRank": "Job rank not found!",
"PayPhoneRecipientAnswered": "Somebody answered the call. Use normal chat to talk to them.",
"PayPhoneAnswered": "You answered the phone. Use normal chat to talk to the caller.",
"PayPhoneRecipientHangup": "The line was disconnected. You have been charged {1}",
"PayPhoneHangup": "You hung up the phone.",
"AlreadyUsingPayPhone": "You are already using a payphone!",
"NotUsingPayPhone": "You are not using a payphone!",
"NoPayPhoneCloseEnough": "There is no payphone close enough!",
"PayPhoneNotRinging": "This payphone is not ringing!",
"PayPhoneOccupied": "This payphone is already being used by someone else!",
"PayPhoneOccupantSwitched": "A different voice is now on the line",
"PayPhoneGiven": "You gave the phone to {1}",
"PayPhoneReceived": "{1} gave you the phone",
"PayPhoneUnableToCallPlayer": "You can't call {1} at this time. Please try again later.",
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Use {1} to turn on or off a vehicle's engine",
"VehicleLockedAfterEntryAttempt": "Use {1} to lock or unlock a vehicle",
"ShowItemsAfterPurchase": "Use {1} to see your inventory",
"BuyCommandAfterEnterBusiness": "Use {1} to buy items from a business",
"UseItemKeyAfterEquipping": "Use {1} to use your equipped item",
"UseItemKeyAfterEquippingWalkieTalkie": "Use {1} to turn on or off your radio",
"RadioCommandAfterEnablingWalkieTalkie": "Use {1} to talk on your radio",
"ReplyToDirectMessage": "Use {1} to easily reply to a private message",
"UseItemKeyAmmoAfterEquippingWeapon": "Use {1} to load an ammo item into your equipped weapon",
"AnimationStop": "Use {1} to stop your animation",
"JobEquipmentInventory": "The job equipment is in your inventory. Use {1} to see them.",
"ViewInventory": "Use {1} to see your items",
"VehicleRepairItemUsage": "Stand next to a vehicle and use {1} to repair it",
"VehicleColourItemUsage": "Stand next to a vehicle and use {1} to change it's colour",
"VehiclePartItemUsage": "Stand next to a vehicle and use {1} to upgrade with {2}",
"AmmoClipItemUsage": "Equip the weapon and use {1} to load ammo into it",
"GenericItemUsage": "Use {1} to use the {2}",
"EnterJobVehicleForRoute": "Enter a job vehicle nearby to start a job route",
"JobLocations": "Visit a job location to get a job. Use {1} to find a job location",
"JobRouteStart": "Use {1} to start a job route with this vehicle",
"PayPhoneFirstUse": "Use {1} to end the call, and {2} to give the phone to somebody nearby"
},
"NoBusinessesWithinRange": "There are no businesses within {1} meters",
"NoHousesWithinRange": "There are no houses within {1} meters",
"NoPayPhonesWithinRange": "There are no payphones within {1} meters",
"HeaderBusinessesInRangeList": "Businesses (within {1} meters)",
"HeaderHousesInRangeList": "Businesses (within {1} meters)",
"HeaderPayPhonesInRangeList": "Businesses (within {1} meters)",
"HeaderCommandsForStaffFlagList": "Admin Commands ({1})",
"PlayerLocateDistanceAndDirection": "{1} is {2} meters {3}",
"MustBeNumber": "You need to use a number!",
"HeaderJobRoutesList": "Job Routes ({1})",
"HeaderJobRouteInfo": "Job Route Information (${1})",
"InvalidJobRoute": "Job route not found!",
"PayPhoneDeleted": "The payphone was deleted",
"PayPhoneAnswer": "Use {1} to answer the payphone",
"ResetActionTipsConfirm": "Are you sure you want to reset all seen action tips?",
"ActionTipsReset": "All seen action tips have been reset.",
"NormalChatDisabled": "Normal chat is disabled by server admin. Use chat commands instead.",
"GlobalChatDisabled": "Global out-of-character chat is disabled by server admin",
"CantEditJobUniforms": "You can't edit job uniforms!",
"PlayerNotSurrendered": "The player must be surrendered (hands up, be knocked out, or tazed)!",
"PlayerRemovedFromJob": "You removed {1} from the job",
"RemovedFromJob": "You were removed from the job by {1}",
"UnableToCallPlayer": "{1} can't be called right now",
"NoRadioToUse": "You must have a radio, or be in a vehicle with a radio!",
"FrequencyMustBeNumber": "The radio channel must be a number!",
"FrequencyMustBeBetween": "The radio channel must be between {1} and {2}!"
}

View File

@@ -16,12 +16,9 @@
"InvalidAnimationDistance": "The distance must be between 0 and 3",
"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",
@@ -652,28 +649,6 @@
"LeftWrist": "Left Wrist",
"RightWrist": "Right Wrist"
},
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Use {1} to turn on or off a vehicle's engine",
"VehicleLockedAfterEntryAttempt": "Use {1} to lock or unlock a vehicle",
"ShowItemsAfterPurchase": "Use {1} to see your inventory",
"BuyCommandAfterEnterBusiness": "Use {1} to buy items from a business",
"UseItemKeyAfterEquipping": "Use {1} to use your equipped item",
"UseItemKeyAfterEquippingWalkieTalkie": "Use {1} to turn on or off your radio",
"RadioCommandAfterEnablingWalkieTalkie": "Use {1} to talk on your radio",
"ReplyToDirectMessage": "Use {1} to easily reply to a private message",
"UseItemKeyAmmoAfterEquippingWeapon": "Use {1} to load an ammo item into your equipped weapon",
"AnimationStop": "Use {1} to stop your animation",
"JobEquipmentInventory": "The job equipment is in your inventory. Use {1} to see them.",
"ViewInventory": "Use {1} to see your items",
"VehicleRepairItemUsage": "Stand next to a vehicle and use {1} to repair it",
"VehicleColourItemUsage": "Stand next to a vehicle and use {1} to change it's colour",
"VehiclePartItemUsage": "Stand next to a vehicle and use {1} to upgrade with {2}",
"AmmoClipItemUsage": "Equip the weapon and use {1} to load ammo into it",
"GenericItemUsage": "Use {1} to use the {2}",
"EnterJobVehicleForRoute": "Enter a job vehicle nearby to start a job route",
"JobLocations": "Visit a job location to get a job. Use {1} to find a job location",
"JobRouteStart": "Use {1} to start a job route with this vehicle"
},
"DisconnectReasons": {
"Unknown": "Unknown",
"LostConnection": "Lost Connection",
@@ -749,5 +724,68 @@
"Cancel": "Cancel",
"AlreadyOwnVehicle": "You already own this vehicle!",
"PropertyEntranceFeeLabel": "Entrance Fee: {1}",
"NeedToBeInJobVehicle": "You need to be in a job vehicle!"
"NeedToBeInJobVehicle": "You need to be in a job vehicle!",
"InvalidJobRank": "Job rank not found!",
"PayPhoneRecipientAnswered": "Somebody answered the call. Use normal chat to talk to them.",
"PayPhoneAnswered": "You answered the phone. Use normal chat to talk to the caller.",
"PayPhoneRecipientHangup": "The line was disconnected. You have been charged {1}",
"PayPhoneHangup": "You hung up the phone.",
"AlreadyUsingPayPhone": "You are already using a payphone!",
"NotUsingPayPhone": "You are not using a payphone!",
"NoPayPhoneCloseEnough": "There is no payphone close enough!",
"PayPhoneNotRinging": "This payphone is not ringing!",
"PayPhoneOccupied": "This payphone is already being used by someone else!",
"PayPhoneOccupantSwitched": "A different voice is now on the line",
"PayPhoneGiven": "You gave the phone to {1}",
"PayPhoneReceived": "{1} gave you the phone",
"PayPhoneUnableToCallPlayer": "You can't call {1} at this time. Please try again later.",
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Use {1} to turn on or off a vehicle's engine",
"VehicleLockedAfterEntryAttempt": "Use {1} to lock or unlock a vehicle",
"ShowItemsAfterPurchase": "Use {1} to see your inventory",
"BuyCommandAfterEnterBusiness": "Use {1} to buy items from a business",
"UseItemKeyAfterEquipping": "Use {1} to use your equipped item",
"UseItemKeyAfterEquippingWalkieTalkie": "Use {1} to turn on or off your radio",
"RadioCommandAfterEnablingWalkieTalkie": "Use {1} to talk on your radio",
"ReplyToDirectMessage": "Use {1} to easily reply to a private message",
"UseItemKeyAmmoAfterEquippingWeapon": "Use {1} to load an ammo item into your equipped weapon",
"AnimationStop": "Use {1} to stop your animation",
"JobEquipmentInventory": "The job equipment is in your inventory. Use {1} to see them.",
"ViewInventory": "Use {1} to see your items",
"VehicleRepairItemUsage": "Stand next to a vehicle and use {1} to repair it",
"VehicleColourItemUsage": "Stand next to a vehicle and use {1} to change it's colour",
"VehiclePartItemUsage": "Stand next to a vehicle and use {1} to upgrade with {2}",
"AmmoClipItemUsage": "Equip the weapon and use {1} to load ammo into it",
"GenericItemUsage": "Use {1} to use the {2}",
"EnterJobVehicleForRoute": "Enter a job vehicle nearby to start a job route",
"JobLocations": "Visit a job location to get a job. Use {1} to find a job location",
"JobRouteStart": "Use {1} to start a job route with this vehicle",
"PayPhoneFirstUse": "Use {1} to end the call, and {2} to give the phone to somebody nearby"
},
"NoBusinessesWithinRange": "There are no businesses within {1} meters",
"NoHousesWithinRange": "There are no houses within {1} meters",
"NoPayPhonesWithinRange": "There are no payphones within {1} meters",
"HeaderBusinessesInRangeList": "Businesses (within {1} meters)",
"HeaderHousesInRangeList": "Businesses (within {1} meters)",
"HeaderPayPhonesInRangeList": "Businesses (within {1} meters)",
"HeaderCommandsForStaffFlagList": "Admin Commands ({1})",
"PlayerLocateDistanceAndDirection": "{1} is {2} meters {3}",
"MustBeNumber": "You need to use a number!",
"HeaderJobRoutesList": "Job Routes ({1})",
"HeaderJobRouteInfo": "Job Route Information (${1})",
"InvalidJobRoute": "Job route not found!",
"PayPhoneDeleted": "The payphone was deleted",
"PayPhoneAnswer": "Use {1} to answer the payphone",
"ResetActionTipsConfirm": "Are you sure you want to reset all seen action tips?",
"ActionTipsReset": "All seen action tips have been reset.",
"NormalChatDisabled": "Normal chat is disabled by server admin. Use chat commands instead.",
"GlobalChatDisabled": "Global out-of-character chat is disabled by server admin",
"CantEditJobUniforms": "You can't edit job uniforms!",
"PlayerNotSurrendered": "The player must be surrendered (hands up, be knocked out, or tazed)!",
"PlayerRemovedFromJob": "You removed {1} from the job",
"RemovedFromJob": "You were removed from the job by {1}",
"UnableToCallPlayer": "{1} can't be called right now",
"NoRadioToUse": "You must have a radio, or be in a vehicle with a radio!",
"FrequencyMustBeNumber": "The radio channel must be a number!",
"FrequencyMustBeBetween": "The radio channel must be between {1} and {2}!"
}

View File

@@ -16,12 +16,9 @@
"InvalidAnimationDistance": "The distance must be between 0 and 3",
"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",
@@ -652,28 +649,6 @@
"LeftWrist": "Left Wrist",
"RightWrist": "Right Wrist"
},
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Use {1} to turn on or off a vehicle's engine",
"VehicleLockedAfterEntryAttempt": "Use {1} to lock or unlock a vehicle",
"ShowItemsAfterPurchase": "Use {1} to see your inventory",
"BuyCommandAfterEnterBusiness": "Use {1} to buy items from a business",
"UseItemKeyAfterEquipping": "Use {1} to use your equipped item",
"UseItemKeyAfterEquippingWalkieTalkie": "Use {1} to turn on or off your radio",
"RadioCommandAfterEnablingWalkieTalkie": "Use {1} to talk on your radio",
"ReplyToDirectMessage": "Use {1} to easily reply to a private message",
"UseItemKeyAmmoAfterEquippingWeapon": "Use {1} to load an ammo item into your equipped weapon",
"AnimationStop": "Use {1} to stop your animation",
"JobEquipmentInventory": "The job equipment is in your inventory. Use {1} to see them.",
"ViewInventory": "Use {1} to see your items",
"VehicleRepairItemUsage": "Stand next to a vehicle and use {1} to repair it",
"VehicleColourItemUsage": "Stand next to a vehicle and use {1} to change it's colour",
"VehiclePartItemUsage": "Stand next to a vehicle and use {1} to upgrade with {2}",
"AmmoClipItemUsage": "Equip the weapon and use {1} to load ammo into it",
"GenericItemUsage": "Use {1} to use the {2}",
"EnterJobVehicleForRoute": "Enter a job vehicle nearby to start a job route",
"JobLocations": "Visit a job location to get a job. Use {1} to find a job location",
"JobRouteStart": "Use {1} to start a job route with this vehicle"
},
"DisconnectReasons": {
"Unknown": "Unknown",
"LostConnection": "Lost Connection",
@@ -749,5 +724,68 @@
"Cancel": "Cancel",
"AlreadyOwnVehicle": "You already own this vehicle!",
"PropertyEntranceFeeLabel": "Entrance Fee: {1}",
"NeedToBeInJobVehicle": "You need to be in a job vehicle!"
"NeedToBeInJobVehicle": "You need to be in a job vehicle!",
"InvalidJobRank": "Job rank not found!",
"PayPhoneRecipientAnswered": "Somebody answered the call. Use normal chat to talk to them.",
"PayPhoneAnswered": "You answered the phone. Use normal chat to talk to the caller.",
"PayPhoneRecipientHangup": "The line was disconnected. You have been charged {1}",
"PayPhoneHangup": "You hung up the phone.",
"AlreadyUsingPayPhone": "You are already using a payphone!",
"NotUsingPayPhone": "You are not using a payphone!",
"NoPayPhoneCloseEnough": "There is no payphone close enough!",
"PayPhoneNotRinging": "This payphone is not ringing!",
"PayPhoneOccupied": "This payphone is already being used by someone else!",
"PayPhoneOccupantSwitched": "A different voice is now on the line",
"PayPhoneGiven": "You gave the phone to {1}",
"PayPhoneReceived": "{1} gave you the phone",
"PayPhoneUnableToCallPlayer": "You can't call {1} at this time. Please try again later.",
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Use {1} to turn on or off a vehicle's engine",
"VehicleLockedAfterEntryAttempt": "Use {1} to lock or unlock a vehicle",
"ShowItemsAfterPurchase": "Use {1} to see your inventory",
"BuyCommandAfterEnterBusiness": "Use {1} to buy items from a business",
"UseItemKeyAfterEquipping": "Use {1} to use your equipped item",
"UseItemKeyAfterEquippingWalkieTalkie": "Use {1} to turn on or off your radio",
"RadioCommandAfterEnablingWalkieTalkie": "Use {1} to talk on your radio",
"ReplyToDirectMessage": "Use {1} to easily reply to a private message",
"UseItemKeyAmmoAfterEquippingWeapon": "Use {1} to load an ammo item into your equipped weapon",
"AnimationStop": "Use {1} to stop your animation",
"JobEquipmentInventory": "The job equipment is in your inventory. Use {1} to see them.",
"ViewInventory": "Use {1} to see your items",
"VehicleRepairItemUsage": "Stand next to a vehicle and use {1} to repair it",
"VehicleColourItemUsage": "Stand next to a vehicle and use {1} to change it's colour",
"VehiclePartItemUsage": "Stand next to a vehicle and use {1} to upgrade with {2}",
"AmmoClipItemUsage": "Equip the weapon and use {1} to load ammo into it",
"GenericItemUsage": "Use {1} to use the {2}",
"EnterJobVehicleForRoute": "Enter a job vehicle nearby to start a job route",
"JobLocations": "Visit a job location to get a job. Use {1} to find a job location",
"JobRouteStart": "Use {1} to start a job route with this vehicle",
"PayPhoneFirstUse": "Use {1} to end the call, and {2} to give the phone to somebody nearby"
},
"NoBusinessesWithinRange": "There are no businesses within {1} meters",
"NoHousesWithinRange": "There are no houses within {1} meters",
"NoPayPhonesWithinRange": "There are no payphones within {1} meters",
"HeaderBusinessesInRangeList": "Businesses (within {1} meters)",
"HeaderHousesInRangeList": "Businesses (within {1} meters)",
"HeaderPayPhonesInRangeList": "Businesses (within {1} meters)",
"HeaderCommandsForStaffFlagList": "Admin Commands ({1})",
"PlayerLocateDistanceAndDirection": "{1} is {2} meters {3}",
"MustBeNumber": "You need to use a number!",
"HeaderJobRoutesList": "Job Routes ({1})",
"HeaderJobRouteInfo": "Job Route Information (${1})",
"InvalidJobRoute": "Job route not found!",
"PayPhoneDeleted": "The payphone was deleted",
"PayPhoneAnswer": "Use {1} to answer the payphone",
"ResetActionTipsConfirm": "Are you sure you want to reset all seen action tips?",
"ActionTipsReset": "All seen action tips have been reset.",
"NormalChatDisabled": "Normal chat is disabled by server admin. Use chat commands instead.",
"GlobalChatDisabled": "Global out-of-character chat is disabled by server admin",
"CantEditJobUniforms": "You can't edit job uniforms!",
"PlayerNotSurrendered": "The player must be surrendered (hands up, be knocked out, or tazed)!",
"PlayerRemovedFromJob": "You removed {1} from the job",
"RemovedFromJob": "You were removed from the job by {1}",
"UnableToCallPlayer": "{1} can't be called right now",
"NoRadioToUse": "You must have a radio, or be in a vehicle with a radio!",
"FrequencyMustBeNumber": "The radio channel must be a number!",
"FrequencyMustBeBetween": "The radio channel must be between {1} and {2}!"
}

View File

@@ -1,8 +1,8 @@
{
"TranslationProvidedBy": "Suprise444",
"TranslationProvidedBy": "Suprise444, Grzelciu",
"LocaleEnglishName": "Polish",
"LocaleNativeName": "Polski",
"LocaleOffer": "Ten serwer jest dostępny w języku Polskim. Użyj {1} aby go użyć.",
"LocaleOffer": "Ten serwer jest dostępny również w języku Polskim. Użyj {1} z niego skorzystać.",
"LocaleChanged1": "Twój język jest ustawiony na {1}",
"LocaleChanged2": "Serwer będzie teraz pokazywał wiadomości w języku {1}",
"LocaleChangedNote": "To nie zmienia wiadomości od innych graczy",
@@ -15,12 +15,9 @@
"AnimationInvalidDistance": "Dystans musi być między 0 i 3",
"CantBanClient": "Nie możesz zbanować tej osoby",
"PlayerAccountBanned": "{1} został zbanowany",
"ClanNotFound": "Nie znaleziono klanu",
"ClanNameTaken": "Klan z taką nazwą już istnieje",
"PlayerNotFound": "Nie znaleziono gracza",
"ClanCantRemoveRanks": "Nie możesz usuwać rang klanu",
"ClanCantAddRanks": "Nie możesz dodawać rang klanu",
"ClanRankNotFound": "Nie znaleziono rangi klanu",
"ClanCantChangeMemberTag": "Nie możesz zmienić tagu członka klanu",
"ClanPlayerNotInSameClan": "Ten gracz nie jest w twoim klanie",
"ClanCantChangeRankLevel": "Nie możesz zmienić poziomu rangi klanu",
@@ -96,7 +93,7 @@
"HeaderKeyBindsList": "Lista przypisań klawiszy",
"RadioVolumeChanged": "{1} Zmieniłeś głośność swojego radia na {2}%",
"VolumeLevelNotNumber": "Poziom głośności musi być liczbą",
"RadioStationLocationInvalid": "Musisz być w aucie, domu, biznesie lub mieć osobite urządzenie by zmienić stacje radiową!",
"RadioStationLocationInvalid": "Musisz być w aucie, domu, biznesie lub mieć osobiste urządzenie by zmienić stacje radiową!",
"ActionBusinessRadioStationChange": "zmienia biznesową stacje radiową na {1} ({2})",
"ActionHouseRadioStationChange": "zmienia domową stacje radiową na {1} ({2})",
"ActionVehicleRadioStationChange": "zmienia samochodową stacje radiową na {1} ({2})",
@@ -124,7 +121,7 @@
"CantGiveItemInSkinChange": "Nie możesz dać przedmiotu podczas zmieniania swojego wizerunku",
"CantTakeItemInSkinChange": "Nie możesz wziąć przedmiotu podczas zmieniania swojego wizerunku",
"ItemUnequippableNoAmmo": "{1} w slocie {2} nie ma amunicji i nie może zostać użyty!",
"NoSpaceSelfInventory": "Nie masz już miesca w ekwipunku",
"NoSpaceSelfInventory": "Nie masz już miejsca w ekwipunku",
"Business": "biznes",
"House": "mieszkanie",
"Clan": "klan",
@@ -370,15 +367,15 @@
"ADDED-23MAR2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations",
"CarCommandHelp": "Możesz kupić pojazd poprzez odwiedzenie salonu samochodowego. Użyj {1} aby uzyskać więcej informacji.",
"SkinCommandHelp": "Możesz zmienić swój wygląd poprzez odwiedzenie sklepu odzieżowego. Użyj {1} aby uzyskać więcej informacji.",
"BusinessVehiclesRespawned": "Wszystkie pojazdy biznesowe zostały zrespione przez admina!",
"JobVehiclesRespawned": "Wszystkie pojazdy firmowe zostały zrespione przez admina!",
"PlayerVehiclesRespawned": "Wszystkie pojazdy gracza zostały zrespione przez admina!",
"ClanVehiclesRespawned": "Wszystkie pojazdy klanowe zostały zrespione przez admina!",
"PublicVehiclesRespawned": "Wszystkie pojazdy publiczne zostały zrespione przez admina!",
"EmptyVehiclesRespawned": "Wszystkie puste pojazdy zostały zrespione przez admina!",
"AllVehiclesRespawned": "Wszystkie pojazdy zostały zrespione przez admina!",
"BusinessVehiclesRespawned": "Wszystkie pojazdy biznesowe zostały zrespawnowane przez admina!",
"JobVehiclesRespawned": "Wszystkie pojazdy firmowe zostały zrespawnowane przez admina!",
"PlayerVehiclesRespawned": "Wszystkie pojazdy gracza zostały zrespawnowane przez admina!",
"ClanVehiclesRespawned": "Wszystkie pojazdy klanowe zostały zrespawnowane przez admina!",
"PublicVehiclesRespawned": "Wszystkie pojazdy publiczne zostały zrespawnowane przez admina!",
"EmptyVehiclesRespawned": "Wszystkie puste pojazdy zostały zrespawnowane przez admina!",
"AllVehiclesRespawned": "Wszystkie pojazdy zostały zrespawnowane przez admina!",
"AllVehiclesReloaded": "Wszystkie pojazdy biznesowe zostały ponownie załadowane przez admina!",
"YourVehicleRespawned": "Twój pojazd został zrespiony",
"YourVehicleRespawned": "Twój pojazd został zrespawnowany",
"PlayerIPBanned": "{1} został zbanowany poprzez IP!",
"PlayerCharacterBanned": "{1} został zbanowany poprzez postać!",
"PlayerSubNetBanned": "{1} został zbanowany poprzez podsieć!",
@@ -650,28 +647,6 @@
"LeftWrist": "Lewy Nadgarstek",
"RightWrist": "Prawy Nadgarstek"
},
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Użyj {1} aby włączyć/wyłączyć silnik pojazdu",
"VehicleLockedAfterEntryAttempt": "Użyj {1} aby otworzyć/zamknąć pojazd",
"ShowItemsAfterPurchase": "Użyj {1} aby zobaczyć swoje inventory",
"BuyCommandAfterEnterBusiness": "Użyj {1} aby kupić przedmioty od biznesu",
"UseItemKeyAfterEquipping": "Użyj {1} aby użyć wyjęty przedmiot",
"UseItemKeyAfterEquippingWalkieTalkie": "Użyj {1} aby włączyć/wyłączyć radio",
"RadioCommandAfterEnablingWalkieTalkie": "Użyj {1} aby użyć radia",
"ReplyToDirectMessage": "Użyj {1} aby odpowiedzieć na prywatną wiadomość",
"UseItemKeyAmmoAfterEquippingWeapon": "Użyj {1} aby załadować amunicje do wyjętej broni",
"AnimationStop": "Użyj {1} aby zatrzymać swoją animacje",
"JobEquipmentInventory": "Sprzęt do pracy jest w twoim inventory. Użyj {1} aby go zobaczyć.",
"ViewInventory": "Użyj {1} aby zobaczyć swoje przedmioty",
"VehicleRepairItemUsage": "Stań obok pojazdu i użyj {1} aby go naprawić",
"VehicleColourItemUsage": "Stań obok pojazdu i użyj {1} aby zmienić jego kolor",
"VehiclePartItemUsage": "Stań obok pojazdu i użyj {1} aby ulepszyć go z {2}",
"AmmoClipItemUsage": "Wyjmnij broń i użyj {1} aby załadować amunicje",
"GenericItemUsage": "Użyj {1} aby użyć {2}",
"EnterJobVehicleForRoute": "Wejdź do pobliskiego pojazdu służbowego aby rozpocząć trasę",
"JobLocations": "Odwiedź zakład pracy aby zdobyć pracę. Użyj {1} aby znaleźć zakład pracy",
"JobRouteStart": "Użyj {1} aby rozpocząć trasę z tym pojazdem"
},
"DisconnectReasons": {
"Unknown": "Nieznane",
"LostConnection": "Stracono Połączenie",
@@ -747,5 +722,68 @@
"Cancel": "Anuluj",
"AlreadyOwnVehicle": "Już posiadasz ten pojazd!",
"PropertyEntranceFeeLabel": "Opłata wejściowa: {1}",
"NeedToBeInJobVehicle": "Musisz być w firmowym pojeździe!"
"NeedToBeInJobVehicle": "Musisz być w firmowym pojeździe!",
"InvalidJobRank": "Nie znaleziono rangi stanowiska pracy!",
"PayPhoneRecipientAnswered": "Ktoś odebrał telefon. Użyj normalnego czatu, aby z nim porozmawiać.",
"PayPhoneAnswered": "Odebrałeś telefon. Użyj normalnego czatu, aby porozmawiać z rozmówcą.",
"PayPhoneRecipientHangup": "Linia została rozłączona. Pobrano opłatę w wysokości {1}",
"PayPhoneHangup": "Odłożyłeś słuchawkę.",
"AlreadyUsingPayPhone": "Już korzystasz z budki telefonicznej!",
"NotUsingPayPhone": "Nie korzystasz z budki telefonicznej!",
"NoPayPhoneCloseEnough": "W pobliżu nie ma żadnej budki telefonicznej!",
"PayPhoneNotRinging": "Ta budka telefoniczna nie dzwoni!",
"PayPhoneOccupied": "Ta budka telefoniczna jest już używana przez kogoś innego!",
"PayPhoneOccupantSwitched": "Na linii jest teraz inny głos",
"PayPhoneGiven": "Podałeś słuchawkę do {1}",
"PayPhoneReceived": "{1} podał ci słuchawkę",
"PayPhoneUnableToCallPlayer": "W tej chwili nie można się dodzwonić do {1}. Proszę spróbować ponownie później.",
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Użyj {1} aby włączyć/wyłączyć silnik pojazdu",
"VehicleLockedAfterEntryAttempt": "Użyj {1} aby otworzyć/zamknąć pojazd",
"ShowItemsAfterPurchase": "Użyj {1} aby zobaczyć swoje inventory",
"BuyCommandAfterEnterBusiness": "Użyj {1} aby kupić przedmioty od biznesu",
"UseItemKeyAfterEquipping": "Użyj {1} aby użyć wyjęty przedmiot",
"UseItemKeyAfterEquippingWalkieTalkie": "Użyj {1} aby włączyć/wyłączyć radio",
"RadioCommandAfterEnablingWalkieTalkie": "Użyj {1} aby użyć radia",
"ReplyToDirectMessage": "Użyj {1} aby odpowiedzieć na prywatną wiadomość",
"UseItemKeyAmmoAfterEquippingWeapon": "Użyj {1} aby załadować amunicje do wyjętej broni",
"AnimationStop": "Użyj {1} aby zatrzymać swoją animacje",
"JobEquipmentInventory": "Sprzęt do pracy jest w twoim inventory. Użyj {1} aby go zobaczyć.",
"ViewInventory": "Użyj {1} aby zobaczyć swoje przedmioty",
"VehicleRepairItemUsage": "Stań obok pojazdu i użyj {1} aby go naprawić",
"VehicleColourItemUsage": "Stań obok pojazdu i użyj {1} aby zmienić jego kolor",
"VehiclePartItemUsage": "Stań obok pojazdu i użyj {1} aby ulepszyć go z {2}",
"AmmoClipItemUsage": "Wyjmnij broń i użyj {1} aby załadować amunicje",
"GenericItemUsage": "Użyj {1} aby użyć {2}",
"EnterJobVehicleForRoute": "Wejdź do pobliskiego pojazdu służbowego aby rozpocząć trasę",
"JobLocations": "Odwiedź zakład pracy aby zdobyć pracę. Użyj {1} aby znaleźć zakład pracy",
"JobRouteStart": "Użyj {1} aby rozpocząć trasę z tym pojazdem",
"PayPhoneFirstUse": "Użyj {1} aby zakończyć połączenie, lub {2} aby przekazać słuchawkę komuś w pobliżu"
},
"NoBusinessesWithinRange": "W promieniu {1} metrów nie ma żadnych biznesów",
"NoHousesWithinRange": "W promieniu {1} metrów nie ma żadnych domów",
"NoPayPhonesWithinRange": "W promieniu {1} nie ma żadnych budek telefonicznych",
"HeaderBusinessesInRangeList": "Biznesy (w promieniu {1} metrów)",
"HeaderHousesInRangeList": "Domy (w promieniu {1} metrów)",
"HeaderPayPhonesInRangeList": "Budki telefoniczne (w promieniu {1} metrów)",
"HeaderCommandsForStaffFlagList": "Komendy administratora ({1})",
"PlayerLocateDistanceAndDirection": "{1} jest {2} metrów {3}",
"MustBeNumber": "Musisz użyć numeru!",
"HeaderJobRoutesList": "Trasy zakładu pracy ({1})",
"HeaderJobRouteInfo": "Informacje o trasie zakładu pracy (${1})",
"InvalidJobRoute": "Nie znaleziono trasy zakładu pracy!",
"PayPhoneDeleted": "Budka telefoniczna została usunięta",
"PayPhoneAnswer": "Użyj {1} aby odebrać telefon",
"ResetActionTipsConfirm": "Czy na pewno chcesz zresetować wszystkie zobaczone wskazówki dotyczące akcji?",
"ActionTipsReset": "Wszystkie zobaczone wskazówki dotyczące akcji zostały zresetowane.",
"NormalChatDisabled": "Normalny czat jest wyłączony przez administratora serwera. Zamiast tego należy użyć komend czatu.",
"GlobalChatDisabled": "Globalny czat poza postacią jest wyłączony przez administratora serwera"
"CantEditJobUniforms": "You can't edit job uniforms!",
"PlayerNotSurrendered": "The player must be surrendered (hands up, be knocked out, or tazed)!",
"PlayerRemovedFromJob": "You removed {1} from the job",
"RemovedFromJob": "You were removed from the job by {1}",
"UnableToCallPlayer": "{1} can't be called right now",
"NoRadioToUse": "You must have a radio, or be in a vehicle with a radio!",
"FrequencyMustBeNumber": "The radio channel must be a number!",
"FrequencyMustBeBetween": "The radio channel must be between {1} and {2}!"
}

View File

@@ -16,12 +16,9 @@
"InvalidAnimationDistance": "Дистанция должна быть между 0 и 3",
"CantBanClient": "Вы не можете забанить этого игрока",
"PlayerAccountBanned": "Аккаунт {1} был заблокирован ",
"ClanNotFound": "Не удалось найти клан",
"ClanNameTaken": "Клан с таким именем уже существует",
"PlayerNotFound": "Не удалось найти игрока",
"ClanCantRemoveRanks": "Вы не можете убрать ранги клана",
"ClanCantAddRanks": "Вы не можете добавить новые ранги клана",
"ClanRankNotFound": "Не удалось найти ранг клана",
"ClanCantChangeMemberTag": "Вы не можете изменить теги членов клана",
"ClanPlayerNotInSameClan": "Игрок не в вашем клане",
"ClanCantChangeRankLevel": "Вы не можете изменить уровень ранга клана",
@@ -651,28 +648,6 @@
"LeftWrist": "Left Wrist",
"RightWrist": "Right Wrist"
},
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Use {1} to turn on or off a vehicle's engine",
"VehicleLockedAfterEntryAttempt": "Use {1} to lock or unlock a vehicle",
"ShowItemsAfterPurchase": "Use {1} to see your inventory",
"BuyCommandAfterEnterBusiness": "Use {1} to buy items from a business",
"UseItemKeyAfterEquipping": "Use {1} to use your equipped item",
"UseItemKeyAfterEquippingWalkieTalkie": "Use {1} to turn on or off your radio",
"RadioCommandAfterEnablingWalkieTalkie": "Use {1} to talk on your radio",
"ReplyToDirectMessage": "Use {1} to easily reply to a private message",
"UseItemKeyAmmoAfterEquippingWeapon": "Use {1} to load an ammo item into your equipped weapon",
"AnimationStop": "Use {1} to stop your animation",
"JobEquipmentInventory": "The job equipment is in your inventory. Use {1} to see them.",
"ViewInventory": "Use {1} to see your items",
"VehicleRepairItemUsage": "Stand next to a vehicle and use {1} to repair it",
"VehicleColourItemUsage": "Stand next to a vehicle and use {1} to change it's colour",
"VehiclePartItemUsage": "Stand next to a vehicle and use {1} to upgrade with {2}",
"AmmoClipItemUsage": "Equip the weapon and use {1} to load ammo into it",
"GenericItemUsage": "Use {1} to use the {2}",
"EnterJobVehicleForRoute": "Enter a job vehicle nearby to start a job route",
"JobLocations": "Visit a job location to get a job. Use {1} to find a job location",
"JobRouteStart": "Use {1} to start a job route with this vehicle"
},
"DisconnectReasons": {
"Unknown": "Unknown",
"LostConnection": "Lost Connection",
@@ -748,5 +723,68 @@
"Cancel": "Cancel",
"AlreadyOwnVehicle": "You already own this vehicle!",
"PropertyEntranceFeeLabel": "Entrance Fee: {1}",
"NeedToBeInJobVehicle": "You need to be in a job vehicle!"
"NeedToBeInJobVehicle": "You need to be in a job vehicle!",
"InvalidJobRank": "Job rank not found!",
"PayPhoneRecipientAnswered": "Somebody answered the call. Use normal chat to talk to them.",
"PayPhoneAnswered": "You answered the phone. Use normal chat to talk to the caller.",
"PayPhoneRecipientHangup": "The line was disconnected. You have been charged {1}",
"PayPhoneHangup": "You hung up the phone.",
"AlreadyUsingPayPhone": "You are already using a payphone!",
"NotUsingPayPhone": "You are not using a payphone!",
"NoPayPhoneCloseEnough": "There is no payphone close enough!",
"PayPhoneNotRinging": "This payphone is not ringing!",
"PayPhoneOccupied": "This payphone is already being used by someone else!",
"PayPhoneOccupantSwitched": "A different voice is now on the line",
"PayPhoneGiven": "You gave the phone to {1}",
"PayPhoneReceived": "{1} gave you the phone",
"PayPhoneUnableToCallPlayer": "You can't call {1} at this time. Please try again later.",
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Use {1} to turn on or off a vehicle's engine",
"VehicleLockedAfterEntryAttempt": "Use {1} to lock or unlock a vehicle",
"ShowItemsAfterPurchase": "Use {1} to see your inventory",
"BuyCommandAfterEnterBusiness": "Use {1} to buy items from a business",
"UseItemKeyAfterEquipping": "Use {1} to use your equipped item",
"UseItemKeyAfterEquippingWalkieTalkie": "Use {1} to turn on or off your radio",
"RadioCommandAfterEnablingWalkieTalkie": "Use {1} to talk on your radio",
"ReplyToDirectMessage": "Use {1} to easily reply to a private message",
"UseItemKeyAmmoAfterEquippingWeapon": "Use {1} to load an ammo item into your equipped weapon",
"AnimationStop": "Use {1} to stop your animation",
"JobEquipmentInventory": "The job equipment is in your inventory. Use {1} to see them.",
"ViewInventory": "Use {1} to see your items",
"VehicleRepairItemUsage": "Stand next to a vehicle and use {1} to repair it",
"VehicleColourItemUsage": "Stand next to a vehicle and use {1} to change it's colour",
"VehiclePartItemUsage": "Stand next to a vehicle and use {1} to upgrade with {2}",
"AmmoClipItemUsage": "Equip the weapon and use {1} to load ammo into it",
"GenericItemUsage": "Use {1} to use the {2}",
"EnterJobVehicleForRoute": "Enter a job vehicle nearby to start a job route",
"JobLocations": "Visit a job location to get a job. Use {1} to find a job location",
"JobRouteStart": "Use {1} to start a job route with this vehicle",
"PayPhoneFirstUse": "Use {1} to end the call, and {2} to give the phone to somebody nearby"
},
"NoBusinessesWithinRange": "There are no businesses within {1} meters",
"NoHousesWithinRange": "There are no houses within {1} meters",
"NoPayPhonesWithinRange": "There are no payphones within {1} meters",
"HeaderBusinessesInRangeList": "Businesses (within {1} meters)",
"HeaderHousesInRangeList": "Businesses (within {1} meters)",
"HeaderPayPhonesInRangeList": "Businesses (within {1} meters)",
"HeaderCommandsForStaffFlagList": "Admin Commands ({1})",
"PlayerLocateDistanceAndDirection": "{1} is {2} meters {3}",
"MustBeNumber": "You need to use a number!",
"HeaderJobRoutesList": "Job Routes ({1})",
"HeaderJobRouteInfo": "Job Route Information (${1})",
"InvalidJobRoute": "Job route not found!",
"PayPhoneDeleted": "The payphone was deleted",
"PayPhoneAnswer": "Use {1} to answer the payphone",
"ResetActionTipsConfirm": "Are you sure you want to reset all seen action tips?",
"ActionTipsReset": "All seen action tips have been reset.",
"NormalChatDisabled": "Normal chat is disabled by server admin. Use chat commands instead.",
"GlobalChatDisabled": "Global out-of-character chat is disabled by server admin",
"CantEditJobUniforms": "You can't edit job uniforms!",
"PlayerNotSurrendered": "The player must be surrendered (hands up, be knocked out, or tazed)!",
"PlayerRemovedFromJob": "You removed {1} from the job",
"RemovedFromJob": "You were removed from the job by {1}",
"UnableToCallPlayer": "{1} can't be called right now",
"NoRadioToUse": "You must have a radio, or be in a vehicle with a radio!",
"FrequencyMustBeNumber": "The radio channel must be a number!",
"FrequencyMustBeBetween": "The radio channel must be between {1} and {2}!"
}

View File

@@ -16,12 +16,9 @@
"InvalidAnimationDistance": "The distance must be between 0 and 3",
"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",
@@ -651,28 +648,6 @@
"LeftWrist": "Left Wrist",
"RightWrist": "Right Wrist"
},
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Use {1} to turn on or off a vehicle's engine",
"VehicleLockedAfterEntryAttempt": "Use {1} to lock or unlock a vehicle",
"ShowItemsAfterPurchase": "Use {1} to see your inventory",
"BuyCommandAfterEnterBusiness": "Use {1} to buy items from a business",
"UseItemKeyAfterEquipping": "Use {1} to use your equipped item",
"UseItemKeyAfterEquippingWalkieTalkie": "Use {1} to turn on or off your radio",
"RadioCommandAfterEnablingWalkieTalkie": "Use {1} to talk on your radio",
"ReplyToDirectMessage": "Use {1} to easily reply to a private message",
"UseItemKeyAmmoAfterEquippingWeapon": "Use {1} to load an ammo item into your equipped weapon",
"AnimationStop": "Use {1} to stop your animation",
"JobEquipmentInventory": "The job equipment is in your inventory. Use {1} to see them.",
"ViewInventory": "Use {1} to see your items",
"VehicleRepairItemUsage": "Stand next to a vehicle and use {1} to repair it",
"VehicleColourItemUsage": "Stand next to a vehicle and use {1} to change it's colour",
"VehiclePartItemUsage": "Stand next to a vehicle and use {1} to upgrade with {2}",
"AmmoClipItemUsage": "Equip the weapon and use {1} to load ammo into it",
"GenericItemUsage": "Use {1} to use the {2}",
"EnterJobVehicleForRoute": "Enter a job vehicle nearby to start a job route",
"JobLocations": "Visit a job location to get a job. Use {1} to find a job location",
"JobRouteStart": "Use {1} to start a job route with this vehicle"
},
"DisconnectReasons": {
"Unknown": "Unknown",
"LostConnection": "Lost Connection",
@@ -748,5 +723,68 @@
"Cancel": "Cancel",
"AlreadyOwnVehicle": "You already own this vehicle!",
"PropertyEntranceFeeLabel": "Entrance Fee: {1}",
"NeedToBeInJobVehicle": "You need to be in a job vehicle!"
"NeedToBeInJobVehicle": "You need to be in a job vehicle!",
"InvalidJobRank": "Job rank not found!",
"PayPhoneRecipientAnswered": "Somebody answered the call. Use normal chat to talk to them.",
"PayPhoneAnswered": "You answered the phone. Use normal chat to talk to the caller.",
"PayPhoneRecipientHangup": "The line was disconnected. You have been charged {1}",
"PayPhoneHangup": "You hung up the phone.",
"AlreadyUsingPayPhone": "You are already using a payphone!",
"NotUsingPayPhone": "You are not using a payphone!",
"NoPayPhoneCloseEnough": "There is no payphone close enough!",
"PayPhoneNotRinging": "This payphone is not ringing!",
"PayPhoneOccupied": "This payphone is already being used by someone else!",
"PayPhoneOccupantSwitched": "A different voice is now on the line",
"PayPhoneGiven": "You gave the phone to {1}",
"PayPhoneReceived": "{1} gave you the phone",
"PayPhoneUnableToCallPlayer": "You can't call {1} at this time. Please try again later.",
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Use {1} to turn on or off a vehicle's engine",
"VehicleLockedAfterEntryAttempt": "Use {1} to lock or unlock a vehicle",
"ShowItemsAfterPurchase": "Use {1} to see your inventory",
"BuyCommandAfterEnterBusiness": "Use {1} to buy items from a business",
"UseItemKeyAfterEquipping": "Use {1} to use your equipped item",
"UseItemKeyAfterEquippingWalkieTalkie": "Use {1} to turn on or off your radio",
"RadioCommandAfterEnablingWalkieTalkie": "Use {1} to talk on your radio",
"ReplyToDirectMessage": "Use {1} to easily reply to a private message",
"UseItemKeyAmmoAfterEquippingWeapon": "Use {1} to load an ammo item into your equipped weapon",
"AnimationStop": "Use {1} to stop your animation",
"JobEquipmentInventory": "The job equipment is in your inventory. Use {1} to see them.",
"ViewInventory": "Use {1} to see your items",
"VehicleRepairItemUsage": "Stand next to a vehicle and use {1} to repair it",
"VehicleColourItemUsage": "Stand next to a vehicle and use {1} to change it's colour",
"VehiclePartItemUsage": "Stand next to a vehicle and use {1} to upgrade with {2}",
"AmmoClipItemUsage": "Equip the weapon and use {1} to load ammo into it",
"GenericItemUsage": "Use {1} to use the {2}",
"EnterJobVehicleForRoute": "Enter a job vehicle nearby to start a job route",
"JobLocations": "Visit a job location to get a job. Use {1} to find a job location",
"JobRouteStart": "Use {1} to start a job route with this vehicle",
"PayPhoneFirstUse": "Use {1} to end the call, and {2} to give the phone to somebody nearby"
},
"NoBusinessesWithinRange": "There are no businesses within {1} meters",
"NoHousesWithinRange": "There are no houses within {1} meters",
"NoPayPhonesWithinRange": "There are no payphones within {1} meters",
"HeaderBusinessesInRangeList": "Businesses (within {1} meters)",
"HeaderHousesInRangeList": "Businesses (within {1} meters)",
"HeaderPayPhonesInRangeList": "Businesses (within {1} meters)",
"HeaderCommandsForStaffFlagList": "Admin Commands ({1})",
"PlayerLocateDistanceAndDirection": "{1} is {2} meters {3}",
"MustBeNumber": "You need to use a number!",
"HeaderJobRoutesList": "Job Routes ({1})",
"HeaderJobRouteInfo": "Job Route Information (${1})",
"InvalidJobRoute": "Job route not found!",
"PayPhoneDeleted": "The payphone was deleted",
"PayPhoneAnswer": "Use {1} to answer the payphone",
"ResetActionTipsConfirm": "Are you sure you want to reset all seen action tips?",
"ActionTipsReset": "All seen action tips have been reset.",
"NormalChatDisabled": "Normal chat is disabled by server admin. Use chat commands instead.",
"GlobalChatDisabled": "Global out-of-character chat is disabled by server admin",
"CantEditJobUniforms": "You can't edit job uniforms!",
"PlayerNotSurrendered": "The player must be surrendered (hands up, be knocked out, or tazed)!",
"PlayerRemovedFromJob": "You removed {1} from the job",
"RemovedFromJob": "You were removed from the job by {1}",
"UnableToCallPlayer": "{1} can't be called right now",
"NoRadioToUse": "You must have a radio, or be in a vehicle with a radio!",
"FrequencyMustBeNumber": "The radio channel must be a number!",
"FrequencyMustBeBetween": "The radio channel must be between {1} and {2}!"
}

View File

@@ -22,12 +22,9 @@
"InvalidAnimationDistance": "La distancia debe ser un numero entre el 0 y el 3",
"CantBanClient": "No se puede vetar a esta persona",
"PlayerAccountBanned": "La cuenta de {1} ha sido vetada",
"ClanNotFound": "Clan no encontrado",
"ClanNameTaken": "Ya existe un clan con ese nombre",
"PlayerNotFound": "Jugador no encontrado",
"ClanCantRemoveRanks": "No puedes eliminar rangos del clan",
"ClanCantAddRanks": "No puedes añadir rangos del clan",
"ClanRankNotFound": "No se encontró el rango del clan indicado",
"ClanCantChangeMemberTag": "No puedes cambiar las etiquetas del miembro del clan",
"ClanPlayerNotInSameClan": "El jugador indicado no está en tu clan",
"ClanCantChangeRankLevel": "No puedes cambiar el nivel del rango del clan",
@@ -657,28 +654,6 @@
"LeftWrist": "Left Wrist",
"RightWrist": "Right Wrist"
},
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Use {1} to turn on or off a vehicle's engine",
"VehicleLockedAfterEntryAttempt": "Use {1} to lock or unlock a vehicle",
"ShowItemsAfterPurchase": "Use {1} to see your inventory",
"BuyCommandAfterEnterBusiness": "Use {1} to buy items from a business",
"UseItemKeyAfterEquipping": "Use {1} to use your equipped item",
"UseItemKeyAfterEquippingWalkieTalkie": "Use {1} to turn on or off your radio",
"RadioCommandAfterEnablingWalkieTalkie": "Use {1} to talk on your radio",
"ReplyToDirectMessage": "Use {1} to easily reply to a private message",
"UseItemKeyAmmoAfterEquippingWeapon": "Use {1} to load an ammo item into your equipped weapon",
"AnimationStop": "Use {1} to stop your animation",
"JobEquipmentInventory": "The job equipment is in your inventory. Use {1} to see them.",
"ViewInventory": "Use {1} to see your items",
"VehicleRepairItemUsage": "Stand next to a vehicle and use {1} to repair it",
"VehicleColourItemUsage": "Stand next to a vehicle and use {1} to change it's colour",
"VehiclePartItemUsage": "Stand next to a vehicle and use {1} to upgrade with {2}",
"AmmoClipItemUsage": "Equip the weapon and use {1} to load ammo into it",
"GenericItemUsage": "Use {1} to use the {2}",
"EnterJobVehicleForRoute": "Enter a job vehicle nearby to start a job route",
"JobLocations": "Visit a job location to get a job. Use {1} to find a job location",
"JobRouteStart": "Use {1} to start a job route with this vehicle"
},
"DisconnectReasons": {
"Unknown": "Unknown",
"LostConnection": "Lost Connection",
@@ -754,5 +729,68 @@
"Cancel": "Cancel",
"AlreadyOwnVehicle": "You already own this vehicle!",
"PropertyEntranceFeeLabel": "Entrance Fee: {1}",
"NeedToBeInJobVehicle": "You need to be in a job vehicle!"
"NeedToBeInJobVehicle": "You need to be in a job vehicle!",
"InvalidJobRank": "Job rank not found!",
"PayPhoneRecipientAnswered": "Somebody answered the call. Use normal chat to talk to them.",
"PayPhoneAnswered": "You answered the phone. Use normal chat to talk to the caller.",
"PayPhoneRecipientHangup": "The line was disconnected. You have been charged {1}",
"PayPhoneHangup": "You hung up the phone.",
"AlreadyUsingPayPhone": "You are already using a payphone!",
"NotUsingPayPhone": "You are not using a payphone!",
"NoPayPhoneCloseEnough": "There is no payphone close enough!",
"PayPhoneNotRinging": "This payphone is not ringing!",
"PayPhoneOccupied": "This payphone is already being used by someone else!",
"PayPhoneOccupantSwitched": "A different voice is now on the line",
"PayPhoneGiven": "You gave the phone to {1}",
"PayPhoneReceived": "{1} gave you the phone",
"PayPhoneUnableToCallPlayer": "You can't call {1} at this time. Please try again later.",
"ActionTips": {
"VehicleEngineOffWhenEnteringKey": "Use {1} to turn on or off a vehicle's engine",
"VehicleLockedAfterEntryAttempt": "Use {1} to lock or unlock a vehicle",
"ShowItemsAfterPurchase": "Use {1} to see your inventory",
"BuyCommandAfterEnterBusiness": "Use {1} to buy items from a business",
"UseItemKeyAfterEquipping": "Use {1} to use your equipped item",
"UseItemKeyAfterEquippingWalkieTalkie": "Use {1} to turn on or off your radio",
"RadioCommandAfterEnablingWalkieTalkie": "Use {1} to talk on your radio",
"ReplyToDirectMessage": "Use {1} to easily reply to a private message",
"UseItemKeyAmmoAfterEquippingWeapon": "Use {1} to load an ammo item into your equipped weapon",
"AnimationStop": "Use {1} to stop your animation",
"JobEquipmentInventory": "The job equipment is in your inventory. Use {1} to see them.",
"ViewInventory": "Use {1} to see your items",
"VehicleRepairItemUsage": "Stand next to a vehicle and use {1} to repair it",
"VehicleColourItemUsage": "Stand next to a vehicle and use {1} to change it's colour",
"VehiclePartItemUsage": "Stand next to a vehicle and use {1} to upgrade with {2}",
"AmmoClipItemUsage": "Equip the weapon and use {1} to load ammo into it",
"GenericItemUsage": "Use {1} to use the {2}",
"EnterJobVehicleForRoute": "Enter a job vehicle nearby to start a job route",
"JobLocations": "Visit a job location to get a job. Use {1} to find a job location",
"JobRouteStart": "Use {1} to start a job route with this vehicle",
"PayPhoneFirstUse": "Use {1} to end the call, and {2} to give the phone to somebody nearby"
},
"NoBusinessesWithinRange": "There are no businesses within {1} meters",
"NoHousesWithinRange": "There are no houses within {1} meters",
"NoPayPhonesWithinRange": "There are no payphones within {1} meters",
"HeaderBusinessesInRangeList": "Businesses (within {1} meters)",
"HeaderHousesInRangeList": "Businesses (within {1} meters)",
"HeaderPayPhonesInRangeList": "Businesses (within {1} meters)",
"HeaderCommandsForStaffFlagList": "Admin Commands ({1})",
"PlayerLocateDistanceAndDirection": "{1} is {2} meters {3}",
"MustBeNumber": "You need to use a number!",
"HeaderJobRoutesList": "Job Routes ({1})",
"HeaderJobRouteInfo": "Job Route Information (${1})",
"InvalidJobRoute": "Job route not found!",
"PayPhoneDeleted": "The payphone was deleted",
"PayPhoneAnswer": "Use {1} to answer the payphone",
"ResetActionTipsConfirm": "Are you sure you want to reset all seen action tips?",
"ActionTipsReset": "All seen action tips have been reset.",
"NormalChatDisabled": "Normal chat is disabled by server admin. Use chat commands instead.",
"GlobalChatDisabled": "Global out-of-character chat is disabled by server admin",
"CantEditJobUniforms": "You can't edit job uniforms!",
"PlayerNotSurrendered": "The player must be surrendered (hands up, be knocked out, or tazed)!",
"PlayerRemovedFromJob": "You removed {1} from the job",
"RemovedFromJob": "You were removed from the job by {1}",
"UnableToCallPlayer": "{1} can't be called right now",
"NoRadioToUse": "You must have a radio, or be in a vehicle with a radio!",
"FrequencyMustBeNumber": "The radio channel must be a number!",
"FrequencyMustBeBetween": "The radio channel must be between {1} and {2}!"
}

View File

@@ -8,6 +8,8 @@
<script src="scripts/shared/utilities.js" type="client" language="javascript" />
<script src="scripts/shared/gamedata.js" type="server" language="javascript" />
<script src="scripts/shared/gamedata.js" type="client" language="javascript" />
<script src="scripts/shared/queue.js" type="server" language="javascript" />
<script src="scripts/shared/queue.js" type="client" language="javascript" />
<!-- Multiplayer Mod (Wrapped Natives) -->
<!-- The goal is to just swap only these out when I port the script to a new MP mod -->
@@ -50,6 +52,7 @@
<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/payphone.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/radio.js" type="server" language="javascript" />
@@ -83,16 +86,29 @@
<script src="scripts/server/item/rope.js" type="server" language="javascript" />
<script src="scripts/server/item/tazer.js" type="server" language="javascript" />
<!-- Extra Client Files -->
<!-- Fonts -->
<file type="client" src="files/fonts/roboto-regular.ttf" />
<file type="client" src="files/fonts/pricedown.ttf" />
<file type="client" src="files/fonts/aurora-bold-condensed.ttf" />
<!-- Images -->
<file type="client" src="files/images/skins/none.png" />
<!--<file type="client" src="files/images/server-logo.png" />-->
<file type="client" src="files/images/gtac-logo.png" />
<file type="client" src="files/images/mafiac-logo.png" />
<file type="client" src="files/images/cursor.png" />
<!-- 3D World Icons -->
<file type="client" src="files/images/icons/objective-icon.png" />
<file type="client" src="files/images/icons/business-icon.png" />
<file type="client" src="files/images/icons/house-icon.png" />
<file type="client" src="files/images/icons/job-icon.png" />
<!-- Sounds -->
<file type="client" src="files/sounds/payphone/old-payphone-ring.mp3" />
<file type="client" src="files/sounds/payphone/old-payphone-dial.mp3" />
<file type="client" src="files/sounds/payphone/old-payphone-pickup.mp3" />
<file type="client" src="files/sounds/payphone/old-payphone-hangup.mp3" />
<!-- GUI -->
<script src="scripts/client/gui/2fa.js" type="client" language="javascript" />
<script src="scripts/client/gui/bizmgr.js" type="client" language="javascript" />
@@ -119,14 +135,16 @@
<script src="scripts/client/afk.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/core.js" type="client" language="javascript" />
<script src="scripts/client/camera.js" type="client" language="javascript" />
<script src="scripts/client/chat.js" type="client" language="javascript" />
<script src="scripts/client/core.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/gui.js" type="client" language="javascript" />
<script src="scripts/client/gps.js" type="client" language="javascript" />
<script src="scripts/client/house.js" type="client" language="javascript" />
<script src="scripts/client/hud.js" type="client" language="javascript" />
<script src="scripts/client/item.js" type="client" language="javascript" />
<script src="scripts/client/job.js" type="client" language="javascript" />
<script src="scripts/client/keybind.js" type="client" language="javascript" />
@@ -137,10 +155,12 @@
<script src="scripts/client/mousecam.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/payphone.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/skin-select.js" type="client" language="javascript" />
<script src="scripts/client/sync.js" type="client" language="javascript" />
<script src="scripts/client/timers.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/netevents.js" type="client" language="javascript" />

View File

@@ -22,7 +22,7 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) {
}
let animationData = getAnimationData(animationSlot);
logToConsole(LOG_DEBUG, `[AGRP.Animation] Playing animation ${animationData[0]} for ped ${pedId}`);
logToConsole(LOG_DEBUG, `[V.RP.Animation] Playing animation ${animationData[0]} for ped ${pedId}`);
let freezePlayer = false;
switch (animationData.moveType) {

View File

@@ -35,10 +35,19 @@ function initBusinessScript() {
// ===========================================================================
function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked, hasItems, entranceFee) {
logToConsole(LOG_DEBUG, `[AGRP.Business] Received business ${businessId} (${name}) from server`);
function receiveBusinessFromServer(businessId, isDeleted, name, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked, hasItems, entranceFee) {
logToConsole(LOG_DEBUG, `[V.RP.Business] Received business ${businessId} (${name}) from server`);
if (!areServerElementsSupported() || getGame() == V_GAME_MAFIA_ONE || getGame() == V_GAME_GTA_IV) {
if (isDeleted == true) {
if (getGame() == V_GAME_GTA_IV) {
natives.removeBlipAndClearIndex(getBusinessData(businessId).blipId);
}
getServerData().businesses.splice(businessId, 1);
return false;
}
if (getBusinessData(businessId) != false) {
let businessData = getBusinessData(businessId);
businessData.name = name;
@@ -52,20 +61,24 @@ function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel
businessData.locked = locked;
businessData.entranceFee = entranceFee;
if (hasInterior && !hasItems) {
businessData.labelInfoType = V_PROPLABEL_INFO_ENTER;
} else if (!hasInterior && hasItems) {
businessData.labelInfoType = V_PROPLABEL_INFO_BUY;
if (businessData.buyPrice > 0) {
businessData.labelInfoType = V_PROPLABEL_INFO_BUYBIZ;
} else {
if (businessData.buyPrice > 0) {
businessData.labelInfoType = V_PROPLABEL_INFO_BUYBIZ;
if (hasInterior) {
businessData.labelInfoType = V_PROPLABEL_INFO_ENTER;
} else {
if (hasItems) {
businessData.labelInfoType = V_PROPLABEL_INFO_BUY;
} else {
businessData.labelInfoType = V_PROPLABEL_INFO_NONE;
}
}
}
logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId} already exists. Checking blip ...`);
logToConsole(LOG_DEBUG, `[V.RP.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`);
logToConsole(LOG_DEBUG, `[V.RP.Business] Business ${businessId}'s blip has been removed by the server`);
if (getGame() == V_GAME_GTA_IV) {
natives.removeBlipAndClearIndex(getBusinessData(businessId).blipId);
} else {
@@ -75,11 +88,11 @@ function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel
//businesses.splice(businessData.index, 1);
//setAllBusinessDataIndexes();
} else {
logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId}'s blip is unchanged`);
logToConsole(LOG_DEBUG, `[V.RP.Business] Business ${businessId}'s blip is unchanged`);
}
} else {
if (businessData.blipId != -1) {
logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId}'s blip has been changed by the server`);
logToConsole(LOG_DEBUG, `[V.RP.Business] Business ${businessId}'s blip has been changed by the server`);
if (getGame() == V_GAME_GTA_IV) {
natives.setBlipCoordinates(businessData.blipId, businessData.entrancePosition);
natives.changeBlipSprite(businessData.blipId, businessData.blipModel);
@@ -92,22 +105,32 @@ function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel
if (blipId != -1) {
tempBusinessData.blipId = blipId;
}
logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
logToConsole(LOG_DEBUG, `[V.RP.Business] Business ${businessId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
}
}
} else {
logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId} doesn't exist. Adding ...`);
let tempBusinessData = new BusinessData(businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems);
logToConsole(LOG_DEBUG, `[V.RP.Business] Business ${businessId} doesn't exist. Adding ...`);
let businessData = new BusinessData(businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, locked, hasItems, entranceFee);
businessData.name = name;
businessData.entrancePosition = entrancePosition;
businessData.blipModel = blipModel;
businessData.pickupModel = pickupModel;
businessData.hasInterior = hasInterior;
businessData.buyPrice = buyPrice;
businessData.rentPrice = rentPrice;
businessData.hasItems = hasItems;
businessData.locked = locked;
businessData.entranceFee = entranceFee;
if (blipModel != -1) {
let blipId = createGameBlip(tempBusinessData.blipModel, tempBusinessData.entrancePosition, tempBusinessData.name);
let blipId = createGameBlip(businessData.blipModel, businessData.entrancePosition, businessData.name);
if (blipId != -1) {
tempBusinessData.blipId = blipId;
businessData.blipId = blipId;
}
logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
logToConsole(LOG_DEBUG, `[V.RP.Business] Business ${businessId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
} else {
logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId} has no blip.`);
logToConsole(LOG_DEBUG, `[V.RP.Business] Business ${businessId} has no blip.`);
}
getServerData().businesses.push(tempBusinessData);
getServerData().businesses.push(businessData);
setAllBusinessDataIndexes();
}
}
@@ -142,4 +165,10 @@ function setAllBusinessDataIndexes() {
}
}
// ===========================================================================
function removeBusinessesFromClient() {
getServerData().businesses.splice(0);
}
// ===========================================================================

View File

@@ -12,27 +12,45 @@ let cameraFadeIn = false;
let cameraFadeStart = 0;
let cameraFadeDuration = 0;
let cameraFadeColour = 0;
let cameraFadeAlpha = 0;
// ===========================================================================
function processCameraFadeRendering() {
if (cameraFadeEnabled) {
logToConsole(LOG_VERBOSE, `[V.RP.Camera] Camera fade enabled`);
let finishTime = cameraFadeStart + cameraFadeDuration;
if (sdl.ticks >= finishTime) {
logToConsole(LOG_VERBOSE, `[V.RP.Camera] Camera fade finished`);
cameraFadeEnabled = false;
cameraFadeDuration = 0;
cameraFadeStart = 0;
} else {
logToConsole(LOG_VERBOSE, `[V.RP.Camera] Camera fade processing`);
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);
cameraFadeAlpha = (cameraFadeIn) ? Math.ceil(((100 - progressPercent) / 100) * 255) : Math.ceil(255 * (progressPercent / 100));
logToConsole(LOG_VERBOSE, `[V.RP.Camera] Camera fade progress: ${progressPercent}% (Alpha: ${cameraFadeAlpha})`);
cameraFadeColour = toColour(rgbaArray[0], rgbaArray[1], rgbaArray[2], alpha);
cameraFadeColour = toColour(rgbaArray[0], rgbaArray[1], rgbaArray[2], cameraFadeAlpha);
graphics.drawRectangle(null, toVector2(0, 0), toVector2(game.width, game.height), cameraFadeColour, cameraFadeColour, cameraFadeColour, cameraFadeColour);
}
}
}
// ===========================================================================
function fadeLocalCamera(state, duration, colour) {
logToConsole(LOG_DEBUG, `[V.RP.Utilities] Fading camera ${(state) ? "in" : "out"} for ${duration}ms`);
cameraFadeDuration = duration;
cameraFadeStart = sdl.ticks;
cameraFadeIn = state;
cameraFadeColour = colour;
cameraFadeAlpha = (state) ? 255 : 0;
cameraFadeEnabled = true;
}
// ===========================================================================

View File

@@ -52,7 +52,7 @@ function unBindChatBoxKeys() {
// ===========================================================================
function receiveChatBoxMessageFromServer(messageString, colour, hour, minute, second) {
logToConsole(LOG_DEBUG, `[AGRP.Chat]: Received chatbox message from server: ${messageString}`);
logToConsole(LOG_DEBUG, `[V.RP.Chat]: Received chatbox message from server: ${messageString}`);
// Just in case it's hidden by auto hide
//setChatWindowEnabled(true);
@@ -77,16 +77,16 @@ function receiveChatBoxMessageFromServer(messageString, colour, hour, minute, se
outputString = `${timeStampString}${messageString}`;
}
logToConsole(LOG_DEBUG, `[AGRP.Chat]: Changed colours in string: ${outputString}`);
logToConsole(LOG_DEBUG, `[V.RP.Chat]: Changed colours in string: ${outputString}`);
outputString = replaceColoursInMessage(`${outputString}`);
if (chatEmojiEnabled == true) {
logToConsole(LOG_DEBUG, `[AGRP.Chat]: Enabled emoji in string: ${outputString}`);
logToConsole(LOG_DEBUG, `[V.RP.Chat]: Enabled emoji in string: ${outputString}`);
outputString = replaceEmojiInMessage(outputString);
}
if (profanityFilterEnabled == true) {
logToConsole(LOG_DEBUG, `[AGRP.Chat]: Removed profanity in string: ${outputString}`);
logToConsole(LOG_DEBUG, `[V.RP.Chat]: Removed profanity in string: ${outputString}`);
outputString = replaceProfanityInMessage(outputString);
}

View File

@@ -28,10 +28,11 @@ let renderHotBar = true;
let renderItemActionDelay = true;
let renderInteriorLights = true;
let logLevel = LOG_INFO;
let logLevel = LOG_INFO | LOG_DEBUG;
let weaponDamageEnabled = {};
let weaponDamageEvent = {};
let weaponDamageMultiplier = 1.0;
let forceWeapon = 0;
let forceWeaponAmmo = 0;
@@ -89,6 +90,7 @@ let localLocaleId = 0;
* @property {Array} localeStrings
* @property {Array} localeOptions
* @property {Object} cvars
* @property {Array.<PayPhoneData>} payPhones
*/
let serverData = {
houses: [],
@@ -98,14 +100,15 @@ let serverData = {
vehicles: [],
jobs: [],
cvars: {},
payPhones: [],
};
let localPlayerMoney = 0;
let localPlayerMoneyInterval = null;
let currencyString = "${AMOUNT}";
let mapChangeWarning = false;
let mapChangeToNight = false;
let cruiseControlEnabled = false;
let cruiseControlSpeed = 0.0;

View File

@@ -16,9 +16,6 @@ function initEventScript() {
// ===========================================================================
function addAllEventHandlers() {
addEventHandler("OnResourceStart", onResourceStart);
addEventHandler("OnResourceReady", onResourceReady);
addEventHandler("OnResourceStop", onResourceStop);
addEventHandler("OnProcess", onProcess);
addEventHandler("OnKeyUp", onKeyUp);
addEventHandler("OnDrawnHUD", onDrawnHUD);
@@ -32,17 +29,22 @@ function addAllEventHandlers() {
addEventHandler("OnMouseWheel", onMouseWheel);
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() <= V_GAME_GTA_SA) {
if (findResourceByName("v-events") != null) {
if (findResourceByName("v-events").isStarted) {
addEventHandler("OnPedEnteredVehicleEx", onPedEnteredVehicle);
addEventHandler("OnPedExitedVehicleEx", onPedExitedVehicle);
addEventHandler("OnPedEnteredSphereEx", onPedEnteredSphere);
addEventHandler("OnPedExitedSphereEx", onPedExitedSphere);
}
}
}
if (getGame() == V_GAME_MAFIA_ONE) {
addEventHandler("OnMapLoaded", onMapLoaded);
addEventHandler("OnPedEnteringVehicle", onPedEnteredVehicle);
addEventHandler("OnPedExitingVehicle", onPedExitedVehicle);
addEventHandler("OnPedInflictDamage", onPedHit);
}
}
@@ -56,14 +58,20 @@ function onResourceStart(event, resource) {
removeEventHandler("OnPedEnteredSphereEx");
removeEventHandler("OnPedExitedSphereEx");
addEventHandler("OnPedEnteredVehicleEx", onPedEnteredVehicle);
addEventHandler("OnPedExitedVehicleEx", onPedExitedVehicle);
addEventHandler("OnPedEnteredSphereEx", onPedEnteredSphere);
addEventHandler("OnPedExitedSphereEx", onPedExitedSphere);
if (getGame() <= V_GAME_GTA_SA) {
if (findResourceByName("v-events") != null) {
if (findResourceByName("v-events").isStarted) {
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`);
logToConsole(LOG_DEBUG | LOG_WARN, `[V.RP.Event] onResourceStart called - Sending signal to server`);
localPlayerMoneyInterval = setInterval(updateLocalPlayerMoney, 1000 * 5);
sendResourceStartedSignalToServer();
}
@@ -73,7 +81,7 @@ function onResourceStart(event, resource) {
function onResourceStop(event, resource) {
if (resource == thisResource) {
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.Event] onResourceStop called - Sending signal to server`);
logToConsole(LOG_DEBUG | LOG_WARN, `[V.RP.Event] onResourceStop called - Sending signal to server`);
sendResourceStoppedSignalToServer();
}
}
@@ -82,16 +90,20 @@ function onResourceStop(event, resource) {
function onResourceReady(event, resource) {
if (resource == thisResource) {
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.Event] onResourceReady called - Sending signal to server`);
loadLocaleConfig();
sendResourceReadySignalToServer();
logToConsole(LOG_DEBUG | LOG_WARN, `[V.RP.Event] onResourceReady called - Sending signal to server`);
setTimeout(function () {
initClientScripts();
sendResourceReadySignalToServer();
}, 500);
}
}
// ===========================================================================
function onProcess(event, deltaTime) {
logToConsole(LOG_VERBOSE, `[AGRP.Event] onProcess`);
logToConsole(LOG_VERBOSE, `[V.RP.Event] onProcess`);
if (localPlayer == null) {
return false;
}
@@ -110,6 +122,8 @@ function onProcess(event, deltaTime) {
processVehiclePurchasing();
processVehicleBurning();
processVehicleCruiseControl();
processPayPhonesDistance();
processJobRouteLocationDistance();
//checkChatBoxAutoHide(); // Will be uncommented on 1.4.0 GTAC update
//processVehicleFires();
}
@@ -126,7 +140,7 @@ function onKeyUp(event, keyCode, scanCode, keyModifiers) {
// ===========================================================================
function onDrawnHUD(event) {
logToConsole(LOG_VERBOSE, `[AGRP.Event] HUD drawn`);
logToConsole(LOG_VERBOSE, `[V.RP.Event] HUD drawn`);
processMouseCursorRendering();
if (!renderHUD) {
@@ -145,12 +159,16 @@ function onDrawnHUD(event) {
processSkinSelectRendering();
processNameTagRendering();
processInteriorLightsRendering();
processCustomHUDRendering();
processCameraFadeRendering();
processJobLocationIndicatorRendering();
processMapChangeWarning();
}
// ===========================================================================
function onPedWasted(event, wastedPed, killerPed, weapon, pedPiece) {
logToConsole(LOG_DEBUG, `[AGRP.Event] Ped ${wastedPed.name} died`);
logToConsole(LOG_DEBUG, `[V.RP.Event] Ped ${wastedPed.name} died`);
wastedPed.clearWeapons();
}
@@ -163,12 +181,13 @@ function onElementStreamIn(event, element) {
// ===========================================================================
function onPedExitedVehicle(event, ped, vehicle, seat) {
//logToConsole(LOG_DEBUG, `[AGRP.Event] Local player exited vehicle`);
//logToConsole(LOG_DEBUG, `[V.RP.Event] Local player exited vehicle`);
//sendNetworkEventToServer("v.rp.onPlayerExitVehicle", getVehicleForNetworkEvent(vehicle), seat);
cruiseControlEnabled = false;
cruiseControlSpeed = 0.0;
/*
if (localPlayer != null) {
if (ped == localPlayer) {
if (areServerElementsSupported()) {
@@ -182,12 +201,13 @@ function onPedExitedVehicle(event, ped, vehicle, seat) {
}
}
}
*/
}
// ===========================================================================
function onPedExitingVehicle(event, ped, vehicle, seat) {
//logToConsole(LOG_DEBUG, `[AGRP.Event] Local player exited vehicle`);
//logToConsole(LOG_DEBUG, `[V.RP.Event] Local player exited vehicle`);
//sendNetworkEventToServer("v.rp.onPlayerExitVehicle", getVehicleForNetworkEvent(vehicle), seat);
if (localPlayer != null) {
@@ -201,7 +221,7 @@ function onPedExitingVehicle(event, ped, vehicle, seat) {
// ===========================================================================
function onPedEnteredVehicle(event, ped, vehicle, seat) {
logToConsole(LOG_DEBUG, `[AGRP.Event] Ped entered vehicle`);
logToConsole(LOG_DEBUG, `[V.RP.Event] Ped entered vehicle`);
//sendNetworkEventToServer("v.rp.onPlayerEnterVehicle", getVehicleForNetworkEvent(vehicle), seat);
cruiseControlEnabled = false;
@@ -229,7 +249,7 @@ function onPedEnteredVehicle(event, ped, vehicle, seat) {
function onPedInflictDamage(event, damagedEntity, damagerEntity, weaponId, healthLoss, pedPiece) {
//let damagerEntityString = (!isNull(damagedEntity)) ? `${damagerEntity.name} (${damagerEntity.name}, ${damagerEntity.type} - ${typeof damagerEntity})` : `Unknown ped`;
//let damagedEntityString = (!isNull(damagedEntity)) ? `${damagedEntity.name} (${damagedEntity.name}, ${damagedEntity.type} - ${typeof damagedEntity})` : `Unknown ped`;
//logToConsole(LOG_DEBUG, `[AGRP.Event] ${damagerEntityString} damaged ${damagedEntityString}'s '${pedPiece} with weapon ${weaponId}`);
//logToConsole(LOG_DEBUG, `[V.RP.Event] ${damagerEntityString} damaged ${damagedEntityString}'s '${pedPiece} with weapon ${weaponId}`);
if (!isNull(damagedEntity) && !isNull(damagerEntity)) {
if (damagedEntity.isType(ELEMENT_PLAYER)) {
if (damagedEntity == localPlayer) {
@@ -244,6 +264,16 @@ function onPedInflictDamage(event, damagedEntity, damagerEntity, weaponId, healt
// ===========================================================================
function onPedHit(event, hitPed, vec1, vec2, vec3, hitType, damage, bodyPart) {
logToConsole(LOG_DEBUG, `[V.RP.Event] Ped ${hitPed.id} (${hitPed.name}) hit using type ${hitType}, causing ${damage} to body part ${bodyPart}`);
event.preventDefault();
if (hitPed == localPlayer) {
localPlayer.health = localPlayer.health - (damage * weaponDamageMultiplier);
}
}
// ===========================================================================
function onPedEnteredSphere(event, ped, sphere) {
if (sphere == jobRouteLocationSphere) {
enteredJobRouteSphere();
@@ -294,7 +324,7 @@ function onEntityProcess(event, entity) {
// ===========================================================================
function onMapLoaded(mapName) {
function onMapLoaded(event, mapName) {
sendNetworkEventToServer("v.rp.mapLoaded", mapName);
}

View File

@@ -16,7 +16,7 @@ let gpsBlipBlinkTimer = null;
// ===========================================================================
function showGPSLocation(position, colour) {
logToConsole(LOG_DEBUG, `[AGRP.GPS] Showing gps location`);
logToConsole(LOG_DEBUG, `[V.RP.GPS] Showing gps location`);
if (getMultiplayerMod() == V_MPMOD_GTAC) {
if (getGame() == V_GAME_GTA_SA) {
// Server-side spheres don't show in GTA SA for some reason.

View File

@@ -47,7 +47,7 @@ function initGUIScript() {
// ===========================================================================
function initGUI() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Initializing GUI ...`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Initializing GUI ...`);
initLoginGUI();
initRegisterGUI();
@@ -73,7 +73,7 @@ function initGUI() {
closeAllWindows();
guiReady = true;
logToConsole(LOG_DEBUG, `[AGRP.GUI] All GUI created successfully!`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] All GUI created successfully!`);
sendNetworkEventToServer("v.rp.guiReady", true);
};
@@ -81,7 +81,7 @@ function initGUI() {
// ===========================================================================
function closeAllWindows() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Closing all GUI windows`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Closing all GUI windows`);
infoDialog.window.shown = false;
yesNoDialog.window.shown = false;
errorDialog.window.shown = false;
@@ -208,7 +208,7 @@ function isAnyGUIActive() {
// ===========================================================================
function setGUIColours(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}`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Received new GUI colours from server: ${red1}, ${green1}, ${blue1} / ${red2}, ${green2}, ${blue2} / ${red3}, ${green3}, ${blue3}`);
primaryColour = [red1, green1, blue1];
secondaryColour = [red2, green2, blue2];
primaryTextColour = [red3, green3, blue3];
@@ -228,45 +228,45 @@ function hideAllGUI() {
// ===========================================================================
function processGUIKeyPress(keyCode) {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Processing key press: ${keyCode}`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Processing key press: ${keyCode}`);
if (!guiReady) {
return false;
}
if (!isAnyGUIActive()) {
logToConsole(LOG_DEBUG, `[AGRP.GUI] GUI is not active. Cancelling keypress processing.`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] GUI is not active. Cancelling keypress processing.`);
return false;
}
if (keyCode == SDLK_RETURN || keyCode == SDLK_RETURN2) {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Key press is submit (${guiSubmitKey})`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Key press is submit (${guiSubmitKey})`);
if (guiSubmitKey != false) {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Calling submit key function`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Calling submit key function`);
guiSubmitKey.call();
}
} else if (keyCode == getKeyIdFromParams("left") || keyCode == getKeyIdFromParams("a")) {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Key press is left (${guiLeftKey})`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Key press is left (${guiLeftKey})`);
if (guiLeftKey != false) {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Calling left key function`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Calling left key function`);
guiLeftKey.call();
}
} else if (keyCode == getKeyIdFromParams("right") || keyCode == getKeyIdFromParams("d")) {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Key press is right (${guiRightKey})`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Key press is right (${guiRightKey})`);
if (guiRightKey != false) {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Calling right key function`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Calling right key function`);
guiRightKey.call();
}
} else if (keyCode == getKeyIdFromParams("down") || keyCode == getKeyIdFromParams("s")) {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Key press is down (${guiDownKey})`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Key press is down (${guiDownKey})`);
if (guiDownKey != false) {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Calling down key function`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Calling down key function`);
guiDownKey.call();
}
} else if (keyCode == getKeyIdFromParams("up") || keyCode == getKeyIdFromParams("w")) {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Key press is up (${guiUpKey})`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Key press is up (${guiUpKey})`);
if (guiUpKey != false) {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Calling up key function`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Calling up key function`);
guiUpKey.call();
}
}

View File

@@ -20,7 +20,7 @@ let twoFactorAuth = {
// ===========================================================================
function initTwoFactorAuthenticationGUI() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating two factor auth GUI ...`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Creating two factor auth GUI ...`);
twoFactorAuth.window = mexui.window(game.width / 2 - 150, game.height / 2 - 129, 300, 258, 'LOGIN', {
main: {
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
@@ -94,14 +94,14 @@ function initTwoFactorAuthenticationGUI() {
},
}, checkTwoFactorAuth);
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created two factor auth GUI`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Created two factor auth GUI`);
}
// ===========================================================================
function showTwoFactorAuthGUI() {
closeAllWindows();
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing two-factor authentication window`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Showing two-factor authentication window`);
setChatWindowEnabled(false);
mexui.setInput(true);
twoFactorAuth.window.shown = true;
@@ -112,7 +112,7 @@ function showTwoFactorAuthGUI() {
// ===========================================================================
function twoFactorAuthFailed(errorMessage) {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports two-factor authentication failed. Reason: ${errorMessage}`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Server reports two-factor authentication failed. Reason: ${errorMessage}`);
twoFactorAuth.messageLabel.text = errorMessage;
twoFactorAuth.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
twoFactorAuth.codeInput.text = "";
@@ -121,14 +121,14 @@ function twoFactorAuthFailed(errorMessage) {
// ===========================================================================
function twoFactorAuthSuccess() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports two-factor authentication was successful`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Server reports two-factor authentication was successful`);
closeAllWindows();
}
// ===========================================================================
function checkTwoFactorAuth() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Checking two-factor authentication with server ...`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Checking two-factor authentication with server ...`);
sendNetworkEventToServer("v.rp.2fa", twoFactorAuth.codeInput.lines[0]);
}

View File

@@ -19,7 +19,7 @@ let passwordChange = {
// ===========================================================================
function initChangePasswordGUI() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating password change GUI ...`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Creating password change GUI ...`);
passwordChange.window = mexui.window(game.width / 2 - 130, game.height / 2 - 125, 300, 250, 'Change Password', {
main: {
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
@@ -110,13 +110,13 @@ function initChangePasswordGUI() {
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
},
}, checkChangePassword);
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created change password GUI`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Created change password GUI`);
}
// ===========================================================================
function passwordChangeFailed(errorMessage) {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports change password failed. Reason: ${errorMessage}`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Server reports change password failed. Reason: ${errorMessage}`);
passwordChange.messageLabel.text = errorMessage;
passwordChange.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
passwordChange.passwordInput.text = "";
@@ -127,14 +127,14 @@ function passwordChangeFailed(errorMessage) {
// ===========================================================================
function checkChangePassword() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Checking password change with server ...`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Checking password change with server ...`);
sendNetworkEventToServer("v.rp.checkChangePassword", passwordChange.passwordInput.lines[0], passwordChange.confirmPasswordInput.lines[0]);
}
// ===========================================================================
function showChangePasswordGUI(errorMessage) {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing change password window`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Showing change password window`);
closeAllWindows();
setChatWindowEnabled(false);
mexui.setInput(true);
@@ -149,7 +149,7 @@ function showChangePasswordGUI(errorMessage) {
// ===========================================================================
function passwordChangeSuccess() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports password change was successful`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Server reports password change was successful`);
guiSubmitKey = false;
closeAllWindows();
}

View File

@@ -23,7 +23,7 @@ let characterSelect = {
// ===========================================================================
function initCharacterSelectGUI() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating character select GUI ...`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Creating character select GUI ...`);
characterSelect.window = mexui.window(game.width / 2 - 215, game.height / 2 - 83, 430, 190, 'SELECT CHARACTER', {
main: {
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
@@ -31,13 +31,13 @@ function initCharacterSelectGUI() {
title: {
textSize: 12.0,
textFont: mainFont,
textColour: toColour(0, 0, 0, 255),
textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], 255),
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
},
icon: {
textSize: 10.0,
textFont: mainFont,
textColour: toColour(0, 0, 0, 255),
textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], 255),
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
}
});
@@ -150,14 +150,14 @@ function initCharacterSelectGUI() {
borderColour: toColour(0, 0, 0, 0),
}
});
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created character select GUI`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Created character select GUI`);
}
// ===========================================================================
function showCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, skinId) {
closeAllWindows();
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing character selection window`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Showing character selection window`);
setChatWindowEnabled(false);
mexui.setInput(true);
characterSelect.nameText.text = `${firstName} ${lastName}`;
@@ -178,35 +178,35 @@ function showCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, ski
function showNewCharacter() {
closeAllWindows();
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing new character dialog window`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Showing new character dialog window`);
showNewCharacterGUI();
}
// ===========================================================================
function selectNextCharacter() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Requesting next character info from server for character select window`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Requesting next character info from server for character select window`);
sendNetworkEventToServer("v.rp.nextCharacter");
}
// ===========================================================================
function selectPreviousCharacter() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Requesting previous character info from server for character select window`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Requesting previous character info from server for character select window`);
sendNetworkEventToServer("v.rp.previousCharacter");
}
// ===========================================================================
function selectThisCharacter() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Tell server the current shown character was selected in character select window`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Tell server the current shown character was selected in character select window`);
sendNetworkEventToServer("v.rp.selectCharacter");
}
// ===========================================================================
function switchCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, skinId) {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Updating character info with data from server`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Updating character info with data from server`);
setChatWindowEnabled(false);
characterSelect.window.shown = false;
characterSelect.nameText.text = `${firstName} ${lastName}`;
@@ -229,7 +229,7 @@ function switchCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, s
// ===========================================================================
function characterSelectSuccess() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports character selection was successful`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Server reports character selection was successful`);
closeAllWindows();
}

View File

@@ -16,7 +16,7 @@ let errorDialog = {
// ===========================================================================
function initErrorDialogGUI() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating error GUI ...`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Creating error GUI ...`);
errorDialog.window = mexui.window(getScreenWidth() / 2 - 200, getScreenHeight() / 2 - 70, 400, 140, 'ERROR', {
main: {
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
@@ -58,14 +58,14 @@ function initErrorDialogGUI() {
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], 255),
},
}, closeErrorDialog);
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created error GUI ...`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Created error GUI ...`);
}
// ===========================================================================
function showErrorGUI(errorMessage, errorTitle, buttonText) {
closeAllWindows();
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing error window. Error: ${errorTitle} - ${errorMessage}`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Showing error window. Error: ${errorTitle} - ${errorMessage}`);
setChatWindowEnabled(false);
mexui.setInput(true);
errorDialog.messageLabel.text = errorMessage;
@@ -77,7 +77,7 @@ function showErrorGUI(errorMessage, errorTitle, buttonText) {
// ===========================================================================
function closeErrorDialog() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Closing error dialog`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Closing error dialog`);
errorDialog.window.shown = false;
mexui.setInput(false);
}

View File

@@ -13,7 +13,7 @@ let fiveCardPokerGUI = {
function initFiveCardPokerGUI() {
// Render a five card poker game in MexUI
//logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating five-card poker GUI ...`);
//logToConsole(LOG_DEBUG, `[V.RP.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),
@@ -33,7 +33,7 @@ function initFiveCardPokerGUI() {
fiveCardPokerGUI.window.shown = false;
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created five card poker GUI`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Created five card poker GUI`);
}
// ===========================================================================

View File

@@ -22,7 +22,7 @@ let dealerCards = [];
function initBlackJackGUI() {
// Render a blackjack game in MexUI
logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating blackjack GUI ...`);
logToConsole(LOG_DEBUG, `[V.RP.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),
@@ -42,7 +42,7 @@ function initBlackJackGUI() {
blackJackGUI.window.shown = false;
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created blackjack GUI`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Created blackjack GUI`);
}
// ===========================================================================

View File

@@ -16,7 +16,7 @@ let infoDialog = {
// ===========================================================================
function initInfoDialogGUI() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating info dialog GUI ...`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Creating info dialog GUI ...`);
infoDialog.window = mexui.window(getScreenWidth() / 2 - 200, getScreenHeight() / 2 - 70, 400, 140, 'Information', {
main: {
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
@@ -57,13 +57,13 @@ function initInfoDialogGUI() {
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], 255),
},
}, closeInfoDialog);
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created info dialog GUI`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Created info dialog GUI`);
}
// ===========================================================================
function closeInfoDialog() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Closing info dialog`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Closing info dialog`);
infoDialog.window.shown = false;
mexui.setInput(false);
}
@@ -72,7 +72,7 @@ function closeInfoDialog() {
function showInfoGUI(infoMessage, infoTitle, buttonText) {
closeAllWindows();
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing info dialog window. Info: ${infoTitle} - ${infoMessage}`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Showing info dialog window. Info: ${infoTitle} - ${infoMessage}`);
mexui.setInput(true);
infoDialog.messageLabel.text = infoMessage;
infoDialog.okayButton.text = buttonText;

View File

@@ -25,7 +25,7 @@ function initInventoryGUI() {
// ===========================================================================
function closeAllInventoryGUI() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Closing all inventory GUI`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Closing all inventory GUI`);
for (let i in inventoryGUI) {
inventoryGUI[i].window.shown = false;
}
@@ -36,7 +36,7 @@ function closeAllInventoryGUI() {
function showInventoryGUI(inventoryIndex, items) {
closeAllWindows();
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing inventory window. Index: ${inventoryIndex}`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Showing inventory window. Index: ${inventoryIndex}`);
inventoryGUI[inventoryIndex].window.shown = true;
mexui.setInput(true);
}

View File

@@ -25,7 +25,7 @@ function initInventoryBulkGUI() {
// ===========================================================================
function closeAllInventoryBulkGUI() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Closing all bulk inventory GUI`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Closing all bulk inventory GUI`);
for (let i in inventoryBulkGUI) {
inventoryBulkGUI[i].window.shown = false;
}
@@ -36,7 +36,7 @@ function closeAllInventoryBulkGUI() {
function showInventoryBulkGUI(inventoryIndex, items) {
closeAllWindows();
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing bulk inventory window. Index: ${inventoryIndex}`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Showing bulk inventory window. Index: ${inventoryIndex}`);
inventoryBulkGUI[inventoryIndex].window.shown = true;
mexui.setInput(true);
}

View File

@@ -18,7 +18,7 @@ let listDialog = {
// ===========================================================================
function initListGUI() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating list dialog GUI ...`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Creating list dialog GUI ...`);
listDialog.window = mexui.window(game.width / 2 - 200, game.height / 2 - 70, 400, 500, 'List', {
main: {
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
@@ -72,14 +72,14 @@ function initListGUI() {
}
}
});
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created list dialog GUI`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Created list dialog GUI`);
}
// ===========================================================================
function showListGUI() {
closeAllWindows();
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing list window`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Showing list window`);
setChatWindowEnabled(false);
mexui.setInput(true);
listDialog.window.shown = true;

View File

@@ -19,7 +19,7 @@ let flagImageGap = toVector2(5, 5);
// ===========================================================================
function initLocaleChooserGUI() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating locale chooser GUI ...`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Creating locale chooser GUI ...`);
localeChooser.window = mexui.window(game.width / 2 - 200, game.height - 150, 60, 60, 'Choose a language', {
main: {
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], 0),
@@ -39,13 +39,13 @@ function initLocaleChooserGUI() {
localeChooser.window.shown = false;
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created locale chooser GUI`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Created locale chooser GUI`);
}
// ===========================================================================
function closeLocaleChooserGUI() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Closing locale chooser window`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Closing locale chooser window`);
localeChooser.window.shown = false;
for (let i in localeChooser.flagImages) {
localeChooser.flagImages[i].shown = false;
@@ -63,7 +63,7 @@ function showLocaleChooserGUI(position = toVector2(0.0, 0.0)) {
}
//closeAllWindows();
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing locale chooser window`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Showing locale chooser window`);
mexui.setInput(true);
localeChooser.window.shown = true;
@@ -85,14 +85,14 @@ function toggleLocaleChooserGUI() {
// ===========================================================================
function localeChooserSetLocale(localeId) {
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.GUI] Asking server to change locale to ${localeId}`);
logToConsole(LOG_DEBUG | LOG_WARN, `[V.RP.GUI] Asking server to change locale to ${localeId}`);
sendLocaleSelectToServer(localeId);
}
// ===========================================================================
function resetLocaleChooserOptions() {
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.GUI] Resetting locale chooser options`);
logToConsole(LOG_DEBUG | LOG_WARN, `[V.RP.GUI] Resetting locale chooser options`);
// let tempLocaleOptions = getServerData().localeOptions; // getAvailableLocaleOptions();
let tempLocaleOptions = getAvailableLocaleOptions();
@@ -116,7 +116,7 @@ function resetLocaleChooserOptions() {
localeChooser.flagImages[i].shown = false;
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.GUI] Created locale chooser option ${tempLocaleOptions[i].englishName} with image ${imagePath}`);
logToConsole(LOG_DEBUG | LOG_WARN, `[V.RP.GUI] Created locale chooser option ${tempLocaleOptions[i].englishName} with image ${imagePath}`);
//localeChooser.activeRingImages.push(activeRingImage);
}

View File

@@ -42,7 +42,7 @@ let loginHTML =
// ===========================================================================
function initLoginGUI() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating login GUI ...`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Creating login GUI ...`);
login.window = mexui.window(getScreenWidth() / 2 - 150, getScreenHeight() / 2 - 135, 300, 275, 'LOGIN', {
main: {
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
@@ -143,14 +143,14 @@ function initLoginGUI() {
},
});
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created login GUI`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Created login GUI`);
}
// ===========================================================================
function showLoginGUI() {
closeAllWindows();
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing login window`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Showing login window`);
setChatWindowEnabled(false);
mexui.setInput(true);
login.window.shown = true;
@@ -164,14 +164,14 @@ function showLoginGUI() {
// ===========================================================================
function checkLogin() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Checking login with server ...`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Checking login with server ...`);
sendNetworkEventToServer("v.rp.checkLogin", login.passwordInput.lines[0]);
}
// ===========================================================================
function loginFailed(errorMessage) {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports login failed`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Server reports login failed`);
login.messageLabel.text = errorMessage;
login.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
login.passwordInput.text = "";
@@ -180,7 +180,7 @@ function loginFailed(errorMessage) {
// ===========================================================================
function loginSuccess() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports login was successful`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Server reports login was successful`);
guiSubmitKey = false;
closeAllWindows();
}
@@ -189,7 +189,7 @@ function loginSuccess() {
function switchToPasswordResetGUI() {
//closeAllWindows();
//logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing password reset dialog window`);
//logToConsole(LOG_DEBUG, `[V.RP.GUI] Showing password reset dialog window`);
//showResetPasswordGUI();
sendNetworkEventToServer("v.rp.checkResetPassword", "");
return false;

View File

@@ -19,7 +19,7 @@ let newCharacter = {
// ===========================================================================
function initNewCharacterGUI() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating new character GUI ...`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Creating new character GUI ...`);
newCharacter.window = mexui.window(getScreenWidth() / 2 - 150, getScreenHeight() / 2 - 115, 300, 230, 'NEW CHARACTER', {
main: {
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
@@ -110,13 +110,13 @@ function initNewCharacterGUI() {
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
},
}, checkNewCharacter);
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created new character GUI`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Created new character GUI`);
}
// ===========================================================================
function newCharacterFailed(errorMessage) {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports new character creation failed. Reason: ${errorMessage}`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Server reports new character creation failed. Reason: ${errorMessage}`);
newCharacter.messageLabel.text = errorMessage;
newCharacter.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
newCharacter.firstNameInput.text = "";
@@ -134,7 +134,7 @@ function newCharacterFailed(errorMessage) {
// ===========================================================================
function checkNewCharacter() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Checking new character with server ...`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Checking new character with server ...`);
if (newCharacter.firstNameInput.lines[0].length < 2) {
return false;
}
@@ -152,7 +152,7 @@ function checkNewCharacter() {
// ===========================================================================
function showNewCharacterGUI() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing new character window`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Showing new character window`);
closeAllWindows();
setChatWindowEnabled(false);
mexui.setInput(true);

View File

@@ -20,7 +20,7 @@ let register = {
// ===========================================================================
function initRegisterGUI() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating register GUI ...`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Creating register GUI ...`);
register.window = mexui.window(getScreenWidth() / 2 - 150, getScreenHeight() / 2 - 150, 300, 300, 'Register', {
main: {
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
@@ -130,13 +130,13 @@ function initRegisterGUI() {
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
},
}, checkRegistration);
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created register GUI`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Created register GUI`);
}
// ===========================================================================
function registrationFailed(errorMessage) {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports registration failed. Reason: ${errorMessage}`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Server reports registration failed. Reason: ${errorMessage}`);
register.messageLabel.text = errorMessage;
register.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
register.passwordInput.text = "";
@@ -147,14 +147,14 @@ function registrationFailed(errorMessage) {
// ===========================================================================
function checkRegistration() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Checking registration with server ...`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Checking registration with server ...`);
sendNetworkEventToServer("v.rp.checkRegistration", register.passwordInput.lines[0], register.confirmPasswordInput.lines[0], register.emailInput.lines[0]);
}
// ===========================================================================
function showRegistrationGUI() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing registration window`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Showing registration window`);
closeAllWindows();
setChatWindowEnabled(false);
mexui.setInput(true);
@@ -170,7 +170,7 @@ function showRegistrationGUI() {
// ===========================================================================
function registrationSuccess() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports registration was successful`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Server reports registration was successful`);
guiSubmitKey = false;
closeAllWindows();
}

View File

@@ -20,7 +20,7 @@ let passwordReset = {
// ===========================================================================
function initResetPasswordGUI() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating password reset GUI ...`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Creating password reset GUI ...`);
passwordReset.window = mexui.window(getScreenWidth() / 2 - 150, getScreenHeight() / 2 - 135, 300, 275, 'RESET PASSWORD', {
main: {
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
@@ -120,14 +120,14 @@ function initResetPasswordGUI() {
},
});
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created password reset GUI`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Created password reset GUI`);
}
// ===========================================================================
function showResetPasswordGUI() {
closeAllWindows();
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing password reset window`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Showing password reset window`);
setChatWindowEnabled(false);
mexui.setInput(true);
passwordReset.window.shown = true;
@@ -141,14 +141,14 @@ function showResetPasswordGUI() {
// ===========================================================================
function checkResetPassword() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Checking password reset with server (${passwordReset.emailInput.lines[0]}) ...`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Checking password reset with server (${passwordReset.emailInput.lines[0]}) ...`);
sendNetworkEventToServer("v.rp.checkResetPassword", passwordReset.emailInput.lines[0]);
}
// ===========================================================================
function resetPasswordFailed(errorMessage) {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports password reset failed`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Server reports password reset failed`);
passwordReset.messageLabel.text = errorMessage;
passwordReset.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
passwordReset.emailInput.text = "";
@@ -157,7 +157,7 @@ function resetPasswordFailed(errorMessage) {
// ===========================================================================
function resetPasswordCodeInputGUI() {
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.GUI] Server reports password reset email confirmation was successful. Asking for code ...`);
logToConsole(LOG_DEBUG | LOG_WARN, `[V.RP.GUI] Server reports password reset email confirmation was successful. Asking for code ...`);
closeAllWindows();
passwordReset.messageLabel.text = getLocaleString("GUIResetPasswordCodeInputLabel");
@@ -172,7 +172,7 @@ function resetPasswordCodeInputGUI() {
// ===========================================================================
function resetPasswordEmailInputGUI() {
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.GUI] Server reports password reset request was approved. Asking for email ...`);
logToConsole(LOG_DEBUG | LOG_WARN, `[V.RP.GUI] Server reports password reset request was approved. Asking for email ...`);
closeAllWindows();
passwordReset.messageLabel.text = getLocaleString("GUIResetPasswordConfirmEmailLabel");

View File

@@ -18,7 +18,7 @@ let yesNoDialog = {
// ===========================================================================
function initYesNoDialogGUI() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created prompt GUI ...`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Created prompt GUI ...`);
yesNoDialog.window = mexui.window(game.width / 2 - 200, game.height / 2 - 70, 400, 140, 'Question', {
main: {
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
@@ -73,14 +73,14 @@ function initYesNoDialogGUI() {
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], 255),
},
}, yesNoDialogAnswerNo);
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created prompt GUI`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Created prompt GUI`);
}
// ===========================================================================
function showYesNoPromptGUI(promptMessage, promptTitle, yesButtonText, noButtonText) {
closeAllWindows();
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing prompt window. Prompt: ${promptTitle} - ${promptMessage}`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Showing prompt window. Prompt: ${promptTitle} - ${promptMessage}`);
mexui.setInput(true);
yesNoDialog.messageLabel.text = "";
@@ -99,7 +99,7 @@ function showYesNoPromptGUI(promptMessage, promptTitle, yesButtonText, noButtonT
// ===========================================================================
function yesNoDialogAnswerNo() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Responding with answer NO to server prompt`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Responding with answer NO to server prompt`);
sendNetworkEventToServer("v.rp.promptAnswerNo");
closeAllWindows();
}
@@ -107,7 +107,7 @@ function yesNoDialogAnswerNo() {
// ===========================================================================
function yesNoDialogAnswerYes() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Responding with answer YES to server prompt`);
logToConsole(LOG_DEBUG, `[V.RP.GUI] Responding with answer YES to server prompt`);
sendNetworkEventToServer("v.rp.promptAnswerYes");
closeAllWindows();
}

View File

@@ -8,7 +8,7 @@
// ===========================================================================
class HouseData {
constructor(houseId, description, entrancePosition, blipModel, pickupModel, hasInterior) {
constructor(houseId, description, entrancePosition, blipModel, pickupModel, hasInterior, locked) {
this.index = -1;
this.houseId = houseId;
this.description = description;
@@ -19,16 +19,32 @@ class HouseData {
this.rentPrice = 0;
this.buyPrice = 0;
this.blipId = -1;
this.locked = false;
this.locked = locked;
}
}
// ===========================================================================
function receiveHouseFromServer(houseId, description, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked) {
logToConsole(LOG_DEBUG, `[AGRP.House] Received house ${houseId} (${name}) from server`);
function initHouseScript() {
logToConsole(LOG_DEBUG, "[V.RP.House]: Initializing house script ...");
logToConsole(LOG_DEBUG, "[V.RP.House]: House script initialized!");
}
// ===========================================================================
function receiveHouseFromServer(houseId, isDeleted, description, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked) {
logToConsole(LOG_DEBUG, `[V.RP.House] Received house ${houseId} (${description}) from server`);
if (!areServerElementsSupported() || getGame() == V_GAME_MAFIA_ONE || getGame() == V_GAME_GTA_IV) {
if (isDeleted == true) {
if (getGame() == V_GAME_GTA_IV) {
natives.removeBlipAndClearIndex(getHouseData(houseId).blipId);
}
getServerData().houses.splice(houseId, 1);
return false;
}
if (getHouseData(houseId) != false) {
let houseData = getHouseData(houseId);
houseData.description = description;
@@ -46,14 +62,18 @@ function receiveHouseFromServer(houseId, description, entrancePosition, blipMode
if (houseData.rentPrice > 0) {
houseData.labelInfoType = V_PROPLABEL_INFO_RENTHOUSE;
} else {
houseData.labelInfoType = V_PROPLABEL_INFO_ENTER;
if (houseData.hasInterior) {
houseData.labelInfoType = V_PROPLABEL_INFO_ENTER;
} else {
houseData.labelInfoType = V_PROPLABEL_INFO_NONE;
}
}
}
logToConsole(LOG_DEBUG, `[AGRP.House] House ${houseId} already exists. Checking blip ...`);
logToConsole(LOG_DEBUG, `[V.RP.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`);
logToConsole(LOG_DEBUG, `[V.RP.House] House ${houseId}'s blip has been removed by the server`);
if (getGame() == V_GAME_GTA_IV) {
natives.removeBlipAndClearIndex(getHouseData(houseId).blipId);
} else {
@@ -61,11 +81,11 @@ function receiveHouseFromServer(houseId, description, entrancePosition, blipMode
}
houseData.blipId = -1;
} else {
logToConsole(LOG_DEBUG, `[AGRP.House] House ${houseId}'s blip is unchanged`);
logToConsole(LOG_DEBUG, `[V.RP.House] House ${houseId}'s blip is unchanged`);
}
} else {
if (houseData.blipId != -1) {
logToConsole(LOG_DEBUG, `[AGRP.House] House ${houseId}'s blip has been changed by the server`);
logToConsole(LOG_DEBUG, `[V.RP.House] House ${houseId}'s blip has been changed by the server`);
if (getGame() == V_GAME_GTA_IV) {
natives.setBlipCoordinates(houseData.blipId, houseData.entrancePosition);
natives.changeBlipSprite(houseData.blipId, houseData.blipModel);
@@ -78,20 +98,20 @@ function receiveHouseFromServer(houseId, description, entrancePosition, blipMode
if (blipId != -1) {
houseData.blipId = blipId;
}
logToConsole(LOG_DEBUG, `[AGRP.House] House ${houseId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
logToConsole(LOG_DEBUG, `[V.RP.House] House ${houseId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
}
}
} else {
logToConsole(LOG_DEBUG, `[AGRP.House] House ${houseId} doesn't exist. Adding ...`);
let tempHouseData = new HouseData(houseId, description, entrancePosition, blipModel, pickupModel, hasInterior);
logToConsole(LOG_DEBUG, `[V.RP.House] House ${houseId} doesn't exist. Adding ...`);
let tempHouseData = new HouseData(houseId, description, entrancePosition, blipModel, pickupModel, hasInterior, locked);
if (blipModel != -1) {
let blipId = createGameBlip(tempHouseData.blipModel, tempHouseData.entrancePosition, "House");
if (blipId != -1) {
tempHouseData.blipId = blipId;
}
logToConsole(LOG_DEBUG, `[AGRP.House] House ${houseId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
logToConsole(LOG_DEBUG, `[V.RP.House] House ${houseId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
} else {
logToConsole(LOG_DEBUG, `[AGRP.House] House ${houseId} has no blip.`);
logToConsole(LOG_DEBUG, `[V.RP.House] House ${houseId} has no blip.`);
}
getServerData().houses.push(tempHouseData);
setAllHouseDataIndexes();
@@ -124,4 +144,10 @@ function setAllHouseDataIndexes() {
}
}
// ===========================================================================
function removeHousesFromClient() {
getServerData().houses.splice(0);
}
// ===========================================================================

59
scripts/client/hud.js Normal file
View File

@@ -0,0 +1,59 @@
// ===========================================================================
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: hud.js
// DESC: Provides custom HUD functions and usage
// TYPE: Client (JavaScript)
// ===========================================================================
let customHUDMoneyFont = null;
let customHUDMoneyColour = toColour(255, 255, 255, 255);
let customHUDMoneySize = 22.0;
// ===========================================================================
function initCustomHUDScript() {
logToConsole(LOG_DEBUG, "[V.RP.HUD]: Initializing HUD script ...");
customHUDMoneyFont = initCustomHUDMoneyFont();
logToConsole(LOG_DEBUG, "[V.RP.HUD]: HUD script initialized!");
}
// ===========================================================================
function processCustomHUDRendering() {
logToConsole(LOG_VERBOSE, "[V.RP.HUD]: Processing custom HUD rendering ...");
if (renderHUD == false) {
return false;
}
if (getGame() == V_GAME_MAFIA_ONE) {
if (customHUDMoneyFont != null) {
let text = getCurrencyString(localPlayerMoney);
logToConsole(LOG_VERBOSE, `[V.RP.HUD]: Rendering custom HUD money (${text})...`);
customHUDMoneyFont.render(text, [game.width - 150, 20], 130, 1.0, 0.0, customHUDMoneyFont.size, customHUDMoneyColour, true, true, false, true);
//graphics.drawRectangle()
} else {
logToConsole(LOG_VERBOSE | LOG_ERROR, `[V.RP.HUD]: Rendering custom HUD money FAILED. Font object is null!`);
}
}
}
// ===========================================================================
function initCustomHUDMoneyFont() {
logToConsole(LOG_DEBUG, "[V.RP.HUD]: Loading custom HUD money font ...");
let tempFont = null;
let fontStream = openFile("files/fonts/aurora-bold-condensed.ttf");
if (fontStream != null) {
tempFont = lucasFont.createFont(fontStream, customHUDMoneySize);
logToConsole(LOG_DEBUG, "[V.RP.HUD]: Custom HUD money font loaded successfully!");
} else {
logToConsole(LOG_DEBUG | LOG_ERROR, "[V.RP.HUD]: Loading custom HUD money font FAILED. Font file stream is null!");
}
return tempFont;
}
// ===========================================================================

View File

@@ -47,7 +47,7 @@ function processItemActionRendering() {
// ===========================================================================
function updatePlayerHotBar(activeSlot, itemsArray) {
logToConsole(LOG_DEBUG, `[AGRP.Main] Updating hotbar`);
logToConsole(LOG_DEBUG, `[V.RP.Main] Updating hotbar`);
}
// ===========================================================================

View File

@@ -7,10 +7,17 @@
// TYPE: Client (JavaScript)
// ===========================================================================
let localPlayerJobType = 0;
let localPlayerJobType = -1;
let localPlayerWorking = false;
let jobRouteLocationBlip = null;
let jobRouteLocationSphere = null;
let jobRouteLocationRadius = 5.0;
let jobRouteLocationIndicatorPosition = toVector3(0.0, 0.0, 0.0);
let jobRouteLocationIndicatorSize = toVector2(32, 32);
let jobRouteLocationIndicatorEnabled = false;
let jobRouteLocationIndicatorImagePath = "files/images/icons/objective-icon.png";
let jobRouteLocationIndicatorImage = null;
let jobBlipBlinkAmount = 0;
let jobBlipBlinkTimes = 10;
@@ -36,27 +43,41 @@ class JobData {
function initJobScript() {
logToConsole(LOG_DEBUG, "[V.RP.Job]: Initializing job script ...");
jobRouteLocationIndicatorImage = loadJobRouteLocationIndicatorImage();
logToConsole(LOG_DEBUG, "[V.RP.Job]: Job script initialized!");
}
// ===========================================================================
function loadJobRouteLocationIndicatorImage() {
let imageStream = openFile(jobRouteLocationIndicatorImagePath);
let tempImage = null;
if (imageStream != null) {
tempImage = graphics.loadPNG(imageStream);
imageStream.close();
}
return tempImage;
}
// ===========================================================================
function setLocalPlayerJobType(tempJobType) {
logToConsole(LOG_DEBUG, `[AGRP.Job] Set local player job type to ${tempJobType}`);
logToConsole(LOG_DEBUG, `[V.RP.Job] Set local player job type to ${tempJobType}`);
localPlayerJobType = tempJobType;
}
// ===========================================================================
function setLocalPlayerWorkingState(tempWorking) {
logToConsole(LOG_DEBUG, `[AGRP.Job] Setting working state to ${tempWorking}`);
logToConsole(LOG_DEBUG, `[V.RP.Job] Setting working state to ${tempWorking}`);
localPlayerWorking = tempWorking;
}
// ===========================================================================
function showJobRouteLocation(position, colour) {
logToConsole(LOG_DEBUG, `[AGRP.Job] Showing job route location at ${position.x}, ${position.y}, ${position.z}`);
logToConsole(LOG_DEBUG, `[V.RP.Job] Showing job route location at ${position.x}, ${position.y}, ${position.z}`);
hideJobRouteLocation();
if (getMultiplayerMod() == V_MPMOD_GTAC) {
if (getGame() == V_GAME_GTA_SA) {
@@ -75,12 +96,17 @@ function showJobRouteLocation(position, colour) {
blinkJobRouteLocationBlip(10, position, colour);
jobRouteLocationBlip = game.createBlip(position, 0, 2, colour);
}
if (getGame() == V_GAME_MAFIA_ONE) {
jobRouteLocationIndicatorPosition = position;
jobRouteLocationIndicatorEnabled = true;
}
}
// ===========================================================================
function enteredJobRouteSphere() {
logToConsole(LOG_DEBUG, `[AGRP.Job] Entered job route sphere`);
logToConsole(LOG_DEBUG, `[V.RP.Job] Entered job route sphere`);
hideJobRouteLocation();
tellServerPlayerArrivedAtJobRouteLocation();
}
@@ -114,32 +140,48 @@ function blinkJobRouteLocationBlip(times, position, colour) {
// ===========================================================================
function hideJobRouteLocation() {
logToConsole(LOG_DEBUG, `[AGRP.Job] Hiding job route location`);
logToConsole(LOG_DEBUG, `[V.RP.Job] Hiding job route location`);
if (jobRouteLocationBlip != null) {
destroyElement(jobRouteLocationBlip);
jobRouteLocationBlip = null;
if (isGameFeatureSupported("blip")) {
if (jobRouteLocationBlip != null) {
destroyElement(jobRouteLocationBlip);
jobRouteLocationBlip = null;
}
if (jobRouteLocationSphere != null) {
destroyElement(jobRouteLocationSphere);
jobRouteLocationSphere = null;
}
if (jobBlipBlinkTimer != null) {
clearInterval(jobBlipBlinkTimer);
}
jobBlipBlinkAmount = 0;
jobBlipBlinkTimes = 0;
}
if (jobRouteLocationSphere != null) {
destroyElement(jobRouteLocationSphere);
jobRouteLocationSphere = null;
if (getGame() == V_GAME_MAFIA_ONE) {
jobRouteLocationIndicatorPosition = toVector3(0.0, 0.0, 0.0);
jobRouteLocationIndicatorEnabled = false;
}
if (jobBlipBlinkTimer != null) {
clearInterval(jobBlipBlinkTimer);
}
jobBlipBlinkAmount = 0;
jobBlipBlinkTimes = 0;
}
// ===========================================================================
function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, pickupModel) {
logToConsole(LOG_DEBUG, `[AGRP.Job] Received job ${jobId} (${name}) from server`);
function receiveJobFromServer(jobId, isDeleted, jobLocationId, name, position, blipModel, pickupModel) {
logToConsole(LOG_DEBUG, `[V.RP.Job] Received job ${jobId} (${name}) from server`);
if (!areServerElementsSupported() || getGame() == V_GAME_MAFIA_ONE || getGame() == V_GAME_GTA_IV) {
if (isDeleted == true) {
if (getGame() == V_GAME_GTA_IV) {
natives.removeBlipAndClearIndex(getJobData(jobId).blipId);
}
getServerData().jobs.splice(jobs, 1);
return false;
}
if (getJobData(jobId) != false) {
let jobData = getJobData(jobId);
jobData.jobLocationId = jobLocationId;
@@ -148,10 +190,10 @@ function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, p
jobData.blipModel = blipModel;
jobData.pickupModel = pickupModel;
logToConsole(LOG_DEBUG, `[AGRP.Job] Job ${jobId} already exists. Checking blip ...`);
logToConsole(LOG_DEBUG, `[V.RP.Job] Job ${jobId} already exists. Checking blip ...`);
if (blipModel == -1) {
if (jobData.blipId != -1) {
logToConsole(LOG_DEBUG, `[AGRP.Job] Job ${jobId}'s blip has been removed by the server`);
logToConsole(LOG_DEBUG, `[V.RP.Job] Job ${jobId}'s blip has been removed by the server`);
if (getGame() == V_GAME_GTA_IV) {
natives.removeBlipAndClearIndex(getJobData(jobId).blipId);
} else {
@@ -159,11 +201,11 @@ function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, p
}
jobData.blipId = -1;
} else {
logToConsole(LOG_DEBUG, `[AGRP.Job] Job ${jobId}'s blip is unchanged`);
logToConsole(LOG_DEBUG, `[V.RP.Job] Job ${jobId}'s blip is unchanged`);
}
} else {
if (jobData.blipId != -1) {
logToConsole(LOG_DEBUG, `[AGRP.Job] Job ${jobId}'s blip has been changed by the server`);
logToConsole(LOG_DEBUG, `[V.RP.Job] Job ${jobId}'s blip has been changed by the server`);
if (getGame() == V_GAME_GTA_IV) {
natives.setBlipCoordinates(jobData.blipId, jobData.position);
natives.changeBlipSprite(jobData.blipId, jobData.blipModel);
@@ -176,20 +218,20 @@ function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, p
if (blipId != -1) {
jobData.blipId = blipId;
}
logToConsole(LOG_DEBUG, `[AGRP.Job] Job ${jobId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
logToConsole(LOG_DEBUG, `[V.RP.Job] Job ${jobId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
}
}
} else {
logToConsole(LOG_DEBUG, `[AGRP.Job] Job ${jobId} doesn't exist. Adding ...`);
logToConsole(LOG_DEBUG, `[V.RP.Job] Job ${jobId} doesn't exist. Adding ...`);
let tempJobData = new JobData(jobId, jobLocationId, name, position, blipModel, pickupModel);
if (blipModel != -1) {
let blipId = createGameBlip(blipModel, tempJobData.position, tempJobData.name);
if (blipId != -1) {
tempJobData.blipId = blipId;
}
logToConsole(LOG_DEBUG, `[AGRP.Job] Job ${jobId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
logToConsole(LOG_DEBUG, `[V.RP.Job] Job ${jobId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
} else {
logToConsole(LOG_DEBUG, `[AGRP.Job] Job ${jobId} has no blip.`);
logToConsole(LOG_DEBUG, `[V.RP.Job] Job ${jobId} has no blip.`);
}
getServerData().jobs.push(tempJobData);
setAllJobDataIndexes();
@@ -217,7 +259,54 @@ function getJobData(jobId) {
function setAllJobDataIndexes() {
for (let i in getServerData().jobs) {
jobs[i].index = i;
getServerData().jobs[i].index = i;
}
}
// ===========================================================================
function removeJobsFromClient() {
getServerData().jobs.splice(0);
}
// ===========================================================================
function processJobLocationIndicatorRendering() {
if (jobRouteLocationIndicatorImage == null) {
logToConsole(LOG_VERBOSE, `[V.RP.Job]: Can't render job location indicator. Image is null.`);
return false;
}
if (getGame() != V_GAME_MAFIA_ONE) {
logToConsole(LOG_VERBOSE, `[V.RP.Job]: Can't render job location indicator. Unsupported game.`);
return false;
}
if (!jobRouteLocationIndicatorEnabled) {
logToConsole(LOG_VERBOSE, `[V.RP.Job]: Can't render job location indicator. Disabled`);
return false;
}
let screenPosition = getScreenFromWorldPosition(jobRouteLocationIndicatorPosition);
screenPosition = fixOffScreenPosition(screenPosition, jobRouteLocationIndicatorSize);
graphics.drawRectangle(jobRouteLocationIndicatorImage, [screenPosition.x - (jobRouteLocationIndicatorSize.x / 2), screenPosition.y - (jobRouteLocationIndicatorSize.y / 2)], [jobRouteLocationIndicatorSize.x, jobRouteLocationIndicatorSize.y]);
}
// ===========================================================================
function processJobRouteLocationDistance() {
if (getGame() != V_GAME_MAFIA_ONE) {
return false;
}
if (jobRouteLocationIndicatorEnabled == false) {
return false;
}
if (getDistance(getLocalPlayerPosition(), jobRouteLocationIndicatorPosition) <= jobRouteLocationRadius) {
logToConsole(LOG_DEBUG, `[V.RP.Job] Reached job route location`);
hideJobRouteLocation();
tellServerPlayerArrivedAtJobRouteLocation();
}
}

View File

@@ -23,7 +23,7 @@ function initKeyBindScript() {
// ===========================================================================
function bindAccountKey(key, keyState) {
logToConsole(LOG_DEBUG, `[AGRP.KeyBind]: Binded key ${toUpperCase(getKeyNameFromId(key))} (${key})`);
logToConsole(LOG_DEBUG, `[V.RP.KeyBind]: Binded key ${toUpperCase(getKeyNameFromId(key))} (${key})`);
keyBinds.push(toInteger(key));
bindKey(toInteger(key), keyState, function (event) {
if (isAnyGUIActive()) {
@@ -32,14 +32,14 @@ function bindAccountKey(key, keyState) {
if (hasKeyBindDelayElapsed()) {
if (canLocalPlayerUseKeyBinds()) {
logToConsole(LOG_DEBUG, `[AGRP.KeyBind]: Using keybind for key ${toUpperCase(getKeyNameFromId(key))} (${key})`);
logToConsole(LOG_DEBUG, `[V.RP.KeyBind]: Using keybind for key ${toUpperCase(getKeyNameFromId(key))} (${key})`);
lastKeyBindUse = sdl.ticks;
tellServerPlayerUsedKeyBind(key);
} else {
logToConsole(LOG_DEBUG, `[AGRP.KeyBind]: Failed to use keybind for key ${toUpperCase(getKeyNameFromId(key))} (${key}) - Not allowed to use keybinds!`);
logToConsole(LOG_DEBUG, `[V.RP.KeyBind]: Failed to use keybind for key ${toUpperCase(getKeyNameFromId(key))} (${key}) - Not allowed to use keybinds!`);
}
} else {
logToConsole(LOG_DEBUG, `[AGRP.KeyBind]: Failed to use keybind for key ${toUpperCase(getKeyNameFromId(key))} (${key}) - Not enough time has passed since last keybind use!`);
logToConsole(LOG_DEBUG, `[V.RP.KeyBind]: Failed to use keybind for key ${toUpperCase(getKeyNameFromId(key))} (${key}) - Not enough time has passed since last keybind use!`);
}
});
}
@@ -47,7 +47,7 @@ function bindAccountKey(key, keyState) {
// ===========================================================================
function unBindAccountKey(key) {
logToConsole(LOG_DEBUG, `[AGRP.KeyBind]: Unbinded key ${toUpperCase(getKeyNameFromId(key))} (${key})`);
logToConsole(LOG_DEBUG, `[V.RP.KeyBind]: Unbinded key ${toUpperCase(getKeyNameFromId(key))} (${key})`);
unbindKey(key);
keyBinds.splice(keyBinds.indexOf(key), 1);
return true;

View File

@@ -13,7 +13,7 @@ let jobLabels = [];
let propertyLabelNameFont = null;
let propertyLabelLockedFont = null;
let propertyLabelHeight = (getGame() == V_GAME_MAFIA_ONE) ? 2.0 : 1.0;
let propertyLabelHeight = (getGame() == V_GAME_MAFIA_ONE) ? 1.75 : 1.0;
let propertyPickupRenderDistance = 75.0;
let propertyLabelRenderDistance = 5.0;
let propertyLabelLockedOffset = 16;
@@ -27,6 +27,20 @@ let unlockedColour = toColour(50, 205, 50, 255);
let lockedColour = toColour(205, 92, 92, 255);
let jobHelpColour = toColour(234, 198, 126, 255);
let businessWorldIconPath = "files/images/icons/business-icon.png";
let jobWorldIconPath = "files/images/icons/job-icon.png";
let houseWorldIconPath = "files/images/icons/house-icon.png";
let businessWorldIconImage = null;
let jobWorldIconImage = null;
let houseWorldIconImage = null;
let businessWorldIconSize = [64, 64];
let jobWorldIconSize = [64, 64];
let houseWorldIconSize = [64, 64];
let worldIconRenderDistance = 15.0;
let businessWorldIconRenderDistance = worldIconRenderDistance;
let houseWorldIconRenderDistance = worldIconRenderDistance;
let jobWorldIconRenderDistance = worldIconRenderDistance;
// ===========================================================================
function initLabelScript() {
@@ -35,6 +49,10 @@ function initLabelScript() {
propertyLabelLockedFont = initLabelPropertyLockedFont();
jobNameLabelFont = initLabelJobNameFont();
jobHelpLabelFont = initLabelJobHelpFont();
businessWorldIconImage = initBusinessWorldIcon();
jobWorldIconImage = initJobWorldIcon();
houseWorldIconImage = initHouseWorldIcon();
logToConsole(LOG_DEBUG, "[V.RP.Label]: Label script initialized!");
}
@@ -64,6 +82,45 @@ function initLabelJobHelpFont() {
// ===========================================================================
function initBusinessWorldIcon() {
let imageStream = openFile(businessWorldIconPath);
let tempImage = null;
if (imageStream != null) {
tempImage = graphics.loadPNG(imageStream);
imageStream.close();
}
return tempImage;
}
// ===========================================================================
function initJobWorldIcon() {
let imageStream = openFile(jobWorldIconPath);
let tempImage = null;
if (imageStream != null) {
tempImage = graphics.loadPNG(imageStream);
imageStream.close();
}
return tempImage;
}
// ===========================================================================
function initHouseWorldIcon() {
let imageStream = openFile(houseWorldIconPath);
let tempImage = null;
if (imageStream != null) {
tempImage = graphics.loadPNG(imageStream);
imageStream.close();
}
return tempImage;
}
// ===========================================================================
function renderPropertyEntranceLabel(name, position, locked, isBusiness, price, rentPrice, labelInfoType, fee) {
if (localPlayer == null) {
return false;
@@ -77,6 +134,12 @@ function renderPropertyEntranceLabel(name, position, locked, isBusiness, price,
return false;
}
if (getGame() == V_GAME_MAFIA_ONE) {
if (localPlayer.vehicle != null) {
return false;
}
}
if (getGame() == V_GAME_GTA_IV) {
if (!natives.doesViewportExist(natives.getGameViewportId())) {
logToConsole(LOG_INFO, "[V.RP.Label]: Game viewport does not exist!");
@@ -97,7 +160,7 @@ function renderPropertyEntranceLabel(name, position, locked, isBusiness, price,
screenPosition = getScreenFromWorldPosition(position);
}
logToConsole(LOG_VERBOSE, `[AGRP.Label] World [${position.x}, ${position.y}, ${position.z}] to screen [${screenPosition.x}, ${screenPosition.y}, ${screenPosition.z}]`);
logToConsole(LOG_VERBOSE, `[V.RP.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;
@@ -140,7 +203,7 @@ function renderPropertyEntranceLabel(name, position, locked, isBusiness, price,
let infoText = "";
switch (labelInfoType) {
case V_PROPLABEL_INFO_ENTER: {
if (enterPropertyKey) {
if (enterPropertyKey != null) {
infoText = getLocaleString("PropertyEnterKeyPressLabel", toUpperCase(getKeyNameFromId(enterPropertyKey)));
} else {
infoText = getLocaleString("PropertyEnterCommandLabel", "/enter");
@@ -174,7 +237,7 @@ function renderPropertyEntranceLabel(name, position, locked, isBusiness, price,
}
default: {
if (enterPropertyKey) {
if (enterPropertyKey != null) {
infoText = getLocaleString("PropertyEnterKeyPressLabel", toUpperCase(getKeyNameFromId(enterPropertyKey)));
} else {
infoText = getLocaleString("PropertyEnterCommandLabel", "/enter");
@@ -218,6 +281,12 @@ function renderPropertyExitLabel(position) {
return false;
}
if (getGame() == V_GAME_MAFIA_ONE) {
if (localPlayer.vehicle != null) {
return false;
}
}
if (getGame() == V_GAME_GTA_IV) {
if (!natives.doesViewportExist(natives.getGameViewportId())) {
logToConsole(LOG_INFO, "[V.RP.Label]: Game viewport does not exist!");
@@ -230,17 +299,12 @@ function renderPropertyExitLabel(position) {
}
}
let tempPosition = position;
tempPosition.z = tempPosition.z + propertyLabelHeight;
position = getPosAbovePos(position, propertyLabelHeight);
let screenPosition = new Vec3(0.0, 0.0, 0.0);
if (getGame() == V_GAME_GTA_IV) {
screenPosition = natives.getViewportPositionOfCoord(tempPosition, natives.getGameViewportId());
screenPosition = natives.getViewportPositionOfCoord(position, natives.getGameViewportId());
} else {
screenPosition = getScreenFromWorldPosition(tempPosition);
}
if (screenPosition.x < 0 || screenPosition.x > game.width) {
return false;
screenPosition = getScreenFromWorldPosition(position);
}
let text = "EXIT";
@@ -263,6 +327,12 @@ function renderJobLabel(name, position, jobType) {
return false;
}
if (getGame() == V_GAME_MAFIA_ONE) {
if (localPlayer.vehicle != null) {
return false;
}
}
if (getGame() == V_GAME_GTA_IV) {
if (!natives.doesViewportExist(natives.getGameViewportId())) {
logToConsole(LOG_INFO, "[V.RP.Label]: Game viewport does not exist!");
@@ -275,15 +345,16 @@ function renderJobLabel(name, position, jobType) {
}
}
let tempPosition = position;
tempPosition.z = tempPosition.z + propertyLabelHeight;
position = getPosAbovePos(position, propertyLabelHeight);
let screenPosition = new Vec3(0.0, 0.0, 0.0);
if (getGame() == V_GAME_GTA_IV) {
screenPosition = natives.getViewportPositionOfCoord(tempPosition, natives.getGameViewportId());
screenPosition = natives.getViewportPositionOfCoord(position, natives.getGameViewportId());
} else {
screenPosition = getScreenFromWorldPosition(tempPosition);
screenPosition = getScreenFromWorldPosition(position);
}
logToConsole(LOG_VERBOSE, `[V.RP.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;
}
@@ -296,7 +367,7 @@ function renderJobLabel(name, position, jobType) {
text = getLocaleString("StartWorkLabel", "/startwork");
}
} else {
if (localPlayerJobType == 0) {
if (localPlayerJobType == -1) {
text = getLocaleString("TakeJobLabel", "/takejob");
} else {
text = getLocaleString("NotYourJobLabel", "/quitjob");
@@ -316,48 +387,69 @@ function renderJobLabel(name, position, jobType) {
// -------------------------------------------------------------------------
function processLabelRendering() {
if (getGame() == V_GAME_MAFIA_ONE) {
if (localPlayer.vehicle != null) {
return false;
}
}
if (renderLabels) {
if (!areServerElementsSupported() || getGame() == V_GAME_MAFIA_ONE || getGame() == V_GAME_GTA_IV || getGame() == V_GAME_GTA_IV_EFLC) {
if (localPlayer != null) {
getServerData().businesses.forEach((business) => {
if (getDistance(localPlayer.position, business.entrancePosition) <= propertyPickupRenderDistance) {
let distance = getDistance(localPlayer.position, business.entrancePosition);
if (distance <= propertyLabelRenderDistance) {
if (getGame() == V_GAME_GTA_IV || getGame() == V_GAME_GTA_IV_EFLC) {
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);
renderPropertyEntranceLabel(business.name, business.entrancePosition, business.locked, true, business.buyPrice, business.rentPrice, business.labelInfoType, business.entranceFee);
}
if (distance <= businessWorldIconRenderDistance) {
if (getGame() == V_GAME_MAFIA_ONE && localPlayer.vehicle == null) {
renderBusinessWorldIcon(getPosAbovePos(business.entrancePosition, 1.0));
}
}
});
getServerData().houses.forEach((house) => {
if (getDistance(localPlayer.position, house.entrancePosition) <= propertyPickupRenderDistance) {
let distance = getDistance(localPlayer.position, house.entrancePosition);
if (distance <= propertyLabelRenderDistance) {
if (getGame() == V_GAME_GTA_IV || getGame() == V_GAME_GTA_IV_EFLC) {
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);
renderPropertyEntranceLabel(house.description, house.entrancePosition, house.locked, true, house.buyPrice, house.rentPrice, house.labelInfoType);
}
if (distance <= houseWorldIconRenderDistance) {
if (getGame() == V_GAME_MAFIA_ONE && localPlayer.vehicle == null) {
renderHouseWorldIcon(getPosAbovePos(house.entrancePosition, 1.0));
}
}
});
getServerData().jobs.forEach((job) => {
if (getDistance(localPlayer.position, job.position) <= propertyPickupRenderDistance) {
let distance = getDistance(localPlayer.position, job.position);
if (distance <= propertyLabelRenderDistance) {
if (getGame() == V_GAME_GTA_IV || getGame() == V_GAME_GTA_IV_EFLC) {
natives.drawColouredCylinder(getPosBelowPos(job.position, 1.0), 0.0, 0.0, 255, 255, 0, 255);
}
renderJobLabel(job.name, job.position, job.jobId);
}
if (getDistance(localPlayer.position, job.position) <= 5.0) {
renderJobLabel(job.name, job.position, job.jobType);
if (distance <= jobWorldIconRenderDistance) {
if (getGame() == V_GAME_MAFIA_ONE && localPlayer.vehicle == null) {
renderJobWorldIcon(getPosAbovePos(job.position, 1.0));
}
}
});
}
}
if (areWorldLabelsSupported()) {
if (arePickupsSupported() && areWorldLabelsSupported()) {
if (localPlayer != null) {
let pickups = getElementsByType(ELEMENT_PICKUP);
for (let i in pickups) {
@@ -415,4 +507,55 @@ function processLabelRendering() {
}
}
// -------------------------------------------------------------------------
function renderJobWorldIcon(position) {
if (jobWorldIconImage == null) {
logToConsole(LOG_VERBOSE, `[V.RP.Label]: Can't render job world icon. Image is null.`);
return false;
}
if (getGame() != V_GAME_MAFIA_ONE) {
logToConsole(LOG_VERBOSE, `[V.RP.Label]: Can't render job world icon. Unsupported game.`);
return false;
}
let screenPosition = getScreenFromWorldPosition(position);
graphics.drawRectangle(jobWorldIconImage, [screenPosition.x - (jobWorldIconSize[0] / 2), screenPosition.y - (jobWorldIconSize[1] / 2)], [jobWorldIconSize[0], jobWorldIconSize[1]]);
}
// -------------------------------------------------------------------------
function renderBusinessWorldIcon(position) {
if (businessWorldIconImage == null) {
logToConsole(LOG_VERBOSE, `[V.RP.Label]: Can't render business world icon. Image is null.`);
return false;
}
if (getGame() != V_GAME_MAFIA_ONE) {
logToConsole(LOG_VERBOSE, `[V.RP.Label]: Can't render business world icon. Unsupported game.`);
return false;
}
let screenPosition = getScreenFromWorldPosition(position);
graphics.drawRectangle(businessWorldIconImage, [screenPosition.x - (businessWorldIconSize[0] / 2), screenPosition.y - (businessWorldIconSize[1] / 2)], [businessWorldIconSize[0], businessWorldIconSize[1]]);
}
// -------------------------------------------------------------------------
function renderHouseWorldIcon(position) {
if (houseWorldIconImage == null) {
logToConsole(LOG_VERBOSE, `[V.RP.Label]: Can't render house world icon. Image is null.`);
return false;
}
if (getGame() != V_GAME_MAFIA_ONE) {
logToConsole(LOG_VERBOSE, `[V.RP.Label]: Can't render house world icon. Unsupported game.`);
return false;
}
let screenPosition = getScreenFromWorldPosition(position);
graphics.drawRectangle(houseWorldIconImage, [screenPosition.x - (houseWorldIconSize[0] / 2), screenPosition.y - (houseWorldIconSize[1] / 2)], [houseWorldIconSize[0], houseWorldIconSize[1]]);
}
// -------------------------------------------------------------------------

View File

@@ -46,7 +46,7 @@ function loadLocaleConfig() {
function loadAllLocaleStrings() {
let localeOptions = getServerData().localeOptions;
for (let i in localeOptions) {
logToConsole(LOG_INFO, `[AGRP.Locale] Loading locale strings for ${localeOptions[i].englishName} (${i})`);
logToConsole(LOG_INFO, `[V.RP.Locale] Loading locale strings for ${localeOptions[i].englishName} (${i})`);
let localeStringFile = loadTextFile(`locale/${localeOptions[i].stringsFile}`);
let localeStringData = JSON.parse(localeStringFile);
@@ -60,7 +60,7 @@ function loadAllLocaleStrings() {
// ===========================================================================
function setLocale(tempLocaleId) {
logToConsole(LOG_DEBUG, `[AGRP.Locale] Setting locale to ${tempLocaleId} (${getServerData().localeOptions[tempLocaleId].englishName})`);
logToConsole(LOG_DEBUG, `[V.RP.Locale] Setting locale to ${tempLocaleId} (${getServerData().localeOptions[tempLocaleId].englishName})`);
localLocaleId = tempLocaleId;
resetGUIStrings();
}

View File

@@ -8,7 +8,7 @@
// ===========================================================================
let logoImage = null;
let logoPos = toVector2(game.width - 132, game.height - 132);
let logoPos = (getGame() == V_GAME_MAFIA_ONE) ? toVector2(80, game.height - 80) : toVector2(64, 64);
let logoSize = toVector2(128, 128);
// ===========================================================================
@@ -53,7 +53,7 @@ function processLogoRendering() {
// ===========================================================================
function setServerLogoRenderState(state) {
logToConsole(LOG_DEBUG, `[AGRP.Main] Server logo ${(state) ? "enabled" : "disabled"}`);
logToConsole(LOG_DEBUG, `[V.RP.Main] Server logo ${(state) ? "enabled" : "disabled"}`);
renderLogo = state;
}

View File

@@ -62,7 +62,7 @@ function loadBigGameMessageFont() {
fontStream = openFile("files/fonts/aurora-bold-condensed.ttf");
if (fontStream != null) {
tempBigGameMessageFonts["AuroraBdCnBT"] = lucasFont.createFont(fontStream, 20.0);
tempBigGameMessageFonts["AuroraBdCnBT"] = lucasFont.createFont(fontStream, 28.0);
fontStream.close();
}
@@ -78,7 +78,7 @@ function processSmallGameMessageRendering() {
logToConsole(LOG_VERBOSE, "[V.RP.Messaging]: Processing small game message rendering ...");
if (renderSmallGameMessage) {
if (smallGameMessageText != "") {
logToConsole(LOG_VERBOSE, `[AGRP.Messaging]: Rendering small game message: ${smallGameMessageText}`);
logToConsole(LOG_VERBOSE, `[V.RP.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);
}
@@ -89,7 +89,7 @@ function processSmallGameMessageRendering() {
// ===========================================================================
function showSmallGameMessage(text, colour, duration, fontName) {
logToConsole(LOG_DEBUG, `[AGRP.Messaging] Showing small game message '${text}' using font ${fontName} for ${duration}ms`);
logToConsole(LOG_DEBUG, `[V.RP.Messaging] Showing small game message '${text}' using font ${fontName} for ${duration}ms`);
if (smallGameMessageText != "") {
clearTimeout(smallGameMessageTimer);
}

View File

@@ -13,6 +13,7 @@ let afkStatusFont = null;
let pingFont = null;
let nametagDistance = 50.0;
let nametagWidth = 70;
let nametagHeight = (getGame() == V_GAME_MAFIA_ONE) ? 2.0 : 0.9;
let playerNames = {};
let playerColours = {};
@@ -84,21 +85,15 @@ function drawNametag(x, y, health, armour, text, ping, alpha, distance, colour,
// -------------------------------------------
// Health Bar
if (getMultiplayerMod() == V_MPMOD_GTAC) {
if (getGame() == V_GAME_GTA_III) {
// Mickey Hamfists is ridiculously tall. Raise the nametag for him a bit
if (skin == 109) {
y -= 20;
} else {
y -= 5;
}
} else {
y -= 5;
if (getGame() == V_GAME_GTA_III) {
// Mickey Hamfists is ridiculously tall. Raise the nametag for him a bit
if (skin == 109) {
y -= 15;
}
} else {
y -= 5;
}
y -= 5;
if (health > 0.0) {
let hx = x - width / 2;
let hy = y - 10 / 2;
@@ -143,20 +138,18 @@ function drawNametag(x, y, health, armour, text, ping, alpha, distance, colour,
// ===========================================================================
function updateNametag(element) {
if (!areWorldLabelsSupported()) {
if (!isGameFeatureSupported("customNametag")) {
return false;
}
if (localPlayer != null) {
let playerPos = localPlayer.position;
let elementPos = element.position;
let playerPosition = localPlayer.position;
let elementPosition = element.position;
elementPos[2] += 0.9;
elementPosition = getPosAbovePos(elementPosition, nametagHeight);
//if(typeof element.getComponentPosition()) {
let screenPos = getScreenFromWorldPosition(elementPos);
if (screenPos[2] >= 0.0) {
let screenPosition = getScreenFromWorldPosition(elementPosition);
if (screenPosition[2] >= 0.0 || getGame() == V_GAME_MAFIA_ONE) {
let health = element.health / 100.0;
if (health > 1.0) {
health = 1.0;
@@ -167,10 +160,10 @@ function updateNametag(element) {
armour = 1.0;
}
let distance = playerPos.distance(elementPos);
let distance = playerPosition.distance(elementPosition);
if (distance <= nametagDistance) {
if (typeof game.processLineOfSight != "undefined") {
let losCheck = game.processLineOfSight(playerPos, elementPos, true, false, false, true, true, false, true, true);
let losCheck = game.processLineOfSight(playerPosition, elementPosition, true, false, false, true, true, false, true, true);
if (losCheck != null) {
return false;
}
@@ -182,25 +175,23 @@ function updateNametag(element) {
let paused = false;
let ping = -1;
if (element.isType(ELEMENT_PLAYER)) {
if (typeof playerNames[element.name] != "undefined") {
name = playerNames[element.name];
}
if (typeof playerPaused[element.name] != "undefined") {
paused = playerPaused[element.name];
}
if (typeof playerColours[element.name] != "undefined") {
colour = playerColours[element.name];
}
if (typeof playerPing[element.name] != "undefined") {
ping = playerPing[element.name];
}
if (typeof playerNames[element.name] != "undefined") {
name = playerNames[element.name];
}
drawNametag(screenPos[0], screenPos[1], health, armour, name, ping, 1.0 - distance / nametagDistance, distance, colour, paused, element.skin);
if (typeof playerPaused[element.name] != "undefined") {
paused = playerPaused[element.name];
}
if (typeof playerColours[element.name] != "undefined") {
colour = playerColours[element.name];
}
if (typeof playerPing[element.name] != "undefined") {
ping = playerPing[element.name];
}
drawNametag(screenPosition[0], screenPosition[1], health, armour, name, ping, 1.0 - distance / nametagDistance, distance, colour, paused, element.skin);
}
}
}
@@ -224,6 +215,12 @@ function processNameTagRendering(event) {
// return false;
//}
if (getGame() == V_GAME_MAFIA_ONE) {
if (localPlayer.vehicle != null) {
return false;
}
}
getElementsByType(ELEMENT_PED).forEach(function (ped) {
if (ped != localPlayer) {
updateNametag(ped);

View File

@@ -29,6 +29,7 @@ function addAllNetworkHandlers() {
// Job
addNetworkEventHandler("v.rp.job", receiveJobFromServer);
addNetworkEventHandler("v.rp.removeJobs", removeJobsFromClient);
addNetworkEventHandler("v.rp.working", setLocalPlayerWorkingState);
addNetworkEventHandler("v.rp.jobType", setLocalPlayerJobType);
addNetworkEventHandler("v.rp.showJobRouteLocation", showJobRouteLocation);
@@ -64,6 +65,7 @@ function addAllNetworkHandlers() {
// Vehicle
addNetworkEventHandler("v.rp.vehicle", receiveVehicleFromServer);
addNetworkEventHandler("v.rp.removeVehicles", removeVehiclesFromClient);
addNetworkEventHandler("v.rp.veh.lights", setVehicleLights);
addNetworkEventHandler("v.rp.veh.engine", setVehicleEngine);
addNetworkEventHandler("v.rp.veh.repair", repairVehicle);
@@ -108,7 +110,7 @@ function addAllNetworkHandlers() {
addNetworkEventHandler("v.rp.changePassword", showChangePasswordGUI);
addNetworkEventHandler("v.rp.showLocaleChooser", showLocaleChooserGUI);
addNetworkEventHandler("v.rp.guiColour", setGUIColours);
addNetworkEventHandler("v.rp.mapChangeWarning", setMapChangeWarningState);
addNetworkEventHandler("v.rp.mapChangingSoon", setMapChangeWarningState);
// 2D Rendering
addNetworkEventHandler("v.rp.set2DRendering", set2DRendering);
@@ -117,9 +119,11 @@ function addAllNetworkHandlers() {
// Business
addNetworkEventHandler("v.rp.business", receiveBusinessFromServer);
addNetworkEventHandler("v.rp.removeBusinesses", removeBusinessesFromClient);
// House
addNetworkEventHandler("v.rp.house", receiveHouseFromServer);
addNetworkEventHandler("v.rp.removeHouses", removeHousesFromClient);
// GPS
addNetworkEventHandler("v.rp.showGPSBlip", showGPSLocation);
@@ -137,6 +141,14 @@ function addAllNetworkHandlers() {
addNetworkEventHandler("v.rp.nametag", updatePlayerNameTag);
addNetworkEventHandler("v.rp.nametagDistance", setNameTagDistance);
// PayPhones
addNetworkEventHandler("v.rp.payPhone", receivePayPhoneFromServer);
addNetworkEventHandler("v.rp.payPhoneState", receivePayPhoneStateFromServer);
addNetworkEventHandler("v.rp.removePayPhones", removePayPhonesFromClient);
addNetworkEventHandler("v.rp.payPhoneDial", payPhoneDial);
addNetworkEventHandler("v.rp.payPhoneHangup", payPhoneHangup);
addNetworkEventHandler("v.rp.payPhonePickup", payPhonePickup);
// Misc
addNetworkEventHandler("v.rp.mouseCursor", toggleMouseCursor);
addNetworkEventHandler("v.rp.mouseCamera", toggleMouseCamera);
@@ -148,6 +160,7 @@ function addAllNetworkHandlers() {
addNetworkEventHandler("v.rp.minuteDuration", setMinuteDuration);
addNetworkEventHandler("v.rp.snow", setSnowState);
addNetworkEventHandler("v.rp.enterPropertyKey", setEnterPropertyKey);
addNetworkEventHandler("v.rp.scoreBoardKey", setScoreBoardKey);
addNetworkEventHandler("v.rp.skinSelect", toggleSkinSelect);
addNetworkEventHandler("v.rp.hotbar", updatePlayerHotBar);
addNetworkEventHandler("v.rp.logLevel", setLogLevel);
@@ -163,6 +176,7 @@ function addAllNetworkHandlers() {
addNetworkEventHandler("v.rp.profanityFilter", setProfanityFilterState);
addNetworkEventHandler("v.rp.currencyString", receiveCurrencyStringFromServer);
addNetworkEventHandler("v.rp.token", serverRequestedToken);
addNetworkEventHandler("v.rp.incomingDamageMultiplier", setIncomingDamageMultiplier);
}
// ===========================================================================
@@ -188,7 +202,7 @@ function sendResourceStoppedSignalToServer() {
// ===========================================================================
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})`);
logToConsole(LOG_DEBUG, `[V.RP.Main] Updating render states (HUD: ${hudState}, Labels: ${labelState}, Bottom Text: ${smallGameMessageState}, Scoreboard: ${scoreboardState}, HotBar: ${hotBarState}, Item Action Delay: ${itemActionDelayState})`);
renderHUD = hudState;
if (getGame() == V_GAME_GTA_IV) {
@@ -213,9 +227,10 @@ function set2DRendering(hudState, labelState, smallGameMessageState, scoreboardS
// ===========================================================================
function onServerSpawnedLocalPlayer(state) {
logToConsole(LOG_DEBUG, `[AGRP.Main] Setting spawned state to ${state}`);
logToConsole(LOG_DEBUG, `[V.RP.Main] Setting spawned state to ${state}`);
isSpawned = state;
setUpInitialGame();
calledDeathEvent = false;
if (state) {
setTimeout(function () {
calledDeathEvent = false;
@@ -278,7 +293,11 @@ function anchorBoat(vehicleId) {
// ===========================================================================
function setEnterPropertyKey(key) {
enterPropertyKey = key;
if (key == -1) {
enterPropertyKey = null;
} else {
enterPropertyKey = toInteger(key);
}
}
// ===========================================================================
@@ -336,7 +355,7 @@ function setLocalPlayerInfiniteRun(state) {
// ===========================================================================
function setLocalPlayerSkin(skinId) {
logToConsole(LOG_INFO, `[AGRP.Server] Setting locale player skin to ${skinId}`);
logToConsole(LOG_INFO, `[V.RP.Server] Setting locale player skin to ${skinId}`);
if (getGame() == V_GAME_GTA_IV) {
if (natives.isModelInCdimage(skinId)) {
natives.requestModel(skinId);
@@ -379,7 +398,17 @@ function changeScene(sceneName) {
natives.initCutscene(cutsceneName);
}
} else if (getGame() == V_GAME_MAFIA_ONE) {
game.changeMap(sceneName);
renderHUD = false;
renderHotBar = false;
renderInteriorLights = false;
renderItemActionDelay = false;
renderLabels = false;
renderLogo = false;
renderScoreBoard = false;
renderSmallGameMessage = false;
setTimeout(function () {
game.changeMap(sceneName, false);
}, 250);
}
}
@@ -444,8 +473,9 @@ function receiveCurrencyStringFromServer(newCurrencyString) {
// ===========================================================================
function setMapChangeWarningState(state) {
function setMapChangeWarningState(state, changeToNight) {
mapChangeWarning = state;
mapChangeToNight = changeToNight;
}
// ===========================================================================
@@ -467,4 +497,10 @@ function serverRequestedToken() {
sendNetworkEventToServer("v.rp.token", token);
}
// ===========================================================================
function setIncomingDamageMultiplier(tempMultiplier) {
weaponDamageMultiplier = tempMultiplier;
}
// ===========================================================================

307
scripts/client/payphone.js Normal file
View File

@@ -0,0 +1,307 @@
// ===========================================================================
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: payphone.js
// DESC: Provides payphone functions and processing
// TYPE: Client (JavaScript)
// ===========================================================================
let payPhoneMaxAudibleDistance = 75;
let payPhoneRingMaxVolume = 50;
let payPhoneRingingIndicatorImage = null;
let payPhoneRingingIndicatorImagePath = "files/images/payphone-ringing.png";
// Will be unnecessary once MafiaC has game sound playback in scripting
let payPhoneRingingSound = null;
let payPhoneDialingSound = null;
let payPhonePickupSound = null;
let payPhoneHangupSound = null;
let payPhoneRingingSoundFilePath = "";
let payPhoneDialingSoundFilePath = "";
let payPhonePickupSoundFilePath = "";
let payPhoneHangupSoundFilePath = "";
let ringingPayPhone = -1;
// ===========================================================================
class PayPhoneData {
constructor(payPhoneId, state, position) {
this.index = -1;
this.payPhoneId = payPhoneId;
this.position = position;
this.state = state;
}
}
// ===========================================================================
function initPayPhoneScript() {
logToConsole(LOG_DEBUG, "[V.RP.PayPhone]: Initializing payphone script ...");
if (getGame() == V_GAME_MAFIA_ONE) {
payPhoneRingingSoundFilePath = "files/sounds/payphone/old-payphone-ring.mp3";
payPhoneDialingSoundFilePath = "files/sounds/payphone/old-payphone-dial.mp3";
payPhonePickupSoundFilePath = "files/sounds/payphone/old-payphone-pickup.mp3";
payPhoneHangupSoundFilePath = "files/sounds/payphone/old-payphone-hangup.mp3";
} else {
if (getGame() != V_GAME_GTA_SA) {
payPhoneRingingSoundFilePath = "files/sounds/payphone/old-payphone-ring.mp3";
payPhoneDialingSoundFilePath = "files/sounds/payphone/old-payphone-dial.mp3";
payPhonePickupSoundFilePath = "files/sounds/payphone/old-payphone-pickup.mp3";
payPhoneHangupSoundFilePath = "files/sounds/payphone/old-payphone-hangup.mp3";
}
}
//payPhoneRingingIndicatorImage = loadPayPhoneRingingIndicatorImage();
payPhoneRingingSound = loadPayPhoneRingingSound();
payPhoneDialingSound = loadPayPhoneDialingSound();
payPhonePickupSound = loadPayPhonePickupSound();
payPhoneHangupSound = loadPayPhoneHangupSound();
logToConsole(LOG_DEBUG, "[V.RP.PayPhone]: Payphone script initialized!");
}
// ===========================================================================
function loadPayPhoneRingingIndicatorImage() {
if (payPhoneRingingIndicatorImagePath == "") {
return null;
}
let imageStream = openFile(payPhoneRingingIndicatorImagePath);
let tempImage = null;
if (imageStream != null) {
tempImage = graphics.loadPNG(imageStream);
imageStream.close();
}
return tempImage;
}
// ===========================================================================
function loadPayPhoneRingingSound() {
if (payPhoneRingingSoundFilePath == "") {
return null;
}
let soundStream = openFile(payPhoneRingingSoundFilePath);
let tempSound = null;
if (soundStream != null) {
tempSound = audio.createSound(soundStream, true);
soundStream.close();
}
return tempSound;
}
// ===========================================================================
function loadPayPhoneDialingSound() {
if (payPhoneDialingSoundFilePath == "") {
return null;
}
let soundStream = openFile(payPhoneDialingSoundFilePath);
let tempSound = null;
if (soundStream != null) {
tempSound = audio.createSound(soundStream, false);
soundStream.close();
}
if (tempSound != null) {
tempSound.volume = 1.0;
}
return tempSound;
}
// ===========================================================================
function loadPayPhonePickupSound() {
if (payPhonePickupSoundFilePath == "") {
return null;
}
let soundStream = openFile(payPhonePickupSoundFilePath);
let tempSound = null;
if (soundStream != null) {
tempSound = audio.createSound(soundStream, false);
soundStream.close();
}
if (tempSound != null) {
tempSound.volume = 1.0;
}
return tempSound;
}
// ===========================================================================
function loadPayPhoneHangupSound() {
if (payPhoneHangupSoundFilePath == "") {
return null;
}
let soundStream = openFile(payPhoneHangupSoundFilePath);
let tempSound = null;
if (soundStream != null) {
tempSound = audio.createSound(soundStream, false);
soundStream.close();
}
if (tempSound != null) {
tempSound.volume = 1.0;
}
return tempSound;
}
// ===========================================================================
function processPayPhonesDistance() {
if (payPhoneRingingSound == null) {
return false;
}
let tempRingingPhone = -1;
for (let i in getServerData().payPhones) {
if (getServerData().payPhones[i].state == V_PAYPHONE_STATE_RINGING) {
if (getDistance(getLocalPlayerPosition(), getServerData().payPhones[i].position) <= payPhoneMaxAudibleDistance) {
if (tempRingingPhone != -1) {
if (getDistance(getLocalPlayerPosition(), getServerData().payPhones[i].position) <= getDistance(getLocalPlayerPosition(), getServerData().payPhones[tempRingingPhone].position)) {
tempRingingPhone = i;
}
} else {
tempRingingPhone = i;
}
}
}
}
if (tempRingingPhone == -1) {
logToConsole(LOG_VERBOSE, "[V.RP.PayPhone]: No phones are ringing, stopping all ring sounds");
payPhoneRingingSound.stop();
} else {
let distance = getDistance(getLocalPlayerPosition(), getServerData().payPhones[tempRingingPhone].position);
let distancePercent = (payPhoneRingMaxVolume - (distance * 100 / payPhoneMaxAudibleDistance));
payPhoneRingingSound.volume = distancePercent / 100;
if (ringingPayPhone == -1) {
logToConsole(LOG_VERBOSE, "[V.RP.PayPhone]: No previous phone ringing, starting ring sound");
payPhoneRingingSound.play();
}
}
ringingPayPhone = tempRingingPhone;
}
// ===========================================================================
function receivePayPhoneFromServer(payPhoneId, isDeleted, state, position) {
logToConsole(LOG_DEBUG, `[V.RP.PayPhone] Received payphone ${payPhoneId} from server`);
if (!areServerElementsSupported() || getGame() == V_GAME_MAFIA_ONE || getGame() == V_GAME_GTA_IV) {
if (isDeleted == true) {
getServerData().payPhones.splice(payPhoneId, 1);
return false;
}
if (getPayPhoneData(payPhoneId) != false) {
logToConsole(LOG_DEBUG, `[V.RP.PayPhone] Payphone ${payPhoneId} already exists. Updating ...`);
let payPhoneData = getPayPhoneData(payPhoneId);
payPhoneData.state = state;
payPhoneData.position = position;
} else {
logToConsole(LOG_DEBUG, `[V.RP.PayPhone] Payphone ${payPhoneId} doesn't exist. Adding ...`);
let tempPayPhoneData = new PayPhoneData(payPhoneId, state, position);
getServerData().payPhones.push(tempPayPhoneData);
}
}
}
// ===========================================================================
function receivePayPhoneStateFromServer(payPhoneId, state) {
logToConsole(LOG_DEBUG, `[V.RP.PayPhone] Received payphone ${payPhoneId} state (${state}) from server`);
if (payPhoneId != -1) {
if (getPayPhoneData(payPhoneId) == false) {
return false;
}
getPayPhoneData(payPhoneId).state = state;
} else {
for (let i in getServerData().payPhones) {
getServerData().payPhones[i].state = state;
}
}
}
// ===========================================================================
/**
* @param {number} payPhoneId - The ID of the payphone (initially provided by server)
* @return {PayPhoneData} The payphone's data (class instance)
*/
function getPayPhoneData(payPhoneId) {
if (payPhoneId == -1) {
return false;
}
for (let i in getServerData().payPhones) {
if (getServerData().payPhones[i].payPhoneId == payPhoneId) {
return getServerData().payPhones[i];
}
}
return false;
}
// ===========================================================================
function removePayPhonesFromClient() {
clearArray(getServerData().payPhones);
}
// ===========================================================================
function payPhoneDial() {
if (payPhoneDialingSound == null) {
logToConsole(LOG_DEBUG | LOG_ERROR, "[V.RP.PayPhone]: Attempted to play payphone dial sound, but sound object is null");
return false;
}
logToConsole(LOG_DEBUG, "[V.RP.PayPhone]: Playing payphone dial sound");
payPhoneDialingSound.play();
}
// ===========================================================================
function payPhoneHangup() {
if (payPhoneHangupSound == null) {
logToConsole(LOG_DEBUG | LOG_ERROR, "[V.RP.PayPhone]: Attempted to play payphone hangup sound, but sound object is null");
return false;
}
logToConsole(LOG_DEBUG, "[V.RP.PayPhone]: Playing payphone hangup sound");
payPhoneHangupSound.play();
}
// ===========================================================================
function payPhonePickup() {
if (payPhonePickupSound == null) {
logToConsole(LOG_DEBUG | LOG_ERROR, "[V.RP.PayPhone]: Attempted to play payphone pickup sound, but sound object is null");
return false;
}
logToConsole(LOG_DEBUG, "[V.RP.PayPhone]: Playing payphone pickup sound");
payPhonePickupSound.play();
}
// ===========================================================================

View File

@@ -12,7 +12,7 @@ let scoreBoardListFont = null;
let pausedColour = COLOUR_RED;
let scoreboardKey = SDLK_TAB;
let scoreBoardKey = null;
// ===========================================================================
@@ -38,67 +38,97 @@ function initScoreBoardListFont() {
// ===========================================================================
function processScoreBoardRendering() {
if (isAnyGUIActive()) {
if (!renderScoreBoard) {
logToConsole(LOG_VERBOSE | LOG_ERROR, `[V.RP.ScoreBoard] Could not render scoreboard. Scoreboard rendering is disabled!`);
return false;
}
if (renderScoreBoard) {
if (isKeyDown(SDLK_TAB)) {
if (scoreBoardListFont != null && scoreBoardTitleFont != null) {
let scoreboardStart = (game.height / 2) - (Math.floor(getClients().length / 2) * 20);
let titleSize = scoreBoardTitleFont.measure("PLAYERS", game.width, 0.0, 1.0, 10, false, false);
scoreBoardTitleFont.render("PLAYERS", [game.width / 2, scoreboardStart - 50], 0, 0.5, 0.0, scoreBoardTitleFont.size, COLOUR_WHITE, false, false, false, true);
if (scoreBoardListFont == null) {
logToConsole(LOG_VERBOSE | LOG_ERROR, `[V.RP.ScoreBoard] Could not render scoreboard. List font is null!`);
return 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);
if (scoreBoardTitleFont == null) {
logToConsole(LOG_VERBOSE | LOG_ERROR, `[V.RP.ScoreBoard] Could not render scoreboard. Title font is null!`);
return false;
}
let clients = getClients();
for (let i in clients) {
if (!clients[i].console) {
let name = clients[i].name;
let colour = COLOUR_WHITE;
let paused = false;
let ping = "-1";
if (isAnyGUIActive()) {
logToConsole(LOG_VERBOSE | LOG_ERROR, `[V.RP.ScoreBoard] Could not render scoreboard. A GUI window is active!`);
return false;
}
if (typeof playerNames[clients[i].name] != "undefined") {
name = playerNames[clients[i].name];
}
if (scoreBoardKey == null) {
return false;
}
if (typeof playerPaused[clients[i].name] != "undefined") {
paused = playerPaused[clients[i].name];
}
if (!isKeyDown(scoreBoardKey)) {
return false;
}
if (typeof playerColours[clients[i].name] != "undefined") {
colour = playerColours[clients[i].name];
}
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);
scoreBoardTitleFont.render("PLAYERS", [game.width / 2, scoreboardStart - 50], 0, 0.5, 0.0, scoreBoardTitleFont.size, COLOUR_WHITE, false, false, false, true);
if (typeof playerPing[clients[i].name] != "undefined") {
ping = toString(playerPing[clients[i].name]);
}
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);
// Player ID
let text = String(clients[i].index);
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);
let clients = getClients();
for (let i in clients) {
if (!clients[i].console) {
let name = clients[i].name;
let colour = COLOUR_WHITE;
let paused = false;
let ping = "-1";
// Player Name
text = name;
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);
if (typeof playerNames[clients[i].name] != "undefined") {
name = playerNames[clients[i].name];
}
// Ping
text = ping;
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);
if (typeof playerPaused[clients[i].name] != "undefined") {
paused = playerPaused[clients[i].name];
}
// PAUSED Status (depends on resource "afk")
if (paused == true) {
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);
}
}
}
if (typeof playerColours[clients[i].name] != "undefined") {
colour = playerColours[clients[i].name];
}
if (typeof playerPing[clients[i].name] != "undefined") {
ping = toString(playerPing[clients[i].name]);
}
// Player ID
let text = String(clients[i].index);
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);
// Player Name
text = name;
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);
// Ping
text = ping;
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);
// PAUSED Status (depends on resource "afk")
if (paused == true) {
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);
}
}
}
}
}
// ===========================================================================
function setScoreBoardKey(key) {
if (key == -1) {
scoreBoardKey = null;
} else {
scoreBoardKey = toInteger(key);
}
}
// ===========================================================================

View File

@@ -21,8 +21,19 @@ function initClientScripts() {
initEventScript();
initSkinSelectScript();
initCursorScript();
initCustomHUDScript();
initPayPhoneScript();
initTimersScript();
initJobScript();
initItemScript();
initBusinessScript();
initHouseScript();
loadLocaleConfig();
addAllNetworkHandlers();
initTimers();
}
// ===========================================================================
@@ -190,13 +201,15 @@ function setUpInitialGame() {
// Some last steps
//natives.loadAllObjectsNow();
} else if (getGame() == V_GAME_MAFIA_ONE) {
game.mapEnabled = false;
game.setTrafficEnabled(false);
game.mapEnabled = true;
//game.setTrafficEnabled(false);
}
}
// ===========================================================================
initClientScripts();
addEventHandler("OnResourceStart", onResourceStart);
addEventHandler("OnResourceReady", onResourceReady);
addEventHandler("OnResourceStop", onResourceStop);
// ===========================================================================
// ===========================================================================

View File

@@ -19,24 +19,27 @@ function processSync(event, deltaTime) {
//}
}
if (localPlayer.health <= 0) {
if (!calledDeathEvent) {
logToConsole(LOG_DEBUG, `Local player died`);
localPlayer.clearWeapons();
calledDeathEvent = true;
sendNetworkEventToServer("v.rp.playerDeath");
if (calledDeathEvent == false) {
if (localPlayer.health <= 0) {
if (!calledDeathEvent) {
logToConsole(LOG_DEBUG, `Local player died`);
localPlayer.clearWeapons();
calledDeathEvent = true;
sendNetworkEventToServer("v.rp.playerDeath");
}
}
}
}
if (localPlayer.health <= 0) {
if (!calledDeathEvent) {
logToConsole(LOG_DEBUG, `Local player died`);
localPlayer.clearWeapons();
calledDeathEvent = true;
sendNetworkEventToServer("v.rp.playerDeath");
}
}
//if (localPlayer.health <= 0) {
// if (!calledDeathEvent) {
// logToConsole(LOG_DEBUG, `Local player died`);
// localPlayer.clearWeapons();
// calledDeathEvent = true;
// sendNetworkEventToServer("v.rp.playerDeath");
// }
//}
if (streamingRadioElement) {
//streamingRadio.volume = getStreamingRadioVolumeForPosition(streamingRadio.position);
@@ -46,15 +49,9 @@ function processSync(event, deltaTime) {
// ===========================================================================
function setVehicleLights(vehicleId, state) {
//if (getGame() == V_GAME_GTA_IV) {
// if (!state) {
// natives.forceCarLights(natives.getVehicleFromNetworkId(vehicleId, 0));
// } else {
// natives.forceCarLights(natives.getVehicleFromNetworkId(vehicleId, 1));
// }
//} else {
getElementFromId(vehicleId).lights = state;
//}
if (getElementFromId(vehicleId) != null) {
getElementFromId(vehicleId).lights = state;
}
}
// ===========================================================================

25
scripts/client/timers.js Normal file
View File

@@ -0,0 +1,25 @@
// ===========================================================================
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: timers.js
// DESC: Provides timer functions and usage
// TYPE: Client (JavaScript)
// ===========================================================================
let localPlayerMoneyInterval = null;
// ===========================================================================
function initTimersScript() {
logToConsole(LOG_DEBUG, "[V.RP.Timers]: Initializing timer script ...");
logToConsole(LOG_DEBUG, "[V.RP.Timers]: Timers script initialized!");
}
// ===========================================================================
function initTimers() {
localPlayerMoneyInterval = setInterval(updateLocalPlayerMoney, 1000 * 5);
}
// ===========================================================================

View File

@@ -8,14 +8,14 @@
// ===========================================================================
function setLocalPlayerFrozenState(state) {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Setting frozen state to ${state}`);
logToConsole(LOG_DEBUG, `[V.RP.Utilities] Setting frozen state to ${state}`);
gui.showCursor(state, !state);
}
// ===========================================================================
function setLocalPlayerControlState(controlState, cursorState = false) {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Setting control state to ${controlState} (Cursor: ${cursorState})`);
logToConsole(LOG_DEBUG, `[V.RP.Utilities] Setting control state to ${controlState} (Cursor: ${cursorState})`);
controlsEnabled = controlState;
game.setPlayerControl(controlState);
if (getGame() == V_GAME_GTA_III || getGame() == V_GAME_GTA_VC) {
@@ -28,27 +28,19 @@ function setLocalPlayerControlState(controlState, cursorState = false) {
// ===========================================================================
function fadeLocalCamera(state, duration, colour) {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Fading camera ${(state) ? "in" : "out"} for ${time}ms`);
cameraFadeDuration = duration;
cameraFadeStart = sdl.ticks;
cameraFadeEnabled = true;
cameraFadeIn = state;
cameraFadeColour = colour;
cameraFadeAlpha = (state) ? 255 : 0;
}
// ===========================================================================
function removeLocalPlayerFromVehicle() {
if (getGame() == V_GAME_MAFIA_ONE) {
localPlayer.removeFromVehicle(localPlayer.vehicle, 0);
localPlayer.position = getPosAbovePos(localPlayer.position, 5);
}
localPlayer.removeFromVehicle();
}
// ===========================================================================
function restoreLocalCamera() {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Camera restored`);
logToConsole(LOG_DEBUG, `[V.RP.Utilities] Camera restored`);
if (isGameFeatureSupported("customCamera")) {
game.restoreCamera(true);
}
@@ -57,7 +49,7 @@ function restoreLocalCamera() {
// ===========================================================================
function setLocalCameraLookAt(cameraPosition, cameraLookAt) {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Set camera to look at [${cameraLookAt.x}, ${cameraLookAt.y}, ${cameraLookAt.z}] from [${cameraPosition.x}, ${cameraPosition.y}, ${cameraPosition.z}]`);
logToConsole(LOG_DEBUG, `[V.RP.Utilities] Set camera to look at [${cameraLookAt.x}, ${cameraLookAt.y}, ${cameraLookAt.z}] from [${cameraPosition.x}, ${cameraPosition.y}, ${cameraPosition.z}]`);
if (isCustomCameraSupported()) {
game.setCameraLookAt(cameraPosition, cameraLookAt, true);
}
@@ -66,15 +58,15 @@ function setLocalCameraLookAt(cameraPosition, cameraLookAt) {
// ===========================================================================
function clearLocalPlayerOwnedPeds() {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Clearing all self-owned peds ...`);
logToConsole(LOG_DEBUG, `[V.RP.Utilities] Clearing all self-owned peds ...`);
clearSelfOwnedPeds();
logToConsole(LOG_DEBUG, `[AGRP.Utilities] All self-owned peds cleared`);
logToConsole(LOG_DEBUG, `[V.RP.Utilities] All self-owned peds cleared`);
};
// ===========================================================================
function setCityAmbienceState(state, clearElements = false) {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Ambient civilians and traffic ${(state) ? "enabled" : "disabled"}`);
logToConsole(LOG_DEBUG, `[V.RP.Utilities] Ambient civilians and traffic ${(state) ? "enabled" : "disabled"}`);
game.setTrafficEnabled(state);
if (getMultiplayerMod() == V_MPMOD_GTAC) {
@@ -134,7 +126,7 @@ function enterVehicleAsPassenger() {
// ===========================================================================
function giveLocalPlayerWeapon(weaponId, ammo, active) {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Giving weapon ${weaponId} with ${ammo} ammo`);
logToConsole(LOG_DEBUG, `[V.RP.Utilities] Giving weapon ${weaponId} with ${ammo} ammo`);
forceWeapon = weaponId;
if (getGame() == V_GAME_MAFIA_ONE) {
localPlayer.giveWeapon(weaponId, 0, ammo);
@@ -155,7 +147,7 @@ function giveLocalPlayerWeapon(weaponId, ammo, active) {
// ===========================================================================
function clearLocalPlayerWeapons(clearData) {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Clearing weapons`);
logToConsole(LOG_DEBUG, `[V.RP.Utilities] Clearing weapons`);
localPlayer.clearWeapons();
if (clearData == true) {
forceWeapon = 0;
@@ -173,7 +165,7 @@ function getClosestVehicle(pos) {
// ===========================================================================
function setLocalPlayerPosition(position) {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Setting position to ${position.x}, ${position.y}, ${position.z}`);
logToConsole(LOG_DEBUG, `[V.RP.Utilities] Setting position to ${position.x}, ${position.y}, ${position.z}`);
if (typeof localPlayer.velocity != "undefined") {
localPlayer.velocity = toVector3(0.0, 0.0, 0.0);
}
@@ -186,7 +178,7 @@ function setLocalPlayerPosition(position) {
// ===========================================================================
function setLocalPlayerHeading(heading) {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Setting heading to ${heading}`);
logToConsole(LOG_DEBUG, `[V.RP.Utilities] Setting heading to ${heading}`);
if (typeof localPlayer.heading != "undefined") {
localPlayer.heading = heading;
}
@@ -195,7 +187,7 @@ function setLocalPlayerHeading(heading) {
// ===========================================================================
function setLocalPlayerInterior(interior) {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Setting interior to ${interior}`);
logToConsole(LOG_DEBUG, `[V.RP.Utilities] Setting interior to ${interior}`);
if (getMultiplayerMod() == V_MPMOD_GTAC) {
if (!isGTAIV()) {
localPlayer.interior = interior;
@@ -224,7 +216,11 @@ function setLocalPlayerInterior(interior) {
// ===========================================================================
function setSnowState(falling, ground, forceGround) {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Setting falling snow to ${falling} and ground snow to ${ground}`);
if (!isGameFeatureSupported("snow")) {
return false;
}
logToConsole(LOG_DEBUG, `[V.RP.Utilities] Setting falling snow to ${falling} and ground snow to ${ground}`);
snowing = falling;
//snow.force = ground;
//if (forceGround == true) {
@@ -238,13 +234,16 @@ function setSnowState(falling, ground, forceGround) {
// ===========================================================================
function setLocalPlayerHealth(health) {
if (localPlayer == null) {
return false;
}
localPlayer.health = health;
}
// ===========================================================================
function playPedSpeech(pedName, speechId) {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Making ${pedName}'s ped talk (${speechId})`);
logToConsole(LOG_DEBUG, `[V.RP.Utilities] Making ${pedName}'s ped talk (${speechId})`);
if (getMultiplayerMod() == V_MPMOD_GTAC) {
game.SET_CHAR_SAY(int, int);
}
@@ -253,7 +252,7 @@ function playPedSpeech(pedName, speechId) {
// ===========================================================================
function clearLocalPedState() {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Clearing local ped state`);
logToConsole(LOG_DEBUG, `[V.RP.Utilities] Clearing local ped state`);
localPlayer.clearObjective();
}
@@ -267,7 +266,7 @@ function getWeaponSlot(weaponId) {
function setLocalPlayerDrunkEffect(amount, duration) {
if (getMultiplayerMod() == V_MPMOD_GTAC) {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Drunk effect set to ${amount} for ${duration} ms`);
logToConsole(LOG_DEBUG, `[V.RP.Utilities] Drunk effect set to ${amount} for ${duration} ms`);
drunkEffectAmount = 0;
drunkEffectDurationTimer = setInterval(function () {
drunkEffectAmount = drunkEffectAmount;
@@ -285,11 +284,13 @@ function setLocalPlayerDrunkEffect(amount, duration) {
// ===========================================================================
function getLocalPlayerVehicleSeat() {
for (let i = 0; i <= 4; i++) {
if (localPlayer.vehicle.getOccupant(i) == localPlayer) {
return i;
}
}
return inVehicleSeat;
//for (let i = 0; i <= 4; i++) {
// if (localPlayer.vehicle.getOccupant(i) == localPlayer) {
// return i;
// }
//}
}
// ===========================================================================
@@ -317,7 +318,7 @@ function clearSelfOwnedVehicles() {
// ===========================================================================
function setMouseCameraState(state) {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] ${(state) ? "Enabled" : "Disabled"} mouse camera`);
logToConsole(LOG_DEBUG, `[V.RP.Utilities] ${(state) ? "Enabled" : "Disabled"} mouse camera`);
mouseCameraEnabled = state;
SetStandardControlsEnabled(!mouseCameraEnabled);
}
@@ -325,28 +326,28 @@ function setMouseCameraState(state) {
// ===========================================================================
function toggleMouseCursor() {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] ${(!gui.cursorEnabled) ? "Enabled" : "Disabled"} mouse cursor`);
logToConsole(LOG_DEBUG, `[V.RP.Utilities] ${(!gui.cursorEnabled) ? "Enabled" : "Disabled"} mouse cursor`);
gui.showCursor(!gui.cursorEnabled, gui.cursorEnabled);
}
// ===========================================================================
function toggleMouseCursor() {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] ${(!gui.cursorEnabled) ? "Enabled" : "Disabled"} mouse cursor`);
logToConsole(LOG_DEBUG, `[V.RP.Utilities] ${(!gui.cursorEnabled) ? "Enabled" : "Disabled"} mouse cursor`);
setMouseCameraState(!mouseCameraEnabled);
}
// ===========================================================================
function setPlayerWeaponDamageEvent(clientName, eventType) {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Set ${clientName} damage event type to ${eventType}`);
logToConsole(LOG_DEBUG, `[V.RP.Utilities] Set ${clientName} damage event type to ${eventType}`);
weaponDamageEvent[clientName] = eventType;
}
// ===========================================================================
function setPlayerWeaponDamageEnabled(clientName, state) {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] ${(state) ? "Enabled" : "Disabled"} damage from ${clientName}`);
logToConsole(LOG_DEBUG, `[V.RP.Utilities] ${(state) ? "Enabled" : "Disabled"} damage from ${clientName}`);
weaponDamageEnabled[clientName] = state;
}
@@ -396,34 +397,6 @@ function processWantedLevelReset() {
// ===========================================================================
function processLocalPlayerVehicleControlState() {
if (areServerElementsSupported()) {
if (localPlayer.vehicle != null) {
if (doesEntityDataExist(localPlayer.vehicle, "v.rp.engine")) {
if (getEntityData(localPlayer.vehicle, "v.rp.engine") == false) {
localPlayer.vehicle.engine = false;
//localPlayer.vehicle.netFlags.sendSync = false;
if (!localPlayer.vehicle.engine) {
if (typeof localPlayer.vehicle.velocity != "undefined") {
localPlayer.vehicle.velocity = toVector3(0.0, 0.0, 0.0);
localPlayer.vehicle.turnVelocity = toVector3(0.0, 0.0, 0.0);
}
//if (parkedVehiclePosition) {
// localPlayer.vehicle.position = parkedVehiclePosition;
// localPlayer.vehicle.heading = parkedVehicleHeading;
//}
}
} else {
//localPlayer.vehicle.netFlags.sendSync = true;
}
}
}
}
}
// ===========================================================================
function forceLocalPlayerEquippedWeaponItem() {
if (typeof localPlayer.weapon != "undefined") {
if (forceWeapon != 0) {
@@ -470,7 +443,7 @@ function getVehicleForNetworkEvent(vehicle) {
// ===========================================================================
function setMinuteDuration(minuteDuration) {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Setting minute duration to ${minuteDuration}ms`);
logToConsole(LOG_DEBUG, `[V.RP.Utilities] Setting minute duration to ${minuteDuration}ms`);
if (isTimeSupported()) {
game.time.minuteDuration = minuteDuration;
@@ -615,9 +588,37 @@ function updateLocalPlayerMoney() {
// ===========================================================================
function setLocalPlayerMoney(amount) {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Setting local player money`);
logToConsole(LOG_DEBUG, `[V.RP.Utilities] Setting local player money`);
localPlayerMoney = amount;
updateLocalPlayerMoney();
}
// ===========================================================================
function fixOffScreenPosition(position, margin = toVector2(0.0, 0.0)) {
if (position.x <= 0) {
position.x = 0.0 + (margin.x / 2);
} else if (position.x > game.width) {
position.x = game.width - (margin.x / 2);
}
if (position.y <= 0) {
position.y = 0.0 + (margin.y / 2);
} else if (position.y > game.height) {
position.y = game.height - (margin.y / 2);
}
return position;
}
// ===========================================================================
function processMapChangeWarning() {
if (mapChangeWarning == false) {
return false;
}
smallGameMessageFonts["AuroraBdCnBT"].render(`Map is changing to ${(mapChangeToNight) ? "night" : "day"} soon!`, [0, game.height - 90], game.width, 0.5, 0.0, smallGameMessageFonts["AuroraBdCnBT"].size, getColourByName("yellow"), true, true, false, true);
}
// ===========================================================================

View File

@@ -30,7 +30,7 @@ class VehicleData {
// ===========================================================================
function receiveVehicleFromServer(vehicleId, position, model, colour1, colour2, colour3 = 0, colour4 = 0, locked = false, lights = false, engine = false, licensePlate = "") {
logToConsole(LOG_DEBUG, `[AGRP.Vehicle] Received vehicle ${vehicleId} (${getVehicleNameFromModel(model, getGame())}) from server`);
logToConsole(LOG_DEBUG, `[V.RP.Vehicle] Received vehicle ${vehicleId} (${getVehicleNameFromModel(model, getGame())}) from server`);
if (getGame() != V_GAME_GTA_IV) {
return false;
@@ -52,7 +52,7 @@ function receiveVehicleFromServer(vehicleId, position, model, colour1, colour2,
let vehicle = natives.getVehicleFromNetworkId(vehicleId.ivNetworkId);
} else {
//logToConsole(LOG_DEBUG, `[AGRP.Vehicle] Vehicle ${vehicleId} doesn't exist. Adding ...`);
//logToConsole(LOG_DEBUG, `[V.RP.Vehicle] Vehicle ${vehicleId} doesn't exist. Adding ...`);
//let tempVehicleData = new VehicleData(vehicleId, name, position, blipModel, pickupModel);
//vehicles.push(tempVehicleData);
@@ -163,4 +163,35 @@ function getVehicleSpeed(vehicle) {
return speed;
}
// ===========================================================================
function removeVehiclesFromClient() {
// Need to destroy elements before clearing array
getServerData().vehicles.splice(0);
}
// ===========================================================================
function processLocalPlayerVehicleControlState() {
if (areServerElementsSupported()) {
if (localPlayer.vehicle != null) {
if (doesEntityDataExist(localPlayer.vehicle, "v.rp.engine")) {
if (getEntityData(localPlayer.vehicle, "v.rp.engine") == false) {
setImmediate(function () {
localPlayer.vehicle.engine = getEntityData(localPlayer.vehicle, "v.rp.engine");
});
if (!getEntityData(localPlayer.vehicle, "v.rp.engine")) {
if (typeof localPlayer.vehicle.velocity != "undefined") {
localPlayer.vehicle.velocity = toVector3(0.0, 0.0, 0.0);
localPlayer.vehicle.turnVelocity = toVector3(0.0, 0.0, 0.0);
}
}
}
}
}
}
}
// ===========================================================================

View File

@@ -48,6 +48,7 @@ class AccountData {
this.databaseId = 0;
this.name = "";
this.password = "";
this.passwordRevision = 0;
this.registerDate = 0;
this.flags = {
moderation: 0,
@@ -78,6 +79,7 @@ class AccountData {
this.databaseId = toInteger(dbAssoc["acct_id"]);
this.name = toString(dbAssoc["acct_name"]);
this.password = toString(dbAssoc["acct_pass"]);
this.passwordRevision = toString(dbAssoc["acct_pass_revision"]);
this.registerDate = toInteger(dbAssoc["acct_when_registered"]);
this.flags = {
moderation: toInteger(dbAssoc["acct_svr_mod_flags"]),
@@ -284,31 +286,31 @@ function toggleAccountGUICommand(command, params, client) {
if (doesPlayerHaveGUIEnabled(client)) {
getPlayerData(client).accountData.settings = addBitFlag(getPlayerData(client).accountData.settings, flagValue);
messagePlayerNormal(client, getLocaleString(client, "GUIAccountSettingToggle", `{softRed}${toUpperCase(getLocaleString(client, "Off"))}{MAINCOLOUR}`));
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has toggled GUI for their account OFF.`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} has toggled GUI for their account OFF.`);
} else {
getPlayerData(client).accountData.settings = removeBitFlag(getPlayerData(client).accountData.settings, flagValue);
messagePlayerNormal(client, getLocaleString(client, "GUIAccountSettingToggle", `{softGreen}${toUpperCase(getLocaleString(client, "On"))}{MAINCOLOUR}`));
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has toggled GUI for their account ON.`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} has toggled GUI for their account ON.`);
}
if (!isPlayerLoggedIn(client)) {
if (getPlayerData().accountData.databaseId != 0) {
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
showPlayerLoginGUI(client);
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI`);
} else {
hideAllPlayerGUI(client);
messagePlayerNormal(client, getLocaleString(client, "WelcomeBack", getServerName(), getPlayerName(client), "{ALTCOLOUR}/login{MAINCOLOUR}"));
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled)`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled)`);
}
} else {
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
showPlayerRegistrationGUI(client);
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register GUI`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register GUI`);
} else {
hideAllPlayerGUI(client);
messagePlayerNormal(client, getLocaleString(client, "WelcomeNewPlayer", getServerName(), getPlayerName(client), "{ALTCOLOUR}/register{MAINCOLOUR}"));
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register message (GUI disabled)`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register message (GUI disabled)`);
}
}
}
@@ -323,11 +325,11 @@ function toggleAccountLoginAttemptNotificationsCommand(command, params, client)
if (doesPlayerHaveLoginAlertsEnabled(client)) {
getPlayerData(client).accountData.settings = removeBitFlag(getPlayerData(client).accountData.settings, flagValue);
messagePlayerNormal(client, `⚙️ You turned ${getBoolRedGreenInlineColour(false)}OFF{MAINCOLOUR} notification by email when somebody tries to login to your account`);
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has toggled the login attempt email notifications OFF for their account`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} has toggled the login attempt email notifications OFF for their account`);
} else {
getPlayerData(client).accountData.settings = addBitFlag(getPlayerData(client).accountData.settings, flagValue);
messagePlayerNormal(client, `⚙️ You turned ${getBoolRedGreenInlineColour(true)}ON{MAINCOLOUR} notification by email when somebody tries to login to your account`);
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has toggled the login attempt email notifications OFF for their account`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} has toggled the login attempt email notifications OFF for their account`);
}
return true;
@@ -341,14 +343,14 @@ function toggleAccountServerLogoCommand(command, params, client) {
if (!doesPlayerHaveLogoEnabled(client)) {
getPlayerData(client).accountData.settings = removeBitFlag(getPlayerData(client).accountData.settings, flagValue);
messagePlayerSuccess(client, getLocaleString(client, "AccountServerLogoSet", `${getBoolRedGreenInlineColour(true)}${getLocaleString(client, "On")}{MAINCOLOUR}`));
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has toggled the server logo ON for their account`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} has toggled the server logo ON for their account`);
if (getServerConfig().showLogo) {
updatePlayerShowLogoState(client, true);
}
} else {
getPlayerData(client).accountData.settings = addBitFlag(getPlayerData(client).accountData.settings, flagValue);
messagePlayerSuccess(client, getLocaleString(client, "AccountServerLogoSet", `${getBoolRedGreenInlineColour(false)}${getLocaleString(client, "Off")}{MAINCOLOUR}`));
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has toggled the server logo OFF for their account`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} has toggled the server logo OFF for their account`);
updatePlayerShowLogoState(client, false);
}
@@ -377,11 +379,11 @@ function toggleAccountTwoFactorAuthCommand(command, params, client) {
if (!doesPlayerHaveTwoFactorAuthEnabled(client)) {
getPlayerData(client).accountData.settings = addBitFlag(getPlayerData(client).accountData.settings, flagValue);
messagePlayerSuccess(client, getLocaleString(client, "TwoFactorAuthSet", `${getBoolRedGreenInlineColour(true)}${getLocaleString(client, "On")}{MAINCOLOUR}`));
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has toggled two-factor authentication ON for their account`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} has toggled two-factor authentication ON for their account`);
} else {
getPlayerData(client).accountData.settings = removeBitFlag(getPlayerData(client).accountData.settings, flagValue);
messagePlayerSuccess(client, getLocaleString(client, "TwoFactorAuthSet", `${getBoolRedGreenInlineColour(false)}${toUpperCase(getLocaleString(client, "Off"))}{MAINCOLOUR}`));
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has toggled two-factor authentication OFF for their account`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} has toggled two-factor authentication OFF for their account`);
}
return true;
}
@@ -614,6 +616,13 @@ function verifyAccountEmailCommand(command, params, client) {
// ===========================================================================
function resetActionTipsCommand(command, params, client) {
getPlayerData(client).promptType = V_PROMPT_RESETACTIONTIPS;
showPlayerPrompt(client, getLocaleString(client, "ResetActionTipsConfirm"), getLocaleString(client, "GUIWarningTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
}
// ===========================================================================
/*
function resetAccountPasswordCommand(command, params, client) {
if(areParamsEmpty(params)) {
@@ -802,7 +811,7 @@ function getAccountHashingFunction() {
// ===========================================================================
async function isNameRegistered(name) {
function isNameRegistered(name) {
let accountData = loadAccountFromName(name, true);
if (accountData.databaseId > 0) {
return true;
@@ -813,22 +822,27 @@ async function isNameRegistered(name) {
// ===========================================================================
function hashAccountPassword(name, password) {
function hashAccountPassword(name, password, revision = 0) {
let hashFunction = getAccountHashingFunction();
let saltedInfo = saltAccountInfo(name, password);
let saltedInfo = saltAccountInfo(name, password, revision);
return hashFunction(saltedInfo);
}
// ===========================================================================
function saltAccountInfo(name, password) {
return `ag.gaming.${accountSaltHash}.${name}.${password}`;
function saltAccountInfo(name, password, revision = 0) {
let tempString = getSecurityConfig().accountPasswordSaltAlgorithm[revision];
tempString = tempString.replace("{NAME}", name);
tempString = tempString.replace("{PASSWORD}", password);
tempString = tempString.replace("{SALTHASH}", getSecurityConfig().accountSaltHash[revision]);
return tempString;
}
// ===========================================================================
function loginSuccess(client) {
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} successfully logged in.`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} successfully logged in.`);
getPlayerData(client).loggedIn = true;
if (getPlayerData(client).loginTimeout != null) {
@@ -839,7 +853,7 @@ function loginSuccess(client) {
updateConnectionLogOnAuth(client, getPlayerData(client).accountData.databaseId);
if (doesPlayerHaveStaffPermission(client, "Developer") || doesPlayerHaveStaffPermission(client, "ManageServer")) {
logToConsole(LOG_WARN, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has needed permissions and is being given administrator access`);
logToConsole(LOG_WARN, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} has needed permissions and is being given administrator access`);
setPlayerNativeAdminState(client, true);
}
@@ -851,11 +865,11 @@ function loginSuccess(client) {
}, 3500);
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the error GUI (not a tester).`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the error GUI (not a tester).`);
showPlayerErrorGUI(client, getLocaleString(client, "NotATester"), getLocaleString(client, "AccessDenied"));
return false;
} else {
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the "not a tester" error message (GUI disabled).`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the "not a tester" error message (GUI disabled).`);
messagePlayerError(client, getLocaleString(client, "NotATester"));
return false;
}
@@ -866,10 +880,10 @@ function loginSuccess(client) {
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
showPlayerPrompt(client, getLocaleString(client, "NoCharactersGUIMessage"), getLocaleString(client, "NoCharactersGUIWindowTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
getPlayerData(client).promptType = V_PROMPT_CREATEFIRSTCHAR;
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the no characters prompt GUI`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the no characters prompt GUI`);
} else {
messagePlayerAlert(client, getLocaleString(client, "NoCharactersChatMessage", `{ALTCOLOUR}/newchar{MAINCOLOUR}`));
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the no characters message (GUI disabled)`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the no characters message (GUI disabled)`);
}
} else {
showCharacterSelectToClient(client);
@@ -915,6 +929,7 @@ function saveAccountToDatabase(accountData) {
["acct_streaming_radio_volume", accountData.streamingRadioVolume],
["acct_ip", accountData.ipAddress],
["acct_locale", accountData.locale],
["acct_pass_revision", accountData.passwordRevision],
];
let data2 = [
@@ -935,6 +950,10 @@ function saveAccountToDatabase(accountData) {
let dbQuery2 = queryDatabase(dbConnection, queryString2);
freeDatabaseQuery(dbQuery2);
//saveAllAccountCommandAliasesToDatabase(accountData);
//saveAllAccountStaffNotesToDatabase(accountData);
//saveAllAccountKeyBindsToDatabase(accountData);
disconnectFromDatabase(dbConnection);
return true;
}
@@ -1010,6 +1029,39 @@ function saveAccountStaffNotesDatabase(staffNoteData) {
// ===========================================================================
function saveAccountCommandAliasesToDatabase(commandAliasData) {
let dbConnection = connectToDatabase();
if (dbConnection) {
let safeOriginalCommandName = escapeDatabaseString(dbConnection, commandAliasData.forCommand);
let safeAliasCommandName = escapeDatabaseString(dbConnection, commandAliasData.aliasCommand);
let data = [
["acct_cmd_for_cmd", safeOriginalCommandName],
["acct_cmd_alias_cmd", safeAliasCommandName],
["acct_cmd_deleted", boolToInt(commandAliasData.whoAdded)],
["acct_cmd_when_added", commandAliasData.whenAdded],
["acct_cmd_server", commandAliasData.server],
["acct_cmd_acct", commandAliasData.account],
];
let dbQuery = null;
if (commandAliasData.databaseId == 0) {
let queryString = createDatabaseInsertQuery("acct_cmd", data);
dbQuery = queryDatabase(dbConnection, queryString);
commandAliasData.databaseId = getDatabaseInsertId(dbConnection);
} else {
let queryString = createDatabaseUpdateQuery("acct_cmd", data, `acct_cmd_id=${commandAliasData.databaseId}`);
dbQuery = queryDatabase(dbConnection, queryString);
}
commandAliasData.needsSaved = false;
freeDatabaseQuery(dbQuery);
disconnectFromDatabase(dbConnection);
}
}
// ===========================================================================
/*
function saveAccountContactsToDatabase(accountContactData) {
let dbConnection = connectToDatabase();
@@ -1033,15 +1085,15 @@ function saveAccountContactsToDatabase(accountContactData) {
// ===========================================================================
async function createAccount(name, password, email = "") {
function createAccount(name, password, email = "", passwordRevision = 0) {
let dbConnection = connectToDatabase();
if (dbConnection) {
let hashedPassword = hashAccountPassword(name, password);
let hashedPassword = hashAccountPassword(name, password, passwordRevision);
let safeName = escapeDatabaseString(dbConnection, name);
let safeEmail = escapeDatabaseString(dbConnection, email);
let dbQuery = queryDatabase(dbConnection, `INSERT INTO acct_main (acct_name, acct_pass, acct_email, acct_when_registered) VALUES ('${safeName}', '${hashedPassword}', '${safeEmail}', CURRENT_TIMESTAMP())`);
let dbQuery = queryDatabase(dbConnection, `INSERT INTO acct_main (acct_name, acct_pass, acct_email, acct_when_registered, acct_pass_revision) VALUES ('${safeName}', '${hashedPassword}', '${safeEmail}', UNIX_TIMESTAMP(), ${passwordRevision})`);
if (getDatabaseInsertId(dbConnection) > 0) {
let insertId = getDatabaseInsertId(dbConnection);
createDefaultAccountServerData(insertId);
@@ -1068,7 +1120,7 @@ function checkLogin(client, password) {
}
if (isPlayerLoggedIn(client)) {
logToConsole(LOG_WARN, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} attempted to login but is already logged in`);
logToConsole(LOG_WARN, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} attempted to login but is already logged in`);
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
showPlayerLoginSuccessGUI(client);
} else {
@@ -1079,25 +1131,25 @@ function checkLogin(client, password) {
}
if (!isPlayerRegistered(client)) {
logToConsole(LOG_WARN, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} attempted to login but is not registered`);
logToConsole(LOG_WARN, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} attempted to login but is not registered`);
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
showPlayerRegistrationGUI(client);
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register GUI`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register GUI`);
} else {
messagePlayerError(client, "Your name is not registered! Use /register to make an account.");
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register message (GUI disabled)`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register message (GUI disabled)`);
}
return false;
}
if (areParamsEmpty(password)) {
logToConsole(LOG_WARN, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} attempted to login but failed (empty password). ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining`);
logToConsole(LOG_WARN, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} attempted to login but failed (empty password). ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining`);
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
showPlayerLoginFailedGUI(client, getLocaleString(client, "LoginFailedInvalidPassword", getPlayerData(client).loginAttemptsRemaining));
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
} else {
messagePlayerError(client, getLocaleString(client, "LoginFailedNoPassword", getPlayerData(client).loginAttemptsRemaining));
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled) with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled) with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
}
// Disabling email login alerts for now. It hangs the server for a couple seconds. Need a way to thread it.
@@ -1108,13 +1160,13 @@ function checkLogin(client, password) {
}
if (!isAccountPasswordCorrect(getPlayerData(client).accountData, hashAccountPassword(getPlayerName(client), password))) {
logToConsole(LOG_WARN, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} attempted to login but failed (wrong password). ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining`);
logToConsole(LOG_WARN, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} attempted to login but failed (wrong password). ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining`);
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
showPlayerLoginFailedGUI(client, getLocaleString(client, "LoginFailedInvalidPassword", getPlayerData(client).loginAttemptsRemaining));
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
} else {
messagePlayerError(client, getLocaleString(client, "LoginFailedInvalidPassword", getPlayerData(client).loginAttemptsRemaining));
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled) with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled) with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
}
// Disabling email login alerts for now. It hangs the server for a couple seconds. Need a way to thread it.
@@ -1147,7 +1199,7 @@ function checkLogin(client, password) {
// ===========================================================================
function checkRegistration(client, password, confirmPassword = "", emailAddress = "") {
logToConsole(LOG_DEBUG, `[AGRP.Account]: Checking registration for ${getPlayerName(client)}`);
logToConsole(LOG_DEBUG, `[V.RP.Account]: Checking registration for ${getPlayerName(client)}`);
if (isPlayerRegistered(client)) {
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
@@ -1268,11 +1320,11 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress
}, 5000);
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the error GUI (not a tester).`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the error GUI (not a tester).`);
showPlayerErrorGUI(client, getLocaleString(client, "NotATester"), getLocaleString(client, "AccessDenied"));
return false;
} else {
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the "not a tester" error message (GUI disabled).`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the "not a tester" error message (GUI disabled).`);
messagePlayerError(client, getLocaleString(client, "NotATester"));
return false;
}
@@ -1421,7 +1473,7 @@ function savePlayerToDatabase(client) {
return false;
}
logToConsole(LOG_DEBUG, `[AGRP.Account]: Saving client ${getPlayerName(client)} to database ...`);
logToConsole(LOG_DEBUG, `[V.RP.Account]: Saving client ${getPlayerName(client)} to database ...`);
saveAccountToDatabase(getPlayerData(client).accountData);
if (getPlayerData(client).currentSubAccount != -1) {
@@ -1441,9 +1493,11 @@ function savePlayerToDatabase(client) {
}
}
getPlayerCurrentSubAccount(client).payDayAmount = getPlayerData(client).payDayAmount;
saveSubAccountToDatabase(getPlayerCurrentSubAccount(client));
}
logToConsole(LOG_DEBUG, `[AGRP.Account]: Saved client ${getPlayerDisplayForConsole(client)} to database successfully!`);
logToConsole(LOG_DEBUG, `[V.RP.Account]: Saved client ${getPlayerDisplayForConsole(client)} to database successfully!`);
return true;
}
@@ -1466,8 +1520,13 @@ function createDefaultAccountServerData(accountDatabaseId) {
let dbConnection = connectToDatabase();
let serversAssoc = fetchQueryAssoc(dbConnection, "SELECT * FROM svr_main");
let defaultSettings = 0;
for (let i in getGlobalConfig().defaultEnabledAccountSettings) {
defaultSettings = addBitFlag(defaultSettings, getAccountSettingsFlagValue(getGlobalConfig().defaultEnabledAccountSettings[i]));
}
for (let i in serversAssoc) {
let dbQueryString = `INSERT INTO acct_svr (acct_svr_acct, acct_svr_svr) VALUES (${accountDatabaseId}, ${serversAssoc[i]["svr_id"]})`;
let dbQueryString = `INSERT INTO acct_svr (acct_svr_acct, acct_svr_svr, acct_svr_settings) VALUES (${accountDatabaseId}, ${serversAssoc[i]["svr_id"]}, ${defaultSettings})`;
quickDatabaseQuery(dbQueryString);
}
@@ -1477,7 +1536,7 @@ function createDefaultAccountServerData(accountDatabaseId) {
// ===========================================================================
function loadAccountKeybindsFromDatabase(accountDatabaseID) {
logToConsole(LOG_DEBUG, `[AGRP.Account]: Loading account keybinds for account ${accountDatabaseID} from database ...`);
logToConsole(LOG_DEBUG, `[V.RP.Account]: Loading account keybinds for account ${accountDatabaseID} from database ...`);
let tempAccountKeybinds = [];
let dbConnection = connectToDatabase();
@@ -1500,21 +1559,21 @@ function loadAccountKeybindsFromDatabase(accountDatabaseID) {
for (let i in dbAssoc) {
let tempAccountKeyBindData = new KeyBindData(dbAssoc[i]);
tempAccountKeybinds.push(tempAccountKeyBindData);
logToConsole(LOG_DEBUG, `[AGRP.Account]: Account keybind '${tempAccountKeyBindData.databaseId}' (Key ${tempAccountKeyBindData.key} '${toUpperCase(getKeyNameFromId(tempAccountKeyBindData.key))}') loaded from database successfully!`);
logToConsole(LOG_DEBUG, `[V.RP.Account]: Account keybind '${tempAccountKeyBindData.databaseId}' (Key ${tempAccountKeyBindData.key} '${toUpperCase(getKeyNameFromId(tempAccountKeyBindData.key))}') loaded from database successfully!`);
}
}
disconnectFromDatabase(dbConnection);
}
}
logToConsole(LOG_DEBUG, `[AGRP.Account]: ${tempAccountKeybinds.length} account keybinds for account ${accountDatabaseID} loaded from database successfully!`);
logToConsole(LOG_DEBUG, `[V.RP.Account]: ${tempAccountKeybinds.length} account keybinds for account ${accountDatabaseID} loaded from database successfully!`);
return tempAccountKeybinds;
}
// ===========================================================================
function loadAccountStaffNotesFromDatabase(accountDatabaseID) {
logToConsole(LOG_DEBUG, `[AGRP.Account]: Loading account staff notes for account ${accountDatabaseID} from database ...`);
logToConsole(LOG_DEBUG, `[V.RP.Account]: Loading account staff notes for account ${accountDatabaseID} from database ...`);
let tempAccountStaffNotes = [];
let dbConnection = connectToDatabase();
@@ -1527,20 +1586,46 @@ function loadAccountStaffNotesFromDatabase(accountDatabaseID) {
for (let i in dbAssoc) {
let tempAccountStaffNoteData = new AccountStaffNoteData(dbAssoc[i]);
tempAccountStaffNotes.push(tempAccountStaffNoteData);
logToConsole(LOG_DEBUG, `[AGRP.Account]: Account staff note '${tempAccountStaffNoteData.databaseId}' loaded from database successfully!`);
logToConsole(LOG_DEBUG, `[V.RP.Account]: Account staff note '${tempAccountStaffNoteData.databaseId}' loaded from database successfully!`);
}
}
disconnectFromDatabase(dbConnection);
}
logToConsole(LOG_DEBUG, `[AGRP.Account]: ${tempAccountStaffNotes.length} account staff notes for account ${accountDatabaseID} loaded from database successfully!`);
logToConsole(LOG_DEBUG, `[V.RP.Account]: ${tempAccountStaffNotes.length} account staff notes for account ${accountDatabaseID} loaded from database successfully!`);
return tempAccountStaffNotes;
}
// ===========================================================================
function loadAccountCommandAliasesFromDatabase(accountDatabaseID) {
logToConsole(LOG_DEBUG, `[V.RP.Account]: Loading account command aliases for account ${accountDatabaseID} from database ...`);
let tempAccountCommandAliases = [];
let dbConnection = connectToDatabase();
let dbAssoc = [];
if (dbConnection) {
let dbQueryString = `SELECT * FROM acct_cmd WHERE acct_cmd_deleted = 0 AND acct_cmd_acct = ${accountDatabaseID}`;
dbAssoc = fetchQueryAssoc(dbConnection, dbQueryString);
if (dbAssoc.length > 0) {
for (let i in dbAssoc) {
let tempAccountCommandAliasData = new AccountCommandAliasData(dbAssoc[i]);
tempAccountCommandAliases.push(tempAccountCommandAliasData);
logToConsole(LOG_DEBUG, `[V.RP.Account]: Account command alias '${tempAccountCommandAliasData.databaseId}' loaded from database successfully!`);
}
}
disconnectFromDatabase(dbConnection);
}
logToConsole(LOG_DEBUG, `[V.RP.Account]: ${tempAccountCommandAliases.length} account command aliases for account ${accountDatabaseID} loaded from database successfully!`);
return tempAccountCommandAliases;
}
// ===========================================================================
function loadAccountContactsFromDatabase(accountDatabaseID) {
logToConsole(LOG_DEBUG, `[AGRP.Account]: Loading account contacts for account ${accountDatabaseID} from database ...`);
logToConsole(LOG_DEBUG, `[V.RP.Account]: Loading account contacts for account ${accountDatabaseID} from database ...`);
let tempAccountContacts = [];
let dbConnection = connectToDatabase();
@@ -1553,20 +1638,20 @@ function loadAccountContactsFromDatabase(accountDatabaseID) {
for (let i in dbAssoc) {
let tempAccountContactData = new AccountContactData(dbAssoc[i]);
tempAccountContacts.push(tempAccountContactData);
logToConsole(LOG_DEBUG, `[AGRP.Account]: Account contact '${tempAccountContactData.databaseId}' loaded from database successfully!`);
logToConsole(LOG_DEBUG, `[V.RP.Account]: Account contact '${tempAccountContactData.databaseId}' loaded from database successfully!`);
}
}
disconnectFromDatabase(dbConnection);
}
logToConsole(LOG_DEBUG, `[AGRP.Account]: ${tempAccountContacts.length} account contacts for account ${accountDatabaseID} loaded from database successfully!`);
logToConsole(LOG_DEBUG, `[V.RP.Account]: ${tempAccountContacts.length} account contacts for account ${accountDatabaseID} loaded from database successfully!`);
return tempAccountContacts;
}
// ===========================================================================
function loadAccountMessagesFromDatabase(accountDatabaseID) {
logToConsole(LOG_DEBUG, `[AGRP.Account]: Loading account messages for account ${accountDatabaseID} from database ...`);
logToConsole(LOG_DEBUG, `[V.RP.Account]: Loading account messages for account ${accountDatabaseID} from database ...`);
let tempAccountMessages = [];
let dbConnection = connectToDatabase();
@@ -1579,13 +1664,13 @@ function loadAccountMessagesFromDatabase(accountDatabaseID) {
for (let i in dbAssoc) {
let tempAccountMessageData = new AccountContactData(dbAssoc[i]);
tempAccountMessages.push(tempAccountMessageData);
logToConsole(LOG_DEBUG, `[AGRP.Account]: Account contact '${tempAccountMessageData.databaseId}' loaded from database successfully!`);
logToConsole(LOG_DEBUG, `[V.RP.Account]: Account contact '${tempAccountMessageData.databaseId}' loaded from database successfully!`);
}
}
disconnectFromDatabase(dbConnection);
}
logToConsole(LOG_DEBUG, `[AGRP.Account]: ${tempAccountMessages.length} account messages for account ${accountDatabaseID} loaded from database successfully!`);
logToConsole(LOG_DEBUG, `[V.RP.Account]: ${tempAccountMessages.length} account messages for account ${accountDatabaseID} loaded from database successfully!`);
return tempAccountMessages;
}
@@ -1664,34 +1749,34 @@ function generateEmailVerificationCode() {
// ===========================================================================
async function sendEmailVerificationEmail(client, emailVerificationCode) {
function sendEmailVerificationEmail(client, emailVerificationCode) {
let emailBodyText = getEmailConfig().bodyContent.confirmEmail;
emailBodyText = emailBodyText.replace("{VERIFICATIONCODE}", emailVerificationCode);
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName());
await sendEmail(getPlayerData(client).accountData.emailAddress, getPlayerData(client).accountData.name, `Confirm email on ${getServerName()}`, emailBodyText);
sendEmail(getPlayerData(client).accountData.emailAddress, getPlayerData(client).accountData.name, `Confirm email on ${getServerName()}`, emailBodyText);
}
// ===========================================================================
async function sendPasswordResetEmail(client, verificationCode) {
function sendPasswordResetEmail(client, verificationCode) {
let emailBodyText = getEmailConfig().bodyContent.confirmPasswordReset;
emailBodyText = emailBodyText.replace("{VERIFICATIONCODE}", verificationCode);
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName());
await sendEmail(getPlayerData(client).accountData.emailAddress, getPlayerData(client).accountData.name, `Reset your password on ${getServerName()}`, emailBodyText);
sendEmail(getPlayerData(client).accountData.emailAddress, getPlayerData(client).accountData.name, `Reset your password on ${getServerName()}`, emailBodyText);
}
// ===========================================================================
async function verifyAccountEmail(accountData, verificationCode) {
function verifyAccountEmail(accountData, verificationCode) {
let emailVerificationCode = generateRandomString(10);
let emailBodyText = getEmailConfig().bodyContent.confirmEmail;
emailBodyText = emailBodyText.replace("{VERIFICATIONCODE}", emailVerificationCode);
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName());
await sendEmail(getPlayerData(client).accountData.emailAddress, getPlayerData(client).accountData.name, `Confirm email on ${getServerName()}`, emailBodyText);
sendEmail(getPlayerData(client).accountData.emailAddress, getPlayerData(client).accountData.name, `Confirm email on ${getServerName()}`, emailBodyText);
getPlayerData(client).accountData.emailAddress = emailAddress;
getPlayerData(client).accountData.emailVerificationCode = module.hashing.sha512(emailVerificationCode);
@@ -1699,7 +1784,7 @@ async function verifyAccountEmail(accountData, verificationCode) {
// ===========================================================================
async function sendAccountLoginFailedNotification(emailAddress, name, ip, game = getGame()) {
function sendAccountLoginFailedNotification(emailAddress, name, ip, game = getGame()) {
let countryName = module.geoip.getCountryName(getGlobalConfig().geoIPCountryDatabaseFilePath, ip);
let subDivisionName = module.geoip.getSubdivisionName(getGlobalConfig().geoIPCityDatabaseFilePath, ip);
let cityName = module.geoip.getCityName(getGlobalConfig().geoIPCityDatabaseFilePath, ip);
@@ -1711,13 +1796,13 @@ async function sendAccountLoginFailedNotification(emailAddress, name, ip, game =
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName());
emailBodyText = emailBodyText.replace("{TIMESTAMP}", new Date().toLocaleString('en-US'));
await sendEmail(emailAddress, name, `Login failed on ${getServerName()}`, emailBodyText);
sendEmail(emailAddress, name, `Login failed on ${getServerName()}`, emailBodyText);
return true;
}
// ===========================================================================
async function sendAccountLoginSuccessNotification(emailAddress, name, ip, game = getGame()) {
function sendAccountLoginSuccessNotification(emailAddress, name, ip, game = getGame()) {
let countryName = module.geoip.getCountryName(getGlobalConfig().geoIPCountryDatabaseFilePath, ip);
let subDivisionName = module.geoip.getSubdivisionName(getGlobalConfig().geoIPCityDatabaseFilePath, ip);
let cityName = module.geoip.getCityName(getGlobalConfig().geoIPCityDatabaseFilePath, ip);
@@ -1729,7 +1814,7 @@ async function sendAccountLoginSuccessNotification(emailAddress, name, ip, game
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName());
emailBodyText = emailBodyText.replace("{TIMESTAMP}", new Date().toLocaleString('en-US'));
await sendEmail(emailAddress, name, `Login successful on ${getServerName()}`, emailBodyText);
sendEmail(emailAddress, name, `Login successful on ${getServerName()}`, emailBodyText);
return true;
}
@@ -1775,13 +1860,13 @@ function isPlayerATester(client) {
// ===========================================================================
async function sendAccountTwoFactorAuthCode(emailAddress, name, twoFactorAuthCode) {
function sendAccountTwoFactorAuthCode(emailAddress, name, twoFactorAuthCode) {
let emailBodyText = getEmailConfig().bodyContent.twoFactorAuthentication;
emailBodyText = emailBodyText.replace("{2FACODE}", twoFactorAuthCode);
emailBodyText = emailBodyText.replace("{GAMENAME}", getGameName(getGame()));
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName());
await sendEmail(emailAddress, name, `Login code for ${getServerName()}`, emailBodyText);
sendEmail(emailAddress, name, `Login code for ${getServerName()}`, emailBodyText);
return true;
}

View File

@@ -29,6 +29,12 @@ function playPlayerAnimationCommand(command, params, client) {
return false;
}
if (!getAnimationData(animationSlot)) {
messagePlayerError(client, getLocaleString(client, "InvalidAnimation"));
messagePlayerInfo(client, getLocaleString(client, "AnimationCommandTip", `{ALTCOLOUR}/animlist{MAINCOLOUR}`));
return false;
}
if (toInteger(animationPositionOffset) < 0 || toInteger(animationPositionOffset) > 3) {
messagePlayerError(client, getLocaleString(client, "InvalidAnimationDistance"));
return false;

View File

@@ -65,7 +65,7 @@ function accountBanCommand(command, params, client) {
return false;
}
logToConsole(LOG_WARN, `[AGRP.Ban]: ${getPlayerDisplayForConsole(targetClient)} (${getPlayerData(targetClient).accountData.name}) account was banned by ${getPlayerDisplayForConsole(client)}. Reason: ${reason}`);
logToConsole(LOG_WARN, `[V.RP.Ban]: ${getPlayerDisplayForConsole(targetClient)} (${getPlayerData(targetClient).accountData.name}) account was banned by ${getPlayerDisplayForConsole(client)}. Reason: ${reason}`);
announceAdminAction(`PlayerAccountBanned`, `{ALTCOLOUR}${getPlayerName(targetClient)}{MAINCOLOUR}`);
banAccount(getPlayerData(targetClient).accountData.databaseId, getPlayerData(client).accountData.databaseId, reason);
@@ -97,7 +97,7 @@ function subAccountBanCommand(command, params, client, fromDiscord) {
return false;
}
logToConsole(LOG_WARN, `[AGRP.Ban]: ${getPlayerDisplayForConsole(targetClient)} (${getPlayerData(targetClient).accountData.name})'s subaccount was banned by ${getPlayerDisplayForConsole(client)}. Reason: ${reason}`);
logToConsole(LOG_WARN, `[V.RP.Ban]: ${getPlayerDisplayForConsole(targetClient)} (${getPlayerData(targetClient).accountData.name})'s subaccount was banned by ${getPlayerDisplayForConsole(client)}. Reason: ${reason}`);
announceAdminAction(`PlayerCharacterBanned`, `{ALTCOLOUR}${getPlayerName(targetClient)}{MAINCOLOUR}`);
banSubAccount(getPlayerData(targetClient).currentSubAccountData.databaseId, getPlayerData(client).accountData.databaseId, reason);

View File

@@ -40,6 +40,7 @@ let serverBitFlagKeys = {
"Developer",
"ManageNPCs",
"ManageRaces",
"ManagePayPhones",
],
moderationFlagKeys: [
"None",
@@ -261,14 +262,14 @@ let serverBitFlagKeys = {
"EnterJobVehicleForRoute",
"JobLocations",
"JobRouteStart",
"PayPhoneFirstUse",
],
jobRankKeys: [
jobFlagKeys: [
"None",
"PublicAccess",
"WhiteList",
"BlackList",
"AddMember",
"RemoveMember",
"SuspendMember",
"SetRank",
"SetPay",
"ManageUniforms",
"ManageEquipment",
"ManageVehicles",
@@ -293,7 +294,7 @@ function initBitFlagScript() {
serverBitFlags.npcTriggerConditionTypes = createBitFlagTable(serverBitFlagKeys.npcTriggerConditionTypeKeys);
serverBitFlags.npcTriggerResponseTypes = createBitFlagTable(serverBitFlagKeys.npcTriggerResponseTypeKeys);
serverBitFlags.seenActionTips = createBitFlagTable(serverBitFlagKeys.seenActionTipsKeys);
serverBitFlags.jobRankFlags = createBitFlagTable(serverBitFlagKeys.jobRankKeys);
serverBitFlags.jobFlags = createBitFlagTable(serverBitFlagKeys.jobFlagKeys);
logToConsole(LOG_INFO, "[V.RP.BitFlag]: Bit flag script initialized successfully!");
return true;
}
@@ -420,6 +421,20 @@ function getClanFlagValue(flagName) {
// ===========================================================================
function getJobFlagValue(flagName) {
if (flagName == "All") {
return -1;
}
if (typeof getServerBitFlags().jobFlags[flagName] == "undefined") {
return false;
}
return getServerBitFlags().jobFlags[flagName];
}
// ===========================================================================
function getAccountSettingsFlagValue(flagName) {
if (flagName == "All") {
return -1;

View File

@@ -95,6 +95,9 @@ class BusinessData {
this.labelHelpType = V_PROPLABEL_INFO_NONE;
this.whoAdded = 0;
this.whenAdded = 0;
if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["biz_id"]);
this.name = toString(dbAssoc["biz_name"]);
@@ -124,9 +127,10 @@ class BusinessData {
this.entranceFee = toInteger(dbAssoc["biz_entrance_fee"]);
this.till = toInteger(dbAssoc["biz_till"]);
this.labelHelpType = toInteger(dbAssoc["biz_label_help_type"]);
this.streamingRadioStation = toInteger(dbAssoc["biz_radio_station"]);
this.whoAdded = toInteger(dbAssoc["biz_who_added"]);
this.whenAdded = toInteger(dbAssoc["biz_when_added"]);
}
};
};
@@ -224,24 +228,24 @@ function loadBusinessesFromDatabase() {
if (dbAssoc.length > 0) {
for (let i in dbAssoc) {
let tempBusinessData = new BusinessData(dbAssoc[i]);
tempBusinessData.locations = loadBusinessLocationsFromDatabase(tempBusinessData.databaseId);
//tempBusinessData.locations = loadBusinessLocationsFromDatabase(tempBusinessData.databaseId);
//tempBusinessData.gameScripts = loadBusinessGameScriptsFromDatabase(tempBusinessData.databaseId);
tempBusinesses.push(tempBusinessData);
logToConsole(LOG_VERBOSE, `[AGRP.Business]: Business '${tempBusinessData.name}' (ID ${tempBusinessData.databaseId}) loaded from database successfully!`);
logToConsole(LOG_VERBOSE, `[V.RP.Business]: Business '${tempBusinessData.name}' (ID ${tempBusinessData.databaseId}) loaded from database successfully!`);
}
}
disconnectFromDatabase(dbConnection);
}
logToConsole(LOG_INFO, `[AGRP.Business]: ${tempBusinesses.length} businesses loaded from database successfully!`);
logToConsole(LOG_INFO, `[V.RP.Business]: ${tempBusinesses.length} businesses loaded from database successfully!`);
return tempBusinesses;
}
// ===========================================================================
function loadBusinessLocationsFromDatabase(businessId) {
logToConsole(LOG_VERBOSE, `[AGRP.Business]: Loading business locations for business ${businessId} from database ...`);
logToConsole(LOG_VERBOSE, `[V.RP.Business]: Loading business locations for business ${businessId} from database ...`);
let tempBusinessLocations = [];
let dbConnection = connectToDatabase();
@@ -255,13 +259,13 @@ function loadBusinessLocationsFromDatabase(businessId) {
for (let i in dbAssoc) {
let tempBusinessLocationData = new BusinessLocationData(dbAssoc[i]);
tempBusinessLocations.push(tempBusinessLocationData);
logToConsole(LOG_VERBOSE, `[AGRP.Business]: Location '${tempBusinessLocationData.name}' loaded from database successfully!`);
logToConsole(LOG_VERBOSE, `[V.RP.Business]: Location '${tempBusinessLocationData.name}' loaded from database successfully!`);
}
}
disconnectFromDatabase(dbConnection);
}
logToConsole(LOG_VERBOSE, `[AGRP.Business]: ${tempBusinessLocations.length} location for business ${businessId} loaded from database successfully!`);
logToConsole(LOG_VERBOSE, `[V.RP.Business]: ${tempBusinessLocations.length} location for business ${businessId} loaded from database successfully!`);
return tempBusinessLocations;
}
@@ -269,7 +273,7 @@ function loadBusinessLocationsFromDatabase(businessId) {
/*
function loadBusinessGameScriptsFromDatabase(businessId) {
logToConsole(LOG_VERBOSE, `[AGRP.Business]: Loading business game scripts for business ${businessId} from database ...`);
logToConsole(LOG_VERBOSE, `[V.RP.Business]: Loading business game scripts for business ${businessId} from database ...`);
let tempBusinessGameScripts = [];
let dbConnection = connectToDatabase();
@@ -284,13 +288,13 @@ function loadBusinessGameScriptsFromDatabase(businessId) {
for (let i in dbAssoc) {
let tempBusinessGameScriptData = new BusinessGameScriptData(dbAssoc[i]);
tempBusinessGameScripts.push(tempBusinessGameScriptData);
logToConsole(LOG_VERBOSE, `[AGRP.Business]: Game script '${tempBusinessGameScriptData.name}' loaded from database successfully!`);
logToConsole(LOG_VERBOSE, `[V.RP.Business]: Game script '${tempBusinessGameScriptData.name}' loaded from database successfully!`);
}
}
disconnectFromDatabase(dbConnection);
}
logToConsole(LOG_VERBOSE, `[AGRP.Business]: ${tempBusinessGameScripts.length} game scripts for business ${businessId} loaded from database successfully!`);
logToConsole(LOG_VERBOSE, `[V.RP.Business]: ${tempBusinessGameScripts.length} game scripts for business ${businessId} loaded from database successfully!`);
return tempBusinessGameScripts;
}
*/
@@ -315,7 +319,9 @@ function createBusinessCommand(command, params, client) {
-1,
getPlayerInterior(client),
getPlayerDimension(client),
getPlayerData(client).interiorScene);
getPlayerData(client).interiorScene,
getPlayerData(client).accountData.databaseId
);
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} created business: {businessBlue}${params}`, true);
}
@@ -357,7 +363,7 @@ function createBusinessLocationCommand(command, params, client) {
// ===========================================================================
function createBusiness(name, entrancePosition, exitPosition, entrancePickupModel = -1, entranceBlipModel = -1, entranceInterior = 0, entranceDimension = 0, entranceScene = -1) {
function createBusiness(name, entrancePosition, exitPosition, entrancePickupModel = -1, entranceBlipModel = -1, entranceInterior = 0, entranceDimension = 0, entranceScene = -1, whoAdded = defaultNoAccountId) {
let tempBusinessData = new BusinessData(false);
tempBusinessData.name = name;
@@ -377,13 +383,16 @@ function createBusiness(name, entrancePosition, exitPosition, entrancePickupMode
tempBusinessData.exitDimension = 0;
tempBusinessData.exitScene = -1;
tempBusinessData.whoAdded = whoAdded;
tempBusinessData.whenAdded = getCurrentUnixTimestamp();
tempBusinessData.needsSaved = true;
let businessId = getServerData().businesses.push(tempBusinessData);
setBusinessDataIndexes();
saveAllBusinessesToDatabase();
createBusinessPickups(businessId - 1);
createBusinessBlips(businessId - 1);
spawnBusinessPickups(businessId - 1);
spawnBusinessBlips(businessId - 1);
return tempBusinessData;
}
@@ -460,8 +469,9 @@ function setBusinessNameCommand(command, params, client) {
let oldBusinessName = getBusinessData(businessId).name;
getBusinessData(businessId).name = newBusinessName;
setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.name", getBusinessData(businessId).name, true);
getBusinessData(businessId).needsSaved = true;
updateBusinessPickupLabelData(businessId);
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} renamed business {businessBlue}${oldBusinessName}{MAINCOLOUR} to {businessBlue}${newBusinessName}`, true);
}
@@ -503,6 +513,7 @@ function setBusinessOwnerCommand(command, params, client) {
getBusinessData(businessId).ownerType = V_BIZ_OWNER_PLAYER;
getBusinessData(businessId).ownerId = getPlayerCurrentSubAccount(newBusinessOwner).databaseId;
getBusinessData(businessId).needsSaved = true;
updateBusinessPickupLabelData(businessId);
messagePlayerSuccess(client, `{MAINCOLOUR}You gave business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} to {ALTCOLOUR}${getCharacterFullName(newBusinessOwner)}`);
}
@@ -545,6 +556,7 @@ function setBusinessJobCommand(command, params, client) {
getBusinessData(businessId).ownerType = V_BIZ_OWNER_JOB;
getBusinessData(businessId).ownerId = getJobData(jobId).databaseId;
getBusinessData(businessId).needsSaved = true;
updateBusinessPickupLabelData(businessId);
messagePlayerSuccess(client, `{MAINCOLOUR}You set the owner of business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} to the {jobYellow}${getJobData(jobId).name}`);
}
@@ -728,8 +740,9 @@ function setBusinessJobCommand(command, params, client) {
getBusinessData(businessId).ownerType = V_BIZ_OWNER_JOB;
getBusinessData(businessId).ownerId = getJobData(jobId).databaseId;
getBusinessData(businessId).needsSaved = true;
updateBusinessPickupLabelData(businessId);
messagePlayerSuccess(client, `{MAINCOLOUR}You set business {businessBlue}${getBusinessData(businessId).name} {MAINCOLOUR}owner to the {jobYellow}${getJobData(jobId).name} {MAINCOLOUR}job`);
}
@@ -758,8 +771,9 @@ function setBusinessPublicCommand(command, params, client) {
getBusinessData(businessId).ownerType = V_BIZ_OWNER_PUBLIC;
getBusinessData(businessId).ownerId = 0;
getBusinessData(businessId).needsSaved = true;
updateBusinessPickupLabelData(businessId);
messagePlayerSuccess(client, `{MAINCOLOUR}You set business {businessBlue}${getBusinessData(businessId).name} {MAINCOLOUR}owner set to {ALTCOLOUR}public`);
}
@@ -789,6 +803,7 @@ function removeBusinessOwnerCommand(command, params, client) {
getBusinessData(businessId).ownerType = V_BIZ_OWNER_NONE;
getBusinessData(businessId).ownerId = -1;
getBusinessData(businessId).needsSaved = true;
updateBusinessPickupLabelData(businessId);
messagePlayerSuccess(client, `{MAINCOLOUR}You removed business {businessBlue}${getBusinessData(businessId).name}'s{MAINCOLOUR} owner`);
}
@@ -819,8 +834,8 @@ function toggleBusinessInteriorLightsCommand(command, params, client) {
getBusinessData(businessId).interiorLights = !getBusinessData(businessId).interiorLights;
updateBusinessInteriorLightsForOccupants(businessId);
getBusinessData(businessId).needsSaved = true;
meActionToNearbyPlayers(client, `turns ${toLowerCase(getOnOffFromBool(getBusinessData(businessId).interiorLights))} the business lights`);
}
@@ -852,6 +867,7 @@ function setBusinessEntranceFeeCommand(command, params, client) {
getBusinessData(businessId).entranceFee = entranceFee;
getBusinessData(businessId).needsSaved = true;
updateBusinessPickupLabelData(businessId);
messagePlayerSuccess(client, `{MAINCOLOUR}You set business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} entrance fee to {ALTCOLOUR}${getCurrencyString(entranceFee)}`);
}
@@ -881,6 +897,8 @@ function setBusinessPaintBallCommand(command, params, client) {
getBusinessData(businessId).type = V_BIZ_TYPE_PAINTBALL;
getBusinessData(businessId).needsSaved = true;
updateBusinessPickupLabelData(businessId);
messagePlayerSuccess(client, getLocaleString(client, "BusinessIsNowPaintBall"));
}
@@ -1105,6 +1123,8 @@ function setBusinessInteriorTypeCommand(command, params, client) {
getBusinessData(businessId).exitScene = "";
getBusinessData(businessId).exitPickupModel = -1;
getBusinessData(businessId).customInterior = false;
getBusinessData(businessId).exitScene = "";
getBusinessData(businessId).entranceScene = "";
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} removed business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} interior`, true);
return false;
}
@@ -1129,18 +1149,15 @@ function setBusinessInteriorTypeCommand(command, params, client) {
getBusinessData(businessId).customInterior = getGameConfig().interiors[getGame()][typeParam][2];
if (isGameFeatureSupported("interiorScene")) {
if (isMainWorldScene(getPlayerData(client).scene)) {
getBusinessData(businessId).exitScene = getGameConfig().mainWorldScene[getGame()];
} else {
getBusinessData(businessId).exitScene = getGameConfig().interiors[getGame()][typeParam][3];
}
getBusinessData(businessId).exitScene = getGameConfig().interiors[getGame()][typeParam][3];
getBusinessData(businessId).entranceScene = getPlayerData(client).scene;
}
}
//deleteBusinessExitPickup(businessId);
//deleteBusinessExitBlip(businessId);
//createBusinessExitBlip(businessId);
//createBusinessExitPickup(businessId);
//spawnBusinessExitBlip(businessId);
//spawnBusinessExitPickup(businessId);
resetBusinessPickups(businessId);
@@ -1198,8 +1215,8 @@ function addBusinessPropertyTemplateEntities(command, params, client) {
//deleteBusinessExitPickup(businessId);
//deleteBusinessExitBlip(businessId);
//createBusinessExitBlip(businessId);
//createBusinessExitPickup(businessId);
//spawnBusinessExitBlip(businessId);
//spawnBusinessExitPickup(businessId);
resetBusinessPickups(businessId);
@@ -1278,6 +1295,8 @@ function giveDefaultItemsToBusinessCommand(command, params, client) {
return false;
}
saveBusinessToDatabase(businessId);
if (isNull(getGameConfig().defaultBusinessItems[getGame()][typeParam])) {
messagePlayerError(client, "Invalid business items type! Use a business items type name");
let businessItemTypes = Object.keys(getGameConfig().defaultBusinessItems[getGame()]);
@@ -1301,6 +1320,7 @@ function giveDefaultItemsToBusinessCommand(command, params, client) {
cacheBusinessItems(businessId);
updateBusinessPickupLabelData(businessId);
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} gave business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} the default items for ${typeParam}`, true);
}
@@ -1326,6 +1346,7 @@ function setBusinessDealershipCommand(command, params, client) {
getBusinessData(businessId).labelHelpType == V_PROPLABEL_INFO_ENTERVEHICLE;
getBusinessData(businessId).type = V_BIZ_TYPE_DEALERSHIP;
updateBusinessPickupLabelData(businessId);
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set the type of business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} to dealership`, true);
}
@@ -1468,9 +1489,9 @@ function setBusinessBuyPriceCommand(command, params, client) {
}
getBusinessData(businessId).buyPrice = amount;
setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.price", getBusinessData(businessId).buyPrice, true);
getBusinessData(businessId).needsSaved = true;
updateBusinessPickupLabelData(businessId);
messagePlayerSuccess(client, `{MAINCOLOUR}You set business {businessBlue}${getBusinessData(businessId).name}'s{MAINCOLOUR} for-sale price to {ALTCOLOUR}${getCurrencyString(amount)}`);
}
@@ -1554,7 +1575,7 @@ function orderItemForBusinessCommand(command, params, client) {
let value = getItemTypeData(itemType).orderValue;
let businessId = getPlayerBusiness(client);
logToConsole(LOG_DEBUG, `[AGRP.Business] ${getPlayerDisplayForConsole(client)} is ordering ${amount} ${splitParams.slice(0, -2).join(" ")}`);
logToConsole(LOG_DEBUG, `[V.RP.Business] ${getPlayerDisplayForConsole(client)} is ordering ${amount} ${splitParams.slice(0, -2).join(" ")}`);
if (!getBusinessData(businessId)) {
messagePlayerError(client, getLocaleString(client, "InvalidBusiness"));
@@ -1573,23 +1594,14 @@ function orderItemForBusinessCommand(command, params, client) {
getPlayerData(client).businessOrderBusiness = businessId;
getPlayerData(client).businessOrderItem = itemType;
getPlayerData(client).businessOrderCost = orderTotalCost;
getBusinessData(businessId).needsSaved = true;
showPlayerPrompt(client, `Ordering ${amount} ${getPluralForm(getItemTypeData(itemType).name)} will cost a total of ${getCurrencyString(orderTotalCost)}`, "Business Order Cost");
getPlayerData(client).promptType = V_PROMPT_BIZORDER;
}
// ===========================================================================
/**
* This is a command handler function.
*
* @param {string} command - The command name used by the player
* @param {string} params - The parameters/args string used with the command by the player
* @param {Client} client - The client/player that used the command
* @return {bool} Whether or not the command was successful
*
*/
function orderItemForBusiness(businessId, itemType, amount) {
if (getBusinessData(businessId).till < orderTotalCost) {
let neededAmount = orderTotalCost - getBusinessData(businessId).till;
@@ -1695,8 +1707,8 @@ function moveBusinessEntranceCommand(command, params, client) {
//deleteBusinessEntranceBlip(businessId);
//deleteBusinessEntrancePickup(businessId);
//createBusinessEntranceBlip(businessId);
//createBusinessEntrancePickup(businessId);
//spawnBusinessEntranceBlip(businessId);
//spawnBusinessEntrancePickup(businessId);
resetBusinessPickups(businessId);
resetBusinessBlips(businessId);
@@ -1736,8 +1748,8 @@ function moveBusinessExitCommand(command, params, client) {
deleteBusinessExitBlip(businessId);
deleteBusinessExitPickup(businessId);
createBusinessExitBlip(businessId);
createBusinessExitPickup(businessId);
spawnBusinessExitBlip(businessId);
spawnBusinessExitPickup(businessId);
getBusinessData(businessId).needsSaved = true;
@@ -1893,7 +1905,7 @@ function saveBusinessToDatabase(businessId) {
return false;
}
logToConsole(LOG_DEBUG, `[AGRP.Business]: Saving business '${tempBusinessData.name}' to database ...`);
logToConsole(LOG_DEBUG, `[V.RP.Business]: Saving business '${tempBusinessData.name}' to database ...`);
let dbConnection = connectToDatabase();
if (dbConnection) {
let safeBusinessName = escapeDatabaseString(dbConnection, tempBusinessData.name);
@@ -1930,6 +1942,8 @@ function saveBusinessToDatabase(businessId) {
["biz_radio_station", (getRadioStationData(tempBusinessData.streamingRadioStationIndex) != false) ? toInteger(getRadioStationData(tempBusinessData.streamingRadioStationIndex).databaseId) : -1],
["biz_custom_interior", boolToInt(tempBusinessData.customInterior)],
["biz_buy_price", tempBusinessData.buyPrice],
["biz_who_added", tempBusinessData.whoAdded],
["biz_when_added", tempBusinessData.whenAdded],
//["biz_rent_price", tempBusinessData.rentPrice],
];
@@ -1949,7 +1963,7 @@ function saveBusinessToDatabase(businessId) {
disconnectFromDatabase(dbConnection);
return true;
}
logToConsole(LOG_DEBUG, `[AGRP.Business]: Saved business '${tempBusinessData.name}' to database!`);
logToConsole(LOG_DEBUG, `[V.RP.Business]: Saved business '${tempBusinessData.name}' to database!`);
return false;
}
@@ -1962,14 +1976,14 @@ function saveBusinessToDatabase(businessId) {
* @return {Boolean} Whether or not the server pickups were created
*
*/
function createAllBusinessPickups() {
function spawnAllBusinessPickups() {
if (!getServerConfig().createBusinessPickups) {
return false;
}
for (let i in getServerData().businesses) {
createBusinessEntrancePickup(i);
createBusinessExitPickup(i);
spawnBusinessEntrancePickup(i);
spawnBusinessExitPickup(i);
updateBusinessPickupLabelData(i);
}
@@ -1984,7 +1998,7 @@ function createAllBusinessPickups() {
* @return {Boolean} Whether or not the server blips were created
*
*/
function createAllBusinessBlips() {
function spawnAllBusinessBlips() {
if (!getServerConfig().createBusinessBlips) {
return false;
}
@@ -1994,8 +2008,8 @@ function createAllBusinessBlips() {
}
for (let i in getServerData().businesses) {
createBusinessEntranceBlip(i);
createBusinessExitBlip(i);
spawnBusinessEntranceBlip(i);
spawnBusinessExitBlip(i);
}
}
@@ -2008,7 +2022,7 @@ function createAllBusinessBlips() {
* @return {Boolean} Whether or not the blip was created
*
*/
function createBusinessEntrancePickup(businessId) {
function spawnBusinessEntrancePickup(businessId) {
if (!getServerConfig().createBusinessPickups) {
return false;
}
@@ -2019,7 +2033,7 @@ function createBusinessEntrancePickup(businessId) {
// return false;
//}
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating entrance pickup for business ${businessData.name}`);
logToConsole(LOG_VERBOSE, `[V.RP.Business]: Creating entrance pickup for business ${businessData.name} (${businessData.databaseId})`);
if (areServerElementsSupported() && getGame() != V_GAME_MAFIA_ONE && getGame() != V_GAME_GTA_IV) {
let entrancePickup = null;
@@ -2071,7 +2085,7 @@ function createBusinessEntrancePickup(businessId) {
* @return {Boolean} Whether or not the blip was created
*
*/
function createBusinessEntranceBlip(businessId) {
function spawnBusinessEntranceBlip(businessId) {
if (!getServerConfig().createBusinessBlips) {
return false;
}
@@ -2096,7 +2110,7 @@ function createBusinessEntranceBlip(businessId) {
blipModelId = businessData.entranceBlipModel;
}
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating entrance blip for business ${businessData.name} (model ${blipModelId})`);
logToConsole(LOG_VERBOSE, `[V.RP.Job]: Creating entrance blip for business ${businessData.name} (model ${blipModelId})`);
if (areServerElementsSupported() && getGame() != V_GAME_MAFIA_ONE && getGame() != V_GAME_GTA_IV) {
let entranceBlip = createGameBlip(businessData.entrancePosition, blipModelId, 1, getColourByType("businessBlue"));
@@ -2129,7 +2143,7 @@ function createBusinessEntranceBlip(businessId) {
* @return {Boolean} Whether or not the pickup was created
*
*/
function createBusinessExitPickup(businessId) {
function spawnBusinessExitPickup(businessId) {
if (!areServerElementsSupported()) {
return false;
}
@@ -2148,7 +2162,7 @@ function createBusinessExitPickup(businessId) {
return false;
}
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating exit pickup for business ${businessData.name}`);
logToConsole(LOG_VERBOSE, `[V.RP.Job]: Creating exit pickup for business ${businessData.name}`);
let exitPickup = null;
if (isGameFeatureSupported("pickup")) {
@@ -2191,7 +2205,7 @@ function createBusinessExitPickup(businessId) {
* @return {Boolean} Whether or not the blip was created
*
*/
function createBusinessExitBlip(businessId) {
function spawnBusinessExitBlip(businessId) {
if (!areServerElementsSupported()) {
return false;
}
@@ -2220,7 +2234,7 @@ function createBusinessExitBlip(businessId) {
blipModelId = businessData.exitBlipModel;
}
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating exit blip for business ${businessData.name} (model ${blipModelId})`);
logToConsole(LOG_VERBOSE, `[V.RP.Job]: Creating exit blip for business ${businessData.name} (model ${blipModelId})`);
let exitBlip = createGameBlip(businessData.exitPosition, blipModelId, 1, getColourByName("businessBlue"));
if (exitBlip != null) {
@@ -2269,8 +2283,8 @@ function deleteBusiness(businessId, whoDeleted = 0) {
}
removePlayersFromBusiness(businessId);
getServerData().businesses.splice(businessId, 1);
updateBusinessPickupLabelData(businessId, true);
return true;
}
@@ -2411,7 +2425,7 @@ function deleteBusinessEntrancePickup(businessId) {
//removeFromWorld(getBusinessData(businessId).entrancePickup);
deleteGameElement(getBusinessData(businessId).entrancePickup);
getBusinessData(businessId).entrancePickup = null;
updateBusinessPickupLabelData(businessId);
return true;
}
@@ -2510,8 +2524,8 @@ function reloadAllBusinessesCommand(command, params, client) {
//forceAllPlayersToStopWorking();
clearArray(getServerData().businesses);
getServerData().businesses = loadBusinessesFromDatabase();
createAllBusinessPickups();
createAllBusinessBlips();
spawnAllBusinessPickups();
spawnAllBusinessBlips();
setBusinessDataIndexes();
cacheAllBusinessItems();
@@ -2616,6 +2630,14 @@ function buyFromBusinessCommand(command, params, client) {
return false;
}
let useType = getItemTypeData(getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).itemTypeIndex).useType;
if (useType == V_ITEM_USE_TYPE_WEAPON || V_ITEM_USE_TYPE_TAZER || useType == V_ITEM_USE_TYPE_AMMO_CLIP) {
if (isPlayerWeaponBanned(client) && !isPlayerExemptFromAntiCheat(client)) {
messagePlayerError(client, getLocaleString(client, "WeaponBanned"));
return false;
}
}
let amount = 1;
if (areThereEnoughParams(params, 2, " ")) {
amount = toInteger(getParam(params, " ", 2)) || 1;
@@ -2640,12 +2662,12 @@ function buyFromBusinessCommand(command, params, client) {
let itemName = getItemTypeData(getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).itemTypeIndex).name;
if (getPlayerCurrentSubAccount(client).cash < totalCost) {
messagePlayerError(client, getLocaleString(client, "NotEnoughCashNeedAmountMore", `{ALTCOLOUR}${getBusinessData(businessId).floorItemCache[itemSlot - 1].buyPrice * amount - getPlayerCurrentSubAccount(client).cash}{MAINCOLOUR}`));
messagePlayerError(client, getLocaleString(client, "NotEnoughCashNeedAmountMore", `{ALTCOLOUR}${totalCost - getPlayerCurrentSubAccount(client).cash}{MAINCOLOUR}`));
return false;
}
takePlayerCash(client, totalCost);
createItem(getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).itemTypeIndex, getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).value, V_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId, amount);
let itemIndex = createItem(getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).itemTypeIndex, getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).value, V_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId, amount);
cachePlayerHotBarItems(client);
getBusinessData(businessId).till = getBusinessData(businessId).till + totalCost;
@@ -2654,14 +2676,6 @@ function buyFromBusinessCommand(command, params, client) {
deleteItem(getBusinessData(businessId).floorItemCache[itemSlot - 1]);
}
let useType = getItemTypeData(getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).itemTypeIndex).useType;
if (useType == V_ITEM_USE_TYPE_WEAPON || V_ITEM_USE_TYPE_TAZER || useType == V_ITEM_USE_TYPE_AMMO_CLIP) {
if (isPlayerWeaponBanned(client) && !isPlayerExemptFromAntiCheat(client)) {
messagePlayerError(client, getLocaleString(client, "WeaponBanned"));
return false;
}
}
//messagePlayerSuccess(client, `You bought ${amount} {ALTCOLOUR}${itemName} {MAINCOLOUR}for ${totalCost} ${priceEach}`);
meActionToNearbyPlayers(client, `buys a ${itemName}`);
@@ -2674,7 +2688,7 @@ function buyFromBusinessCommand(command, params, client) {
}
}
markPlayerActionTipSeen(client, "ViewInventory");
logBusinessItemPurchase(getBusinessData(businessId).databaseId, getPlayerCurrentSubAccount(client).databaseId, getItemData(itemIndex).databaseId);
}
// ===========================================================================
@@ -2717,7 +2731,7 @@ function setBusinessItemSellPriceCommand(command, params, client) {
getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).buyPrice = newPrice;
messagePlayerSuccess(client, `You changed the price of the {ALTCOLOUR}${getItemTypeData(getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).itemTypeIndex).name}'s {MAINCOLOUR}in slot {ALTCOLOUR}${itemSlot} {MAINCOLOUR}from ${getCurrencyString(oldPrice)} to ${getCurrencyString(newprice)}`);
messagePlayerSuccess(client, `You changed the price of the {ALTCOLOUR}${getItemTypeData(getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).itemTypeIndex).name}'s {MAINCOLOUR}in slot {ALTCOLOUR}${itemSlot} {MAINCOLOUR}from ${getCurrencyString(oldPrice)} to ${getCurrencyString(newPrice)}`);
}
// ===========================================================================
@@ -2841,11 +2855,11 @@ function cacheBusinessItems(businessId) {
clearArray(getBusinessData(businessId).storageItemCache);
//let businessData = getBusinessData(businessId);
//logToConsole(LOG_VERBOSE, `[AGRP.Business] Caching business items for business ${businessId} (${businessData.name}) ...`);
//logToConsole(LOG_VERBOSE, `[V.RP.Business] Caching business items for business ${businessId} (${businessData.name}) ...`);
//getBusinessData(businessId).floorItemCache = getServerData().items.filter(item => item.ownerType == V_ITEM_OWNER_BIZFLOOR && item.ownerId == businessData.databaseId).map(i => i.index);
//getBusinessData(businessId).storageItemCache = getServerData().items.filter(item => item.ownerType == V_ITEM_OWNER_BIZSTORAGE && item.ownerId == businessData.databaseId);
logToConsole(LOG_VERBOSE, `[AGRP.Business] Caching business items for business ${businessId} (${getBusinessData(businessId).name}) ...`);
logToConsole(LOG_VERBOSE, `[V.RP.Business] Caching business items for business ${businessId} (${getBusinessData(businessId).name}) ...`);
for (let i in getServerData().items) {
if (getItemData(i).ownerType == V_ITEM_OWNER_BIZFLOOR && getItemData(i).ownerId == getBusinessData(businessId).databaseId) {
getBusinessData(businessId).floorItemCache.push(i);
@@ -2854,7 +2868,7 @@ function cacheBusinessItems(businessId) {
}
}
logToConsole(LOG_VERBOSE, `[AGRP.Business] Successfully cached ${getBusinessData(businessId).floorItemCache.length} floor items and ${getBusinessData(businessId).storageItemCache} storage items for business ${businessId} (${getBusinessData(businessId).name})!`);
logToConsole(LOG_VERBOSE, `[V.RP.Business] Successfully cached ${getBusinessData(businessId).floorItemCache.length} floor items and ${getBusinessData(businessId).storageItemCache} storage items for business ${businessId} (${getBusinessData(businessId).name})!`);
}
// ===========================================================================
@@ -2867,9 +2881,19 @@ function getBusinessIdFromDatabaseId(databaseId) {
// ===========================================================================
// Updates all pickup data for a business by businessId
function updateBusinessPickupLabelData(businessId) {
function updateBusinessPickupLabelData(businessId, deleted = false) {
let businessData = false;
if (deleted == false) {
businessData = getBusinessData(businessId);
}
if (!areServerElementsSupported() || getGame() == V_GAME_MAFIA_ONE || getGame() == V_GAME_GTA_IV) {
sendBusinessToPlayer(null, businessId, getBusinessData(businessId).name, getBusinessData(businessId).entrancePosition, getBusinessEntranceBlipModelForNetworkEvent(businessId), getBusinessEntrancePickupModelForNetworkEvent(businessId), getBusinessData(businessId).buyPrice, getBusinessData(businessId).rentPrice, getBusinessData(businessId).hasInterior, getBusinessData(businessId).locked, doesBusinessHaveAnyItemsToBuy(businessId));
if (businessData == false) {
sendBusinessToPlayer(null, businessId, true, "", false, -1, -1, 0, 0, false, false, false, 0);
} else {
sendBusinessToPlayer(null, businessId, false, businessData.name, businessData.entrancePosition, getBusinessEntranceBlipModelForNetworkEvent(businessId), getBusinessEntrancePickupModelForNetworkEvent(businessId), businessData.buyPrice, businessData.rentPrice, businessData.hasInterior, businessData.locked, doesBusinessHaveAnyItemsToBuy(businessId), businessData.entranceFee);
}
return false;
}
@@ -2926,24 +2950,24 @@ function updateBusinessPickupLabelData(businessId) {
function resetBusinessPickups(businessId) {
deleteBusinessPickups(businessId);
createBusinessEntrancePickup(businessId);
createBusinessExitPickup(businessId);
spawnBusinessEntrancePickup(businessId);
spawnBusinessExitPickup(businessId);
}
// ===========================================================================
function resetBusinessBlips(businessId) {
deleteBusinessBlips(businessId);
createBusinessEntranceBlip(businessId);
createBusinessExitBlip(businessId);
spawnBusinessEntranceBlip(businessId);
spawnBusinessExitBlip(businessId);
}
// ===========================================================================
function resetAllBusinessPickups(businessId) {
deleteBusinessPickups(businessId);
createBusinessEntrancePickup(businessId);
createBusinessExitPickup(businessId);
spawnBusinessEntrancePickup(businessId);
spawnBusinessExitPickup(businessId);
}
// ===========================================================================
@@ -2951,15 +2975,15 @@ function resetAllBusinessPickups(businessId) {
function resetAllBusinessBlips() {
for (let i in getServerData().businesses) {
deleteBusinessBlips(i);
createBusinessBlips(i);
spawnBusinessBlips(i);
}
}
// ===========================================================================
function createBusinessBlips(businessId) {
createBusinessEntranceBlip(businessId);
createBusinessExitBlip(businessId);
function spawnBusinessBlips(businessId) {
spawnBusinessEntranceBlip(businessId);
spawnBusinessExitBlip(businessId);
}
// ===========================================================================
@@ -2967,15 +2991,15 @@ function createBusinessBlips(businessId) {
function resetAllBusinessPickups() {
for (let i in getServerData().businesses) {
deleteBusinessPickups(i);
createBusinessPickups(i);
spawnBusinessPickups(i);
}
}
// ===========================================================================
function createBusinessPickups(businessId) {
createBusinessEntrancePickup(businessId);
createBusinessExitPickup(businessId);
function spawnBusinessPickups(businessId) {
spawnBusinessEntrancePickup(businessId);
spawnBusinessExitPickup(businessId);
}
// ===========================================================================
@@ -3235,4 +3259,61 @@ function getBusinessEntrancePickupModelForNetworkEvent(businessIndex) {
return pickupModelId;
}
// ===========================================================================
function getBusinessesInRange(position, distance) {
return getServerData().businesses.filter((business) => getDistance(position, business.entrancePosition) <= distance);
}
// ===========================================================================
function getNearbyBusinessesCommand(command, params, client) {
let distance = 10.0;
if (!areParamsEmpty(params)) {
distance = getParam(params, " ", 1);
}
if (isNaN(distance)) {
messagePlayerError(client, "The distance must be a number!");
return false;
}
distance = toFloat(distance);
if (distance <= 0) {
messagePlayerError(client, "The distance must be more than 0!");
return false;
}
let nearbyBusinesses = getBusinessesInRange(getPlayerPosition(client), distance);
if (nearbyBusinesses.length == 0) {
messagePlayerAlert(client, getLocaleString(client, "NoBusinessesWithinRange", distance));
return false;
}
let businessesList = nearbyBusinesses.map(function (x) {
return `{chatBoxListIndex}${x.index}: {MAINCOLOUR}${x.name} {mediumGrey}(${toFloat(getDistance(getPlayerPosition(client), x.entrancePosition)).toFixed(2)} ${toLowerCase(getLocaleString(client, "Meters"))} ${toLowerCase(getGroupedLocaleString(client, "CardinalDirections", getCardinalDirectionName(getCardinalDirection(getPlayerPosition(client), x.entrancePosition))))})`;
});
let chunkedList = splitArrayIntoChunks(businessesList, 4);
messagePlayerNormal(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderBusinessesInRangeList", `${distance} ${toLowerCase(getLocaleString(client, "Meters"))}`)));
for (let i in chunkedList) {
messagePlayerInfo(client, chunkedList[i].join(", "));
}
}
// ===========================================================================
function logBusinessItemPurchase(businessId, purchaserId, itemId) {
if (getServerConfig().devServer) {
return false;
}
quickDatabaseQuery(`INSERT INTO log_biz_buy (log_biz_buy_biz, log_biz_buy_who, log_biz_buy_item, log_biz_buy_when) VALUES (${businessId}, ${purchaserId}, ${itemId}, UNIX_TIMESTAMP())`);
logItemMove(itemId, V_ITEM_OWNER_BIZFLOOR, businessId, V_ITEM_OWNER_PLAYER, purchaserId)
}
// ===========================================================================

View File

@@ -7,6 +7,17 @@
// TYPE: Server (JavaScript)
// ===========================================================================
// ===========================================================================
const V_CHAT_TYPE_NONE = 0; // None (invalid)
const V_CHAT_TYPE_GLOBAL = 1; // Global OOC
const V_CHAT_TYPE_LOCAL = 2; // Local OOC
const V_CHAT_TYPE_TALK = 3; // Local IC (normal talking)
const V_CHAT_TYPE_SHOUT = 4; // Local IC (shouting)
const V_CHAT_TYPE_WHISPER = 5; // Local IC (whispering)
// ===========================================================================
function initChatScript() {
logToConsole(LOG_INFO, "[V.RP.Chat]: Initializing chat script ...");
logToConsole(LOG_INFO, "[V.RP.Chat]: Chat script initialized successfully!");
@@ -38,8 +49,38 @@ function processPlayerChat(client, messageText) {
}
messageText = messageText.substring(0, 128);
messagePlayerNormal(null, `💬 ${getCharacterFullName(client)}: {MAINCOLOUR}${messageText}`, getPlayerColour(client));
messageDiscordChatChannel(`💬 ${getCharacterFullName(client)}: ${messageText}`);
if (getPlayerData(client).usingPayPhone != -1 && getPayPhoneData(getPlayerData(client).usingPayPhone).state == V_PAYPHONE_STATE_ACTIVE_CALL) {
messagePlayerPhoneCall(client, getPlayerData(client).payPhoneOtherPlayer, messageText);
return true;
}
switch (getServerConfig().normalChatType) {
case V_CHAT_TYPE_TALK:
talkToNearbyPlayers(client, messageText);
break;
case V_CHAT_TYPE_SHOUT:
shoutToNearbyPlayers(client, messageText);
break;
case V_CHAT_TYPE_WHISPER:
whisperToNearbyPlayers(client, messageText);
break;
case V_CHAT_TYPE_LOCAL:
oocToNearbyPlayers(client, messageText);
break;
case V_CHAT_TYPE_NONE:
messagePlayerError(client, getLocaleString(client, "NormalChatDisabled"));
break;
case V_CHAT_TYPE_GLOBAL:
default:
oocToAllPlayers(client, messageText);
break;
}
} else {
messagePlayerNormal(null, `🛡️ (ADMIN) - ${messageText}`);
}
@@ -48,7 +89,7 @@ function processPlayerChat(client, messageText) {
let clients = getClients();
for(let i in clients) {
let translatedText;
translatedText = await translateMessage(messageText, getPlayerData(client).locale, getPlayerData(clients[i]).locale);
translatedText = translateMessage(messageText, getPlayerData(client).locale, getPlayerData(clients[i]).locale);
let original = (getPlayerData(client).locale == getPlayerData(clients[i]).locale) ? `` : ` {ALTCOLOUR}(${messageText})`;
messagePlayerNormal(clients[i], `💬 ${getCharacterFullName(client)}: [#FFFFFF]${translatedText}${original}`, clients[i], getColourByName("mediumGrey"));
@@ -60,7 +101,51 @@ function processPlayerChat(client, messageText) {
// ===========================================================================
function globalOOCCommand(command, params, client) {
if (isPlayerMuted(client)) {
messagePlayerError(client, getLocaleString(client, "MutedCantChat"));
return false;
}
if (areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
return false;
}
if (!getServerConfig().globalChatEnabled) {
messagePlayerError(client, getLocaleString(client, "GlobalChatDisabled"));
return false;
}
oocToAllPlayers(client, params);
return true;
}
// ===========================================================================
function localOOCCommand(command, params, client) {
if (isPlayerMuted(client)) {
messagePlayerError(client, getLocaleString(client, "MutedCantChat"));
return false;
}
if (areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
return false;
}
oocToNearbyPlayers(client, params);
return true;
}
// ===========================================================================
function meActionCommand(command, params, client) {
if (isPlayerMuted(client)) {
messagePlayerError(client, getLocaleString(client, "MutedCantChat"));
return false;
}
if (areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
return false;
@@ -180,7 +265,7 @@ function adminChatCommand(command, params, client) {
}
}
messageDiscordAdminChannel(`${getPlayerData(client).accountData.staffTitle} ${getPlayerData(client).accountData.name}: ${messageText}`);
messageDiscordAdminChannel(`${getPlayerData(client).accountData.staffTitle} ${getPlayerData(client).accountData.name}: ${params}`);
}
// ===========================================================================
@@ -196,6 +281,16 @@ function clanChatCommand(command, params, client) {
return false;
}
if (getPlayerClan(client) == -1) {
messagePlayerError(client, getLocaleString(client, "InvalidClan"));
return false;
}
if (getClanData(getPlayerClan) == false) {
messagePlayerError(client, getLocaleString(client, "InvalidClan"));
return false;
}
clanChat(client, params);
}
@@ -247,8 +342,7 @@ function replyToLastPrivateMessageCommand(command, params, client) {
return false;
}
getPlayerData(targetClient).privateMessageReplyTo = client;
messagePlayerPrivateMessage(targetClient, client, messageText);
messagePlayerPrivateMessage(getPlayerData(client).privateMessageReplyTo, client, params);
markPlayerActionTipSeen(client, "ReplyToDirectMessage");
}
@@ -416,4 +510,26 @@ function canPlayerUseMegaphone(client) {
return false;
}
// ===========================================================================
function oocToAllPlayers(client, messageText) {
messagePlayerNormal(null, `💬 ${getCharacterFullName(client)}: {MAINCOLOUR}(( ${messageText} ))`, getPlayerColour(client));
messageDiscordChatChannel(`💬 ${getCharacterFullName(client)}: (( ${messageText} ))`);
}
// ===========================================================================
function oocToNearbyPlayers(client, messageText) {
let clients = getClients();
for (let i in clients) {
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]))) {
messagePlayerNormal(clients[i], `💬 ${getCharacterFullName(client)}: {lightGrey}(( ${messageText} ))`, getPlayerColour(client));
}
}
}
messageDiscordChatChannel(`💬 ${getCharacterFullName(client)}: (( ${messageText} ))`);
}
// ===========================================================================

View File

@@ -23,11 +23,15 @@ class ClanData {
this.colour = COLOUR_WHITE;
this.colours = [];
this.initialRank = 0;
this.members = [];
this.ranks = [];
this.needsSaved = false;
this.motd = false;
/** @type {Array.<ClanMemberData>} */
this.members = [];
/** @type {Array.<ClanRankData>} */
this.ranks = [];
if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["clan_id"]);
this.name = dbAssoc["clan_name"];
@@ -132,13 +136,13 @@ function loadClansFromDatabase() {
//tempClanData.members = loadClanMembersFromDatabase(tempClanData.databaseId);
tempClanData.ranks = loadClanRanksFromDatabase(tempClanData.databaseId);
tempClans.push(tempClanData);
logToConsole(LOG_DEBUG, `[AGRP.Clan]: Clan '${tempClanData.name}' loaded from database successfully!`);
logToConsole(LOG_DEBUG, `[V.RP.Clan]: Clan '${tempClanData.name}' loaded from database successfully!`);
}
}
disconnectFromDatabase(dbConnection);
}
logToConsole(LOG_INFO, `[AGRP.Clan]: ${tempClans.length} clans loaded from database successfully!`);
logToConsole(LOG_INFO, `[V.RP.Clan]: ${tempClans.length} clans loaded from database successfully!`);
return tempClans;
}
@@ -158,20 +162,20 @@ function loadClanMembersFromDatabase() {
for (let i in dbAssoc) {
let tempClanData = new ClanData(dbAssoc[i]);
tempClans.push(tempClanData);
logToConsole(LOG_VERBOSE, `[AGRP.Clan]: Clan '${tempClanData.name}' loaded from database successfully!`);
logToConsole(LOG_VERBOSE, `[V.RP.Clan]: Clan '${tempClanData.name}' loaded from database successfully!`);
}
}
disconnectFromDatabase(dbConnection);
}
logToConsole(LOG_INFO, `[AGRP.Clan]: ${tempClans.length} clans loaded from database successfully!`);
logToConsole(LOG_INFO, `[V.RP.Clan]: ${tempClans.length} clans loaded from database successfully!`);
return tempClans;
}
// ===========================================================================
function loadClanRanksFromDatabase(clanDatabaseId) {
logToConsole(LOG_INFO, `[AGRP.Clan]: Loading ranks for clan ${clanDatabaseId} from database ...`);
logToConsole(LOG_INFO, `[V.RP.Clan]: Loading ranks for clan ${clanDatabaseId} from database ...`);
let dbConnection = connectToDatabase();
let dbAssoc = [];
@@ -184,13 +188,13 @@ function loadClanRanksFromDatabase(clanDatabaseId) {
for (let i in dbAssoc) {
let tempClanRankData = new ClanRankData(dbAssoc[i]);
tempClanRanks.push(tempClanRankData);
logToConsole(LOG_VERBOSE, `[AGRP.Clan]: Clan rank '${tempClanRankData.name}' loaded from database successfully!`);
logToConsole(LOG_VERBOSE, `[V.RP.Clan]: Clan rank '${tempClanRankData.name}' loaded from database successfully!`);
}
}
disconnectFromDatabase(dbConnection);
}
logToConsole(LOG_INFO, `[AGRP.Clan]: Loaded ranks for clan ${clanDatabaseId} from database successfully!`);
logToConsole(LOG_INFO, `[V.RP.Clan]: Loaded ranks for clan ${clanDatabaseId} from database successfully!`);
return tempClanRanks;
}
@@ -311,7 +315,7 @@ function deleteClanCommand(command, params, client) {
// ===========================================================================
function setClanOwnerCommand(command, params, client) {
if (!doesPlayerHaveClanPermission(client, getClanFlagValue("owner"))) {
if (!doesPlayerHaveClanPermission(client, getClanFlagValue("Owner"))) {
messagePlayerError(client, "You must be the clan owner to use this command!");
return false;
}
@@ -334,18 +338,20 @@ function setClanOwnerCommand(command, params, client) {
return false;
}
let highestRankIndex = getHighestClanRank(clanIndex);
getClanData(clanIndex).owner = getPlayerCurrentSubAccount(targetClient).databaseId;
getPlayerCurrentSubAccount(targetClient).clan = getClanData(clanIndex).databaseId;
getPlayerCurrentSubAccount(targetClient).clanRank = getHighestClanRank(clanIndex);
getPlayerCurrentSubAccount(targetClient).clanIndex = getClanIndexFromDatabaseId(clanIndex)
getPlayerCurrentSubAccount(targetClient).clanRankIndex = getClanRankIndexFromDatabaseId(clanIndex, getPlayerCurrentSubAccount(targetClient).clanRank);
getPlayerCurrentSubAccount(targetClient).clanIndex = getClanIndexFromDatabaseId(clanIndex);
getPlayerCurrentSubAccount(targetClient).clanRank = getClanRankData(clanIndex, highestRankIndex).databaseId;
getPlayerCurrentSubAccount(targetClient).clanRankIndex = highestRankIndex;
getClanData(clanIndex).needsSaved = true;
getPlayerCurrentSubAccount(targetClient).clan = getClanData(clanIndex).databaseId;
getPlayerCurrentSubAccount(targetClient).clanFlags = getClanFlagValue("All");
//messageAdmins(`{adminOrange}${getPlayerName(client)} {MAINCOLOUR}set clan {clanOrange}${getClanData(clanIndex).name} {MAINCOLOUR}owner to {ALTCOLOUR}${getCharacterFullName(targetClient)}`);
messagePlayerSuccess(client, `You changed the clan owner to {ALTCOLOUR}${getCharacterFullName(targetClient)}`);
messagePlayerSuccess(client, `You changed clan {clanOrange}${getClanData(clanIndex).name}'s {MAINCOLOUR}owner to {ALTCOLOUR}${getCharacterFullName(targetClient)}`);
}
// ===========================================================================
@@ -1047,7 +1053,12 @@ function createClan(name) {
let tempClan = new ClanData(false);
tempClan.databaseId = getDatabaseInsertId(dbConnection);
tempClan.name = name;
getServerData().clans.push(tempClan);
let clanId = getServerData().clans.push(tempClan);
let tempDefaultRank = new ClanRankData(false);
tempDefaultRank.name = "Default Rank";
tempDefaultRank.needsSaved = true;
getServerData().clans[clanId - 1].ranks.push(tempDefaultRank);
setAllClanDataIndexes();
}
@@ -1285,10 +1296,10 @@ function setClanRankTitle(clanId, rankId, title) {
// ===========================================================================
function saveAllClansToDatabase() {
logToConsole(LOG_DEBUG, `[AGRP.Clan]: Saving all server clans to database ...`);
logToConsole(LOG_DEBUG, `[V.RP.Clan]: Saving all server clans to database ...`);
if (getServerConfig().devServer) {
logToConsole(LOG_DEBUG, `[AGRP.Clan]: Aborting save all clans to database, dev server is enabled.`);
logToConsole(LOG_DEBUG, `[V.RP.Clan]: Aborting save all clans to database, dev server is enabled.`);
return false;
}
@@ -1296,7 +1307,7 @@ function saveAllClansToDatabase() {
saveClanToDatabase(i);
}
logToConsole(LOG_INFO, `[AGRP.Clan]: Saved all server clans to database`);
logToConsole(LOG_INFO, `[V.RP.Clan]: Saved all server clans to database`);
}
// ===========================================================================
@@ -1521,7 +1532,7 @@ function getLowestClanRank(clanIndex) {
// ===========================================================================
function getHighestJobRank(clanIndex) {
function getHighestClanRank(clanIndex) {
let highestRank = 0;
for (let i in getServerData().clans[clanIndex].ranks) {
if (getClanRankData(clanIndex, i).level > getClanRankData(clanIndex, highestRank).level) {
@@ -1531,4 +1542,4 @@ function getHighestJobRank(clanIndex) {
return highestRank;
}
// ===========================================================================
// ===========================================================================

View File

@@ -16,12 +16,13 @@ const V_RETURNTO_TYPE_SKINSELECT = 2; // "Return to" data is from skin
/**
* @class Representing extra data for a client
* @property {AccountData} accountData
* @property {Array.<SubAccountData>} subAccounts
*/
class ClientData {
constructor(client, accountData, subAccounts) {
/** @type {AccountData} */
this.accountData = accountData;
/** @type {Array.<SubAccountData>} */
this.subAccounts = subAccounts; // Characters
// General Info
@@ -129,6 +130,7 @@ class ClientData {
this.alcoholLevel = 0;
this.pedState = V_PEDSTATE_NONE;
this.promptType = V_PROMPT_NONE;
this.promptValue = 0;
this.privateMessageReplyTo = null;
this.enteringExitingProperty = null;
this.inProperty = null;
@@ -149,6 +151,12 @@ class ClientData {
this.casinoChips = 0; // This might become an item with a useId of a business (for chips belonging to specific casinos)
this.casinoCardHand = [];
this.casinoPlayingGame = V_CASINO_GAME_NONE;
// PayPhone
this.usingPayPhone = -1;
this.payPhoneOtherPlayer = null;
this.payPhoneCallStart = 0;
this.payPhoneInitiatedCall = false;
}
};
@@ -162,7 +170,7 @@ function initClientScript() {
// ===========================================================================
function resetClientStuff(client) {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Resetting client data for ${getPlayerDisplayForConsole(client)}`);
logToConsole(LOG_DEBUG, `[V.RP.Utilities] Resetting client data for ${getPlayerDisplayForConsole(client)}`);
if (!getPlayerData(client)) {
return false;
@@ -199,23 +207,25 @@ function resetClientStuff(client) {
function kickAllClients() {
getClients().forEach((client) => {
getPlayerData(client).customDisconnectReason = "ServerRestarting";
if (getPlayerData(client) != false) {
getPlayerData(client).customDisconnectReason = "ServerRestarting";
}
disconnectPlayer(client);
})
});
}
// ===========================================================================
function initClient(client) {
logToConsole(LOG_DEBUG, `[AGRP.Account] Initializing client ${getPlayerDisplayForConsole(client)} ...`);
logToConsole(LOG_DEBUG, `[V.RP.Account] Initializing client ${getPlayerDisplayForConsole(client)} ...`);
if (isConsole(client)) {
logToConsole(LOG_DEBUG | LOG_ERROR, `[AGRP.Account] Client initialization failed for ${getPlayerDisplayForConsole(client)}! (is console client)`);
logToConsole(LOG_DEBUG | LOG_ERROR, `[V.RP.Account] Client initialization failed for ${getPlayerDisplayForConsole(client)}! (is console client)`);
return false;
}
if (playerInitialized[client.index] == true) {
logToConsole(LOG_DEBUG | LOG_ERROR, `[AGRP.Account] Client initialization failed for ${getPlayerDisplayForConsole(client)}! (already initialized)`);
logToConsole(LOG_DEBUG | LOG_ERROR, `[V.RP.Account] Client initialization failed for ${getPlayerDisplayForConsole(client)}! (already initialized)`);
return false;
}
@@ -223,25 +233,25 @@ function initClient(client) {
//setEntityData(client, "v.rp.isInitialized", true, false);
logToConsole(LOG_DEBUG, `[AGRP.Account] Initializing GUI for ${getPlayerDisplayForConsole(client)} ...`);
logToConsole(LOG_DEBUG, `[V.RP.Account] Initializing GUI for ${getPlayerDisplayForConsole(client)} ...`);
sendPlayerCurrencyString(client);
sendPlayerGUIColours(client);
sendPlayerGUIInit(client);
updatePlayerSnowState(client, getServerConfig().groundSnow);
//logToConsole(LOG_DEBUG, `[AGRP.Account] Showing connect camera to ${getPlayerDisplayForConsole(client)} ...`);
//logToConsole(LOG_DEBUG, `[V.RP.Account] Showing connect camera to ${getPlayerDisplayForConsole(client)} ...`);
//showConnectCameraToPlayer(client);
messageClient(`Please wait ...`, client, getColourByName("softGreen"));
logToConsole(LOG_DEBUG, `[AGRP.Account] Waiting for 2.5 seconds to prevent race attack ...`);
logToConsole(LOG_DEBUG, `[V.RP.Account] Waiting for 2.5 seconds to prevent race attack ...`);
setTimeout(function () {
if (client != null) {
clearChatBox(client);
logToConsole(LOG_DEBUG, `[AGRP.Account] Loading account for ${getPlayerDisplayForConsole(client)}`);
logToConsole(LOG_DEBUG, `[V.RP.Account] Loading account for ${getPlayerDisplayForConsole(client)}`);
let tempAccountData = loadAccountFromName(getPlayerName(client), true);
logToConsole(LOG_DEBUG, `[AGRP.Account] Loading subaccounts for ${getPlayerDisplayForConsole(client)}`);
logToConsole(LOG_DEBUG, `[V.RP.Account] Loading subaccounts for ${getPlayerDisplayForConsole(client)}`);
let tempSubAccounts = loadSubAccountsFromAccount(tempAccountData.databaseId);
getServerData().clients[getPlayerId(client)] = new ClientData(client, tempAccountData, tempSubAccounts);
@@ -258,10 +268,10 @@ function initClient(client) {
playRadioStreamForPlayer(client, getServerIntroMusicURL(), true, getPlayerStreamingRadioVolume(client));
} else {
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI.`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI.`);
showPlayerLoginGUI(client);
} else {
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled).`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled).`);
messagePlayerNormal(client, getLocaleString(client, "WelcomeBack", getServerName(), getPlayerName(client), "/login"), getColourByName("softGreen"));
if (checkForGeoIPModule()) {
@@ -281,10 +291,10 @@ function initClient(client) {
} else {
sendPlayerLocaleId(client, 0);
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register GUI.`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register GUI.`);
showPlayerRegistrationGUI(client);
} else {
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register message (GUI disabled).`);
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register message (GUI disabled).`);
messagePlayerNormal(client, getLocaleString(client, "WelcomeNewPlayer", getServerName(), getPlayerName(client), "/register"), getColourByName("softGreen"));
}
playRadioStreamForPlayer(client, getServerIntroMusicURL(), true, getPlayerStreamingRadioVolume(client));

View File

@@ -147,7 +147,8 @@ function loadCommands() {
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("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"),
new CommandData("bizpaintball", setBusinessPaintBallCommand, "", getStaffFlagValue("None"), true, true, "Sets the business to a paintball arena"),
new CommandData("nearbiz", getNearbyBusinessesCommand, "[distance]", getStaffFlagValue("None"), true, true, "Shows all businesses within X meters"),
],
chat: [
new CommandData("me", meActionCommand, "<message>", getStaffFlagValue("None"), true, false, "Shows a custom action message in chat"),
@@ -167,6 +168,8 @@ function loadCommands() {
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"),
new CommandData("b", localOOCCommand, "<message>", getStaffFlagValue("None"), true, true, "Local OOC (out of character) chat, shows to players in proximity"),
new CommandData("o", globalOOCCommand, "<message>", getStaffFlagValue("None"), true, true, "Global OOC (out of character) chat, shows to all players"),
],
clan: [
new CommandData("clans", listClansCommand, "[search text]", getStaffFlagValue("None"), true, true, "List clans (search by partial name, if provided)"),
@@ -195,10 +198,10 @@ function loadCommands() {
client: [],
colour: [],
command: [
new CommandData("cmdenabletype", enableAllCommandsByType, "<type>", getStaffFlagValue("Developer"), true, true, "Enables all commands by type."),
new CommandData("cmddisabletype", disableAllCommandsByType, "<type>", getStaffFlagValue("Developer"), true, true, "Disables all commands by type."),
new CommandData("cmdenable", enableCommand, "<command>", getStaffFlagValue("Developer"), true, true, "Enable a specific command"),
new CommandData("cmddisable", disableCommand, "<command>", getStaffFlagValue("Developer"), true, true, "Disables a specific command"),
new CommandData("cmdenabletype", enableAllCommandsByType, "<type>", getStaffFlagValue("ManageServer"), true, true, "Enables all commands by type."),
new CommandData("cmddisabletype", disableAllCommandsByType, "<type>", getStaffFlagValue("ManageServer"), true, true, "Disables all commands by type."),
new CommandData("cmdenable", enableCommand, "<command>", getStaffFlagValue("ManageServer"), true, true, "Enable a specific command"),
new CommandData("cmddisable", disableCommand, "<command>", getStaffFlagValue("ManageServer"), true, true, "Disables a specific command"),
],
config: [
new CommandData("settime", setTimeCommand, "<hour> [minute]", getStaffFlagValue("ManageWorld"), true, true, "Sets the time. Hours are required, minute is optional and will default to 0"),
@@ -236,7 +239,7 @@ function loadCommands() {
new CommandData("scode", executeServerCodeCommand, "<code>", getStaffFlagValue("Developer"), true, true, "Execute serverside code"),
new CommandData("ccode", executeClientCodeCommand, "<code>", getStaffFlagValue("Developer"), true, true, "Execute clientside code for a player"),
new CommandData("gmx", restartGameModeCommand, "", getStaffFlagValue("Developer"), true, true, "Restart this gamemode"),
new CommandData("saveall", saveServerDataCommand, "", getStaffFlagValue("Developer"), true, true, "Immediately save all data to database"),
new CommandData("saveall", saveServerDataCommand, "", getStaffFlagValue("ManageHouses") | getStaffFlagValue("ManageBusinesses") | getStaffFlagValue("ManageJobs") | getStaffFlagValue("ManagePayPhones"), true, true, "Immediately save all data to database"),
new CommandData("docmd", simulateCommandForPlayerCommand, "<player name/id> <command> [params]", getStaffFlagValue("Developer"), true, true, "Force a player to use a command"),
new CommandData("docmdall", simulateCommandForAllPlayersCommand, "<command> [params]", getStaffFlagValue("Developer"), true, true, "Force all players to use a command"),
new CommandData("addloglevel", addLogLevelCommand, "<log level name>", getStaffFlagValue("Developer"), true, true, "Adds a log level"),
@@ -247,7 +250,6 @@ function loadCommands() {
new CommandData("streamurlall", streamAudioURLToAllPlayersCommand, "<url> <volume>", getStaffFlagValue("Developer"), true, true, "Plays a URL radio stream for all players"),
new CommandData("streamnameall", streamAudioNameToAllPlayersCommand, "<name> <volume>", getStaffFlagValue("Developer"), true, true, "Plays an audio file stream for all players"),
new CommandData("forceresetpass", forceAccountPasswordResetCommand, "<account name>", getStaffFlagValue("Developer"), true, true),
new CommandData("fixblips", fixAllServerBlipsCommand, "", getStaffFlagValue("Developer"), true, true, "Clears and recreates all map blips"),
new CommandData("fixpickups", fixAllServerPickupsCommand, "", getStaffFlagValue("Developer"), true, true, "Clears and recreates all pickups"),
new CommandData("resetambience", resetAllServerAmbienceElementsCommand, "", getStaffFlagValue("ManageWorld"), true, true, "Clears all current server ambience elements (traffic, peds, etc)"),
@@ -260,11 +262,24 @@ function loadCommands() {
new CommandData("tax", taxInfoCommand, "", getStaffFlagValue("None"), true, true),
new CommandData("wealth", wealthInfoCommand, "", getStaffFlagValue("None"), true, true),
new CommandData("forcepayday", forcePlayerPayDayCommand, "<player name/id>", getStaffFlagValue("ManageServer"), true, true, "Gives a player an instant payday."),
new CommandData("setincomemultiplier", setGrossIncomeMultiplierCommand, "<amount>", getStaffFlagValue("ManageServer"), true, true, "Multiplies pay by this amount. 100% adds nothing extra"),
new CommandData("setinflation", setInflationMultiplierCommand, "<amount>", getStaffFlagValue("ManageServer"), true, true, "Sets the server inflation (in percent). 100% is no inflation"),
new CommandData("setincometax", setIncomeTaxCommand, "<amount>", getStaffFlagValue("ManageServer"), true, true, "Sets the server income tax (in percent). Players will be taxed this much when getting pay"),
new CommandData("sethouseupkeep", setHouseUpkeepCommand, "<amount>", getStaffFlagValue("ManageServer"), true, true, "Sets the base upkeep cost of a house"),
new CommandData("setbizupkeep", setBusinessUpkeepCommand, "<amount>", getStaffFlagValue("ManageServer"), true, true, "Sets the base upkeep cost of a business"),
new CommandData("setvehupkeep", setVehicleUpkeepCommand, "<amount>", getStaffFlagValue("ManageServer"), true, true, "Sets the base upkeep cost of a vehicle"),
new CommandData("setcurrencystring", setCurrencyStringCommand, "<string> MUST INCLUDE {AMOUNT}", getStaffFlagValue("ManageServer"), true, true, "Sets the currency string"),
new CommandData("setpassiveincome", setPassiveIncomeCommand, "<amount>", getStaffFlagValue("ManageServer"), true, true, "Sets the base upkeep cost of a vehicle"),
],
email: [
new CommandData("testemail", testEmailCommand, "<email address>", getStaffFlagValue("Developer"), true, true),
],
fishing: [],
fishing: [
//new CommandData("fish", castFishingLineCommand, "", getStaffFlagValue("None"), true, true, "Casts your fishing line into the water"),
//new CommandData("castline", castFishingLineCommand, "", getStaffFlagValue("None"), true, true, "Casts your fishing line into the water"),
//new CommandData("resetline", resetFishingLineCommand, "", getStaffFlagValue("None"), true, true, "Casts your fishing line into the water"),
],
forensics: [],
gate: [
new CommandData("gate", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"),
@@ -317,6 +332,7 @@ function loadCommands() {
new CommandData("houseentrance", moveHouseEntranceCommand, "", getStaffFlagValue("ManageHouses"), true, true, "Moves a house's entrance (outside/exterior location to enter 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("nearhouse", getNearbyHousesCommand, "[distance]", getStaffFlagValue("None"), true, true, "Shows all houses within X meters"),
],
insurance: [],
item: [
@@ -332,8 +348,10 @@ function loadCommands() {
new CommandData("use", useItemCommand, "", getStaffFlagValue("None"), true, false, "Uses the currently equipped item"),
new CommandData("inv", listPlayerInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items in your inventory"),
new CommandData("inventory", listPlayerInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items in your inventory"),
new CommandData("search", listOtherPlayerInventoryCommand, "<player name/id>", getStaffFlagValue("None"), true, false, "Shows the items in a player's inventory"),
new CommandData("items", listItemInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items in your inventory"),
new CommandData("items", listItemInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items stored in a container item"),
//new CommandData("vehtrunk", listVehicleTrunkInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items in a vehicle's trunk"),
new CommandData("houseitems", listHouseInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items in the house's storage"),
new CommandData("bizstorage", listBusinessStorageInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items in the business's extra storage (not buyable)"),
new CommandData("bizfloor", listBusinessFloorInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items that can be bought from the business"),
@@ -342,11 +360,11 @@ function loadCommands() {
new CommandData("buylist", listBusinessFloorInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items that can be bought from the business"),
new CommandData("power", toggleItemEnabledCommand, "", getStaffFlagValue("None"), true, false, "Turns on or off an item"),
new CommandData("freq", setWalkieTalkieFrequencyCommand, "[frequncy number]", getStaffFlagValue("None"), true, false, "Sets a radio item's frequency"),
//new CommandData("freq", setRadioFrequencyCommand, "[frequency number]", getStaffFlagValue("None"), true, false, "Sets a vehicle or item radio frequency"),
//new CommandData("call", callWithPhoneCommand, "[number]", getStaffFlagValue("None"), true, false),
//new CommandData("speakerphone", togglePhoneSpeakerCommand, "", getStaffFlagValue("None"), true, false),
new CommandData("radio", walkieTalkieChatCommand, "", getStaffFlagValue("None"), true, false, "Chat over a radio item (item must be able to transmit)"),
new CommandData("r", walkieTalkieChatCommand, "", getStaffFlagValue("None"), true, false, "Chat over a radio item (item must be able to transmit)"),
new CommandData("radio", radioTransmitCommand, "", getStaffFlagValue("None"), true, false, "Chat over a radio (vehicle radio or item)"),
new CommandData("r", radioTransmitCommand, "", getStaffFlagValue("None"), true, false, "Chat over a radio (vehicle radio or item)"),
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)"),
@@ -376,7 +394,7 @@ function loadCommands() {
new CommandData("quitjob", quitJobCommand, "", getStaffFlagValue("None"), true, false, "Leave your job and be unemployed"),
new CommandData("uniform", jobUniformCommand, "[uniform]", getStaffFlagValue("None"), true, false, "Use a job uniform"),
new CommandData("equip", jobEquipmentCommand, "[equipment]", getStaffFlagValue("None"), true, false, "Get equipment for your job"),
new CommandData("jobrank", setPlayerJobRankCommand, "<player name/id> <rank name/id>", getStaffFlagValue("None"), true, true, "Sets a player's job rank"),
new CommandData("jobs", jobListCommand, "", getStaffFlagValue("None"), true, false, "Shows a list of all jobs"),
new CommandData("joblist", jobListCommand, "", getStaffFlagValue("None"), true, false, "Shows a list of all jobs"),
new CommandData("alljobs", jobListCommand, "", getStaffFlagValue("None"), true, false, "Shows a list of all jobs"),
@@ -411,6 +429,8 @@ function loadCommands() {
new CommandData("deljobroute", deleteJobRouteCommand, "", getStaffFlagValue("ManageJobs"), true, false),
new CommandData("deljobrouteloc", deleteJobRouteLocationCommand, "", getStaffFlagValue("ManageJobs"), true, false),
new CommandData("deljobroutelocation", deleteJobRouteLocationCommand, "", getStaffFlagValue("ManageJobs"), true, false),
new CommandData("jobuniformname", setJobUniformNameCommand, "<uniform id> <name>", getStaffFlagValue("ManageJobs"), true, false),
new CommandData("jobuniformrank", setJobUniformMinimumRankCommand, "<uniform id> <rank level>", getStaffFlagValue("ManageJobs"), true, false),
new CommandData("jobroutelocpos", setJobRouteLocationPositionCommand, "", getStaffFlagValue("ManageJobs"), true, false),
new CommandData("jobroutename", setJobRouteNameCommand, "<name>", getStaffFlagValue("ManageJobs"), true, false),
new CommandData("jobroutepay", setJobRoutePayCommand, "<amount>", getStaffFlagValue("ManageJobs"), true, false),
@@ -443,6 +463,13 @@ function loadCommands() {
new CommandData("jobreloadall", reloadAllJobsCommand, "", getStaffFlagValue("ManageJobs"), true, false),
new CommandData("jobinfo", getJobInfoCommand, "", getStaffFlagValue("None"), true, true, "Get info for nearest or specified job"),
new CommandData("joblocinfo", getJobLocationInfoCommand, "", getStaffFlagValue("None"), true, true, "Get info for nearest or specified job location"),
new CommandData("jobroutes", getJobRoutesCommand, "", getStaffFlagValue("None"), true, false, "Shows a list of job routes for the nearest job location"),
new CommandData("jobrouteinfo", getJobRouteInfoCommand, "", getStaffFlagValue("None"), true, false, "Shows info about a job route"),
new CommandData("jobinvite", jobInviteCommand, "<player name/id>", getStaffFlagValue("None"), true, false, "Invites a player to a job"),
new CommandData("jobhire", jobInviteCommand, "<player name/id>", getStaffFlagValue("None"), true, false, "Invites a player to a job"),
new CommandData("jobuninvite", jobUninviteCommand, "<player name/id>", getStaffFlagValue("None"), true, false, "Removes a player from their job"),
new CommandData("jobfire", jobUninviteCommand, "<player name/id>", getStaffFlagValue("None"), true, false, "Removes a player from their job"),
],
keybind: [
new CommandData("bindkey", addKeyBindCommand, "<key id/name> <command> [params]", getStaffFlagValue("None"), true, false, "Binds a key to a command and optional parameters"),
@@ -454,6 +481,8 @@ function loadCommands() {
new CommandData("language", setLocaleCommand, "<language name>", getStaffFlagValue("None"), true, false, "Sets your language"),
new CommandData("locale", setLocaleCommand, "<language name>", getStaffFlagValue("None"), true, false, "Sets your language"),
new CommandData("setlang", setLocaleCommand, "<language name>", getStaffFlagValue("None"), true, false, "Sets your language"),
new CommandData("locales", showLocaleListCommand, "", getStaffFlagValue("None"), true, false, "Shows a list of available languages"),
new CommandData("languages", showLocaleListCommand, "", getStaffFlagValue("None"), true, false, "Shows a list of available languages"),
],
messaging: [],
misc: [
@@ -478,6 +507,8 @@ function loadCommands() {
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"),
new CommandData("scoreboard", scoreBoardCommand, "", getStaffFlagValue("None"), true, false, "Shows the scoreboard (key press only)"),
new CommandData("locate", locatePlayerCommand, "<player name/id>", getStaffFlagValue("None"), true, true, "Shows the distance and direction of another player"),
],
npc: [
new CommandData("addnpc", createNPCCommand, "<skin id/name>", getStaffFlagValue("ManageNPCs"), true, false, "Creates an NPC with the specified skin"),
@@ -490,6 +521,23 @@ function loadCommands() {
//new CommandData("npcrespawn", respawnNPCCommand, "", getStaffFlagValue("ManageNPCs"), true, false, "Respawns the nearest NPC"),
],
paintball: [],
payPhone: [
new CommandData("addpayphone", createPayPhoneCommand, "[number]", getStaffFlagValue("ManagePayPhones"), true, false, "Creates an payphone with optional number (random number if not added)"),
new CommandData("delpayphone", deletePayPhoneCommand, "[number]", getStaffFlagValue("ManagePayPhones"), true, false, "Deleted a payphone with number (optional, will use closest payphone if no number)"),
new CommandData("call", callPayPhoneCommand, "<player name/id>", getStaffFlagValue("None"), true, false, "Calls the player (nearest payphone or their cellphone if applicable"),
new CommandData("hangup", hangupPayPhoneCommand, "", getStaffFlagValue("None"), true, false, "Ends a payphone call"),
new CommandData("answer", answerPayPhoneCommand, "", getStaffFlagValue("None"), true, false, "Answer's a ringing phone"),
new CommandData("givephone", givePayPhoneToPlayerCommand, "<player name/id>", getStaffFlagValue("None"), true, false, "Gives a phone to another player to talk on the call"),
new CommandData("payphone", getPayPhoneNumberCommand, "", getStaffFlagValue("None"), true, false, "Shows a phone's number"),
new CommandData("number", getPayPhoneNumberCommand, "", getStaffFlagValue("None"), true, false, "Shows a phone's number"),
new CommandData("nearpayphone", getNearbyPayPhonesCommand, "[range]", getStaffFlagValue("None"), true, false, "Shows a list of all nearby phones within certain range"),
new CommandData("nearpayphones", getNearbyPayPhonesCommand, "[range]", getStaffFlagValue("None"), true, false, "Shows a list of all nearby phones within certain range"),
new CommandData("payphoneinfo", getPayPhoneInfoCommand, "[number]", getStaffFlagValue("None"), true, false, "Shows info of nearest payphone (or of payphone with number)"),
new CommandData("phoneinfo", getPayPhoneInfoCommand, "[number]", getStaffFlagValue("None"), true, false, "Shows info of nearest payphone (or of payphone with number)"),
new CommandData("resetpayphones", resetAllPayPhonesCommand, "", getStaffFlagValue("ManagePayPhones"), true, false, "Resets all payphone states"),
new CommandData("fixpayphones", resetAllPayPhonesCommand, "", getStaffFlagValue("ManagePayPhones"), true, false, "Resets all payphone states"),
//new CommandData("callphone", callPhoneNumberCommand, "<number>", getStaffFlagValue("None"), true, false, "Rings the payphone with number"),
],
race: [
// Unfinished!
//new CommandData("addrace", createRaceCommand, "<name>", getStaffFlagValue("ManageRaces"), true, false, "Creates a race"),
@@ -559,7 +607,7 @@ function loadCommands() {
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("setname", forceCharacterNameCommand, "<player name/id> <first name> <last name>", getStaffFlagValue("BasicModeration"), true, true, "Changes a character's name directly."),
new CommandData("setskin", forcePlayerSkinCommand, "<player name/id> <skin id/name>", getStaffFlagValue("BasicModeration"), true, true, "Changes a character's skin."),
@@ -594,7 +642,9 @@ function loadCommands() {
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"),
new CommandData("clearchat", clearChatCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Clears the chat"),
new CommandData("forceresetpass", forceAccountPasswordResetCommand, "<player name/id>", getStaffFlagValue("ManageServer"), true, true),
new CommandData("chattype", setServerDefaultChatTypeCommand, "<chat type name>", getStaffFlagValue("ManageServer"), true, true, "Sets the normal chat type for the server"),
],
startup: [],
subAccount: [
@@ -707,7 +757,7 @@ function addAllCommandHandlers() {
let commands = getCommands();
for (let i in commands) {
for (let j in commands[i]) {
logToConsole(LOG_VERBOSE, `[AGRP.Command] Adding command handler for ${i} - ${commands[i][j].command}`);
logToConsole(LOG_VERBOSE, `[V.RP.Command] Adding command handler for ${i} - ${commands[i][j].command}`);
addCommandHandler(commands[i][j].command, processPlayerCommand);
commandCount++;
}
@@ -716,7 +766,7 @@ function addAllCommandHandlers() {
removeCommandHandler("help");
addCommandHandler("help", helpCommand);
logToConsole(LOG_INFO, `[AGRP.Command] ${commandCount} command handlers added!`);
logToConsole(LOG_INFO, `[V.RP.Command] ${commandCount} command handlers added!`);
}
// ===========================================================================
@@ -882,6 +932,12 @@ function processPlayerCommand(command, params, client) {
return true;
}
//let possibleAlias = getPlayerAliasForCommand(client, command);
//if (possibleAlias) {
// // Just change to the command the alias is for, then continue as normal
// command = possibleAlias.forCommand;
//}
let commandData = getCommand(toLowerCase(command));
let paramsDisplay = params;
@@ -890,19 +946,19 @@ function processPlayerCommand(command, params, client) {
}
if (!doesCommandExist(toLowerCase(command))) {
logToConsole(LOG_WARN, `[AGRP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (invalid command): /${command} ${paramsDisplay}`);
logToConsole(LOG_WARN, `[V.RP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (invalid command): /${command} ${paramsDisplay}`);
let possibleCommand = getCommandFromParams(command);
if (possibleCommand != false && doesPlayerHaveStaffPermission(client, getCommandRequiredPermissions(toLowerCase(possibleCommand.command)))) {
messagePlayerError(client, getLocaleString(client, "InvalidCommandPossibleMatchTip", `{ALTCOLOUR}/${command}{MAINCOLOUR}`, `{ALTCOLOUR}${toLowerCase(possibleCommand.command)}{MAINCOLOUR}`));
messagePlayerError(client, getLocaleString(client, "CommandNotFoundPossibleMatchTip", `{ALTCOLOUR}/${command}{MAINCOLOUR}`, `{ALTCOLOUR}${toLowerCase(possibleCommand.command)}{MAINCOLOUR}`));
} else {
messagePlayerError(client, getLocaleString(client, "InvalidCommandHelpTip", `{ALTCOLOUR}/${command}{MAINCOLOUR}`, `{ALTCOLOUR}/help{MAINCOLOUR}`));
messagePlayerError(client, getLocaleString(client, "CommandNotFoundHelpTip", `{ALTCOLOUR}/${command}{MAINCOLOUR}`, `{ALTCOLOUR}/help{MAINCOLOUR}`));
}
return false;
}
if (!commandData.enabled) {
logToConsole(LOG_WARN, `[AGRP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (command is disabled): /${command} ${paramsDisplay}`);
logToConsole(LOG_WARN, `[V.RP.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, getLocaleString(client, "CommandDisabled", `{ALTCOLOUR}/${command}{MAINCOLOUR}`));
return false;
@@ -910,7 +966,7 @@ function processPlayerCommand(command, params, client) {
if (doesCommandRequireLogin(toLowerCase(command))) {
if (!isPlayerLoggedIn(client)) {
logToConsole(LOG_WARN, `[AGRP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (requires login first): /${command} ${paramsDisplay}`);
logToConsole(LOG_WARN, `[V.RP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (requires login first): /${command} ${paramsDisplay}`);
messagePlayerError(client, getLocaleString(client, "CommandRequiresLogin", `{ALTCOLOUR}/${command}{MAINCOLOUR}`));
return false;
}
@@ -918,7 +974,7 @@ function processPlayerCommand(command, params, client) {
if (isClientFromDiscord(client)) {
if (!isCommandAllowedOnDiscord(command)) {
logToConsole(LOG_WARN, `[AGRP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command from discord, but failed (not available on discord): /${command} ${paramsDisplay}`);
logToConsole(LOG_WARN, `[V.RP.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!`);
return false;
}
@@ -926,13 +982,13 @@ function processPlayerCommand(command, params, client) {
if (!isConsole(client)) {
if (!doesPlayerHaveStaffPermission(client, getCommandRequiredPermissions(toLowerCase(command)))) {
logToConsole(LOG_WARN, `[AGRP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (no permission): /${command} ${paramsDisplay}`);
logToConsole(LOG_WARN, `[V.RP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (no permission): /${command} ${paramsDisplay}`);
messagePlayerError(client, getLocaleString(client, "CommandNoPermissions", `{ALTCOLOUR}/${toLowerCase(command)}{MAINCOLOUR}`));
return false;
}
}
logToConsole(LOG_DEBUG, `[AGRP.Command] ${getPlayerDisplayForConsole(client)} used command: /${command} ${paramsDisplay}`);
logToConsole(LOG_DEBUG, `[V.RP.Command] ${getPlayerDisplayForConsole(client)} used command: /${command} ${paramsDisplay}`);
commandData.handlerFunction(toLowerCase(command), params, client);
}
@@ -1089,4 +1145,30 @@ function getCommandFromParams(params) {
return false;
}
// ===========================================================================
function getPlayerAliasForCommand(client, command) {
return command;
}
// ===========================================================================
/**
* @return {Array.<CommandData>} Array of commands usable by staff flag
*/
function getCommandsUsableByStaffFlag(flagName) {
let usableCommands = [];
let commands = getCommands();
for (let i in commands) {
for (let j in commands[i]) {
if (hasBitFlag(commands[i][j].requiredStaffFlags, getStaffFlagValue(flagName))) {
usableCommands.push(commands[i][j]);
}
}
}
return usableCommands;
}
// ===========================================================================

View File

@@ -49,7 +49,6 @@ class ServerConfigData {
this.guiTextColourPrimary = [0, 0, 0];
this.guiTextColourSecondary = [0, 0, 0];
this.showLogo = true;
this.inflationMultiplier = 1;
this.testerOnly = false;
this.devServer = false;
this.nameTagDistance = 50.0;
@@ -80,12 +79,29 @@ class ServerConfigData {
this.useRealTime = false;
this.realTimeZone = 0;
this.normalChatType = V_CHAT_TYPE_GLOBAL;
this.discordConfig = {
sendEvents: true,
sendChat: true,
sendAdmin: true,
};
this.economy = {
inflationMultiplier: 1.0,
passiveIncomePerPayDay: 2000,
applyTax: true,
applyUpkeep: true,
grossIncomeMultiplier: 1.0,
incomeTaxRate: 0.7,
currencyString: "${AMOUNT}",
upKeepCosts: {
upKeepPerVehicle: 250,
upKeepPerHouse: 350,
upKeepPerBusiness: 600
}
};
if (dbAssoc) {
this.databaseId = dbAssoc["svr_id"];
this.newCharacter = {
@@ -125,8 +141,8 @@ class ServerConfigData {
this.discordBotToken = intToBool(dbAssoc["svr_discord_bot_token"]);
this.introMusicURL = dbAssoc["svr_intro_music"];
this.useRealTime = intToBool(toInteger(dbAssoc["svr_real_time_enabled"]));
this.realTimeZone = dbAssoc["svr_real_time_timezone"];
this.useRealTime = intToBool(toInteger(dbAssoc["svr_real_time"]));
this.realTimeZone = toInteger(dbAssoc["svr_real_time_timezone"]);
this.discord = {
sendEvents: intToBool(dbAssoc["svr_discord_send_events"]),
@@ -136,12 +152,24 @@ class ServerConfigData {
this.economy = {
inflationMultiplier: toFloat(dbAssoc["svr_inflation_multiplier"]),
incomeTaxRate: toFloat(dbAssoc["svr_income_tax_rate"]),
passiveIncome: toFloat(dbAssoc["svr_passive_income"]),
}
incomeTaxRate: toFloat(dbAssoc["svr_tax_income"]),
passiveIncomePerPayDay: toFloat(dbAssoc["svr_passive_income"]),
applyTax: intToBool(dbAssoc["svr_tax_enabled"]),
applyUpkeep: intToBool(dbAssoc["svr_upkeep_enabled"]),
grossIncomeMultiplier: toFloat(dbAssoc["svr_gross_income_multiplier"]),
currencyString: toString(dbAssoc["svr_currency_string"]),
upKeepCosts: {
upKeepPerVehicle: toInteger(dbAssoc["svr_upkeep_veh"]),
upKeepPerHouse: toInteger(dbAssoc["svr_upkeep_house"]),
upKeepPerBusiness: toInteger(dbAssoc["svr_upkeep_biz"]),
}
};
this.devServer = intToBool(toInteger(server.getCVar("agrp_devserver")));
this.testerOnly = intToBool(toInteger(server.getCVar("agrp_testeronly")));
this.devServer = intToBool(toInteger(server.getCVar("v_devserver")));
this.testerOnly = intToBool(toInteger(server.getCVar("v_testeronly")));
this.normalChatType = toInteger(dbAssoc["svr_chat_type"]);
this.globalChatEnabled = intToBool(dbAssoc["svr_chat_global_enabled"]);
}
}
};
@@ -155,12 +183,12 @@ let gameConfig = false;
let globalConfig = {
keyBind: [],
economy: {},
database: {},
locale: {},
accents: {},
discord: {},
email: {},
security: {},
accountPasswordHash: "SHA512",
npcFarProximity: 100,
npcMediumProximity: 40,
@@ -183,14 +211,15 @@ let globalConfig = {
houseDimensionStart: 100,
buyVehicleDriveAwayDistance: 25.0,
returnToJobVehicleTime: 30,
walkieTalkieSpeakerDistance: 15,
walkieTalkieTalkDistance: 15,
radioTransmitSpeakerDistance: 15,
radioTransmitTalkDistance: 15,
phoneSpeakerDistance: 15,
phoneTalkDistance: 15,
tazerEffectDuration: 15000,
vehicleRepairDistance: 5,
itemActionStateReset: 5000,
subAccountNameAllowedCharacters: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
alphaNumericCharacters: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
emailValidationRegex: /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/,
itemActionDelayExtraTimeout: 1000,
geoIPCountryDatabaseFilePath: "modules/geoip/geoip-country.mmdb",
@@ -210,7 +239,7 @@ let globalConfig = {
V_ITEM_USE_TYPE_VEHLIVERY,
V_ITEM_USE_TYPE_VEHTIRE,
],
vehicleInactiveRespawnDelay: 1800000, // 20 minutes
vehicleInactiveRespawnDelay: 1000 * 60 * 60, // 60 minutes
chatSectionHeaderLength: 96,
useServerSideVehiclePurchaseCheck: true,
useServerSideVehicleBurnCheck: false,
@@ -250,6 +279,11 @@ let globalConfig = {
"ChatBoxTimestamps",
"ChatEmoji",
],
nightMapStartHour: 19,
nightMapEndHour: 7,
payPhoneGiveDistance: 2.5,
payPhoneAnswerDistance: 2.5,
vehicleTransmitRadioUseDistance: 2.5,
};
// ===========================================================================
@@ -266,49 +300,49 @@ function loadGlobalConfig() {
try {
getGlobalConfig().database = loadDatabaseConfig();
} catch (error) {
logToConsole(LOG_ERROR, `[AGRP.Config] Failed to load global configuration. Error: ${error}`);
thisResource.stop();
}
try {
getGlobalConfig().economy = loadEconomyConfig();
} catch (error) {
logToConsole(LOG_ERROR, `[AGRP.Config] Failed to load economy configuration. Error: ${error}`);
logToConsole(LOG_ERROR, `[V.RP.Config] Failed to load global configuration. Error: ${error}`);
thisResource.stop();
}
try {
getGlobalConfig().locale = loadLocaleConfig();
} catch (error) {
logToConsole(LOG_ERROR, `[AGRP.Config] Failed to load locale configuration. Error: ${error}`);
logToConsole(LOG_ERROR, `[V.RP.Config] Failed to load locale configuration. Error: ${error}`);
thisResource.stop();
}
try {
getGlobalConfig().accents = loadAccentConfig();
} catch (error) {
logToConsole(LOG_ERROR, `[AGRP.Config] Failed to load accent configuration. Error: ${error}`);
logToConsole(LOG_ERROR, `[V.RP.Config] Failed to load accent configuration. Error: ${error}`);
thisResource.stop();
}
try {
getGlobalConfig().discord = loadDiscordConfig();
} catch (error) {
logToConsole(LOG_ERROR, `[AGRP.Config] Failed to load discord configuration. Error: ${error}`);
logToConsole(LOG_ERROR, `[V.RP.Config] Failed to load discord configuration. Error: ${error}`);
thisResource.stop();
}
try {
getGlobalConfig().keyBind = loadKeyBindConfig();
} catch (error) {
logToConsole(LOG_ERROR, `[AGRP.Config] Failed to load keybind configuration. Error: ${error}`);
logToConsole(LOG_ERROR, `[V.RP.Config] Failed to load keybind configuration. Error: ${error}`);
thisResource.stop();
}
try {
getGlobalConfig().email = loadEmailConfig();
} catch (error) {
logToConsole(LOG_ERROR, `[AGRP.Config] Failed to load email configuration. Error: ${error}`);
logToConsole(LOG_ERROR, `[V.RP.Config] Failed to load email configuration. Error: ${error}`);
thisResource.stop();
}
try {
getGlobalConfig().security = loadSecurityConfig();
} catch (error) {
logToConsole(LOG_ERROR, `[V.RP.Config] Failed to load security configuration. Error: ${error}`);
thisResource.stop();
}
@@ -379,12 +413,12 @@ function applyConfigToServer(tempServerConfig) {
updateServerGameTime();
//if (isTimeSupported()) {
// logToConsole(LOG_DEBUG, `[AGRP.Config]: Setting time to to ${tempServerConfig.hour}:${tempServerConfig.minute} with minute duration of ${tempServerConfig.minuteDuration}`);
// logToConsole(LOG_DEBUG, `[V.RP.Config]: Setting time to to ${tempServerConfig.hour}:${tempServerConfig.minute} with minute duration of ${tempServerConfig.minuteDuration}`);
// setGameTime(tempServerConfig.hour, tempServerConfig.minute, tempServerConfig.minuteDuration);
//}
if (isWeatherSupported()) {
logToConsole(LOG_DEBUG, `[AGRP.Config]: Setting weather to ${tempServerConfig.weather}`);
logToConsole(LOG_DEBUG, `[V.RP.Config]: Setting weather to ${tempServerConfig.weather}`);
game.forceWeather(getWeatherData(tempServerConfig.weather).weatherId);
}
@@ -394,7 +428,7 @@ function applyConfigToServer(tempServerConfig) {
// ===========================================================================
function saveServerConfigToDatabase() {
logToConsole(LOG_DEBUG, `[AGRP.Config]: Saving server ${getServerConfig().databaseId} configuration to database ...`);
logToConsole(LOG_DEBUG, `[V.RP.Config]: Saving server ${getServerConfig().databaseId} configuration to database ...`);
if (getServerConfig().needsSaved) {
let dbConnection = connectToDatabase();
if (dbConnection) {
@@ -433,7 +467,6 @@ function saveServerConfigToDatabase() {
["svr_charselect_ped_rot_z", getServerConfig().characterSelectPedHeading],
["svr_charselect_int", getServerConfig().characterSelectInterior],
["svr_charselect_vw", getServerConfig().characterSelectDimension],
["svr_inflation_multiplier", getServerConfig().inflationMultiplier],
["svr_intro_music", getServerConfig().introMusicURL],
["svr_gui", getServerConfig().useGUI],
["svr_logo", getServerConfig().showLogo],
@@ -446,6 +479,19 @@ function saveServerConfigToDatabase() {
["svr_job_blips", getServerConfig().createJobBlips],
["svr_job_pickups", getServerConfig().createJobPickups],
["svr_nametag_distance", getServerConfig().nameTagDistance],
["svr_real_time", boolToInt(getServerConfig().useRealTime)],
["svr_real_time_timezone", getServerConfig().realTimeZone],
["svr_inflation_multiplier", getServerConfig().economy.inflationMultiplier],
["svr_tax_income", getServerConfig().economy.incomeTaxRate],
["svr_passive_income", getServerConfig().economy.passiveIncomePerPayDay],
["svr_tax_enabled", boolToInt(getServerConfig().economy.applyTax)],
["svr_upkeep_enabled", boolToInt(getServerConfig().economy.applyUpkeep)],
["svr_gross_income_multiplier", getServerConfig().economy.grossIncomeMultiplier],
["svr_currency_string", getServerConfig().economy.currencyString],
["svr_upkeep_veh", getServerConfig().economy.upKeepCosts.upKeepPerVehicle],
["svr_upkeep_house", getServerConfig().economy.upKeepCosts.upKeepPerHouse],
["svr_upkeep_biz", getServerConfig().economy.upKeepCosts.upKeepPerBusiness],
["svr_chat_type", getServerConfig().normalChatType],
];
let dbQuery = null;
@@ -458,7 +504,7 @@ function saveServerConfigToDatabase() {
}
}
logToConsole(LOG_DEBUG, `[AGRP.Config]: Server ${getServerConfig().databaseId} configuration saved to database!`);
logToConsole(LOG_DEBUG, `[V.RP.Config]: Server ${getServerConfig().databaseId} configuration saved to database!`);
}
// ===========================================================================
@@ -892,7 +938,7 @@ function setServerRealWorldTimeZoneCommand(command, params, client) {
* @return {bool} Whether or not the command was successful
*
*/
async function reloadServerConfigurationCommand(command, params, client) {
function reloadServerConfigurationCommand(command, params, client) {
serverConfig = loadServerConfigFromGameAndPort(server.game, server.port);
applyConfigToServer(serverConfig);
updateServerRules();
@@ -932,7 +978,7 @@ function reloadEmailConfigurationCommand(command, params, client) {
*/
function reloadDatabaseConfigurationCommand(command, params, client) {
if (getDatabaseConfig().usePersistentConnection && isDatabaseConnected(persistentDatabaseConnection)) {
logToConsole(LOG_WARN, `[AGRP.Database] Closing persistent database connection`);
logToConsole(LOG_WARN, `[V.RP.Database] Closing persistent database connection`);
persistentDatabaseConnection.close();
persistentDatabaseConnection = null;
}
@@ -980,7 +1026,7 @@ function getServerIntroMusicURL() {
// ===========================================================================
function loadLocaleConfig() {
logToConsole(LOG_DEBUG, "[V.RP.Config] Loading locale configuration");
logToConsole(LOG_DEBUG, "[V.RP.Config] Loading locale configuration ...");
let localeConfig = JSON.parse(loadTextFile(`config/locale.json`));
if (localeConfig != null) {
return localeConfig;
@@ -989,18 +1035,8 @@ function loadLocaleConfig() {
// ===========================================================================
function loadEconomyConfig() {
logToConsole(LOG_DEBUG, "[V.RP.Config] Loading economy configuration");
let economyConfig = JSON.parse(loadTextFile(`config/economy.json`));
if (economyConfig != null) {
return economyConfig;
}
}
// ===========================================================================
function loadAccentConfig() {
logToConsole(LOG_DEBUG, "[V.RP.Config] Loading accents configuration");
logToConsole(LOG_DEBUG, "[V.RP.Config] Loading accents configuration ...");
let accentConfig = JSON.parse(loadTextFile(`config/accents.json`));
if (accentConfig != null) {
return accentConfig;
@@ -1010,7 +1046,7 @@ function loadAccentConfig() {
// ===========================================================================
function loadDiscordConfig() {
logToConsole(LOG_DEBUG, "[V.RP.Config] Loading discord configuration");
logToConsole(LOG_DEBUG, "[V.RP.Config] Loading discord configuration ...");
let discordConfig = JSON.parse(loadTextFile(`config/discord.json`));
if (discordConfig != null) {
return discordConfig;
@@ -1021,7 +1057,7 @@ function loadDiscordConfig() {
// ===========================================================================
function loadDatabaseConfig() {
logToConsole(LOG_DEBUG, "[V.RP.Config] Loading database configuration");
logToConsole(LOG_DEBUG, "[V.RP.Config] Loading database configuration ...");
let databaseConfig = JSON.parse(loadTextFile("config/database.json"));
if (databaseConfig != null) {
return databaseConfig;
@@ -1032,7 +1068,7 @@ function loadDatabaseConfig() {
// ===========================================================================
function loadKeyBindConfig() {
logToConsole(LOG_DEBUG, "[V.RP.Config] Loading keybind configuration");
logToConsole(LOG_DEBUG, "[V.RP.Config] Loading keybind configuration ...");
let keyBindConfig = JSON.parse(loadTextFile("config/keybind.json"));
if (keyBindConfig != null) {
return keyBindConfig;
@@ -1043,7 +1079,7 @@ function loadKeyBindConfig() {
// ===========================================================================
function loadEmailConfig() {
logToConsole(LOG_DEBUG, "[V.RP.Config] Loading email configuration");
logToConsole(LOG_DEBUG, "[V.RP.Config] Loading email configuration ...");
let emailConfig = JSON.parse(loadTextFile("config/email.json"));
if (emailConfig != null) {
return emailConfig;
@@ -1053,6 +1089,17 @@ function loadEmailConfig() {
// ===========================================================================
function loadSecurityConfig() {
logToConsole(LOG_DEBUG, "[V.RP.Config] Loading security configuration ...");
let securityConfig = JSON.parse(loadTextFile("config/security.json"));
if (securityConfig != null) {
return securityConfig;
}
return false;
}
// ===========================================================================
function doesServerHaveGUIEnabled() {
return getServerConfig().useGUI;
}
@@ -1125,21 +1172,37 @@ function getDatabaseConfig() {
// ===========================================================================
function getSecurityConfig() {
return getGlobalConfig().security;
}
// ===========================================================================
function loadServerConfig() {
logToConsole(LOG_DEBUG, "[V.RP.Config] Loading server configuration");
logToConsole(LOG_DEBUG, "[V.RP.Config] Loading server configuration ...");
if (toInteger(server.getCVar("agrp_devserver")) == 1) {
serverConfig = loadServerConfigFromGame(getGame());
if (toInteger(server.getCVar("v_devserver")) == 1) {
try {
serverConfig = loadServerConfigFromGame(getGame());
if (serverConfig == false) {
logToConsole(LOG_ERROR, `[AGRP.Config] Could not load server configuration for game ${getGame()}`);
if (serverConfig == false) {
logToConsole(LOG_ERROR, `[V.RP.Config] Could not load server configuration for game ${getGame()}`);
server.shutdown();
}
} catch (error) {
logToConsole(LOG_ERROR, `[V.RP.Config] Could not load server configuration for game ${getGame()} (${error})`);
server.shutdown();
}
} else {
serverConfig = loadServerConfigFromGameAndPort(getGame(), getServerPort());
try {
serverConfig = loadServerConfigFromGameAndPort(getGame(), getServerPort());
if (serverConfig == false) {
logToConsole(LOG_ERROR, `[AGRP.Config] Could not load server configuration for game ${getGame()} and port ${getServerPort()}`);
if (serverConfig == false) {
logToConsole(LOG_ERROR, `[V.RP.Config] Could not load server configuration for game ${getGame()} and port ${getServerPort()}`);
server.shutdown();
}
} catch (error) {
logToConsole(LOG_ERROR, `[V.RP.Config] Could not load server configuration for game ${getGame()} (${error})`);
server.shutdown();
}
}

View File

@@ -9,13 +9,14 @@
let scriptVersion = "1.3";
let serverStartTime = 0;
let logLevel = LOG_INFO | LOG_DEBUG | LOG_VERBOSE;
let logLevel = LOG_INFO | LOG_DEBUG;
let playerResourceReady = new Array(server.maxClients).fill(false);
let playerResourceStarted = new Array(server.maxClients).fill(false);
let playerInitialized = new Array(server.maxClients).fill(false);
let playerGUI = new Array(server.maxClients).fill(false);
let defaultNoAccountId = 1;
let serverStarting = false;
// ===========================================================================
@@ -25,7 +26,7 @@ let defaultNoAccountId = 1;
* @property {Array.<ClientData>} clients
* @property {Array.<BusinessData>} businesses
* @property {Array.<HouseData>} houses
* @property {Array.<HouseData>} commands
* @property {Array} commands
* @property {Array.<ItemData>} items
* @property {Array.<ItemTypeData>} itemTypes
* @property {Array.<ClanData>} clans
@@ -35,6 +36,7 @@ let defaultNoAccountId = 1;
* @property {Array.<JobData>} jobs
* @property {Array.<GateData>} gates
* @property {Array.<RadioStationData>} radioStations
* @property {Array.<PayPhoneData>} payPhones
* @property {Array} locales
* @property {Array} localeStrings
* @property {Array} groundItemCache
@@ -60,6 +62,7 @@ let serverData = {
jobs: [],
gates: [],
radioStations: [],
payPhones: [],
localeStrings: {},
groundItemCache: [],
groundPlantCache: [],

View File

@@ -318,8 +318,8 @@ function executeServerCodeCommand(command, params, client) {
}
messagePlayerSuccess(client, "Server code executed!");
messagePlayerNormal(client, `Code: ${params}`, COLOUR_YELLOW);
messagePlayerNormal(client, `Returns: ${returnValue} (${typeof returnValue})`, COLOUR_YELLOW);
messagePlayerNormal(client, `Code: ${params}`, getColourByName("yellow"));
messagePlayerNormal(client, `Returns: ${returnValue} (${typeof returnValue})`, getColourByName("yellow"));
logToConsole(LOG_INFO, `Server code executed by ${getPlayerDisplayForConsole(client)}: ${params}`);
return true;
}
@@ -349,7 +349,7 @@ function executeClientCodeCommand(command, params, client) {
sendRunCodeToClient(targetClient, targetCode, client);
messagePlayerSuccess(client, `Executing client code for ${getPlayerName(targetClient)}`);
messagePlayerNormal(client, `Code: ${targetCode}`);
messagePlayerNormal(client, `Code: ${targetCode}`, getColourByName("yellow"));
return true;
}
@@ -448,7 +448,7 @@ function saveServerDataCommand(command, params, client) {
// ===========================================================================
async function testEmailCommand(command, params, client) {
function testEmailCommand(command, params, client) {
sendEmail(params, "Player", "Test email", "Just testing the email system for the server!");
return true;
@@ -483,7 +483,7 @@ function clientRunCodeSuccess(client, returnTo, returnVal) {
//messagePlayerSuccess(returnClient, `Client code executed for ${getPlayerName(client)}!`);
//messagePlayerNormal(returnClient, `Code: ${code}`, getColourByName("yellow"));
messagePlayerNormal(returnClient, `(${getPlayerName(client)}) Code returns: ${returnVal}`, getColourByName("white"));
messagePlayerNormal(returnClient, `(${getPlayerName(client)}) Code returns: ${returnVal}`, getColourByName("yellow"));
}
// ===========================================================================
@@ -548,7 +548,7 @@ function isDevelopmentServer() {
// ===========================================================================
async function migrateSubAccountsToPerServerData() {
function migrateSubAccountsToPerServerData() {
let dbConnection = connectToDatabase();
let dbAssoc = [];
@@ -569,7 +569,7 @@ async function migrateSubAccountsToPerServerData() {
// ===========================================================================
async function resetAllAccountsHotkeysToDefault() {
function resetAllAccountsHotkeysToDefault() {
let dbConnection = connectToDatabase();
let dbAssoc = [];
@@ -593,11 +593,10 @@ function togglePauseSavingToDatabaseCommand(command, params, client) {
function createAccountDataForNewServer(serverId) {
let dbConnection = connectToDatabase();
let dbQuery = false;
if (dbConnection) {
dbQuery = queryDatabase(dbConnection, `SELECT * FROM acct_main`);
if (dbQuery) {
let dbQueryString = `INSERT INTO acct_svr (acct_svr_acct, acct_svr_svr) VALUES (${accountDatabaseId}, ${serverId})`;
let accounts = fetchQueryAssoc(dbConnection, `SELECT * FROM acct_main`);
for (let i in accounts) {
let dbQueryString = `INSERT INTO acct_svr (acct_svr_acct, acct_svr_svr) VALUES (${accounts[i]["acct_id"]}, ${serverId})`;
quickDatabaseQuery(dbQueryString);
}
}
@@ -605,6 +604,60 @@ function createAccountDataForNewServer(serverId) {
// ===========================================================================
function fixMissingAccountServerData() {
let dbConnection = connectToDatabase();
console.log(`Connection: ${dbConnection}`);
if (dbConnection != false) {
let accounts = fetchQueryAssoc(dbConnection, `SELECT * FROM acct_main WHERE acct_id > 12`);
console.log(`Accounts: ${accounts.length}`);
let servers = fetchQueryAssoc(dbConnection, `SELECT * FROM svr_main`);
console.log(`Servers: ${servers.length}`);
for (let i in accounts) {
let serverAccounts = fetchQueryAssoc(dbConnection, `SELECT * FROM acct_svr WHERE acct_svr_acct = ${accounts[i]["acct_id"]}`)
console.log(`Server accounts for ${accounts[i]["acct_id"]}: ${serverAccounts.length}`);
for (let k in servers) {
let check = serverAccounts.find((sa) => sa["acct_svr_svr"] == servers[k]["svr_id"]);
console.log(`Check server: ${servers[k]["svr_id"]}. Amount ${check}`);
if (typeof check == "undefined") {
let dbQueryString = `INSERT INTO acct_svr (acct_svr_acct, acct_svr_svr) VALUES (${accounts[i]["acct_id"]}, ${servers[k]["svr_id"]})`;
//console.log(dbQueryString);
quickDatabaseQuery(dbQueryString);
}
}
}
}
}
// ===========================================================================
function fixMissingSubAccountServerData() {
let dbConnection = connectToDatabase();
console.log(`Connection: ${dbConnection}`);
if (dbConnection != false) {
let subAccounts = fetchQueryAssoc(dbConnection, `SELECT * FROM sacct_main`);
console.log(`SubAccounts: ${subAccounts.length}`);
let servers = fetchQueryAssoc(dbConnection, `SELECT * FROM svr_main`);
console.log(`Servers: ${servers.length}`);
for (let i in subAccounts) {
let serverAccounts = fetchQueryAssoc(dbConnection, `SELECT * FROM sacct_svr WHERE sacct_svr_sacct = ${subAccounts[i]["sacct_id"]}`)
console.log(`Server accounts for ${subAccounts[i]["sacct_id"]}: ${serverAccounts.length}`);
for (let k in servers) {
let check = serverAccounts.find((sa) => sa["sacct_svr_server"] == servers[k]["svr_id"]);
console.log(`Check server: ${servers[k]["svr_id"]}. Amount ${check}`);
if (typeof check == "undefined") {
let dbQueryString = `INSERT INTO sacct_svr (sacct_svr_sacct, sacct_svr_server) VALUES (${subAccounts[i]["sacct_id"]}, ${servers[k]["svr_id"]})`;
//console.log(dbQueryString);
quickDatabaseQuery(dbQueryString);
}
}
}
}
}
// ===========================================================================
function streamAudioURLToAllPlayersCommand(command, params, client) {
if (areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
@@ -643,9 +696,9 @@ function fixAllServerBlipsCommand(command, params, client) {
deleteGameElement(blip);
});
createAllJobBlips();
createAllBusinessBlips();
createAllHouseBlips();
spawnAllJobBlips();
spawnAllBusinessBlips();
spawnAllHouseBlips();
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} reset all server blips`);
}
@@ -658,9 +711,9 @@ function fixAllServerPickupsCommand(command, params, client) {
deleteGameElement(pickup);
});
createAllJobPickups();
createAllBusinessPickups();
createAllHousePickups();
spawnAllJobPickups();
spawnAllBusinessPickups();
spawnAllHousePickups();
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} reset all server pickups`);
}
@@ -674,13 +727,6 @@ function resetAllServerAmbienceElementsCommand(command, params, client) {
// ===========================================================================
function reloadEconomyConfigurationCommand(command, params, client) {
getGlobalConfig().economy = loadEconomyConfig();
messageAdmins(`{adminOrange}${getPlayerName(client)} {MAINCOLOUR}has reloaded the economy settings`);
}
// ===========================================================================
function showLocalePickerTestCommand(command, params, client) {
showLocaleChooserForPlayer(client);
}

View File

@@ -31,10 +31,19 @@ function playerPayDay(client) {
let grossIncome = getPlayerData(client).payDayAmount;
// Passive income
grossIncome = Math.round(grossIncome + getGlobalConfig().economy.passiveIncomePerPayDay);
grossIncome = Math.round(grossIncome + getServerConfig().economy.passiveIncomePerPayDay);
// Job Pay
if (getPlayerJob(client) != -1) {
if (!getJobRankData(getPlayerJob(client), getPlayerJobRank(client))) {
grossIncome = grossIncome + 0;
} else {
grossIncome = Math.round(grossIncome + getJobRankData(getPlayerJob(client), getPlayerJobRank(client)).pay);
}
}
// Payday bonus
grossIncome = Math.round(grossIncome * getGlobalConfig().economy.grossIncomeMultiplier);
grossIncome = Math.round(grossIncome * getServerConfig().economy.grossIncomeMultiplier);
// Double bonus
if (isDoubleBonusActive()) {
@@ -50,7 +59,7 @@ function playerPayDay(client) {
messagePlayerInfo(client, `Taxes: {ALTCOLOUR}${getCurrencyString(incomeTaxAmount)}`);
messagePlayerInfo(client, `You receive: {ALTCOLOUR}${getCurrencyString(netIncome)}`);
if (netIncome < incomeTaxAmount) {
let totalCash = getPlayerCash(client);
let totalCash = getPlayerCurrentSubAccount(client);
let canPayNow = totalCash + netIncome;
if (incomeTaxAmount <= canPayNow) {
takePlayerCash(client, canPayNow);
@@ -75,6 +84,7 @@ function playerPayDay(client) {
}
givePlayerCash(client, netIncome);
getPlayerData(client).payDayAmount = 0;
}
// ===========================================================================
@@ -84,9 +94,9 @@ function calculateWealth(client) {
let houses = getAllHousesOwnedByPlayer(client);
let businesses = getAllBusinessesOwnedByPlayer(client);
let vehicleUpKeep = applyServerInflationMultiplier(vehicles.length * getGlobalConfig().economy.upKeepCosts.upKeepPerVehicle);
let houseUpKeep = applyServerInflationMultiplier(houses.length * getGlobalConfig().economy.upKeepCosts.upKeepPerHouse);
let businessUpKeep = applyServerInflationMultiplier(businesses.length * getGlobalConfig().economy.upKeepCosts.upKeepPerBusiness);
let vehicleUpKeep = applyServerInflationMultiplier(vehicles.length * getServerConfig().economy.upKeepCosts.upKeepPerVehicle);
let houseUpKeep = applyServerInflationMultiplier(houses.length * getServerConfig().economy.upKeepCosts.upKeepPerHouse);
let businessUpKeep = applyServerInflationMultiplier(businesses.length * getServerConfig().economy.upKeepCosts.upKeepPerBusiness);
return vehicleUpKeep + houseUpKeep + businessUpKeep;
}
@@ -94,7 +104,7 @@ function calculateWealth(client) {
// ===========================================================================
function calculateIncomeTax(amount) {
return amount * getGlobalConfig().economy.incomeTaxRate;
return amount * getServerConfig().economy.incomeTaxRate;
}
// ===========================================================================
@@ -117,26 +127,6 @@ function forcePlayerPayDayCommand(command, params, client) {
// ===========================================================================
function setPayDayBonusMultiplier(command, params, client) {
if (areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
return false;
}
let newMultiplier = params;
if (isNaN(newMultiplier)) {
messagePlayerError(client, getLocaleString(client, "AmountNotNumber"));
return false;
}
getGlobalConfig().economy.grossIncomeMultiplier = newMultiplier;
announceAdminAction(`PaydayBonusSet`, `{adminOrange}${getPlayerName(client)}{MAINCOLOUR}`, `{ALTCOLOUR}${newMultiplier * 100}%{MAINCOLOUR}`);
}
// ===========================================================================
function taxInfoCommand(command, params, client) {
let wealth = calculateWealth(client);
let tax = calculateIncomeTax(wealth);
@@ -168,19 +158,19 @@ function repossessFirstAsset(client) {
let vehicles = getAllVehiclesOwnedByPlayer(client);
if (vehicles.length > 0) {
deleteVehicle(vehicles[0]);
return getGlobalConfig().economy.upKeepCosts.upKeepPerVehicle;
return getServerConfig().economy.upKeepCosts.upKeepPerVehicle;
}
let houses = getAllHousesOwnedByPlayer(client);
if (houses.length > 0) {
deleteHouse(houses[0].index);
return getGlobalConfig().economy.upKeepCosts.upKeepPerHouse;
return getServerConfig().economy.upKeepCosts.upKeepPerHouse;
}
let businesses = getAllBusinessesOwnedByPlayer(client);
if (businesses.length > 0) {
deleteBusiness(businesses[0].index);
return getGlobalConfig().economy.upKeepCosts.upKeepPerBusiness;
return getServerConfig().economy.upKeepCosts.upKeepPerBusiness;
}
}
@@ -215,9 +205,202 @@ function isDoubleBonusActive() {
// ===========================================================================
function getCurrencyString(amount) {
let tempString = getGlobalConfig().economy.currencyString;
let tempString = getServerConfig().economy.currencyString;
tempString = tempString.replace("{AMOUNT}", toString(makeLargeNumberReadable(amount)));
return tempString;
}
// ===========================================================================
function setPassiveIncomeCommand(command, params, client) {
if (areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
return false;
}
if (isNaN(params)) {
messagePlayerError(client, "The amount needs to be a number!");
return false;
}
let amount = toInteger(params);
if (amount <= 0) {
messagePlayerError(client, "The amount can't be negative!");
return false;
}
getServerConfig().economy.passiveIncomePerPayDay = amount;
getServerConfig().needsSaved = true;
messageAdmins(`{adminOrange}${client.name}{MAINCOLOUR} set the passive income to {ALTCOLOUR}${getCurrencyString(amount)}`);
}
// ===========================================================================
function setCurrencyStringCommand(command, params, client) {
if (areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
return false;
}
if (params.indexOf("{AMOUNT}") == -1) {
messagePlayerError(client, "The currency text must include {AMOUNT}");
return false;
}
getServerConfig().economy.currencyString = params;
getServerConfig().needsSaved = true;
messageAdmins(`{adminOrange}${client.name}{MAINCOLOUR} set the to currency string to {ALTCOLOUR}${params}. Example: ${getCurrencyString(1000)}`);
}
// ===========================================================================
function setVehicleUpkeepCommand(command, params, client) {
if (areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
return false;
}
if (isNaN(params)) {
messagePlayerError(client, "The amount needs to be a number!");
return false;
}
let amount = toInteger(params);
if (amount <= 0) {
messagePlayerError(client, "The amount can't be negative!");
return false;
}
getServerConfig().economy.upKeepCosts.upKeepPerVehicle = amount;
getServerConfig().needsSaved = true;
messageAdmins(`{adminOrange}${client.name}{MAINCOLOUR} set the base upkeep per vehicle to {ALTCOLOUR}${getCurrencyString(amount)}`);
}
// ===========================================================================
function setBusinessUpkeepCommand(command, params, client) {
if (areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
return false;
}
if (isNaN(params)) {
messagePlayerError(client, "The amount needs to be a number!");
return false;
}
let amount = toInteger(params);
if (amount <= 0) {
messagePlayerError(client, "The amount can't be negative!");
return false;
}
getServerConfig().economy.upKeepCosts.upKeepPerBusiness = amount;
getServerConfig().needsSaved = true;
messageAdmins(`{adminOrange}${client.name}{MAINCOLOUR} set the base upkeep per business to {ALTCOLOUR}${getCurrencyString(amount)}`);
}
// ===========================================================================
function setHouseUpkeepCommand(command, params, client) {
if (areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
return false;
}
if (isNaN(params)) {
messagePlayerError(client, "The amount needs to be a number!");
return false;
}
let amount = toInteger(params);
if (amount <= 0) {
messagePlayerError(client, "The amount can't be negative!");
return false;
}
getServerConfig().economy.upKeepCosts.upKeepPerHouse = amount;
getServerConfig().needsSaved = true;
messageAdmins(`{adminOrange}${client.name}{MAINCOLOUR} set the base upkeep per house to {ALTCOLOUR}${getCurrencyString(amount)}`);
}
// ===========================================================================
function setIncomeTaxCommand(command, params, client) {
if (areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
return false;
}
if (isNaN(params)) {
messagePlayerError(client, "The amount needs to be a number!");
return false;
}
let amount = toInteger(params);
if (amount <= 0) {
messagePlayerError(client, "The amount can't be negative!");
return false;
}
getServerConfig().economy.incomeTaxRate = amount / 100;
getServerConfig().needsSaved = true;
messageAdmins(`{adminOrange}${client.name}{MAINCOLOUR} set the income tax rate to {ALTCOLOUR}${amount}%`);
}
// ===========================================================================
function setGrossIncomeMultiplierCommand(command, params, client) {
if (areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
return false;
}
if (isNaN(params)) {
messagePlayerError(client, "The amount needs to be a number!");
return false;
}
let amount = toInteger(params);
if (amount <= 0) {
messagePlayerError(client, "The amount can't be negative!");
return false;
}
getServerConfig().economy.grossIncomeMultiplier = amount / 100;
getServerConfig().needsSaved = true;
messageAdmins(`{adminOrange}${client.name}{MAINCOLOUR} set the gross income multiplier to {ALTCOLOUR}${amount}%`);
}
// ===========================================================================
function setInflationMultiplierCommand(command, params, client) {
if (areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
return false;
}
if (isNaN(params)) {
messagePlayerError(client, "The amount needs to be a number!");
return false;
}
let amount = toInteger(params);
if (amount <= 0) {
messagePlayerError(client, "The amount can't be negative!");
return false;
}
getServerConfig().economy.inflationMultiplier = amount / 100;
getServerConfig().needsSaved = true;
messageAdmins(`{adminOrange}${client.name}{MAINCOLOUR} set the server inflation {ALTCOLOUR}${amount}%`);
}
// ===========================================================================

View File

@@ -21,28 +21,28 @@ function initEmailScript() {
// ===========================================================================
async function sendEmail(toEmail, toName, subject, body) {
function sendEmail(toEmail, toName, subject, body) {
switch (getEmailConfig().method) {
case V_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
);
});
//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 V_EMAIL_METHOD_GET_REQUEST:

View File

@@ -15,33 +15,8 @@ function initEventScript() {
// ===========================================================================
function addAllEventHandlers() {
addEventHandler("onResourceStart", onResourceStart);
addEventHandler("onResourceStop", onResourceStop);
addEventHandler("onProcess", onProcess);
addEventHandler("onPlayerConnect", onPlayerConnect);
addEventHandler("onPlayerJoin", onPlayerJoin);
addEventHandler("onPlayerJoined", onPlayerJoined);
addEventHandler("onPlayerChat", onPlayerChat);
addEventHandler("onPlayerQuit", onPlayerQuit);
addEventHandler("onElementStreamIn", onElementStreamIn);
addEventHandler("onElementStreamOut", onElementStreamOut);
addEventHandler("onPedSpawn", onPedSpawn);
addEventHandler("OnPickupPickedUp", onPedPickupPickedUp);
addEventHandler("onPedEnteredVehicleEx", onPedEnteredVehicle);
addEventHandler("onPedExitedVehicleEx", onPedExitedVehicle);
addEventHandler("onPedEnteredSphereEx", onPedEnteredSphere);
addEventHandler("onPedExitedSphereEx", onPedExitedSphere);
if (getGame() == V_GAME_MAFIA_ONE) {
addEventHandler("onPedFall", onPedFall);
}
}
// ===========================================================================
function onPlayerConnect(event, ipAddress, port) {
logToConsole(LOG_INFO, `[AGRP.Event] onPlayerConnect - Client connecting (IP: ${ipAddress})`);
logToConsole(LOG_INFO, `[V.RP.Event] onPlayerConnect - Client connecting (IP: ${ipAddress})`);
//if(isIpAddressBanned(ipAddress)) {
// messagePlayerError(client, "You are banned from this server!");
// return false;
@@ -51,7 +26,7 @@ function onPlayerConnect(event, ipAddress, port) {
// ===========================================================================
function onPlayerJoin(event, client) {
logToConsole(LOG_INFO, `[AGRP.Event] onPlayerJoin - Client ${getPlayerDisplayForConsole(client)} joining from ${getPlayerIP(client)}`);
logToConsole(LOG_INFO, `[V.RP.Event] onPlayerJoin - Client ${getPlayerDisplayForConsole(client)} joining from ${getPlayerIP(client)}`);
playerResourceReady[getPlayerId(client)] = false;
playerResourceStarted[getPlayerId(client)] = false;
@@ -72,7 +47,7 @@ function onPlayerJoin(event, client) {
// ===========================================================================
function onPlayerJoined(event, client) {
logToConsole(LOG_INFO, `[AGRP.Event] onPlayerJoined - Client ${getPlayerDisplayForConsole(client)} joined from ${getPlayerIP(client)}`);
logToConsole(LOG_INFO, `[V.RP.Event] onPlayerJoined - Client ${getPlayerDisplayForConsole(client)} joined from ${getPlayerIP(client)}`);
//initClient(client);
}
@@ -141,7 +116,7 @@ function onPlayerQuit(event, client, quitReasonId) {
// ===========================================================================
async function onPlayerChat(event, client, messageText) {
function onPlayerChat(event, client, messageText) {
event.preventDefault();
processPlayerChat(client, messageText);
}
@@ -209,7 +184,7 @@ function onPedExitingVehicle(event, ped, vehicle) {
// ===========================================================================
function onResourceStart(event, resource) {
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Resource ${resource.name} started!`);
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Resource ${resource.name} started!`);
if (resource == thisResource) {
//messageAdmins(`{MAINCOLOUR}Resource {ALTCOLOUR}${resource.name}{MAINCOLOUR} started!`);
@@ -220,7 +195,7 @@ function onResourceStart(event, resource) {
// ===========================================================================
function onResourceStop(event, resource) {
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Resource ${resource.name} stopped!`);
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Resource ${resource.name} stopped!`);
//if(resource != thisResource) {
// messageAdmins(`{MAINCOLOUR}Resource {ALTCOLOUR}${resource.name}{MAINCOLOUR} stopped!`);
@@ -239,6 +214,8 @@ function onResourceStop(event, resource) {
// ===========================================================================
function onPedEnteredSphere(event, ped, sphere) {
logToConsole(LOG_WARN | LOG_VERBOSE, `[V.RP.Event] OnPedEnteredSphere event called`);
if (ped == null) {
return false;
}
@@ -247,7 +224,7 @@ function onPedEnteredSphere(event, ped, sphere) {
return false;
}
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} entered sphere ${sphere.id}!`);
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Ped ${ped.id} entered sphere ${sphere.id}!`);
//if (ped.isType(ELEMENT_PLAYER)) {
// let client = getClientFromPlayerElement(ped);
@@ -263,6 +240,8 @@ function onPedEnteredSphere(event, ped, sphere) {
// ===========================================================================
function onPedExitedSphere(event, ped, sphere) {
logToConsole(LOG_WARN | LOG_VERBOSE, `[V.RP.Event] OnPedExitedSphere event called`);
if (ped == null) {
return false;
}
@@ -271,7 +250,7 @@ function onPedExitedSphere(event, ped, sphere) {
return false;
}
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} exited sphere ${sphere.id}!`);
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Ped ${ped.id} exited sphere ${sphere.id}!`);
//if (ped.isType(ELEMENT_PLAYER)) {
// let client = getClientFromPlayerElement(ped);
//}
@@ -280,6 +259,8 @@ function onPedExitedSphere(event, ped, sphere) {
// ===========================================================================
function onPedPickupPickedUp(event, ped, pickup) {
logToConsole(LOG_WARN | LOG_VERBOSE, `[V.RP.Event] OnPedPickupPickedUp event called`);
if (ped == null) {
return false;
}
@@ -288,7 +269,7 @@ function onPedPickupPickedUp(event, ped, pickup) {
return false;
}
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} picked up pickup ${pickup.id}!`);
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Ped ${ped.id} picked up pickup ${pickup.id}!`);
if (ped.isType(ELEMENT_PLAYER)) {
let client = getClientFromPlayerElement(ped);
@@ -305,7 +286,7 @@ function onPedPickupPickedUp(event, ped, pickup) {
/*
function onPedWasted(event, ped, killerPed, weapon, pedPiece) {
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} wasted by ped ${killerPed.id}!`);
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Ped ${ped.id} wasted by ped ${killerPed.id}!`);
if (ped.isType(ELEMENT_PLAYER)) {
let killerClient = null;
@@ -319,8 +300,13 @@ function onPedWasted(event, ped, killerPed, weapon, pedPiece) {
// ===========================================================================
function onPlayerDeath(client, killer, weapon, pedPiece) {
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Player ${getPlayerDisplayForConsole(client)} died!`);
function onPlayerDeath(client, killer, weapon = 0, pedPiece = 0) {
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Player ${getPlayerDisplayForConsole(client)} died!`);
// Death is already being processed
if (getPlayerData(client).pedState == V_PEDSTATE_DEAD) {
return false;
}
logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} died.`);
getPlayerData(client).pedState = V_PEDSTATE_DEAD;
@@ -328,7 +314,7 @@ function onPlayerDeath(client, killer, weapon, pedPiece) {
setPlayerControlState(client, false);
setTimeout(function () {
if (isFadeCameraSupported()) {
fadeCamera(client, false, 1.0);
fadePlayerCamera(client, false, 1000);
}
setTimeout(function () {
if (isPlayerInPaintBall(client)) {
@@ -350,6 +336,7 @@ function onPlayerDeath(client, killer, weapon, pedPiece) {
}
} else {
respawnPlayerForPaintBall(client);
getPlayerData(client).pedState = V_PEDSTATE_READY;
}
} else {
if (getPlayerCurrentSubAccount(client).inJail) {
@@ -363,14 +350,14 @@ function onPlayerDeath(client, killer, weapon, pedPiece) {
}
spawnPlayer(client, closestJail.position, closestJail.heading, getGameConfig().skins[getGame()][getPlayerCurrentSubAccount(client).skin][0]);
if (isFadeCameraSupported()) {
fadeCamera(client, true, 1.0);
fadePlayerCamera(client, true, 1000);
}
updatePlayerSpawnedState(client, true);
makePlayerStopAnimation(client);
setPlayerControlState(client, true);
resetPlayerBlip(client);
getPlayerData(client).pedState = V_PEDSTATE_READY;
} else {
let closestHospital = getClosestHospital(getPlayerPosition(client));
despawnPlayer(client);
@@ -384,13 +371,14 @@ function onPlayerDeath(client, killer, weapon, pedPiece) {
spawnPlayer(client, closestHospital.position, closestHospital.heading, getGameConfig().skins[getGame()][getPlayerCurrentSubAccount(client).skin][0]);
if (isFadeCameraSupported()) {
fadeCamera(client, true, 1.0);
fadePlayerCamera(client, true, 1000);
}
updatePlayerSpawnedState(client, true);
makePlayerStopAnimation(client);
setPlayerControlState(client, true);
resetPlayerBlip(client);
getPlayerData(client).pedState = V_PEDSTATE_READY;
}
}
}, 2000);
@@ -413,7 +401,13 @@ function onPlayerDeath(client, killer, weapon, pedPiece) {
// ===========================================================================
function onPedSpawn(ped) {
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} spawned!`);
logToConsole(LOG_WARN | LOG_VERBOSE, `[V.RP.Event] OnPedSpawn event called`);
if (ped != null) {
return false;
}
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Ped ${ped.id} spawned!`);
//if (ped.type == ELEMENT_PLAYER) {
// if (getGame() != V_GAME_MAFIA_ONE) {
@@ -425,69 +419,69 @@ function onPedSpawn(ped) {
// ===========================================================================
async function onPlayerSpawn(client) {
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Player ${getPlayerDisplayForConsole(client)} spawned!`);
//logToConsole(LOG_DEBUG, `[AGRP.Event] Checking for ${getPlayerDisplayForConsole(client)}'s player ped`);
function onPlayerSpawn(client) {
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Player ${getPlayerDisplayForConsole(client)} spawned!`);
//logToConsole(LOG_DEBUG, `[V.RP.Event] Checking for ${getPlayerDisplayForConsole(client)}'s player ped`);
//if(getPlayerPed(client) == null) {
// logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)}'s player element not set yet. Rechecking ...`);
// logToConsole(LOG_DEBUG, `[V.RP.Event] ${getPlayerDisplayForConsole(client)}'s player element not set yet. Rechecking ...`);
// setTimeout(onPlayerSpawn, 500, client);
// return false;
//}
//logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)}'s player ped is valid. Continuing spawn processing ...`);
//logToConsole(LOG_DEBUG, `[V.RP.Event] ${getPlayerDisplayForConsole(client)}'s player ped is valid. Continuing spawn processing ...`);
if (areServerElementsSupported()) {
await waitUntil(() => client != null && getPlayerPed(client) != null);
waitUntil(() => client != null && getPlayerPed(client) != null);
}
stopRadioStreamForPlayer(client);
//logToConsole(LOG_DEBUG, `[AGRP.Event] Checking ${getPlayerDisplayForConsole(client)}'s player data`);
//logToConsole(LOG_DEBUG, `[V.RP.Event] Checking ${getPlayerDisplayForConsole(client)}'s player data`);
if (!getPlayerData(client)) {
logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)}'s player data is invalid. Kicking them from server.`);
logToConsole(LOG_DEBUG, `[V.RP.Event] ${getPlayerDisplayForConsole(client)}'s player data is invalid. Kicking them from server.`);
getPlayerData(targetClient).customDisconnectReason = "Desync";
disconnectPlayer(client);
return false;
}
//logToConsole(LOG_DEBUG, `[AGRP.Event] Checking ${getPlayerDisplayForConsole(client)}'s login status`);
//logToConsole(LOG_DEBUG, `[V.RP.Event] Checking ${getPlayerDisplayForConsole(client)}'s login status`);
if (!isPlayerLoggedIn(client)) {
logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)} is NOT logged in. Despawning their player.`);
logToConsole(LOG_DEBUG, `[V.RP.Event] ${getPlayerDisplayForConsole(client)} is NOT logged in. Despawning their player.`);
getPlayerData(targetClient).customDisconnectReason = "Desync";
disconnectPlayer(client);
return false;
}
//logToConsole(LOG_DEBUG, `[AGRP.Event] Checking ${getPlayerDisplayForConsole(client)}'s selected character status`);
//logToConsole(LOG_DEBUG, `[V.RP.Event] Checking ${getPlayerDisplayForConsole(client)}'s selected character status`);
if (getPlayerData(client).currentSubAccount == -1) {
logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)} has NOT selected a character. Despawning their player.`);
logToConsole(LOG_DEBUG, `[V.RP.Event] ${getPlayerDisplayForConsole(client)} has NOT selected a character. Despawning their player.`);
getPlayerData(targetClient).customDisconnectReason = "Desync";
disconnectPlayer(client);
return false;
}
logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)}'s player data is valid. Continuing spawn processing ...`);
logToConsole(LOG_DEBUG, `[V.RP.Event] ${getPlayerDisplayForConsole(client)}'s player data is valid. Continuing spawn processing ...`);
if (isGameFeatureSupported("pedScale")) {
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped scale (${getPlayerCurrentSubAccount(client).pedScale})`);
logToConsole(LOG_DEBUG, `[V.RP.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped scale (${getPlayerCurrentSubAccount(client).pedScale})`);
setEntityData(getPlayerPed(client), "v.rp.scale", getPlayerCurrentSubAccount(client).pedScale, true);
}
//if (isPlayerSwitchingCharacter(client) || isPlayerCreatingCharacter(client)) {
// logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)}'s ped is being used for character selection/creation. No further spawn processing needed'`);
// logToConsole(LOG_DEBUG, `[V.RP.Event] ${getPlayerDisplayForConsole(client)}'s ped is being used for character selection/creation. No further spawn processing needed'`);
// return false;
//}
if (isCustomCameraSupported()) {
logToConsole(LOG_DEBUG, `[AGRP.Event] Restoring ${getPlayerDisplayForConsole(client)}'s camera`);
logToConsole(LOG_DEBUG, `[V.RP.Event] Restoring ${getPlayerDisplayForConsole(client)}'s camera`);
restorePlayerCamera(client);
}
if (areServerElementsSupported()) {
logToConsole(LOG_DEBUG, `[AGRP.Event] Storing ${getPlayerDisplayForConsole(client)} ped in client data `);
logToConsole(LOG_DEBUG, `[V.RP.Event] Storing ${getPlayerDisplayForConsole(client)} ped in client data `);
getPlayerData(client).ped = getPlayerPed(client);
}
logToConsole(LOG_DEBUG, `[AGRP.Event] Sending ${getPlayerDisplayForConsole(client)} the 'now playing as' message`);
logToConsole(LOG_DEBUG, `[V.RP.Event] Sending ${getPlayerDisplayForConsole(client)} the 'now playing as' message`);
messagePlayerAlert(client, `You are now playing as: {businessBlue}${getCharacterFullName(client)}`, getColourByName("white"));
//messagePlayerNormal(client, "This server is in early development and may restart at any time for updates.", getColourByName("orange"));
//messagePlayerNormal(client, "Please report any bugs using /bug and suggestions using /idea", getColourByName("yellow"));
@@ -501,66 +495,76 @@ async function onPlayerSpawn(client) {
//}
if (isGameFeatureSupported("interior")) {
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting player interior for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).interior}`);
logToConsole(LOG_DEBUG, `[V.RP.Event] Setting player interior for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).interior}`);
setPlayerInterior(client, getPlayerCurrentSubAccount(client).interior);
}
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting player dimension for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).dimension}`);
logToConsole(LOG_DEBUG, `[V.RP.Event] Setting player dimension for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).dimension}`);
setPlayerDimension(client, getPlayerCurrentSubAccount(client).dimension);
//if(getPlayerCurrentSubAccount(client).interior != 0 || getPlayerCurrentSubAccount(client).dimension != 0) {
// updateAllInteriorVehiclesForPlayer(client, getPlayerCurrentSubAccount(client).interior, getPlayerCurrentSubAccount(client).dimension);
//}
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting player health for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).health}`);
logToConsole(LOG_DEBUG, `[V.RP.Event] Setting player health for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).health}`);
setPlayerHealth(client, getPlayerCurrentSubAccount(client).health);
if (isGameFeatureSupported("pedArmour")) {
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting player armour for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).armour}`);
logToConsole(LOG_DEBUG, `[V.RP.Event] Setting player armour for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).armour}`);
setPlayerArmour(client, getPlayerCurrentSubAccount(client).armour);
}
logToConsole(LOG_DEBUG, `[AGRP.Event] Sending ${getPlayerDisplayForConsole(client)}'s job type to their client (${getJobIndexFromDatabaseId(getPlayerCurrentSubAccount(client))})`);
sendPlayerJobType(client, getPlayerCurrentSubAccount(client).job);
logToConsole(LOG_DEBUG, `[V.RP.Event] Sending ${getPlayerDisplayForConsole(client)}'s job type to their client (${getJobIndexFromDatabaseId(getPlayerCurrentSubAccount(client))})`);
sendPlayerJobType(client, (getPlayerCurrentSubAccount(client).job != 0) ? getPlayerCurrentSubAccount(client).jobIndex : -1);
if (isGameFeatureSupported("rendering2D")) {
logToConsole(LOG_DEBUG, `[AGRP.Event] Enabling all rendering states for ${getPlayerDisplayForConsole(client)}`);
logToConsole(LOG_DEBUG, `[V.RP.Event] Enabling all rendering states for ${getPlayerDisplayForConsole(client)}`);
setPlayer2DRendering(client, true, true, true, true, true, true);
}
//if (isGameFeatureSupported("snow")) {
// logToConsole(LOG_DEBUG, `[AGRP.Event] Sending snow states to ${getPlayerDisplayForConsole(client)}`);
// logToConsole(LOG_DEBUG, `[V.RP.Event] Sending snow states to ${getPlayerDisplayForConsole(client)}`);
// updatePlayerSnowState(client, true);
//}
if (areServerElementsSupported() && isGameFeatureSupported("walkStyle")) {
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting player walking style for ${getPlayerDisplayForConsole(client)}`);
logToConsole(LOG_DEBUG, `[V.RP.Event] Setting player walking style for ${getPlayerDisplayForConsole(client)}`);
setEntityData(getPlayerPed(client), "v.rp.walkStyle", getPlayerCurrentSubAccount(client).walkStyle, true);
}
if (isGameFeatureSupported("fightStyle")) {
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting player fighting style for ${getPlayerDisplayForConsole(client)}`);
logToConsole(LOG_DEBUG, `[V.RP.Event] Setting player fighting style for ${getPlayerDisplayForConsole(client)}`);
setPlayerFightStyle(client, getPlayerCurrentSubAccount(client).fightStyle);
}
if (isGameFeatureSupported("rendering2D")) {
logToConsole(LOG_DEBUG, `[AGRP.Event] Updating logo state for ${getPlayerDisplayForConsole(client)}`);
logToConsole(LOG_DEBUG, `[V.RP.Event] Updating logo state for ${getPlayerDisplayForConsole(client)}`);
updatePlayerShowLogoState(client, (getServerConfig().showLogo && doesPlayerHaveLogoEnabled(client)));
}
logToConsole(LOG_DEBUG, `[AGRP.Event] Caching ${getPlayerDisplayForConsole(client)}'s hotbar items`);
logToConsole(LOG_DEBUG, `[V.RP.Event] Caching ${getPlayerDisplayForConsole(client)}'s hotbar items`);
cachePlayerHotBarItems(client);
logToConsole(LOG_DEBUG, `[AGRP.Event] Syncing ${getPlayerDisplayForConsole(client)}'s hotbar`);
logToConsole(LOG_DEBUG, `[V.RP.Event] Syncing ${getPlayerDisplayForConsole(client)}'s hotbar`);
updatePlayerHotBar(client);
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting ${getPlayerDisplayForConsole(client)}'s switchchar state to false`);
logToConsole(LOG_DEBUG, `[V.RP.Event] Setting ${getPlayerDisplayForConsole(client)}'s switchchar state to false`);
getPlayerData(client).switchingCharacter = false;
if (!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "enter")) {
let keyId = getPlayerKeyBindForCommand(client, "enter");
logToConsole(LOG_DEBUG, `[AGRP.Event] Sending custom enter property key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`);
logToConsole(LOG_DEBUG, `[V.RP.Event] Sending custom enter property key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`);
sendPlayerEnterPropertyKey(client, keyId.key);
} else {
sendPlayerEnterPropertyKey(client, -1);
}
if (!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "scoreboard")) {
let keyId = getPlayerKeyBindForCommand(client, "scoreboard");
logToConsole(LOG_DEBUG, `[V.RP.Event] Sending scoreboard key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`);
sendPlayerScoreBoardKey(client, keyId.key);
} else {
sendPlayerScoreBoardKey(client, -1);
}
sendPlayerChatBoxTimeStampsState(client, isPlayerAccountSettingEnabled(client, "ChatBoxTimestamps"));
@@ -590,7 +594,7 @@ async function onPlayerSpawn(client) {
//sendPlayerPedPartsAndProps(client);
}
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped state to ready`);
logToConsole(LOG_DEBUG, `[V.RP.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped state to ready`);
getPlayerData(client).pedState = V_PEDSTATE_READY;
if (areServerElementsSupported()) {
@@ -600,18 +604,19 @@ async function onPlayerSpawn(client) {
//}, 1000);
}
logToConsole(LOG_DEBUG, `[AGRP.Event] Syncing ${getPlayerDisplayForConsole(client)}'s cash ${getPlayerCurrentSubAccount(client).cash}`);
logToConsole(LOG_DEBUG, `[V.RP.Event] Syncing ${getPlayerDisplayForConsole(client)}'s cash ${getPlayerCurrentSubAccount(client).cash}`);
updatePlayerCash(client);
if (isGameFeatureSupported("customNametag")) {
logToConsole(LOG_DEBUG, `[AGRP.Event] Sending player nametag distance to ${getPlayerDisplayForConsole(client)}`);
logToConsole(LOG_DEBUG, `[V.RP.Event] Sending player nametag distance to ${getPlayerDisplayForConsole(client)}`);
sendNameTagDistanceToClient(client, getServerConfig().nameTagDistance);
}
if (!areServerElementsSupported() || getGame() == V_GAME_MAFIA_ONE || getGame() == V_GAME_GTA_IV) {
logToConsole(LOG_DEBUG, `[AGRP.Event] Sending properties, jobs, and vehicles to ${getPlayerDisplayForConsole(client)} (no server elements)`);
logToConsole(LOG_DEBUG, `[V.RP.Event] Sending properties, jobs, and vehicles to ${getPlayerDisplayForConsole(client)} (no server elements)`);
sendAllBusinessesToPlayer(client);
sendAllHousesToPlayer(client);
sendAllPayPhonesToPlayer(client);
if (getGame() != V_GAME_GTA_IV) {
sendAllJobsToPlayer(client);
}
@@ -622,7 +627,7 @@ async function onPlayerSpawn(client) {
sendAllVehiclesToPlayer(client);
}
logToConsole(LOG_DEBUG, `[AGRP.Event] Updating spawned state for ${getPlayerDisplayForConsole(client)} to true`);
logToConsole(LOG_DEBUG, `[V.RP.Event] Updating spawned state for ${getPlayerDisplayForConsole(client)} to true`);
updatePlayerSpawnedState(client, true);
getPlayerData(client).payDayTickStart = sdl.ticks;
@@ -630,7 +635,7 @@ async function onPlayerSpawn(client) {
// Locales are handled via resource files now. No need to send anymore, but kept in case revert is needed.
//sendPlayerLocaleStrings(client);
logToConsole(LOG_DEBUG, `[AGRP.Event] Updating all player name tags`);
logToConsole(LOG_DEBUG, `[V.RP.Event] Updating all player name tags`);
updateAllPlayerNameTags();
setPlayerWeaponDamageEvent(client, V_WEAPON_DAMAGE_EVENT_NORMAL);
@@ -687,7 +692,9 @@ async function onPlayerSpawn(client) {
// ===========================================================================
function onPlayerCommand(event, client, command, params) {
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Player used command ${command}!`);
logToConsole(LOG_WARN | LOG_VERBOSE, `[V.RP.Event] OnPlayerCommand event called`);
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Player used command ${command}!`);
if (!doesCommandExist(command)) {
processPlayerCommand(command, params, client);
@@ -697,6 +704,8 @@ function onPlayerCommand(event, client, command, params) {
// ===========================================================================
function onPedExitedVehicle(event, ped, vehicle, seat) {
logToConsole(LOG_WARN | LOG_VERBOSE, `[V.RP.Event] OnPedExitedVehicle event called`);
if (ped == null) {
return false;
}
@@ -705,7 +714,7 @@ function onPedExitedVehicle(event, ped, vehicle, seat) {
return false;
}
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} exited vehicle ${vehicle.id} from seat ${seat}!`);
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Ped ${ped.id} exited vehicle ${vehicle.id} from seat ${seat}!`);
if (getVehicleData(vehicle) == false) {
return false;
@@ -738,7 +747,7 @@ function onPedExitedVehicle(event, ped, vehicle, seat) {
getVehicleData(vehicle).lastActiveTime = getCurrentUnixTimestamp();
logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)} exited a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("v.rp.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`);
logToConsole(LOG_DEBUG, `[V.RP.Event] ${getPlayerDisplayForConsole(client)} exited a ${getVehicleName(vehicle)} (ID: ${getVehicleDataIndexFromVehicle(vehicle)}, Database ID: ${getVehicleData(vehicle).databaseId})`);
}
}
}
@@ -746,28 +755,34 @@ function onPedExitedVehicle(event, ped, vehicle, seat) {
// ===========================================================================
function onPedEnteredVehicle(event, ped, vehicle, seat) {
logToConsole(LOG_WARN | LOG_VERBOSE, `[V.RP.Event] OnPedEnteredVehicle event called`);
if (ped == null) {
logToConsole(LOG_ERROR | LOG_DEBUG, `[V.RP.Event] Ped ${ped.id} entered vehicle ${vehicle.id} in seat ${seat}, but ped is null`);
return false;
}
if (vehicle == null) {
logToConsole(LOG_ERROR | LOG_DEBUG, `[V.RP.Event] Ped ${ped.id} entered vehicle ${vehicle.id} in seat ${seat}, but vehicle is null`);
return false;
}
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} entered vehicle ${vehicle.id} in seat ${seat}!`);
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Ped ${ped.id} entered vehicle ${vehicle.id} in seat ${seat}!`);
if (ped.isType(ELEMENT_PLAYER)) {
let client = getClientFromPlayerElement(ped);
if (client != null) {
if (getPlayerData(client) == false) {
logToConsole(LOG_ERROR | LOG_DEBUG, `[V.RP.Event] ${getPlayerDisplayForConsole(client)} entered vehicle ${vehicle.id} in seat ${seat}, but player data is false`);
return false;
}
if (!getVehicleData(vehicle)) {
logToConsole(LOG_ERROR | LOG_DEBUG, `[V.RP.Event] ${getPlayerDisplayForConsole(client)} entered vehicle ${vehicle.id} in seat ${seat}, but vehicle data is false`);
return false;
}
logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)} entered a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("v.rp.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`);
logToConsole(LOG_DEBUG, `[V.RP.Event] ${getPlayerDisplayForConsole(client)} entered a ${getVehicleName(vehicle)} (ID: ${getVehicleDataIndexFromVehicle(vehicle)}, Database ID: ${getVehicleData(vehicle).databaseId})`);
getPlayerData(client).lastVehicle = vehicle;
getVehicleData(vehicle).lastActiveTime = getCurrentUnixTimestamp();
@@ -870,6 +885,8 @@ function onPedEnteredVehicle(event, ped, vehicle, seat) {
// ===========================================================================
function onPedEnteringVehicle(event, ped, vehicle, seat) {
logToConsole(LOG_WARN | LOG_VERBOSE, `[V.RP.Event] OnPedEnteringVehicle event called`);
if (ped == null) {
return false;
}
@@ -878,7 +895,7 @@ function onPedEnteringVehicle(event, ped, vehicle, seat) {
return false;
}
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} is entering vehicle ${vehicle.id} in seat ${seat}!`);
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Ped ${ped.id} is entering vehicle ${vehicle.id} in seat ${seat}!`);
if (ped.isType(ELEMENT_PLAYER)) {
let client = getClientFromPlayerElement(ped);
@@ -894,6 +911,8 @@ function onPedEnteringVehicle(event, ped, vehicle, seat) {
// ===========================================================================
function onPedExitingVehicle(event, ped, vehicle, seat) {
logToConsole(LOG_WARN | LOG_VERBOSE, `[V.RP.Event] OnPedExitingVehicle event called`);
if (ped == null) {
return false;
}
@@ -902,7 +921,7 @@ function onPedExitingVehicle(event, ped, vehicle, seat) {
return false;
}
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} is exiting vehicle ${vehicle.id} in seat ${seat}!`);
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Ped ${ped.id} is exiting vehicle ${vehicle.id} in seat ${seat}!`);
if (ped.isType(ELEMENT_PLAYER)) {
let client = getClientFromPlayerElement(ped);
@@ -930,12 +949,12 @@ function onPlayerExitingVehicle(client, vehicle, seat) {
// ===========================================================================
function onPedFall(ped) {
if (ped.isType(ELEMENT_PLAYER)) {
let client = getClientFromPlayerElement(ped);
if (client != null) {
processPlayerDeath(client);
}
}
//if (ped.isType(ELEMENT_PLAYER)) {
// let client = getClientFromPlayerElement(ped);
// if (client != null) {
// processPlayerDeath(client);
// }
//}
}
// ===========================================================================

View File

@@ -22,6 +22,29 @@ const V_FISHING_LINE_STATE_HOOKED = 5;
// ===========================================================================
class FishingLocationData {
constructor(dbAssoc = false) {
this.databaseId = 0;
this.serverId = 0;
this.index = -1;
this.position = toVector3(0.0, 0.0, 0.0);
this.enabled = false;
this.whoAdded = 0;
this.whenAdded = 0;
if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["fish_loc_id"]);
this.serverId = toInteger(dbAssoc["fish_loc_server"]);
this.enabled = intToBool(dbAssoc["fish_loc_enabled"]);
this.position = toVector3(toFloat(dbAssoc["fish_loc_pos_x"]), toFloat(dbAssoc["fish_loc_pos_y"]), toFloat(dbAssoc["fish_loc_pos_z"]));
this.whoAdded = toInteger(dbAssoc["fish_loc_who_added"]);
this.whenAdded = toInteger(dbAssoc["fish_loc_when_added"]);
}
}
};
// ===========================================================================
let fishingCollectables = [
// Fish
["Salmon", V_FISHING_CATCH_TYPE_FISH],
@@ -63,7 +86,11 @@ let fishingAnimations = {
[V_GAME_GTA_SA]: {
"fishingLineCasting": "none",
"fishingLineReeling": "none",
}
},
//[V_GAME_MAFIA_ONE]: {
// "fishingLineCasting": "none",
// "fishingLineReeling": "none",
//}
};
// ===========================================================================
@@ -205,4 +232,16 @@ function isPlayerFishing(client) {
return (getPlayerData(client).fishingLineState != V_FISHING_LINE_STATE_NONE);
}
// ===========================================================================
function getClosestFishingLocation(position) {
let closest = 0;
for (let i in getServerData().fishingLocations) {
if (getDistance(position, getServerData().fishingLocations[i].position) < getDistance(position, getServerData().fishingLocations[closest].position))
closest = i;
}
return closest;
}
// ===========================================================================

View File

@@ -45,8 +45,8 @@ class GateData {
// ===========================================================================
function initGateScript() {
logToConsole(LOG_INFO, `[AGRP.Gate]: Initializing gate script ...`);
logToConsole(LOG_INFO, `[AGRP.Gate]: Gate script initialized successfully!`);
logToConsole(LOG_INFO, `[V.RP.Gate]: Initializing gate script ...`);
logToConsole(LOG_INFO, `[V.RP.Gate]: Gate script initialized successfully!`);
}
// ===========================================================================
@@ -193,7 +193,7 @@ function saveGateToDatabase(gateId) {
return false;
}
logToConsole(LOG_VERBOSE, `[AGRP.Gate]: Saving gate ${tempGateData.databaseId} to database ...`);
logToConsole(LOG_VERBOSE, `[V.RP.Gate]: Saving gate ${tempGateData.databaseId} to database ...`);
let dbConnection = connectToDatabase();
if (dbConnection) {
let safeGateName = escapeDatabaseString(tempGateData.name);
@@ -227,7 +227,7 @@ function saveGateToDatabase(gateId) {
disconnectFromDatabase(dbConnection);
return true;
}
logToConsole(LOG_VERBOSE, `[AGRP.Gate]: Saved gate ${gateDataId} to database!`);
logToConsole(LOG_VERBOSE, `[V.RP.Gate]: Saved gate ${gateDataId} to database!`);
return true;
}
@@ -248,13 +248,13 @@ function loadGatesFromDatabase() {
for (let i in dbAssoc) {
let tempGateData = new GateData(dbAssoc[i]);
tempGates.push(tempGateData);
logToConsole(LOG_DEBUG, `[AGRP.Gate]: Gate '${tempGateData.name}' loaded from database successfully!`);
logToConsole(LOG_DEBUG, `[V.RP.Gate]: Gate '${tempGateData.name}' loaded from database successfully!`);
}
}
disconnectFromDatabase(dbConnection);
}
logToConsole(LOG_INFO, `[AGRP.Gate]: ${tempGates.length} gates loaded from database successfully!`);
logToConsole(LOG_INFO, `[V.RP.Gate]: ${tempGates.length} gates loaded from database successfully!`);
return tempGates;
}

View File

@@ -8,13 +8,14 @@
// ===========================================================================
function initHelpScript() {
logToConsole(LOG_INFO, `[AGRP.Help]: Initializing help script ...`);
logToConsole(LOG_INFO, `[AGRP.Help]: Help script initialized successfully!`);
logToConsole(LOG_INFO, `[V.RP.Help]: Initializing help script ...`);
logToConsole(LOG_INFO, `[V.RP.Help]: Help script initialized successfully!`);
}
// ===========================================================================
let randomTips = [
/*
`{MAINCOLOUR}Look for yellow dots on your map for job locations.`,
`{MAINCOLOUR}You can set custom key binds. Use {ALTCOLOUR}/info keys {MAINCOLOUR} for details.`,
`{MAINCOLOUR}Use /notips if you don't want to see tips and extra information`,
@@ -43,6 +44,7 @@ let randomTips = [
//`{MAINCOLOUR}Banks can provide loans. Use {ALTCOLOUR}/info loans {MAINCOLOUR} for more details.`,
`{MAINCOLOUR}Want to make a clan? Use {ALTCOLOUR}/info clans {MAINCOLOUR} for details.`,
`{MAINCOLOUR}Legal weapons can be purchased at any ammunation.`,
*/
];
// ===========================================================================
@@ -87,13 +89,13 @@ function helpCommand(command, params, client) {
showRulesHelpMessage(client);
break;
case "website":
showWebsiteHelpMessage(client);
break;
//case "website":
// showWebsiteHelpMessage(client);
// break;
case "discord":
showDiscordHelpMessage(client);
break;
//case "discord":
// showDiscordHelpMessage(client);
// break;
case "anim":
case "anims":
@@ -147,6 +149,14 @@ function helpCommand(command, params, client) {
showWealthAndTaxHelpMessage(client);
break;
case "admin":
showAdminHelpMessage(client, getParam(params, " ", 2));
break;
//case "items":
// showItemsHelpMessage(client);
// break;
default:
showMainHelpMessage(client);
break;
@@ -184,8 +194,8 @@ function helpCommand(command, params, client) {
function showMainHelpMessage(client) {
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HelpMainListHeader")));
messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Use /info <category> for commands and info. Example: {ALTCOLOUR}/info vehicle`);
messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Help Categories: [#A9A9A9]account, command, vehicle, job, chat, rules, website, animation`);
messagePlayerNormal(client, `{clanOrange}• [#A9A9A9]skin, mechanic, dealership, discord, colour, keybind`);
messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Help Categories: [#A9A9A9]account, command, vehicle, job, chat, rules, animation`);
messagePlayerNormal(client, `{clanOrange}• [#A9A9A9]skin, mechanic, dealership, colour, keybind`);
}
// ===========================================================================
@@ -252,6 +262,7 @@ function showRulesHelpMessage(client) {
// ===========================================================================
/*
function showWebsiteHelpMessage(client) {
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderWebsiteInfo")));
messagePlayerHelpContent(client, `{MAINCOLOUR}${server.getRule("Website")}`);
@@ -263,6 +274,7 @@ function showDiscordHelpMessage(client) {
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderDiscordInfo")));
messagePlayerHelpContent(client, `{MAINCOLOUR}${server.getRule("Discord")}`);
}
*/
// ===========================================================================
@@ -326,14 +338,39 @@ function showRadioHelpMessage(client) {
function showWealthAndTaxHelpMessage(client) {
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 * getServerConfig().economy.incomeTaxRate}%{MAINCOLOUR}`));
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}${getServerConfig().economy.upKeepCosts.upKeepPerVehicle}{MAINCOLOUR}`, `{ALTCOLOUR}${getServerConfig().economy.upKeepCosts.upKeepPerHouse}{MAINCOLOUR}`, `{ALTCOLOUR}${getServerConfig().economy.upKeepCosts.upKeepPerBusiness}{MAINCOLOUR}`));
messagePlayerHelpContent(client, getGroupedLocaleString(client, "WealthAndTaxHelp", 3, `{ALTCOLOUR}/wealth{MAINCOLOUR}`, `{ALTCOLOUR}/tax{MAINCOLOUR}`));
}
// ===========================================================================
function showAdminHelpMessage(client, flagName) {
if (getPlayerData(client).accountData.flags.admin == 0) {
messagePlayerError(client, getLocaleString(client, "CommandNoPermissions", `{ALTCOLOUR}/info admin`));
return false;
}
if (!flagName) {
messagePlayerSyntax(client, `${getCommandSyntaxText("help")} admin <flag name>`);
messagePlayerInfo(client, `Use /staffflags to see a list of staff flags`);
return false;
}
let commandList = getCommandsUsableByStaffFlag(flagName).map(function (x) {
return `/${x.command}`;
});
let chunkedList = splitArrayIntoChunks(commandList, 8);
messagePlayerNormal(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderCommandsForStaffFlagList", flagName)));
for (let i in chunkedList) {
messagePlayerNormal(client, `{ALTCOLOUR}${chunkedList[i].join(", ")}{MAINCOLOUR}`);
}
}
// ===========================================================================
function showCommandHelpMessage(client, commandName) {
if (!commandName) {
messagePlayerSyntax(client, `${getCommandSyntaxText("help")}command <command name>`);

View File

@@ -187,12 +187,12 @@ function loadHousesFromDatabase() {
for (let i in dbAssoc) {
let tempHouseData = new HouseData(dbAssoc[i]);
tempHouses.push(tempHouseData);
logToConsole(LOG_VERBOSE, `[AGRP.House]: House '${tempHouseData.description}' (ID ${tempHouseData.databaseId}) loaded!`);
logToConsole(LOG_VERBOSE, `[V.RP.House]: House '${tempHouseData.description}' (ID ${tempHouseData.databaseId}) loaded!`);
}
}
disconnectFromDatabase(dbConnection);
}
logToConsole(LOG_INFO, `[AGRP.House]: ${tempHouses.length} houses loaded from database successfully!`);
logToConsole(LOG_INFO, `[V.RP.House]: ${tempHouses.length} houses loaded from database successfully!`);
return tempHouses;
}
@@ -213,7 +213,16 @@ function createHouseCommand(command, params, client) {
return false;
}
createHouse(params, getPlayerPosition(client), toVector3(0.0, 0.0, 0.0), getGameConfig().pickupModels[getGame()].House, -1, getPlayerInterior(client), getPlayerDimension(client), getPlayerData(client).interiorScene);
createHouse(
params,
getPlayerPosition(client),
toVector3(0.0, 0.0, 0.0),
(isGameFeatureSupported("pickup")) ? getGameConfig().pickupModels[getGame()].House : -1,
-1,
getPlayerInterior(client),
getPlayerDimension(client),
getPlayerData(client).interiorScene
);
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} created house: {houseGreen}${params}`, true);
}
@@ -461,8 +470,8 @@ function setHousePickupCommand(command, params, client) {
getHouseData(houseId).entrancePickupModel = toInteger(typeParam);
}
deleteHouseEntrancePickup(houseId);
createHouseEntrancePickup(houseId);
despawnHouseEntrancePickup(houseId);
spawnHouseEntrancePickup(houseId);
getHouseData(houseId).needsSaved = true;
@@ -525,10 +534,10 @@ function setHouseInteriorTypeCommand(command, params, client) {
getHouseData(houseId).hasInterior = true;
}
deleteHouseEntrancePickup(houseId);
deleteHouseExitPickup(houseId);
createHouseEntrancePickup(houseId);
createHouseExitPickup(houseId);
despawnHouseEntrancePickup(houseId);
despawnHouseExitPickup(houseId);
spawnHouseEntrancePickup(houseId);
spawnHouseExitPickup(houseId);
getHouseData(houseId).needsSaved = true;
@@ -652,10 +661,10 @@ function moveHouseExitCommand(command, params, client) {
//createAllHouseBlips(houseId);
//createAllHousePickups(houseId);
deleteHouseExitPickup(houseId);
deleteHouseExitBlip(houseId);
createHouseExitPickup(houseId);
createHouseExitBlip(houseId);
despawnHouseExitPickup(houseId);
despawnHouseExitBlip(houseId);
spawnHouseExitPickup(houseId);
spawnHouseExitBlip(houseId);
getHouseData(houseId).needsSaved = true;
@@ -714,11 +723,11 @@ function deleteHouse(houseIndex, whoDeleted = 0) {
disconnectFromDatabase(dbConnection);
}
deleteHouseEntrancePickup(houseIndex);
deleteHouseExitPickup(houseIndex);
despawnHouseEntrancePickup(houseIndex);
despawnHouseExitPickup(houseIndex);
deleteHouseEntranceBlip(houseIndex);
deleteHouseExitBlip(houseIndex);
despawnHouseEntranceBlip(houseIndex);
despawnHouseExitBlip(houseIndex);
removePlayersFromHouse(houseIndex);
@@ -798,8 +807,8 @@ function createHouse(description, entrancePosition, exitPosition, entrancePickup
saveHouseToDatabase(houseId - 1);
setHouseDataIndexes();
createHousePickups(houseId - 1);
createHouseBlips(houseId - 1);
spawnHousePickups(houseId - 1);
spawnHouseBlips(houseId - 1);
return houseId - 1;
}
@@ -877,9 +886,9 @@ function getPlayerHouse(client) {
// ===========================================================================
function saveAllHousesToDatabase() {
logToConsole(LOG_DEBUG, `[AGRP.House]: Saving all server houses to database ...`);
logToConsole(LOG_DEBUG, `[V.RP.House]: Saving all server houses to database ...`);
if (getServerConfig().devServer) {
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.House]: Aborting save all houses to database, dev server is enabled.`);
logToConsole(LOG_DEBUG | LOG_WARN, `[V.RP.House]: Aborting save all houses to database, dev server is enabled.`);
return false;
}
@@ -888,7 +897,7 @@ function saveAllHousesToDatabase() {
saveHouseToDatabase(i);
}
}
logToConsole(LOG_INFO, `[AGRP.House]: Saved all server houses to database`);
logToConsole(LOG_INFO, `[V.RP.House]: Saved all server houses to database`);
}
// ===========================================================================
@@ -900,7 +909,7 @@ function saveHouseToDatabase(houseId) {
return false;
}
logToConsole(LOG_VERBOSE, `[AGRP.House]: Saving house '${tempHouseData.description}' to database ...`);
logToConsole(LOG_VERBOSE, `[V.RP.House]: Saving house '${tempHouseData.description}' to database ...`);
let dbConnection = connectToDatabase();
if (dbConnection) {
let safeHouseDescription = escapeDatabaseString(dbConnection, tempHouseData.description);
@@ -954,7 +963,7 @@ function saveHouseToDatabase(houseId) {
disconnectFromDatabase(dbConnection);
return true;
}
logToConsole(LOG_VERBOSE, `[AGRP.House]: Saved house '${tempHouseData.description}' to database!`);
logToConsole(LOG_VERBOSE, `[V.RP.House]: Saved house '${tempHouseData.description}' to database!`);
return false;
}
@@ -968,7 +977,7 @@ function saveHouseLocationToDatabase(houseId, locationId) {
return false;
}
logToConsole(LOG_VERBOSE, `[AGRP.House]: Saving house location ${locationId} for house ${houseId} to database ...`);
logToConsole(LOG_VERBOSE, `[V.RP.House]: Saving house location ${locationId} for house ${houseId} to database ...`);
let dbConnection = connectToDatabase();
if (dbConnection) {
let data = [
@@ -1009,32 +1018,32 @@ function saveHouseLocationToDatabase(houseId, locationId) {
disconnectFromDatabase(dbConnection);
return true;
}
logToConsole(LOG_VERBOSE, `[AGRP.House]: Saved location ${locationId} for house ${houseId} to database`);
logToConsole(LOG_VERBOSE, `[V.RP.House]: Saved location ${locationId} for house ${houseId} to database`);
return false;
}
// ===========================================================================
function createAllHousePickups() {
function spawnAllHousePickups() {
for (let i in getServerData().houses) {
createHouseEntrancePickup(i);
createHouseExitPickup(i);
spawnHouseEntrancePickup(i);
spawnHouseExitPickup(i);
}
}
// ===========================================================================
function createAllHouseBlips() {
function spawnAllHouseBlips() {
for (let i in getServerData().houses) {
createHouseEntranceBlip(i);
createHouseExitBlip(i);
spawnHouseEntranceBlip(i);
spawnHouseExitBlip(i);
}
}
// ===========================================================================
function createHouseEntrancePickup(houseId) {
function spawnHouseEntrancePickup(houseId) {
if (!getServerConfig().createHousePickups) {
return false;
}
@@ -1049,40 +1058,50 @@ function createHouseEntrancePickup(houseId) {
// return false;
//}
if (houseData.entrancePickupModel == -1) {
return false;
}
logToConsole(LOG_VERBOSE, `[V.RP.House]: Creating entrance pickup for house ${houseData.description} (${houseData.databaseId})`);
if (areServerElementsSupported() && getGame() != V_GAME_MAFIA_ONE && getGame() != V_GAME_GTA_IV) {
let entrancePickup = null;
if (isGameFeatureSupported("pickup")) {
let pickupModelId = getGameConfig().pickupModels[getGame()].House;
if (houseData.entrancePickupModel == -1) {
return false;
}
if (getServerData().houses[houseId].entrancePickupModel != 0) {
pickupModelId = getHouseData(houseId).entrancePickupModel;
}
entrancePickup = createGamePickup(pickupModelId, houseData.entrancePosition, getGameConfig().pickupTypes[getGame()].house);
} else if (isGameFeatureSupported("dummyElement")) {
entrancePickup = createGameDummyElement(houseData.exitPosition);
}
if (entrancePickup != null) {
setElementOnAllDimensions(entrancePickup, false);
setElementDimension(entrancePickup, getHouseData(houseId).entranceDimension);
setElementStreamInDistance(entrancePickup, getGlobalConfig().housePickupStreamInDistance);
setElementStreamOutDistance(entrancePickup, getGlobalConfig().housePickupStreamOutDistance);
setElementTransient(entrancePickup, false);
if (houseData.entranceDimension != -1) {
setElementDimension(entrancePickup, houseData.entranceDimension);
setElementOnAllDimensions(entrancePickup, false);
} else {
setElementOnAllDimensions(entrancePickup, true);
}
if (getGlobalConfig().housePickupStreamInDistance == -1 || getGlobalConfig().housePickupStreamOutDistance == -1) {
entrancePickup.netFlags.distanceStreaming = false;
} else {
setElementStreamInDistance(entrancePickup, getGlobalConfig().housePickupStreamInDistance);
setElementStreamOutDistance(entrancePickup, getGlobalConfig().housePickupStreamInDistance);
}
setElementTransient(entrancePickup, false);
getHouseData(houseId).entrancePickup = entrancePickup;
updateHousePickupLabelData(houseId);
}
}
updateHousePickupLabelData(houseId);
}
// ===========================================================================
function createHouseEntranceBlip(houseId) {
function spawnHouseEntranceBlip(houseId) {
if (!areServerElementsSupported()) {
return false;
}
@@ -1139,7 +1158,7 @@ function createHouseEntranceBlip(houseId) {
// ===========================================================================
function createHouseExitPickup(houseId) {
function spawnHouseExitPickup(houseId) {
if (!areServerElementsSupported()) {
return false;
}
@@ -1189,7 +1208,7 @@ function createHouseExitPickup(houseId) {
// ===========================================================================
function createHouseExitBlip(houseId) {
function spawnHouseExitBlip(houseId) {
if (!areServerElementsSupported()) {
return false;
}
@@ -1482,7 +1501,7 @@ function doesHouseHaveInterior(houseId) {
// ===========================================================================
function deleteHouseEntrancePickup(houseId) {
function despawnHouseEntrancePickup(houseId) {
if (!areServerElementsSupported()) {
return false;
}
@@ -1496,7 +1515,7 @@ function deleteHouseEntrancePickup(houseId) {
// ===========================================================================
function deleteHouseExitPickup(houseId) {
function despawnHouseExitPickup(houseId) {
if (!areServerElementsSupported()) {
return false;
}
@@ -1510,7 +1529,7 @@ function deleteHouseExitPickup(houseId) {
// ===========================================================================
function deleteHouseEntranceBlip(houseId) {
function despawnHouseEntranceBlip(houseId) {
if (!areServerElementsSupported()) {
return false;
}
@@ -1524,7 +1543,7 @@ function deleteHouseEntranceBlip(houseId) {
// ===========================================================================
function deleteHouseExitBlip(houseId) {
function despawnHouseExitBlip(houseId) {
if (!areServerElementsSupported()) {
return false;
}
@@ -1556,10 +1575,10 @@ function reloadAllHousesCommand(command, params, client) {
}
for (let i in getServerData().houses) {
deleteHouseExitBlip(i);
deleteHouseEntranceBlip(i);
deleteHouseExitPickup(i);
deleteHouseEntrancePickup(i);
despawnHouseExitBlip(i);
despawnHouseEntranceBlip(i);
despawnHouseExitPickup(i);
despawnHouseEntrancePickup(i);
}
clearArray(getServerData().houses);
@@ -1700,19 +1719,19 @@ function canPlayerLockUnlockHouse(client, houseId) {
// ===========================================================================
function resetHousePickups(houseId) {
deleteHouseEntrancePickup(houseId);
deleteHouseExitPickup(houseId);
createHouseEntrancePickup(houseId);
createHouseExitPickup(houseId);
despawnHouseEntrancePickup(houseId);
despawnHouseExitPickup(houseId);
spawnHouseEntrancePickup(houseId);
spawnHouseExitPickup(houseId);
}
// ===========================================================================
function resetHouseBlips(houseId) {
deleteHouseEntranceBlip(houseId);
deleteHouseExitBlip(houseId);
createHouseEntranceBlip(houseId);
createHouseExitBlip(houseId);
despawnHouseEntranceBlip(houseId);
despawnHouseExitBlip(houseId);
spawnHouseEntranceBlip(houseId);
spawnHouseExitBlip(houseId);
}
// ===========================================================================
@@ -1778,13 +1797,29 @@ function getHouseFromParams(params) {
// ===========================================================================
function updateHousePickupLabelData(houseId) {
let houseData = getHouseData(houseId);
if (!areServerElementsSupported() || getGame() == V_GAME_MAFIA_ONE || getGame() == V_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);
if (houseData == false) {
sendHouseToPlayer(null, houseId, true, "", false, -1, -1, 0, 0, false, false);
} else {
sendHouseToPlayer(
null,
houseId,
false,
houseData.description,
houseData.entrancePosition,
getHouseEntranceBlipModelForNetworkEvent(houseId),
getHouseEntrancePickupModelForNetworkEvent(houseId),
houseData.buyPrice,
houseData.rentPrice,
houseData.hasInterior,
houseData.locked
);
}
return false;
}
let houseData = getHouseData(houseId);
if (houseData.entrancePickup != null) {
setEntityData(houseData.entrancePickup, "v.rp.owner.type", V_PICKUP_HOUSE_ENTRANCE, false);
setEntityData(houseData.entrancePickup, "v.rp.owner.id", houseId, false);
@@ -1813,8 +1848,8 @@ function updateHousePickupLabelData(houseId) {
function deleteAllHouseBlips() {
for (let i in getServerData().houses) {
deleteHouseEntranceBlip(i);
deleteHouseExitBlip(i);
despawnHouseEntranceBlip(i);
despawnHouseExitBlip(i);
}
}
@@ -1822,23 +1857,23 @@ function deleteAllHouseBlips() {
function deleteAllHousePickups() {
for (let i in getServerData().houses) {
deleteHouseEntrancePickup(i);
deleteHouseExitPickup(i);
despawnHouseEntrancePickup(i);
despawnHouseExitPickup(i);
}
}
// ===========================================================================
function createHouseBlips(houseId) {
createHouseEntranceBlip(houseId);
createHouseExitBlip(houseId);
function spawnHouseBlips(houseId) {
spawnHouseEntranceBlip(houseId);
spawnHouseExitBlip(houseId);
}
// ===========================================================================
function createHousePickups(houseId) {
createHouseEntrancePickup(houseId);
createHouseExitPickup(houseId);
function spawnHousePickups(houseId) {
spawnHouseEntrancePickup(houseId);
spawnHouseExitPickup(houseId);
}
// ===========================================================================
@@ -1890,4 +1925,49 @@ function getHouseEntrancePickupModelForNetworkEvent(houseIndex) {
return pickupModelId;
}
// ===========================================================================
function getNearbyBusinessesCommand(command, params, client) {
let distance = 10.0;
if (!areParamsEmpty(params)) {
distance = getParam(params, " ", 1);
}
if (isNaN(distance)) {
messagePlayerError(client, "The distance must be a number!");
return false;
}
distance = toFloat(distance);
if (distance <= 0) {
messagePlayerError(client, "The distance must be more than 0!");
return false;
}
let nearbyHouses = getHousesInRange(getPlayerPosition(client), distance);
if (nearbyHouses.length == 0) {
messagePlayerAlert(client, getLocaleString(client, "NoHousesWithinRange", distance));
return false;
}
let housesList = nearbyHouses.map(function (x) {
return `{chatBoxListIndex}${x.index}: {MAINCOLOUR}${x.description} {mediumGrey}(${toFloat(getDistance(getPlayerPosition(client), x.entrancePosition)).toFixed(2)} ${toLowerCase(getLocaleString(client, "Meters"))} ${toLowerCase(getGroupedLocaleString(client, "CardinalDirections", getCardinalDirectionName(getCardinalDirection(getPlayerPosition(client), x.entrancePosition))))})`;
});
let chunkedList = splitArrayIntoChunks(housesList, 4);
messagePlayerNormal(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderHousesInRangeList", `${distance} ${toLowerCase(getLocaleString(client, "Meters"))}`)));
for (let i in chunkedList) {
messagePlayerInfo(client, chunkedList[i].join(", "));
}
}
// ===========================================================================
function getHousesInRange(position, distance) {
return getServerData().houses.filter((house) => getDistance(position, house.entrancePosition) <= distance);
}
// ===========================================================================

Some files were not shown because too many files have changed in this diff Show More