Hello. So I basically created this simple script which gives the player a jetpack when he types /jet.
function giveJetpack(thePlayer, commandName) -- Our function and arguments.
if(givePedJetPack(thePlayer)) then -- Checks if the player got his jetpack, we don't need an output here since the player will clearly see the jetpack.
return true --
end -- ending the "if".
if(getPedOccupiedVehicle(thePlayer)) then -- Checks if the player is in a vehicle, so if he's he won't get his jetpack.
outputChatBox("You can't use this command while in vehicle!", thePlayer, 255, 255, 0) -- If he's, it will output a message.
return false -- returns false so he doesn't get the jetpack.
end -- ending the "if".
end -- ending the function.
addCommandHandler("jet", giveJetpack) -- the command we chose which is /jet in this case, keep in mind you can change it.
I want to know what should I do so when a player types /jet again the jetpack gets removed, thanks in advance.