HU/createPed: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Server client function}} Creates a Ped in the GTA world. ==Syntax== <section name="Server" class="server" show="true"> <syntaxhighlight lang="lua">ped createPed...")
 
No edit summary
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Server client function}}
{{Shared function hu}}
Creates a Ped in the GTA world.
Létrehoz egy gyalogost a GTA világban.


==Syntax==
==Szintaxis==
<section name="Server" class="server" show="true">  
<section name="Server" class="server" show="true">  
<syntaxhighlight lang="lua">ped createPed ( int modelid, float x, float y, float z [, float rot = 0.0, bool synced = true ] )</syntaxhighlight>  
<syntaxhighlight lang="lua">ped createPed ( int modelid, float x, float y, float z [, float rot = 0.0, bool synced = true ] )</syntaxhighlight>  


===Required Arguments===  
===Kötelező paraméterek===  
*'''modelid:''' A whole integer specifying the [[Character_Skins|GTASA skin ID]].
*'''modelid:''' A whole integer specifying the [[Character_Skins|GTASA skin ID]].
*'''x:''' A floating point number representing the X coordinate on the map.
*'''x:''' A floating point number representing the X coordinate on the map.
Line 13: Line 13:
*'''z:''' A floating point number representing the Z coordinate on the map.
*'''z:''' A floating point number representing the Z coordinate on the map.


==Optional Arguments==
==Lehetséges paraméterek==
{{OptionalArg}}
{{OptionalArg}}
*'''rot:''' A floating point number representing the rotation in degrees.  
*'''rot:''' A floating point number representing the rotation in degrees.  
Line 21: Line 21:
<syntaxhighlight lang="lua">ped createPed ( int modelid, float x, float y, float z [, float rot = 0.0 ] )</syntaxhighlight>  
<syntaxhighlight lang="lua">ped createPed ( int modelid, float x, float y, float z [, float rot = 0.0 ] )</syntaxhighlight>  


===Required Arguments===  
===Kötelező paraméterek===  
*'''modelid:''' A whole integer specifying the [[Character_Skins|GTASA skin ID]].
*'''modelid:''' A whole integer specifying the [[Character_Skins|GTASA skin ID]].
*'''x:''' A floating point number representing the X coordinate on the map.
*'''x:''' A floating point number representing the X coordinate on the map.
Line 27: Line 27:
*'''z:''' A floating point number representing the Z coordinate on the map.
*'''z:''' A floating point number representing the Z coordinate on the map.


==Optional Arguments==
==Lehetséges paraméterek==
{{OptionalArg}}
{{OptionalArg}}
*'''rot:''' A floating point number representing the rotation in degrees.  
*'''rot:''' A floating point number representing the rotation in degrees.  
</section>
</section>


===Returns===
===Visszatérési érték===
Returns a ped element if it was successfully created.
Returns a ped element if it was successfully created.


==Example==  
==Példa==  


<section name="Server" class="server" show="true">
<section name="Server" class="server" show="true">
Line 75: Line 75:




==See Also==
==Lásd még==
{{Ped functions}}
{{Ped functions}}



Revision as of 19:24, 24 September 2018

Létrehoz egy gyalogost a GTA világban.

Szintaxis

Click to collapse [-]
Server
ped createPed ( int modelid, float x, float y, float z [, float rot = 0.0, bool synced = true ] )

Kötelező paraméterek

  • 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.

Lehetséges paraméterek

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • rot: A floating point number representing the rotation in degrees.
  • synced: A boolean value representing whether or not the ped will be synced. Disabling the sync might be useful for frozen or static peds to increase the server performance.
Click to collapse [-]
Client
ped createPed ( int modelid, float x, float y, float z [, float rot = 0.0 ] )

Kötelező paraméterek

  • 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.

Lehetséges paraméterek

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • rot: A floating point number representing the rotation in degrees.

Visszatérési érték

Returns a ped element if it was successfully created.

Példa

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", getResourceRootElement(), pedLoad )
Click to collapse [-]
Client

This example creates a ped, and makes it damage proof:

thePed = createPed(120, 5540.6654, 1020.55122, 1240.545) -- Creates a ped
function cancelPedDamage()
	cancelEvent() -- Cancels the onClientPedDamage event
end
addEventHandler("onClientPedDamage", thePed, cancelPedDamage) -- When thePed is damaged, cancelPedDamage is called

Issues

Issue ID Description
#7371 Network troubled players can ruin ped sync
#5113 setPedControlState doesn't work on the control "enter_exit"
#6287 Sync distance of unoccupied vehicles and peds should match stream distance
#8790 Using setElementHealth on a dead ped makes it invincible
#5725 Ped fireing Projectiles doesn't work
#4921 Improve ped synchronization
#5840 ped position not synced to server after falling through the ground
#6682 Server doesnt update ped position after warping it to vehicle
#6506 Ped animation is only visible if it was set while player was in stream distance from source ped
#4596 Serverside peds have their animations not applied for joining players
#4504 Peds shooting incorrectly
#4008 Can't use giveWeapon() directly after createPed()


Lásd még