Difference between revisions of "Engine.GetLocalPlayer"

From GTA Connected
Jump to navigation Jump to search
(Created page with " This function returns the local player instance. == Syntax == <pre>Engine.GetLocalPlayer()</pre> OOP: <pre>client:GetPlayer()</pre> == Return value == This function re...")
 
Line 5: Line 5:
 
== Syntax ==
 
== Syntax ==
  
 +
Clientside:
 
<pre>Engine.GetLocalPlayer()</pre>
 
<pre>Engine.GetLocalPlayer()</pre>
  
OOP:
+
Serverside: (Requires a event)
 
 
 
<pre>client:GetPlayer()</pre>
 
<pre>client:GetPlayer()</pre>
  

Revision as of 13:43, 18 December 2016


This function returns the local player instance.

Syntax

Clientside:

Engine.GetLocalPlayer()

Serverside: (Requires a event)

client:GetPlayer()

Return value

This function returns this values:

  • playerInstance - Whenever the player instance has been found ('ie: the one who called this from a command is a player')
  • false - Whenever the player instance has not been found ('ie: who executed the command was not a player')

Example

In this example, we create a simple command to message who writes the command.

"NYI"