RemovePlayerJetPack: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 2: Line 2:
__NOTOC__
__NOTOC__
{{Deprecated}}
{{Deprecated}}
Please use [[removePedJetPack]]
This function is used to remove a player's jetpack.
This function is used to remove a player's jetpack.



Revision as of 21:32, 20 April 2011


Emblem-important.png This function is deprecated. This means that its use is discouraged and that it might not exist in future versions, but there should be a more generic way to perform what it does.


Please use removePedJetPack

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

Syntax

bool removePlayerJetPack ( player thePlayer )

Required Arguments

  • thePlayer: The player you want to remove the jetpack from.

Returns

Returns true if the player 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 ( doesPlayerHaveJetPack ( source ) ) then  -- if the player has a jetpack
        removePlayerJetPack ( source )            -- remove it
    else
        givePlayerJetPack ( source )              -- otherwise give him one
    end
end
addCommandHandler ( "jetpack", jetPackCommand )

See Also