hitscan_context_t
Info
hitscan context can only be retrieved via the HITSCAN callback in all examples below ctx is the hitscan context
local function on_hitscan(ctx, cmd, unpredicted_data)
ctx:set_min_dmg(100) -- force 100 min dmg
end
callbacks.add(e_callbacks.HITSCAN, on_hitscan)
Fields#
| Field | Description |
|---|---|
playerentity_t |
player entity that is being scanned right now |
healthentity_t |
predicted health of the player |
Functions#
set_min_dmg#
forces min dmg for either all hitscan groups or only a specific one
Example
ctx:set_min_dmg(50) -- force min dmg to 50 for all hitscan groups
-- or...
ctx:set_min_dmg(50, e_hitscan_groups.HEAD) -- force min dmg to 50 only for HEAD
set_hitchance#
forces hitchance for either all hitscan groups or only a specific one
Example
ctx:set_hitchance(50) -- force hitchance to 50% for all hitscan groups
-- or...
ctx:set_hitchance(50, e_hitscan_groups.HEAD) -- force hitchance to 50% only for HEAD
set_damage_accuracy#
forces damage accuracy for either all hitscan groups or only a specific one
Example
ctx:set_damage_accuracy(50) -- force damage accuracy to 50% for all hitscan groups
-- or...
ctx:set_damage_accuracy(50, e_hitscan_groups.HEAD) -- force damage accuracy to 50% only for HEAD
set_safepoint_state#
forces safepoint state for either all hitscan groups or only a specific one
void set_safepoint_state(<bool> should_force_safepoint, [optional] <e_hitscan_groups> hitscan_group)
Example
ctx:set_safepoint_state(true) -- force safepoint for all hitscan groups
-- or...
ctx:set_safepoint_state(true, e_hitscan_groups.HEAD) -- force safepoint only for HEAD
set_hitscan_group_state#
determine whether a hitscan group be scanned and multipointed
Warning
forcing a hitscan group to be scanned without definining whether it should be multipointed will turn off multipoints by default
void set_hitscan_group_state(<e_hitscan_groups> hitscan_group, <bool> should_scan, [optional] <bool> should_multipoint)
Example
-- force head to not be scanned
ctx:set_hitscan_group_state(e_hitscan_groups.HEAD, false)
-- force stomach to be scanned and multipointed
ctx:set_hitscan_group_state(e_hitscan_groups.STOMACH, true, true)