Peds::new: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
mNo edit summary
Line 11: Line 11:


==Example==
==Example==
<div class="header" style="background-color: #AE4040; color: #FFFFFF; border: 2px solid #AE4040;">
{{ClientSide}}
<div style="margin: 10px 10px 10px 10px;"><b>Client-Side</b></div>
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
let Ped = mp.peds.new(mp.game.joaat('MP_F_Freemode_01'), new mp.Vector3( 100.0, -100.0, 25.0), 270.0, (streamPed) => {
let Ped = mp.peds.new(mp.game.joaat('MP_F_Freemode_01'), new mp.Vector3( 100.0, -100.0, 25.0), 270.0, (streamPed) => {
Line 19: Line 18:
}, player.dimension);
}, player.dimension);
</syntaxhighlight>
</syntaxhighlight>
</div>


==See also==
==See also==
{{Ped_s_function_c}}
{{Ped_functions_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]

Revision as of 12:01, 20 January 2018

Syntax

mp.peds.new(model, position, heading, streamInEventHandler, dimension);

Required Arguments

  • modelHash: Model hash
  • position: Vector3 position
  • heading: float
  • streamInEventHandler: function (called when the ped is streamed)
  • dimension: int

Return value

  • Ped handle or object

Example

Client-Side
let Ped = mp.peds.new(mp.game.joaat('MP_F_Freemode_01'), new mp.Vector3( 100.0, -100.0, 25.0), 270.0, (streamPed) => {
    // Ped Streamed
    streamPed.setAlpha(0);
}, player.dimension);

See also