HU/getPedContactElement: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Server client function}} This function detects the element a ped is standing on. This can be a vehicle or an object. ==Syntax== <syntaxhighlight lang="lua"> elem...")
 
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Server client function}}
{{Shared function hu}}
This function detects the element a ped is standing on. This can be a vehicle or an object.
Ez a function felismeri azt az elemet, amin a ped áll. Ez lehet egy jármű, vagy egy objekt.


==Syntax==  
==Szintaxis==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
element getPedContactElement ( ped thePed )
element getPedContactElement ( ped thePed )
Line 9: Line 9:
{{OOP||[[ped]]:getContactElement|contactElement}}
{{OOP||[[ped]]:getContactElement|contactElement}}


===Required Arguments===  
===Kötelező argumentumok===  
*'''thePed:''' The [[ped]] of which you want to get the [[element]] he is standing on.
*'''thePed:''' The [[ped]] of which you want to get the [[element]] he is standing on.


===Returns===
===Visszatérési érték===
Returns an [[object]] or a [[vehicle]] if the ped is standing on one, ''false'' if he is touching none or an invalid element was passed.
Visszatérési érétke egy [[object|objekt]] vagy egy [[vehicle|jármű]], ha a ped rajta áll valamelyiken, ''false'', ha nem érint semmit, vagy érvénytelen elem lett megadva.


==Example==
==Példa==
<section name="Client" class="client" show="true">
<section name="Client" class="client" show="true">
This clientside function outputs the name of the vehicle the specified player is standing on, or a message saying he isn't on one.
Ez a  clientside function kiírja annak a járműnek a nevét, amelyen a megadott játékos áll, vagy kiírja, hogy egy járművön sem áll.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function outputContactVehicleMessage ( thePlayer )
function outputContactVehicleMessage ( thePlayer )
Line 31: Line 31:
</section>
</section>


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


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

Latest revision as of 13:28, 7 October 2018

Ez a function felismeri azt az elemet, amin a ped áll. Ez lehet egy jármű, vagy egy objekt.

Szintaxis

element getPedContactElement ( ped thePed )

OOP Syntax Help! I don't understand this!

Method: ped:getContactElement(...)
Variable: .contactElement


Kötelező argumentumok

  • thePed: The ped of which you want to get the element he is standing on.

Visszatérési érték

Visszatérési érétke egy objekt vagy egy jármű, ha a ped rajta áll valamelyiken, false, ha nem érint semmit, vagy érvénytelen elem lett megadva.

Példa

Click to collapse [-]
Client

Ez a clientside function kiírja annak a járműnek a nevét, amelyen a megadott játékos áll, vagy kiírja, hogy egy járművön sem áll.

function outputContactVehicleMessage ( thePlayer )
    local elementStandingOn = getPedContactElement ( thePlayer )
    if elementStandingOn and getElementType ( elementStandingOn ) == "vehicle" then
        local vehicleName = getVehicleName ( elementStandingOn )
        outputChatBox( "You're standing on a " .. vehicleName .. "." )
    else
        outputChatBox( "You're not standing on any vehicle." )
    end
end

Lásd még

Fordította