CreatePed: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 16: Line 16:


==Example==  
==Example==  
This example creates an ped when the map starts:
 
<section name="Server" class="server" show="true">
This example creates an ped when the resource starts:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function pedLoad ( name )
function pedLoad ( name )
Line 23: Line 25:
addEventHandler ( "onResourceStart", getRootElement(), pedLoad )
addEventHandler ( "onResourceStart", getRootElement(), pedLoad )
</syntaxhighlight>
</syntaxhighlight>
</section>


==See Also==
==See Also==
{{Ped functions}}
{{Ped functions}}

Revision as of 22:28, 30 March 2009

Creates a Ped in the GTA world.

Syntax

ped createPed ( int modelid, float x, float y, float z )

Required Arguments

  • modelid: A whole integer specifying the GTASA skin ID.
  • x: A floating point number representing the X coordinate on the map.
  • y: A floating point number representing the Y coordinate on the map.
  • z: A floating point number representing the Z coordinate on the map.

Returns

Returns the ped element.

Example

Click to collapse [-]
Server

This example creates an ped when the resource starts:

function pedLoad ( name )
   createPed ( 120, 5540.6654, 1020.55122, 1240.545 )
end
addEventHandler ( "onResourceStart", getRootElement(), pedLoad )

See Also