HU/getPedContactElement: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 13: Line 13:


===Visszatérési érték===
===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.


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

Revision as of 13:24, 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

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