RedM Index logoRedM Index
NativesHashesClothesBlipsPropsItem Tool
Sign inGet started

Reference

  • Natives
  • Hashes
  • Clothes
  • Blips
  • Props

Namespace

  1. Reference
  2. Natives
  3. GET_ALL_PEDS

GET_ALL_PEDS

Returns all peds handles known to the server. The data returned adheres to the following layout: ``` [127, 42, 13, 37] ```

CFX

Signature

lua
GetAllPeds()
-- returns object

Usage

Named call
GetAllPeds()
InvokeNative
Citizen.InvokeNative(0xB8584FEF)
lua 1
-- This example prints information of every ped that has an owner.

for i, ped in ipairs(GetAllPeds()) do
    local pedOwner = NetworkGetEntityOwner(ped)
    if pedOwner > 0 then
       local playerName = GetPlayerName(pedOwner)
       local pedModel = GetEntityModel(ped)
       local pedArmour = GetPedArmour(ped)
       print("Ped : "..ped.." | Owner name : "..playerName.." | Model : "..pedModel.." | Armour : "..pedArmour)
    end
end

Details

Hash
API set
Source
cfx

Source: cfx

On this page

  • Signature
  • Usage
  • Details