RemovePedJetPack: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
{{Server function}}
{{Server function}}
__NOTOC__
__NOTOC__
{{Deprecated feature|3.0156|1.5.6|This function is used to remove a ped's jetpack.}}
{{Deprecated feature|3.0156|1.5.6|This function is used to remove a ped's jetpack. This function will be deprecated in '''1.5.6''', use [[setPedWearingJetpack]] in the future.}}


==Syntax==
==Syntax==

Revision as of 21:02, 31 July 2018

Syntax

bool removePedJetPack ( ped thePed )


OOP Syntax Help! I don't understand this!

Method: ped:removeJetPack(...)


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