HU/getPedAnimation: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
 
(7 intermediate revisions by the same user not shown)
Line 2: Line 2:
{{Client function hu}}
{{Client function hu}}


Gets the animation of a player or ped that was set using [[setPedAnimation]].
Visszaadja egy játékos vagy ped animációját a [[setPedAnimation]] használatával.


{{Note_hu|Use [[getPedTask]] to monitor what movements the player is currently doing.}}
{{Note_hu|Használja a [[getPedTask]]-ot egy játékos aktuális mozgásának az ellenőrzéséhez.}}


==Szintaxis==
==Szintaxis==
Line 13: Line 13:


===Kötelező paraméterek===
===Kötelező paraméterek===
*'''thePed:''' the [[player]] or [[ped]] you want to get the [[animations|animation]] of.
*'''thePed:''' a [[HU/Elemento_Player|játékos]] vagy [[HU/Element/Ped|ped]], akinek az [[animations|animációját]] szeretné megkapni.


===Visszatérési érték===
===Visszatérési érték===
Returns two [[string|strings]]: the first is the name of the block, the second is the name of the animation. Returns ''false'' if there was an error or if the ped is not doing an animation.
Visszatérési értéke két [[string|string]]: az első a tömb neve, a második az animáció neve. Visszatérési értéke ''false'', ha valami hiba történt, vagy ha a ped nem csinál semmilyen animációt.


==Példa==
==Példa==
This example adds a command that allows you to copy the animation being used by another player using /copyanim theirName
Ez a példa létrehoz egy parancsot, amely lehetővé teszi egy másik játékos által használt animáció másolását a /copyanim theirName parancs használatával.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function CopyAnimation(theCommand, thePlayer) -- The Command Function
function CopyAnimation(theCommand, thePlayer) -- The Command Function
Line 53: Line 53:
{{Client_ped_functions hu}}
{{Client_ped_functions hu}}


[[en:getPEdAnimation]]
[[en:getPedAnimation]]


==Fordította==
==Fordította==
* '''''[https://wiki.multitheftauto.com/wiki/User:Surge Surge]'''''
* '''''[https://wiki.multitheftauto.com/wiki/User:Surge Surge]'''''

Latest revision as of 19:21, 7 October 2018

Visszaadja egy játékos vagy ped animációját a setPedAnimation használatával.


[[{{{image}}}|link=|]] Megjegyzés: Használja a getPedTask-ot egy játékos aktuális mozgásának az ellenőrzéséhez.

Szintaxis

string, string getPedAnimation ( ped thePed )

OOP Syntax Help! I don't understand this!

Method: ped:getAnimation(...)
Counterpart: setPedAnimation


Kötelező paraméterek

Visszatérési érték

Visszatérési értéke két string: az első a tömb neve, a második az animáció neve. Visszatérési értéke false, ha valami hiba történt, vagy ha a ped nem csinál semmilyen animációt.

Példa

Ez a példa létrehoz egy parancsot, amely lehetővé teszi egy másik játékos által használt animáció másolását a /copyanim theirName parancs használatával.

function CopyAnimation(theCommand, thePlayer) -- The Command Function
	if thePlayer then -- If a player name entered then
		thePlayerToCopyFrom = getPlayerFromName(thePlayer) -- get player from his name
		Block, Anim = getPedAnimation(thePlayerToCopyFrom) -- get the player animation
		if Block then -- if got the animation successfully then
			setPedAnimation(localPlayer, Block, Anim) -- set my animation the same
			outputChatBox("* Copied Successfully !") -- output chat message
		end
	else	
		outputChatBox("* Please Enter a Player Name To Copy From !") -- if you didnt entered a player name , then output a chat box message
	end
end
addCommandHandler("copyanim", CopyAnimation) --  adding the Command Handler

Példa 2

This example shows what block and animation your player is currently performing. Note this will return "N/A" if you did not set an animation with setPedAnimation. If you want to see what the player ped is doing as you control them that is getPedTask.

addEventHandler("onClientPreRender",root,
	function ()
    local block, animation = getPedAnimation(localPlayer)
	dxDrawText ( "CURRENT ANIMATION INFO...", 100, 300 )
	if not block then block = "N/A" end
	if not animation then animation = "N/A" end
	dxDrawText ( "Block = "..block.." Animation = "..animation, 100, 315 )
end )

Lásd még

Fordította