@citizenfx/server 2.0.6500-1 → 2.0.6501-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.
Files changed (2) hide show
  1. package/natives_server.d.ts +138 -2
  2. package/package.json +1 -1
@@ -273,6 +273,13 @@ declare function DeleteResourceKvp(key: string): void;
273
273
  */
274
274
  declare function DeleteResourceKvpNoSync(key: string): void;
275
275
 
276
+ /**
277
+ * DOES_BOAT_SINK_WHEN_WRECKED
278
+ * @param vehicle The target vehicle.
279
+ * @return Returns whether or not the boat sinks when wrecked.
280
+ */
281
+ declare function DoesBoatSinkWhenWrecked(vehicle: number): boolean;
282
+
276
283
  /**
277
284
  * DOES_ENTITY_EXIST
278
285
  */
@@ -424,6 +431,13 @@ declare function GetCurrentResourceName(): string;
424
431
  */
425
432
  declare function GetEntityAttachedTo(entity: number): number;
426
433
 
434
+ /**
435
+ * GET_ENTITY_COLLISION_DISABLED
436
+ * @param entity The target entity.
437
+ * @return Returns whether or not entity collisions are disabled.
438
+ */
439
+ declare function GetEntityCollisionDisabled(entity: number): boolean;
440
+
427
441
  /**
428
442
  * Gets the current coordinates for a specified entity. This native is used server side when using OneSync.
429
443
  * See [GET_ENTITY_COORDS](#\_0x3FEF770D40960D5A) for client side.
@@ -445,7 +459,11 @@ declare function GetEntityFromStateBagName(bagName: string): number;
445
459
  declare function GetEntityHeading(entity: number): number;
446
460
 
447
461
  /**
448
- * Currently it only works with peds.
462
+ * Only works for vehicle and peds
463
+ * @param entity The entity to check the health of
464
+ * @return If the entity is a vehicle it will return 0-1000
465
+ If the entity is a ped it will return 0-200
466
+ If the entity is an object it will return 0
449
467
  */
450
468
  declare function GetEntityHealth(entity: number): number;
451
469
 
@@ -757,6 +775,13 @@ declare function GetPedSourceOfDeath(ped: number): number;
757
775
  */
758
776
  declare function GetPedSpecificTaskType(ped: number, index: number): number;
759
777
 
778
+ /**
779
+ * GET_PED_STEALTH_MOVEMENT
780
+ * @param ped The target ped.
781
+ * @return Whether or not the ped is stealthy.
782
+ */
783
+ declare function GetPedStealthMovement(ped: number): boolean;
784
+
760
785
  /**
761
786
  * Gets the current camera rotation for a specified player. This native is used server side when using OneSync.
762
787
  * @param playerSrc The player handle.
@@ -1217,6 +1242,13 @@ declare function GiveWeaponToPed(ped: number, weaponHash: string | number, ammoC
1217
1242
  */
1218
1243
  declare function HasEntityBeenMarkedAsNoLongerNeeded(vehicle: number): boolean;
1219
1244
 
1245
+ /**
1246
+ * HAS_VEHICLE_BEEN_DAMAGED_BY_BULLETS
1247
+ * @param vehicle The target vehicle.
1248
+ * @return Returns whether or not the target vehicle has been damaged by bullets.
1249
+ */
1250
+ declare function HasVehicleBeenDamagedByBullets(vehicle: number): boolean;
1251
+
1220
1252
  /**
1221
1253
  * HAS_VEHICLE_BEEN_OWNED_BY_PLAYER
1222
1254
  */
