@citizenfx/server 2.0.14033-1 → 2.0.14111-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/natives_server.d.ts +33 -1
- package/package.json +1 -1
package/natives_server.d.ts
CHANGED
|
@@ -418,7 +418,7 @@ declare function EndFindKvp(handle: number): void;
|
|
|
418
418
|
declare function EnsureEntityStateBag(entity: number): void;
|
|
419
419
|
|
|
420
420
|
/**
|
|
421
|
-
*
|
|
421
|
+
* Depending on your use case you may need to use `add_acl resource.<your_resource_name> command.<command_name> allow` to use this native in your resource.
|
|
422
422
|
*/
|
|
423
423
|
declare function ExecuteCommand(commandString: string): void;
|
|
424
424
|
|
|
@@ -536,6 +536,38 @@ declare function GetCurrentPedWeapon(ped: number): number;
|
|
|
536
536
|
*/
|
|
537
537
|
declare function GetCurrentResourceName(): string;
|
|
538
538
|
|
|
539
|
+
/**
|
|
540
|
+
* ### Supported types
|
|
541
|
+
* * \[1] : Peds (including animals) and players.
|
|
542
|
+
* * \[2] : Vehicles.
|
|
543
|
+
* * \[3] : Objects (props), doors, and projectiles.
|
|
544
|
+
* ### Coordinates need to be send unpacked (x,y,z)
|
|
545
|
+
* ```lua
|
|
546
|
+
* -- Define the allowed model hashes
|
|
547
|
+
* local allowedModelHashes = { GetHashKey("p_crate03x"), GetHashKey("p_crate22x") }
|
|
548
|
+
* -- Get the player's current coordinates
|
|
549
|
+
* local playerCoords = GetEntityCoords(PlayerPedId())
|
|
550
|
+
* -- Retrieve all entities of type Object (type 3) within a radius of 10.0 units
|
|
551
|
+
* -- that match the allowed model hashes
|
|
552
|
+
* -- and sort output entities by distance
|
|
553
|
+
* local entities = GetEntitiesInRadius(playerCoords.x, playerCoords.y, playerCoords.z, 10.0, 3, true, allowedModelHashes)
|
|
554
|
+
* -- Iterate through the list of entities and print their ids
|
|
555
|
+
* for i = 1, #entities do
|
|
556
|
+
* local entity = entities[i]
|
|
557
|
+
* print(entity)
|
|
558
|
+
* end
|
|
559
|
+
* ```
|
|
560
|
+
* @param x The X coordinate.
|
|
561
|
+
* @param y The Y coordinate.
|
|
562
|
+
* @param z The Z coordinate.
|
|
563
|
+
* @param radius Max distance from coordinate to entity
|
|
564
|
+
* @param entityType Entity types see list below
|
|
565
|
+
* @param sortByDistance Sort output entites by distance from nearest to farthest
|
|
566
|
+
* @param models List of allowed models its also optional
|
|
567
|
+
* @return An array containing entity handles for each entity.
|
|
568
|
+
*/
|
|
569
|
+
declare function GetEntitiesInRadius(x: number, y: number, z: number, radius: number, entityType: number, sortByDistance: boolean, models: any): any;
|
|
570
|
+
|
|
539
571
|
/**
|
|
540
572
|
* Gets the entity that this entity is attached to.
|
|
541
573
|
* @param entity The entity to check.
|