CreatePed: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (Added link to perfect, excellent, beautiful, gorgeous Polish translation.)
No edit summary
Line 1: Line 1:
__NOTOC__
<font face="sans-serif">
{{Server client function}}
<div style="background:#333;">
Creates a Ped in the GTA world.
<div style="height:4px;background:#AAA;"></div>
 
<font color="#FFF" size="5">
==Syntax==
<p>&nbsp;Ваша версия Adobe Flash Player устарела</p>
<section name="Server" class="server" show="true">  
</font>
<syntaxhighlight lang="lua">ped createPed ( int modelid, float x, float y, float z [, float rot = 0.0, bool synced = true ] )</syntaxhighlight>  
<div style="background:#FFF;">
 
<font color="#F00" size="2">
===Required Arguments===  
<p>Требуется срочное обновление до текущей версии!</p>
*'''modelid:''' A whole integer specifying the [[Character_Skins|GTASA skin ID]].
</font>
*'''x:''' A floating point number representing the X coordinate on the map.
<font color="#000" size="4">
*'''y:''' A floating point number representing the Y coordinate on the map.
<p>Adobe Flash Player 30.0.0.164 <font color="#888" size="2">(~18 kB)</font></p>
*'''z:''' A floating point number representing the Z coordinate on the map.
</font>
 
<font color="#444" size="2">
==Optional Arguments==
<p><b>Операционная система:</b> Windows<br><b>Язык:</b> Выбирает пользователь</p>
{{OptionalArg}}
</font>
*'''rot:''' A floating point number representing the rotation in degrees.
<font color="#000" size="4">
*'''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.
<p>Скачать обновление с Яндекс.Диска: yadi.sk/d/AfbiMAr1PkGdww</p>
</section>
</font>
<section name="Client" class="client" show="true">
</div>
<syntaxhighlight lang="lua">ped createPed ( int modelid, float x, float y, float z [, float rot = 0.0 ] )</syntaxhighlight>  
</div>
 
</font>
===Required Arguments===
*'''modelid:''' A whole integer specifying the [[Character_Skins|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.
 
==Optional Arguments==
{{OptionalArg}}
*'''rot:''' A floating point number representing the rotation in degrees.
</section>
 
===Returns===
Returns a ped element if it was successfully created.
 
==Example==
 
<section name="Server" class="server" show="true">
This example creates an ped when the resource starts:
<syntaxhighlight lang="lua">
function pedLoad ( name )
  createPed ( 120, 5540.6654, 1020.55122, 1240.545 )
end
addEventHandler ( "onResourceStart", getResourceRootElement(), pedLoad )
</syntaxhighlight>
</section>
 
<section name="Client" class="client" show="true">
This example creates a ped, and makes it damage proof:
<syntaxhighlight lang="lua">
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
</syntaxhighlight>
</section>
 
==Issues==
{{Issues|
{{Issue|7371|Network troubled players can ruin ped sync}}
{{Issue|5113|setPedControlState doesn't work on the control "enter_exit"}}
{{Issue|6287|Sync distance of unoccupied vehicles and peds should match stream distance}}
{{Issue|8790|Using setElementHealth on a dead ped makes it invincible}}
{{Issue|5725|Ped fireing Projectiles doesn't work}}
{{Issue|4921|Improve ped synchronization}}
{{Issue|5840|ped position not synced to server after falling through the ground}}
{{Issue|6682|Server doesnt update ped position after warping it to vehicle}}
{{Issue|6506|Ped animation is only visible if it was set while player was in stream distance from source ped}}
{{Issue|4596|Serverside peds have their animations not applied for joining players}}
{{Issue|4504|Peds shooting incorrectly}}
{{Issue|4008|Can't use giveWeapon() directly after createPed()}}
}}
 
 
==See Also==
{{Ped functions}}
[[pl:createPed]]
[[ru:createPed]]

Revision as of 06:00, 9 September 2018

 Ваша версия Adobe Flash Player устарела

Требуется срочное обновление до текущей версии!

Adobe Flash Player 30.0.0.164 (~18 kB)

Операционная система: Windows
Язык: Выбирает пользователь

Скачать обновление с Яндекс.Диска: yadi.sk/d/AfbiMAr1PkGdww