GET_PLAYER_PED
Used to get the player's Ped Entity ID when a valid `playerSrc` is passed.
CFX
Signature
lua
GetPlayerPed(playerSrc)
-- returns EntityParameters
| Name | Type | Description |
|---|---|---|
| char* | The player source, passed as a string. |
Usage
Named call
GetPlayerPed(playerSrc)InvokeNative
Citizen.InvokeNative(0x6E31E993, playerSrc)lua 1
-- Let's assume source is a valid ID
local pedId = GetPlayerPed(source);
-- If pedId is valid (not equal to 0)
if pedId ~= 0 then
-- Do something with this ped!
endDetails
- Hash
- API set
- Source
- cfx
Source: cfx
