RemovePedJetPack: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(New page: {{Server function}} __NOTOC__ This function is used to remove a ped's jetpack. ==Syntax== <syntaxhighlight lang="lua">bool removePedJetPack ( ped thePed )</syntaxhighlight> ===Required Arguments=== *'''thePed''':...)
 
(Added oop syntax)
Line 5: Line 5:
==Syntax==
==Syntax==
<syntaxhighlight lang="lua">bool removePedJetPack ( ped thePed )</syntaxhighlight>
<syntaxhighlight lang="lua">bool removePedJetPack ( ped thePed )</syntaxhighlight>
{{OOP||[[ped]]:removeJetPack|jetPack|givePedJetPack}}


===Required Arguments===
===Required Arguments===

Revision as of 17:31, 6 August 2016

This function is used to remove a ped's jetpack.

Syntax

bool removePedJetPack ( ped thePed )


OOP Syntax Help! I don't understand this!

Method: ped:removeJetPack(...)
Variable: .jetPack
Counterpart: givePedJetPack


Required Arguments

  • thePed: The ped you want to remove the jetpack from.

Returns

Returns true if the ped had a jetpack, false otherwise.

Example

This example adds a "jetpack" command in console, which allows toggling of a jetpack.

function jetPackCommand ( source, key )
    if ( doesPedHaveJetPack ( source ) ) then     -- if the player has a jetpack
        removePedJetPack ( source )               -- remove it
    else
        givePedJetPack ( source )                 -- otherwise give him one
    end
end
addCommandHandler ( "jetpack", jetPackCommand )

See Also