Skip to content

Commit

Permalink
Add description to SET_PED_DENSITY_MULTIPLIER_THIS_FRAME (#927)
Browse files Browse the repository at this point in the history
* Add description to SET_PED_DENSITY_MULTIPLIER_THIS_FRAME

* Update SetPedDensityMultiplierThisFrame.md

Complement the documentation with the examples provided by ahcenezdh. Thanks for the examples!

---------

Co-authored-by: ammonia-cfx <[email protected]>
  • Loading branch information
Aloncheeto and 4mmonium authored Dec 13, 2023
1 parent 7dc4178 commit 4b5b140
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion PED/SetPedDensityMultiplierThisFrame.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,30 @@ ns: PED
void SET_PED_DENSITY_MULTIPLIER_THIS_FRAME(float multiplier);
```
**Usage:** Call this native every frame
## Parameters
* **multiplier**:
* **multiplier**: Adjust from 0.0 (minimum, indicating no pedestrians in the street) to 1.0 (maximum, representing a normal amount of pedestrians on the street).
## Examples
```lua
-- 0.0 means no peds, while 1.0 indicates the regular density of peds.
local pedsDensityFactor = 0.0
Citizen.CreateThread(function()
while true do
SetPedDensityMultiplierThisFrame(pedsDensityFactor)
Citizen.Wait(0)
end
end)
```

```js
// 0.0 means no peds, while 1.0 indicates the regular density of peds.
const pedsDensityFactor = 0.0;

setTick(() => {
SetPedDensityMultiplierThisFrame(pedsDensityFactor);
});
```

0 comments on commit 4b5b140

Please sign in to comment.