[CLIENT] PlayerElement Clientside Definition

Hello,

I just wanted to ask how the Player Element is Defined Clientside, i know that if i trigger a Server Event the Source = the client that triggered the event.

Im trying to freze a Player, that freeze Function is clientside but im not able to find out how the Player Element is defined Clientside, well in ESX the Player Element is defined as PlayerIdentity.

Im kinda too dumb to find that Definition in the ESX Core files O.o

Soryy if this question is dumb.

Thank you for Any Answer in Advance.

there are two ways to do this

you can call a Client event inside the Server and pass it the ‘source’ parameter

On Server:

TriggerClientEvent('event', source)

or you can use a special function that collects the source from the server and sends it to the client

On Client:

GetPlayerPed(GetPlayerFromServerId(source))
1 Like

Ah oky i also had that option in my mind, but i think its not really resource Saving.

DO i even need the Player Source for any CLient Functions?

i think everything thats client will not even need the Identity.

Thank you for your suggestion.

the difference between the client and the server is that the client runs an event only for the caller, while the server runs for everyone, so you don’t need to specify the ID when you’re working with the client-side, since the code will automatically be executed for the caller

1 Like