@citizenfx/server 2.0.10488-1 → 2.0.10558-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.
@@ -64,6 +64,20 @@ declare function AddBlipForEntity(entity: number): number;
64
64
  */
65
65
  declare function AddBlipForRadius(posX: number, posY: number, posZ: number, radius: number): number;
66
66
 
67
+ /**
68
+ * Adds a listener for Console Variable changes.
69
+ * The function called expects to match the following signature:
70
+ * ```ts
71
+ * function ConVarChangeListener(conVarName: string, reserved: any);
72
+ * ```
73
+ * * **conVarName**: The ConVar that changed.
74
+ * * **reserved**: Currently unused.
75
+ * @param conVarFilter The Console Variable to listen for, this can be a pattern like "test:\*", or null for any
76
+ * @param handler The handler function.
77
+ * @return A cookie to remove the change handler.
78
+ */
79
+ declare function AddConvarChangeListener(conVarFilter: string, handler: Function): number;
80
+
67
81
  /**
68
82
  * Applies an Item from a PedDecorationCollection to a ped. These include tattoos and shirt decals.
69
83
  * collection - PedDecorationCollection filename hash
@@ -482,6 +496,22 @@ declare function GetConsoleBuffer(): string;
482
496
  */
483
497
  declare function GetConvar(varName: string, default_: string): string;
484
498
 
499
+ /**
500
+ * Can be used to get a console variable casted back to `bool`.
501
+ * @param varName The console variable to look up.
502
+ * @param defaultValue The default value to set if none is found.
503
+ * @return Returns the convar value if it can be found, otherwise it returns the assigned `default`.
504
+ */
505
+ declare function GetConvarBool(varName: string, defaultValue: boolean): boolean;
506
+
507
+ /**
508
+ * This will have floating point inaccuracy.
509
+ * @param varName The console variable to get
510
+ * @param defaultValue The default value to set, if none are found.
511
+ * @return Returns the value set in varName, or `default` if none are specified
512
+ */
513
+ declare function GetConvarFloat(varName: string, defaultValue: number): number;
514
+
485
515
  /**
486
516
  * Can be used to get a console variable casted back to `int` (an integer value).
487
517
  * @param varName The console variable to look up.
@@ -1857,6 +1887,12 @@ declare function RemoveAllPedWeapons(ped: number, p1: boolean): void;
1857
1887
  */
1858
1888
  declare function RemoveBlip(blip: number): void;
1859
1889
 
1890
+ /**
1891
+ * REMOVE_CONVAR_CHANGE_LISTENER
1892
+ * @param cookie The cookie returned from [ADD_CONVAR_CHANGE_LISTENER](#\_0xAB7F7241)
1893
+ */
1894
+ declare function RemoveConvarChangeListener(cookie: number): void;
1895
+
1860
1896
  /**
1861
1897
  * **Experimental**: This native may be altered or removed in future versions of CitizenFX without warning.
1862
1898
  * Removes a handler for changes to a state bag.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citizenfx/server",
3
- "version": "2.0.10488-1",
3
+ "version": "2.0.10558-1",
4
4
  "description": "Typings for the CitizenFX server JS API.",
5
5
  "main": "index.js",
6
6
  "scripts": {