Difference between revisions of "GetLocalPlayerEntityId"
From Nomad DB
Wasdennnoch (talk | contribs) |
|||
Line 1: | Line 1: | ||
− | This functions return the [[EntityId|Entity | + | This functions return the [[EntityId|Entity ID]] of the local player. Under some circumstances it's possible for the returned ID to be invalid, thus should be checked against [[GetInvalidEntityId]]. |
== Syntax == | == Syntax == | ||
Line 7: | Line 7: | ||
== Example == | == Example == | ||
− | The example below checks | + | The example below checks whether the [[EntityId|Entity ID]] of the local player is valid or not. |
<pre> | <pre> | ||
local lplayerId = GetLocalPlayerEntityId() | local lplayerId = GetLocalPlayerEntityId() |
Revision as of 18:29, 14 April 2020
This functions return the Entity ID of the local player. Under some circumstances it's possible for the returned ID to be invalid, thus should be checked against GetInvalidEntityId.
Syntax
GetLocalPlayerEntityId()
Example
The example below checks whether the Entity ID of the local player is valid or not.
local lplayerId = GetLocalPlayerEntityId() if lplayerId == GetInvalidEntityId() then print("Invalid local player") else print("Got the local player ID") end