GivePlayerJetPack

From Multi Theft Auto: Wiki
Revision as of 01:31, 13 August 2006 by MrJax (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function is used to give a player a jetpack. Note: The player must be on-foot.

Syntax

bool givePlayerJetPack ( player thePlayer )

Required Arguments

  • player: The player you want to give a jetpack to.

Returns

Returns 'true' if the player was on-foot and didn't already have a jetpack, 'false' otherwise.

Example

addCommandHandler ( "jetpack", "jetPackCommand" )
function jetPackCommand ( source, key )
  if ( doesPlayerHaveJetPack ( source ) ) then -- if he has a jetpack
    removePlayerJetPack ( source ) -- remove it
  else
    givePlayerJetPack ( source ) -- give him one
  end
end

See Also