πŸ”«weapon

Functions:

Access functions listed below via get_weapon_by_player 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.

Last updated