From 713b892387a4d859bc0cc6d1b4fa61b1004d03d8 Mon Sep 17 00:00:00 2001 From: ammonia Date: Tue, 27 Sep 2022 08:48:58 -0500 Subject: [PATCH] Update ClearArea* of Cops, Peds and Projectiles. This PR modifies an incorrectly named parameter in the aforementioned natives. The parameter was previously named `flags`, but this parameter actually defines whether a net event of `CClearAreaEvent` should be created or not upon native execution. I'm not entirely sure if changing parameter types is ok to do so (as in won't break anything, never done such thing), if so I can just set the type back to integer, let me know if so, thanks. Correct cs_type decls for ClearArea* natives Correct cs_type declarations for ClearArea* natives to preserve compatibility with C# scripts. Preserve function signature Preserve function signature for ClearAreaOfProjectiles. Last parameter was changed from int to BOOL. Remove redundant description about createNetEvent --- MISC/ClearAreaOfCops.md | 20 ++++++++++++-------- MISC/ClearAreaOfPeds.md | 20 ++++++++++++-------- MISC/ClearAreaOfProjectiles.md | 20 ++++++++++++++------ 3 files changed, 38 insertions(+), 22 deletions(-) diff --git a/MISC/ClearAreaOfCops.md b/MISC/ClearAreaOfCops.md index 958681502..2668ab220 100644 --- a/MISC/ClearAreaOfCops.md +++ b/MISC/ClearAreaOfCops.md @@ -5,17 +5,21 @@ ns: MISC ```c // 0x04F8FC8FCF58F88D 0x95C53824 -void CLEAR_AREA_OF_COPS(float x, float y, float z, float radius, int flags); +void CLEAR_AREA_OF_COPS(float x, float y, float z, float radius, cs_type(int) BOOL createNetEvent); ``` -``` -flags appears to always be 0 +Clears an area of cops at the given coordinates and radius. + +## Examples +```lua +-- Clear the area, do also create an event +ClearAreaOfCops(0.0, 0.0, 0.0, 10000.0, true) ``` ## Parameters -* **x**: -* **y**: -* **z**: -* **radius**: -* **flags**: +* **x**: The x coordinate of where to clear cops. +* **y**: The y coordinate of where to clear cops. +* **z**: The z coordinate of where to clear cops. +* **radius**: The area radius to clear cops. +* **createNetEvent**: specifies whether a `CClearAreaEvent` event of should be created for online use. diff --git a/MISC/ClearAreaOfPeds.md b/MISC/ClearAreaOfPeds.md index 0887289df..611ca7e69 100644 --- a/MISC/ClearAreaOfPeds.md +++ b/MISC/ClearAreaOfPeds.md @@ -5,17 +5,21 @@ ns: MISC ```c // 0xBE31FD6CE464AC59 0x25BE7FA8 -void CLEAR_AREA_OF_PEDS(float x, float y, float z, float radius, int flags); +void CLEAR_AREA_OF_PEDS(float x, float y, float z, float radius, cs_type(int) BOOL createNetEvent); ``` -``` -Example: CLEAR_AREA_OF_PEDS(0, 0, 0, 10000, 1); +Clears an area of peds at the given coordinates and radius. + +## Examples +```lua +-- Clear the area, do also create an event +ClearAreaOfPeds(0.0, 0.0, 0.0, 10000.0, true) ``` ## Parameters -* **x**: -* **y**: -* **z**: -* **radius**: -* **flags**: +* **x**: The x coordinate of where to clear peds. +* **y**: The y coordinate of where to clear peds. +* **z**: The z coordinate of where to clear peds. +* **radius**: The area radius to clear peds. +* **createNetEvent**: specifies whether a `CClearAreaEvent` event of should be created for online use. diff --git a/MISC/ClearAreaOfProjectiles.md b/MISC/ClearAreaOfProjectiles.md index 79ca0d383..f8a0282bd 100644 --- a/MISC/ClearAreaOfProjectiles.md +++ b/MISC/ClearAreaOfProjectiles.md @@ -5,14 +5,22 @@ ns: MISC ```c // 0x0A1CB9094635D1A6 0x18DB5434 -void CLEAR_AREA_OF_PROJECTILES(float x, float y, float z, float radius, cs_type(BOOL) int flags); +void CLEAR_AREA_OF_PROJECTILES(float x, float y, float z, float radius, cs_type(int) BOOL createNetEvent); +``` + +Clears an area of projectiles at the given coordinates and radius. + +## Examples +```lua +-- Clear the area, do also create an event +ClearAreaOfProjectiles(0.0, 0.0, 0.0, 10000.0, true) ``` ## Parameters -* **x**: -* **y**: -* **z**: -* **radius**: -* **flags**: +* **x**: The x coordinate of where to clear projectiles. +* **y**: The y coordinate of where to clear projectiles. +* **z**: The z coordinate of where to clear projectiles. +* **radius**: The area radius to clear projectiles. +* **createNetEvent**: specifies whether a `CClearAreaEvent` event of should be created for online use.