Player::invoke: Difference between revisions

From RAGE Multiplayer Wiki
(Created page with "Calling the native functions of the client ==Parameters== * '''hash: <span style="color:#008017>String</span>''' * '''args: <span style="color:#008017>Any</span>''' ==Syntax=...")
 
m (Replaced HTML with template)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
Calling the native functions of the client
Invokes specified [https://cdn.rage.mp/public/natives/ native] function
 
==Parameters==
==Parameters==
* '''hash: <span style="color:#008017>String</span>'''
* '''hash: <span style="color:#008017>String</span>'''
Line 5: Line 6:


==Syntax==
==Syntax==
<div class="header" style="background-color: #408DAE; color: #FFFFFF; border: 2px solid #408DAE;">
{{ServersideCode|
<div style="margin: 10px 10px 10px 10px;"><b>Server-Side</b></div>
<pre>
<syntaxhighlight lang="javascript">
player.invoke(hash, [, ...args])
player.invoke(hash, [, ...args])
</syntaxhighlight>
</pre>
</div>
}}
 
==Example==
==Example==
<div class="header" style="background-color: #408DAE; color: #FFFFFF; border: 2px solid #408DAE;">
{{ServersideCode|
<div style="margin: 10px 10px 10px 10px;"><b>Server-Side</b></div>
<pre>
<syntaxhighlight lang="javascript">
function playerJoinHandle(player)
function playerJoinHandle(player)
{
{
     player.invoke('0xBBAF4B768DDB7572', true) // 0xBBAF4B768DDB7572 - FREEZE_ENTITY_POSITION (1.39)
     player.invoke('0xBBAF4B768DDB7572', player, true) // 0xBBAF4B768DDB7572 - FREEZE_ENTITY_POSITION (1.39)
}
}
mp.events.add('playerJoin', playerJoinHandle)
mp.events.add('playerJoin', playerJoinHandle)
</syntaxhighlight>
</pre>
</div>
}}
 
==See Also==
==See Also==
{{Player_block}}
{{Player_block}}

Latest revision as of 11:56, 26 October 2018

Invokes specified native function

Parameters

  • hash: String
  • args: Any

Syntax

Server-Side
player.invoke(hash, [, ...args])

Example

Server-Side
function playerJoinHandle(player)
{
    player.invoke('0xBBAF4B768DDB7572', player, true) // 0xBBAF4B768DDB7572 - FREEZE_ENTITY_POSITION (1.39)
}

mp.events.add('playerJoin', playerJoinHandle)

See Also