ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. setPedWearingJetpack

Function

setPedWearingJetpack

Server and clientPedsIdentical to MTA:SA

Gives a player a jetpack or takes it away. The order goes straight to the player's game, so they can take off immediately. Works only for players (not NPCs); a jetpack cannot be put on while the player is in a vehicle.

Syntax

bool setPedWearingJetpack(player ped, bool state)

Arguments

pedplayer
The player.
statebool
true = put on, false = take off.

Returns

true on success, false for an NPC or a player in a vehicle.

Example

addCommandHandler("jetpack", function(player)
    setPedWearingJetpack(player, not isPedWearingJetpack(player))
end)

Notes

Client. In a client script only for localPlayer (other players and NPCs - from the server).

See also