@@ -1232,24 +1264,80 @@ declare function InvokeFunctionReference(referenceIdentity: string, argsSerializ
1232
1264
  */
1233
1265
  declare function IsAceAllowed(object: string): boolean;
1234
1266
 
1267
+ /**
1268
+ * IS_BOAT_ANCHORED_AND_FROZEN
1269
+ * @param vehicle The target vehicle.
1270
+ * @return Returns whether or not the boat is anchored and frozen.
1271
+ */
1272
+ declare function IsBoatAnchoredAndFrozen(vehicle: number): boolean;
1273
+
1274
+ /**
1275
+ * IS_BOAT_WRECKED
1276
+ * @param vehicle The target vehicle.
1277
+ * @return Returns whether or not the boat is wrecked.
1278
+ */
1279
+ declare function IsBoatWrecked(vehicle: number): boolean;
1280
+
1235
1281
  /**
1236
1282
  * Gets whether or not this is the CitizenFX server.
1237
1283
  * @return A boolean value.
1238
1284
  */
1239
1285
  declare function IsDuplicityVersion(): boolean;
1240
1286
 
1287
+ /**
1288
+ * A getter for [FREEZE_ENTITY_POSITION](#\_0x428CA6DBD1094446).
1289
+ * @param entity The entity to check for
1290
+ * @return Boolean stating if it is frozen or not.
1291
+ */
1292
+ declare function IsEntityPositionFrozen(entity: number): boolean;
1293
+
1241
1294
  /**
1242
1295
  * This native checks if the given entity is visible.
1243
1296
  * @return Returns `true` if the entity is visible, `false` otherwise.
1244
1297
  */
1245
1298
  declare function IsEntityVisible(entity: number): boolean;
1246
1299
 
1300
+ /**
1301
+ * IS_FLASH_LIGHT_ON
1302
+ * @param ped The target ped.
1303
+ * @return Whether or not the ped's flash light is on.
1304
+ */
1305
+ declare function IsFlashLightOn(ped: number): boolean;
1306
+
1247
1307
  /**
1248
1308
  * This native checks if the given ped is a player.
1249
1309
  * @return Returns `true` if the ped is a player, `false` otherwise.
1250
1310
  */
1251
1311
  declare function IsPedAPlayer(ped: number): boolean;
1252
1312
 
1313
+ /**
1314
+ * IS_PED_HANDCUFFED
1315
+ * @param ped The target ped.
1316
+ * @return Whether or not the ped is handcuffed.
1317
+ */
1318
+ declare function IsPedHandcuffed(ped: number): boolean;
1319
+
1320
+ /**
1321
+ * IS_PED_RAGDOLL
1322
+ * @param ped The target ped.
1323
+ * @return Whether or not the ped is ragdolling.
1324
+ */
1325
+ declare function IsPedRagdoll(ped: number): boolean;
1326
+
1327
+ /**
1328
+ * IS_PED_STRAFING
1329
+ * @param ped The target ped.
1330
+ * @return Whether or not the ped is strafing.
1331
+ */
1332
+ declare function IsPedStrafing(ped: number): boolean;
1333
+
1334
+ /**
1335
+ * IS_PED_USING_ACTION_MODE
1336
+ * @param ped The target ped.
1337
+ * @return Whether or not the ped is using action mode.
1338
+ */
1339
+ declare function IsPedUsingActionMode(ped: number): boolean;
1340
+
1253
1341
  /**
1254
1342
  * IS_PLAYER_ACE_ALLOWED
1255
1343
  */
@@ -1310,6 +1398,13 @@ declare function IsVehicleSirenOn(vehicle: number): boolean;
1310
1398
  */
1311
1399
  declare function IsVehicleTyreBurst(vehicle: number, wheelID: number, completely: boolean): boolean;
1312
1400
 
1401
+ /**
1402
+ * See the client-side [IS_VEHICLE_WINDOW_INTACT](https://docs.fivem.net/natives/?\_0x46E571A0E20D01F1) for a window indexes list.
1403
+ * @param vehicle The target vehicle.
1404
+ * @param windowIndex The window index.
1405
+ */
1406
+ declare function IsVehicleWindowIntact(vehicle: number, windowIndex: number): boolean;
1407
+
1313
1408
  /**
1314
1409
  * Requests the commerce data for the specified player, including the owned SKUs. Use `IS_PLAYER_COMMERCE_INFO_LOADED` to check if it has loaded.
1315
1410
  * @param playerSrc The player handle
@@ -1585,6 +1680,7 @@ declare function SetEntityCoords(entity: number, xPos: number, yPos: number, zPo
1585
1680
  /**
1586
1681
  * It overrides the default distance culling radius of an entity. Set to `0.0` to reset.
1587
1682
  * If you want to interact with an entity outside of your players' scopes set the radius to a huge number.
1683
+ * **WARNING**: Culling natives are deprecated and have known, [unfixable issues](https://forum.cfx.re/t/issue-with-culling-radius-and-server-side-entities/4900677/4)
1588
1684
  * @param entity The entity handle to override the distance culling radius.
1589
1685
  * @param radius The new distance culling radius.
1590
1686
  */
@@ -1597,6 +1693,13 @@ declare function SetEntityDistanceCullingRadius(entity: number, radius: number):
1597
1693
  */
1598
1694
  declare function SetEntityHeading(entity: number, heading: number): void;
1599
1695
 
1696
+ /**
1697
+ * It allows to flag an entity to ignore the request control filter policy.
1698
+ * @param entity The entity handle to ignore the request control filter.
1699
+ * @param ignore Define if the entity ignores the request control filter policy.
1700
+ */
1701
+ declare function SetEntityIgnoreRequestControlFilter(entity: number, ignore: boolean): void;
1702
+
1600
1703
  /**
1601
1704
  * SET_ENTITY_ROTATION
1602
1705
  * @param rotationOrder The order yaw pitch roll are applied, see [`GET_ENTITY_ROTATION`](#\_0xAFBD61CC738D9EB9).
@@ -1622,7 +1725,39 @@ declare function SetEntityVelocity(entity: number, x: number, y: number, z: numb
1622
1725
  declare function SetGameType(gametypeName: string): void;
1623
1726
 
1624
1727
  /**
1625
- * SET_HTTP_HANDLER
1728
+ * Sets the handler for HTTP requests made to the executing resource.
1729
+ * Example request URL: `http://localhost:30120/http-test/ping` - this request will be sent to the `http-test` resource with the `/ping` path.
1730
+ * The handler function assumes the following signature:
1731
+ * ```ts
1732
+ * function HttpHandler(
1733
+ * request: {
1734
+ * address: string;
1735
+ * headers: Record<string, string>;
1736
+ * method: string;
1737
+ * path: string;
1738
+ * setDataHandler(handler: (data: string) => void): void;
1739
+ * setDataHandler(handler: (data: ArrayBuffer) => void, binary: 'binary'): void;
1740
+ * setCancelHandler(handler: () => void): void;
1741
+ * },
1742
+ * response: {
1743
+ * writeHead(code: number, headers?: Record<string, string | string[]>): void;
1744
+ * write(data: string): void;
1745
+ * send(data?: string): void;
1746
+ * }
1747
+ * ): void;
1748
+ * ```
1749
+ * * **request**: The request object.
1750
+ * * **address**: The IP address of the request sender.
1751
+ * * **path**: The path to where the request was sent.
1752
+ * * **headers**: The headers sent with the request.
1753
+ * * **method**: The request method.
1754
+ * * **setDataHandler**: Sets the handler for when a data body is passed with the request. Additionally you can pass the `'binary'` argument to receive a `BufferArray` in JavaScript or `System.Byte[]` in C# (has no effect in Lua).
1755
+ * * **setCancelHandler**: Sets the handler for when the request is cancelled.
1756
+ * * **response**: An object to control the response.
1757
+ * * **writeHead**: Sets the status code & headers of the response. Can be only called once and won't work if called after running other response functions.
1758
+ * * **write**: Writes to the response body without sending it. Can be called multiple times.
1759
+ * * **send**: Writes to the response body and then sends it along with the status code & headers, finishing the request.
1760
+ * @param handler The handler function.
1626
1761
  */
1627
1762
  declare function SetHttpHandler(handler: Function): void;
1628
1763
 
@@ -2371,6 +2506,7 @@ declare function SetPlayerControl(player: string, bHasControl: boolean, flags: n
2371
2506
  /**
2372
2507
  * Sets the culling radius for the specified player.
2373
2508
  * Set to `0.0` to reset.
2509
+ * **WARNING**: Culling natives are deprecated and have known, [unfixable issues](https://forum.cfx.re/t/issue-with-culling-radius-and-server-side-entities/4900677/4)
2374
2510
  * @param playerSrc The player to set the culling radius for.
2375
2511
  * @param radius The radius.
2376
2512
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citizenfx/server",
3
- "version": "2.0.6500-1",
3
+ "version": "2.0.6501-1",
4
4
  "description": "Typings for the CitizenFX server JS API.",
5
5
  "main": "index.js",
6
6
  "scripts": {