Commit Graph

101 Commits

Author SHA1 Message Date
Linden
5d71c4efdf fix(client/zones): debug erroneously triggers zone:inside
Should only trigger when the player is, in fact, inside the zone.
2022-09-02 22:23:24 +10:00
Linden
3a97a0c569 fix(client/zones): convert tables to vectors
Ensure tables (either array or map) set as points, coords, or size are
converted into vectors.
Includes complementary reformatting.
2022-08-30 02:58:41 +10:00
Linden
2a1815c460 tweak(callback): error handling
Errors during callbacks will never respond, so we'll use a protected call
and format the error message with a normal print to keep the thread
alive.
2022-08-25 18:49:07 +10:00
Linden
8c8da4b119 refactor(raycast/client)!: use new native (GetWorldCoordFromScreenCoord)
This native got merged days after I pushed the raycast function. This will break
scripts relying on this function (doubt there's many, if any).
2022-08-18 01:58:54 +10:00
Jag
99cab6d072 feat(imports): getClosestVehicle and getNearbyVehicles (#71) 2022-08-16 17:34:49 +10:00
Linden
46a525e057 fix(zones/client): debug DrawPoly and DrawLine
Debug for boxes broke with the oal fixes, since vectors don't unpack.
Also fixes flicker when entering a debug zone.
2022-08-13 17:08:39 +10:00
Linden
231ca90b8f fix(zones/client): do not overwrite zone.distance with contains
Manually calling the contains method would overwrite zone distance.
Also move Wait to the end of the thread to prevent race conditions.
2022-08-10 23:45:48 +10:00
Linden
245af3df41 refactor(callback): types 2022-08-08 17:16:57 +10:00
Linden
f122c6e3ea feat(imports): getNearbyPlayers 2022-08-05 00:45:10 +10:00
Linden
a45584ac78 Revert "feat(imports): loadAnimDict"
This reverts commit 77fb9cf637.
2022-08-03 21:57:03 +10:00
Linden
77fb9cf637 feat(imports): loadAnimDict 2022-08-03 17:27:58 +10:00
Linden
68a6352be4 feat(imports): getClosestPlayer 2022-08-03 17:26:51 +10:00
Linden
ee12035a50 feat(imports): raycast module
Just lib.raycast.cam for now.
2022-08-03 17:22:45 +10:00
Jag
3c82b654ff feat(addCommand): Allow multiple groups (#57) 2022-07-12 18:50:01 +10:00
Linden
d33df54f0e tweak(zones): store distance to zone center
Should make sphere "zones" nearly 1:1 with the points api.
Distance added for polygons too for consistency and some use-cases,
but generally only worthwhile for smaller zones.
2022-06-26 12:30:25 +10:00
Linden
6c83adfda8 fix(locale): always assign a table to dict
Prevent indexing nil when no locales exist for a resource.
2022-06-24 09:10:37 +10:00
Linden
e95ae858df fix(callback): handle external resource events
Calling registered callback events in another resource should respond to
the invoking resource.
2022-06-19 13:08:28 +10:00
Linden
76fcc007c4 feat(callback): client callback
Allow the client to listen for and respond to server requests.
Basically just copy-paste and swap the two.
2022-06-09 05:18:05 +10:00
Linden
c85e9032f9 refactor(callback): rewrite
Register a single net event to handle callback responses (per resource).
Previous implementation registered new events for each callback.
2022-06-09 04:43:37 +10:00
Linden
962e735d6f feat(getCore/server): hasGroup method 2022-05-30 15:43:42 +10:00
Linden
2599d2ed80 feat(getCore/server): initialise player module and add getter 2022-05-29 10:33:41 +10:00
Linden
734a6cdc81 refactor(getCore/client): instantiate player
Previously handled by the player module.
2022-05-29 10:33:41 +10:00
Linden
eb54fc4675 refactor(player/client): set CPlayer.__index as a function
Match server implementation.
2022-05-29 10:33:41 +10:00
Linden
04beaf1b5a feat(player): add server methods 2022-05-29 10:33:41 +10:00
Linden
8aa9ebf41d refactor(player/client): create player instance at init
And minor fixes.
2022-05-28 21:30:17 +10:00
Linden
32709db3cb refactor(getCore/shared): adjust ox_core imports 2022-05-28 21:28:23 +10:00
Linden
84867900eb fix(zones): zone.inside should not depend on zone.onEnter 2022-05-18 01:46:58 +10:00
DokaDoka
d52d5adac2 fix(zones): debug thickness misalignment and standardize defaults
all total sizes now default to 4
2022-05-14 12:45:50 +10:00
DokaDoka
14ce365de1 fix(zones): thickness workaround
thickness is calculated incorrectly by glm.polygon.contains so this is required until it is fixed
2022-05-14 12:34:12 +10:00
Linden
139ae0701b refactor(getCore/client): clean up hasGroup method and return values 2022-05-12 07:44:29 +10:00
Linden
4575b5e02a refactor(player): simplify
Was planning to support checking other user playerdata, but will
require much more planning to implement properly.
2022-05-12 07:41:12 +10:00
Linden
5d1f6019c7 feat(getCore/client): load and extend player class 2022-05-12 01:55:21 +10:00
Linden
df8115ea8c feat(player/client): player class and methods
Provide a couple of helper methods (more to come).
2022-05-12 01:55:06 +10:00
DokaDoka
6a8ebb5a0d chore(zones): rearrange variables 2022-05-11 13:38:27 +10:00
DokaDoka
2a1ae2e287 feat(zones): consistent zone debug appearance
through merging debugPoly and debugBox
2022-05-11 13:36:36 +10:00
DokaDoka
38dbc2ac34 refactor(zones): create data.triangles even if the polygon is convex 2022-05-11 13:34:06 +10:00
DokaDoka
9b5ac35ab3 refactior(zones): make makeTriangles available outside of getTriangles 2022-05-11 13:29:18 +10:00
Linden
7a4745c0da chore(zones): adjust debug rgba 2022-05-10 15:29:07 +10:00
Linden
55bfa7ca3d refactor(zones): global Zones 2022-05-07 11:47:39 +10:00
Linden
ce3f916c42 refactor(zones): centroid -> coords
While centroid is a more accurate term, coords is a little simpler when
writing it a million times.
Prefer to use a single term (sphere was using coords) to simplify API.
2022-05-07 11:19:27 +10:00
Linden
d4b5e0402c refactor(server/locale): get array of valid locales 2022-05-06 16:37:36 +10:00
Linden
d3718622cf feat(zones): sphere zone
It's just a distance check and works exactly like lib.points, with some
minor API changes for consistency.
2022-05-06 14:28:45 +10:00
Linden
4555fa0a22 refactor(zones): call zone:contains instead of zone.polygon:contains
Added this function earlier but forgot to include thickness, so
it didn't work.
2022-05-06 14:26:56 +10:00
Linden
96eabf5592 refactor(imports/getCore): set constants and use new import files 2022-05-04 06:33:32 +10:00
Linden
c5bdaaafe8 refactor(imports/getCore): create import files for esx and qb 2022-05-04 06:33:32 +10:00
Linden
a3f38723e3 refactor(getCore): rename loadFramework, tweaks
ESX imports are limited to an event and getSharedObject export.
In the future I want to introduce some generic functions to simplify
cross-framework compatibility
when working with player, accounts, inventories, and groups (jobs/gangs).
2022-05-01 22:51:59 +10:00
DokaDoka
18f55ffefe refactor(zones): handle multiple points in the same horizontal line
- new intersection points are generated per vertical coord present in the original polygon rather than per vertex and are grouped together rather than associated directly with the parent
- hopefully better code structure and organisation for the entire triangle generating section
2022-05-01 12:49:56 +10:00
Linden
48728f0241 feat(locales): include some locales
Partial, and google translated just for the sake of setting an example.
Also renamed many of the language codes where the extra characters are
redundant (i.e. fr-FR, de-DE).
2022-04-30 05:04:15 +10:00
Linden
031cccd886 fix(locale): server hotload and "external" kvp
External kvp's don't exist for the server, so we have to export the proper language.
2022-04-29 16:53:24 +10:00
Linden
8af19bae42 feat: locale system 2022-04-29 05:56:41 +10:00