@citizenfx/server 2.0.14758-1 → 2.0.18214-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/build.sh CHANGED
@@ -22,5 +22,5 @@ npm config set git-tag-version false
22
22
  cp -a $ROOT/out/server/citizen/scripting/v8/index.d.ts $ROOT/out/server/citizen/scripting/v8/natives_server.d.ts .
23
23
  sed -i 's/natives_universal\.d\.ts/natives_server.d.ts/g' index.d.ts
24
24
  npm version "2.0.${CI_PIPELINE_ID}-1"
25
- npm publish
25
+ npm publish --tag latest
26
26
  fi
@@ -167,8 +167,8 @@ declare function SetPedDecoration(ped: number, collection: string | number, over
167
167
  * * **reserved**: Currently unused.
168
168
  * * **replicated**: Whether the set is meant to be replicated.
169
169
  * At this time, the change handler can't opt to reject changes.
170
- * If bagName refers to an entity, use [GET_ENTITY_FROM_STATE_BAG_NAME](?\_0x4BDF1868) to get the entity handle
171
- * If bagName refers to a player, use [GET_PLAYER_FROM_STATE_BAG_NAME](?\_0xA56135E0) to get the player handle
170
+ * If bagName refers to an entity, use [GET_ENTITY_FROM_STATE_BAG_NAME](#\_0x4BDF1867) to get the entity handle
171
+ * If bagName refers to a player, use [GET_PLAYER_FROM_STATE_BAG_NAME](#\_0xA56135E0) to get the player handle
172
172
  * @param keyFilter The key to check for, or null for no filter.
173
173
  * @param bagFilter The bag ID to check for such as `entity:65535`, or null for no filter.
174
174
  * @param handler The handler function.
@@ -390,6 +390,13 @@ declare function DoesPlayerOwnSku(playerSrc: string, skuId: number): boolean;
390
390
  */
391
391
  declare function DoesPlayerOwnSkuExt(playerSrc: string, skuId: number): boolean;
392
392
 
393
+ /**
394
+ * DOES_TRAIN_STOP_AT_STATIONS
395
+ * @param train The train handle
396
+ * @return True if the train stops at stations. False otherwise
397
+ */
398
+ declare function DoesTrainStopAtStations(train: number): boolean;
399
+
393
400
  /**
394
401
  * DROP_PLAYER
395
402
  */
@@ -596,7 +603,7 @@ declare function GetEntityCollisionDisabled(entity: number): boolean;
596
603
  declare function GetEntityCoords(entity: number): number[];
597
604
 
598
605
  /**
599
- * Returns the entity handle for the specified state bag name. For use with [ADD_STATE_BAG_CHANGE_HANDLER](?\_0x5BA35AAF).
606
+ * Returns the entity handle for the specified state bag name. For use with [ADD_STATE_BAG_CHANGE_HANDLER](#\_0x5BA35AAF).
600
607
  * @param bagName An internal state bag ID from the argument to a state bag change handler.
601
608
  * @return The entity handle or 0 if the state bag name did not refer to an entity, or the entity does not exist.
602
609
  */
@@ -745,6 +752,7 @@ declare function GetEntityVelocity(entity: number): number[];
745
752
  * * 3258
746
753
  * * 3323
747
754
  * * 3407
755
+ * * 3570
748
756
  * * RedM
749
757
  * * 1311
750
758
  * * 1355
@@ -837,7 +845,7 @@ declare function GetHeliMainRotorDamageScale(heli: number): number;
837
845
  /**
838
846
  * GET_HELI_MAIN_ROTOR_HEALTH
839
847
  * @param vehicle The target vehicle.
840
- * @return See the client-side [GET_HELI_MAIN_ROTOR_HEALTH](https://docs.fivem.net/natives/?\_0xE4CB7541F413D2C5) for the return value.
848
+ * @return See the client-side [GET_HELI_MAIN_ROTOR_HEALTH](#\_0xE4CB7541F413D2C5) for the return value.
841
849
  */
842
850
  declare function GetHeliMainRotorHealth(vehicle: number): number;
843
851
 
@@ -949,6 +957,69 @@ declare function GetLandingGearState(vehicle: number): number;
949
957
  */
950
958
  declare function GetLastPedInVehicleSeat(vehicle: number, seatIndex: number): number;
951
959
 
960
+ /**
961
+ * Gets the specific entity type (as an integer), which can be one of the following defined down below:
962
+ * #### FiveM:
963
+ * ```cpp
964
+ * enum eNetObjEntityType
965
+ * {
966
+ * Automobile = 0,
967
+ * Bike = 1,
968
+ * Boat = 2,
969
+ * Door = 3,
970
+ * Heli = 4,
971
+ * Object = 5,
972
+ * Ped = 6,
973
+ * Pickup = 7,
974
+ * PickupPlacement = 8,
975
+ * Plane = 9,
976
+ * Submarine = 10,
977
+ * Player = 11,
978
+ * Trailer = 12,
979
+ * Train = 13
980
+ * };
981
+ * ```
982
+ * #### RedM:
983
+ * ```cpp
984
+ * enum eNetObjEntityType
985
+ * {
986
+ * Animal = 0,
987
+ * Automobile = 1,
988
+ * Bike = 2,
989
+ * Boat = 3,
990
+ * Door = 4,
991
+ * Heli = 5,
992
+ * Object = 6,
993
+ * Ped = 7,
994
+ * Pickup = 8,
995
+ * PickupPlacement = 9,
996
+ * Plane = 10,
997
+ * Submarine = 11,
998
+ * Player = 12,
999
+ * Trailer = 13,
1000
+ * Train = 14,
1001
+ * DraftVeh = 15,
1002
+ * StatsTracker = 16,
1003
+ * PropSet = 17,
1004
+ * AnimScene = 18,
1005
+ * GroupScenario = 19,
1006
+ * Herd = 20,
1007
+ * Horse = 21,
1008
+ * WorldState = 22,
1009
+ * WorldProjectile = 23,
1010
+ * Incident = 24,
1011
+ * Guardzone = 25,
1012
+ * PedGroup = 26,
1013
+ * CombatDirector = 27,
1014
+ * PedSharedTargeting = 28,
1015
+ * Persistent = 29
1016
+ * };
1017
+ * ```
1018
+ * @param entity The entity to get the specific type of.
1019
+ * @return The specific entity type returned as an integer value or -1 if the entity is invalid.
1020
+ */
1021
+ declare function GetNetTypeFromEntity(entity: number): number;
1022
+
952
1023
  /**
953
1024
  * GET_NUM_PLAYER_IDENTIFIERS
954
1025
  */
@@ -1109,8 +1180,8 @@ declare function GetPlayerFromStateBagName(bagName: string): number;
1109
1180
  declare function GetPlayerGuid(playerSrc: string): string;
1110
1181
 
1111
1182
  /**
1112
- * To get the number of identifiers, use [GET_NUM_PLAYER_IDENTIFIERS](?\_0xFF7F66AB)
1113
- * To get a specific type of identifier, use [GET_PLAYER_IDENTIFIER_BY_TYPE](?\_0xA61C8FC6)
1183
+ * To get the number of identifiers, use [GET_NUM_PLAYER_IDENTIFIERS](#\_0xFF7F66AB)
1184
+ * To get a specific type of identifier, use [GET_PLAYER_IDENTIFIER_BY_TYPE](#\_0xA61C8FC6)
1114
1185
  * @return Returns the identifier at the specific index, if out of bounds returns `null`
1115
1186
  */
1116
1187
  declare function GetPlayerIdentifier(playerSrc: string, identiferIndex: number): string;
@@ -1410,6 +1481,13 @@ declare function GetThrusterSideRcsThrottle(jetpack: number): number;
1410
1481
  */
1411
1482
  declare function GetThrusterThrottle(jetpack: number): number;
1412
1483
 
1484
+ /**
1485
+ * GET_TRAIN_BACKWARD_CARRIAGE
1486
+ * @param train The train handle
1487
+ * @return The handle of the carriage behind this train in the chain. Otherwise returns 0 if the train is the caboose of the chain.
1488
+ */
1489
+ declare function GetTrainBackwardCarriage(train: number): number;
1490
+
1413
1491
  /**
1414
1492
  * GET_TRAIN_CARRIAGE_ENGINE
1415
1493
  * @param train The entity handle.
@@ -1424,6 +1502,51 @@ declare function GetTrainCarriageEngine(train: number): number;
1424
1502
  */
1425
1503
  declare function GetTrainCarriageIndex(train: number): number;
1426
1504
 
1505
+ /**
1506
+ * Gets the trains desired speed.
1507
+ * @param train The train handle
1508
+ * @return The desired cruise speed of the train. Not the speed the train is currently traveling at
1509
+ */
1510
+ declare function GetTrainCruiseSpeed(train: number): number;
1511
+
1512
+ /**
1513
+ * Gets the direction the train is facing
1514
+ * @param train The train handle
1515
+ * @return True if the train is moving forward on the track, False otherwise
1516
+ */
1517
+ declare function GetTrainDirection(train: number): boolean;
1518
+
1519
+ /**
1520
+ * GET_TRAIN_FORWARD_CARRIAGE
1521
+ * @param train The train handle
1522
+ * @return The handle of the carriage in front of this train in the chain. Otherwise returns 0 if the train has no carriage in front of it
1523
+ */
1524
+ declare function GetTrainForwardCarriage(train: number): number;
1525
+
1526
+ /**
1527
+ * GET_TRAIN_STATE
1528
+ * @param train The train handle
1529
+ * @return The trains current state```cpp
1530
+ enum eTrainState
1531
+ {
1532
+ MOVING = 0,
1533
+ ENTERING_STATION,
1534
+ OPENING_DOORS,
1535
+ STOPPED,
1536
+ CLOSING_DOORS,
1537
+ LEAVING_STATION,
1538
+ }
1539
+ ```
1540
+ */
1541
+ declare function GetTrainState(train: number): number;
1542
+
1543
+ /**
1544
+ * GET_TRAIN_TRACK_INDEX
1545
+ * @param train The train handle
1546
+ * @return The track index the train is currently on.
1547
+ */
1548
+ declare function GetTrainTrackIndex(train: number): number;
1549
+
1427
1550
  /**
1428
1551
  * GET_VEHICLE_BODY_HEALTH
1429
1552
  */
@@ -1522,7 +1645,7 @@ declare function GetVehicleHeadlightsColour(vehicle: number): number;
1522
1645
  declare function GetVehicleHomingLockonState(vehicle: number): number;
1523
1646
 
1524
1647
  /**
1525
- * This is a getter for the client-side native [`START_VEHICLE_HORN`](https://docs.fivem.net/natives/?\_0x9C8C6504B5B63D2C), which allows you to return the horn type of the vehicle.
1648
+ * This is a getter for the client-side native [`START_VEHICLE_HORN`](#\_0x9C8C6504B5B63D2C), which allows you to return the horn type of the vehicle.
1526
1649
  * **Note**: This native only gets the hash value set with `START_VEHICLE_HORN`. If a wrong hash is passed into `START_VEHICLE_HORN`, it will return this wrong hash.
1527
1650
  * ```cpp
1528
1651
  * enum eHornTypes
@@ -1830,6 +1953,13 @@ declare function IsPlayerUsingSuperJump(playerSrc: string): boolean;
1830
1953
  */
1831
1954
  declare function IsPrincipalAceAllowed(principal: string, object: string): boolean;
1832
1955
 
1956
+ /**
1957
+ * IS_TRAIN_CABOOSE
1958
+ * @param train The train handle
1959
+ * @return Returns true if the train is the caboose of the chain.
1960
+ */
1961
+ declare function IsTrainCaboose(train: number): boolean;
1962
+
1833
1963
  /**
1834
1964
  * IS_VEHICLE_ENGINE_STARTING
1835
1965
  */
@@ -1851,7 +1981,7 @@ declare function IsVehicleSirenOn(vehicle: number): boolean;
1851
1981
  declare function IsVehicleTyreBurst(vehicle: number, wheelID: number, completely: boolean): boolean;
1852
1982
 
1853
1983
  /**
1854
- * See the client-side [IS_VEHICLE_WINDOW_INTACT](https://docs.fivem.net/natives/?\_0x46E571A0E20D01F1) for a window indexes list.
1984
+ * See the client-side [IS_VEHICLE_WINDOW_INTACT](#\_0x46E571A0E20D01F1) for a window indexes list.
1855
1985
  * @param vehicle The target vehicle.
1856
1986
  * @param windowIndex The window index.
1857
1987
  */
@@ -2896,7 +3026,7 @@ declare function SetPedHairColor(ped: number, colorID: number, highlightColorID:
2896
3026
  * **Other information:**
2897
3027
  * IDs start at zero and go Male Non-DLC, Female Non-DLC, Male DLC, and Female DLC.</br>
2898
3028
  * This native function is often called prior to calling natives such as:
2899
- * * [`SetPedHairColor`](#\_0xBB43F090)
3029
+ * * [`SetPedHairColor`](#\_0xA23FE32C)
2900
3030
  * * [`SetPedHeadOverlayColor`](#\_0x78935A27)
2901
3031
  * * [`SetPedHeadOverlay`](#\_0xD28DBA90)
2902
3032
  * * [`SetPedFaceFeature`](#\_0x6C8D4458)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citizenfx/server",
3
- "version": "2.0.14758-1",
3
+ "version": "2.0.18214-1",
4
4
  "description": "Typings for the CitizenFX server JS API.",
5
5
  "main": "index.js",
6
6
  "scripts": {