RaweTrip
  • Welcome
  • Official Discord
  • Useful information
    • πŸ”ŒFor beginners
    • β™ŸοΈCommon knowledge
    • πŸ“šExamples
      • βš™οΈTab system
      • βš™οΈUI Interaction
      • βš™οΈClantag
      • βš™οΈWireframe smoke
  • documentation
    • ⛓️Common
      • πŸ“žCallbacks list
    • βš™οΈVariables
      • πŸ‘€esp
      • πŸ“œplist
      • πŸ”«weapon
      • ⚑vector
      • 🎨color
      • πŸŽ“cheat
      • πŸ’»ui
      • πŸ™οΈrender
      • πŸšΆβ€β™‚οΈentity
      • 🌎globalvars
      • πŸ› οΈengine
      • πŸ”©utils
      • πŸ–₯️console
      • πŸ”‘base64
      • πŸ“ bit
      • πŸ—ƒοΈfile
      • πŸ“Άhttp
      • βœ‰οΈchat
      • 〽️animate
      • 🧱materials
      • πŸ”§steam
      • ✈️trace
      • πŸ”—interfaces
        • πŸ’‘ieffects
        • 🧬precache
        • πŸ’³model_info
    • πŸ”’Enumerations
      • 🎞️enum_frames
Powered by GitBook
On this page
  • Functions:
  • :is_empty
  • :can_fire
  • :is_non_aim
  • :can_double_tap
  • :get_name
  • :get_icon
  • :get_spread
  • :get_inaccuracy
  1. documentation
  2. Variables

weapon

PreviousplistNextvector

Last updated 2 years ago

Functions:

Access functions listed below via function

:is_empty

<weapon>:is_empty(): boolean

Returns true, if weapon is empty.

:can_fire

<weapon>:can_fire(): boolean

Returns true, if weapon can fire.

:is_non_aim

<weapon>:is_non_aim(): boolean

Returns true, if weapon is non aim.

:can_double_tap

<weapon>:can_double_tap(): boolean

Returns true, if weapon can double tap.

:get_name

<weapon>:get_name(): string

Returns the weapon name.

:get_icon

<weapon>:get_icon(): string

--> Example
local weapon_font = render.setup_weapon_font(12)

cheat.push_callback("on_paint", function()
    local player = entity.get_local()

    if (player == nil) then
        return
    end

    local player_weapon = entity.get_weapon_by_player(player)

    if (player_weapon == nil) then
        return
    end

    local weapon_icon = player_weapon:get_icon()

    render.text(weapon_font, 200, 200, color(255, 255, 255, 255), weapon_icon)
end)

Returns the icon of the weapon.

:get_spread

<weapon>:get_spread(): number

Returns the spread of the weapon.

:get_inaccuracy

<weapon>:get_inaccuracy(): number

Returns the inaccuracy of the weapon.

βš™οΈ
πŸ”«
get_weapon_by_player