Difference between revisions of "Players::local"

From RAGE Multiplayer Wiki
Jump to navigation Jump to search
Line 1: Line 1:
{{SharedJsProperty}}
+
{{ClientsideJsFunction}}
 +
 
 
Returns object of player. On client-side - current playing player, on server-side, maybe, first player.
 
Returns object of player. On client-side - current playing player, on server-side, maybe, first player.
=Syntax=
 
  
mp.players.local;
+
{{JSContainer|
=Example=
+
== Syntax ==
 +
<pre>mp.players.local</pre>
 +
 
 +
== Example ==
 
<pre>
 
<pre>
setInterval(() => {
+
  const localPlayer = mp.players.local;
    let player = mp.players.local;
+
  localPlayer.freezePosition(true);
 
 
    if (player !== null) {
 
        console.log(player.heading);
 
    }
 
 
 
}, 5000);
 
 
</pre>
 
</pre>
 +
}}

Revision as of 10:00, 1 December 2019

Client-Side
Function

Js.png JavaScript



Returns object of player. On client-side - current playing player, on server-side, maybe, first player.

JavaScript Syntax
Jslogo.png

Syntax

mp.players.local

Example

  const localPlayer = mp.players.local;
  localPlayer.freezePosition(true);