Scripting/Squirrel/Functions/Game/IsAmmuWeaponEnabled

From VC-MP Wiki

Jump to: navigation, search

Contents

Syntax

bool IsAmmuWeaponEnabled( weaponslot )

Arguments

  • weaponslot - Checks the slot number

Example

This example tells if the weaponslot is enabled when they type '/c checkwepslot'

function onPlayerCommand( player, cmd, text )
{
     if ( cmd == "checkwepslot" )
     {
          if ( IsAmmuWeaponEnabled( text ) ) MessagePlayer( "Weapon slot " + text + " is enabled!", player );
          else MessagePlayer( "Weapon slot " + text + " is not enabled!", player );
     }
}

Notes

The function MessagePlayer and call onPlayerCommand were used in in this example. More info about them in corresponding pages.

Personal tools
squirrel scripting