- Documentation
- Shared functions
- setPedWearingJetpack
Function
setPedWearingJetpack
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.
statebooltrue= 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).