MTA:Eir/functions/createCivilian: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ This function creates a civilian. A civilian is a ped that acts like it would in single player. ==Syntax== <syntaxhighlight lang="lua"> civilian createCivilian ( int model, float x...")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
__NOTOC__  
__NOTOC__
{{Not yet added}}
This function creates a civilian. A civilian is a ped that acts like it would in single player.
This function creates a civilian. A civilian is a ped that acts like it would in single player.


==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
civilian createCivilian ( int model, float x, float y, float z, float rot )
civilian createCivilian ( int model, float x, float y, float z, [ float rot=0 ] )
</syntaxhighlight>
</syntaxhighlight>


Line 10: Line 11:
*'''model:''' A whole integer specifying the [[Character_Skins|GTASA skin ID]].
*'''model:''' A whole integer specifying the [[Character_Skins|GTASA skin ID]].
*'''x, y, z:''' position vector on the GTA:SA world
*'''x, y, z:''' position vector on the GTA:SA world
===Optional Arguments===
*'''rot:''' Rotation on the Z axis of the civilian.
*'''rot:''' Rotation on the Z axis of the civilian.


Line 19: Line 22:
This snippet creates a civilian and warps the local player to it.
This snippet creates a civilian and warps the local player to it.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
local myBuilding = createCivilian( 7, 0, 0, 10 );
local myCivilian = createCivilian( 7, 0, 0, 10 );
setElementPosition( localPlayer, 0, 0, 12 );
setElementPosition( localPlayer, 0, 0, 12 );
</syntaxhighlight>
</syntaxhighlight>
</section>
</section>

Latest revision as of 20:14, 17 December 2013

This function creates a civilian. A civilian is a ped that acts like it would in single player.

Syntax

civilian createCivilian ( int model, float x, float y, float z, [ float rot=0 ] )

Arguments

  • model: A whole integer specifying the GTASA skin ID.
  • x, y, z: position vector on the GTA:SA world

Optional Arguments

  • rot: Rotation on the Z axis of the civilian.

Returns

Returns a civilian if successfully created, false otherwise.

Example

Click to collapse [-]
Client

This snippet creates a civilian and warps the local player to it.

local myCivilian = createCivilian( 7, 0, 0, 10 );
setElementPosition( localPlayer, 0, 0, 12 );