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...")
 
No edit summary
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 egy 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.
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.


==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.
This clientside function outputs the name of the vehicle the specified player is standing on, or a message saying he isn't on one.
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]'''''

Revision as of 12:33, 7 October 2018

Ez a function felismeri azt az elemet, amin egy 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

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.

Példa

Click to collapse [-]
Client

This clientside function outputs the name of the vehicle the specified player is standing on, or a message saying he isn't on one.

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