Peds::new: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
Line 1: Line 1:
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">mp.peds.new(model, position, heading, streamInEventHandler, dimension);;</syntaxhighlight>
<syntaxhighlight lang="javascript">mp.peds.new(model, position, heading, streamInEventHandler, dimension);</syntaxhighlight>
=== Required Arguments ===
=== Required Arguments ===
*'''modelHash:''' Model hash
*'''modelHash:''' Model hash

Revision as of 00:16, 16 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