HEX
HexscriptsClassicSync

Events

This section lists all client-side and server-side events in this script. Events allow you to add custom listeners that capture and respond to actions triggered by this script.

Note

If you need additional events for your implementation, please open a ticket on our Discord server.

Client Events

hex_sync:sendHitmarker

Triggerd to the sender when a player gets a hit, it includes the victim's server id, the client bone id, damage, if the victim is armored and if the weapon used is a melee weapon.

RegisterNetEvent('hex_sync:sendHitmarker', function(victimServerId, boneId, damage, isVictimArmored, isMeleeWeapon)
    local victimPlayer = GetPlayerFromServerId(victimServerId)
    -- return if the player is not online anymore
    if victimPlayer == -1 then return end

    local victimPed = GetPlayerPed(victimPlayer)
    local boneCoords = boneId ~= 0 and GetPedBoneCoords(victimPed, boneId, 0.0, 0.0, 0.0) or GetEntityCoords(victimPed)

    print('hex_sync:sendHitmarker', boneCoords, victimServerId, boneId, damage, isVictimArmored, isMeleeWeapon)
end)

Server Events

hex_sync:setCustomDamage

Sets custom damage values for each body part for a specific weapon. if false it will reset the damage values to default.

TriggerEvent('hex_sync:setCustomDamage', playerId, {
    [joaat('WEAPON_PISTOL')] = {
        ['PELVIS'] = 1,
        ['L_CALF'] = 1,
        ['L_FOOT'] = 1,
        ['L_PH_FOOT'] = 1,
        ['R_CALF'] = 1,
        ['R_FOOT'] = 1,
        ['R_PH_FOOT'] = 1,
        ['SPINE'] = 1,
        ['SPINE1'] = 1,
        ['SPINE2'] = 1,
        ['SPINE3'] = 1,
        ['R_UPPERARM'] = 1,
        ['R_FOREARM'] = 1,
        ['R_HAND'] = 1,
        ['R_FINGERS'] = 1,
        ['L_UPPERARM'] = 1,
        ['L_FOREARM'] = 1,
        ['L_HAND'] = 1,
        ['L_FINGERS'] = 1,
        ['NECK'] = 1,
        ['HEAD'] = 1
    }
})

Prop

Type

Example:

RegisterCommand('setCustomDamage', function(playerId, args)
    TriggerEvent('hex_sync:setCustomDamage', playerId, {
        [joaat('WEAPON_PISTOL')] = {
            ['PELVIS'] = 1,
            ['L_CALF'] = 1,
            ['L_FOOT'] = 1,
            ['L_PH_FOOT'] = 1,
            ['R_CALF'] = 1,
            ['R_FOOT'] = 1,
            ['R_PH_FOOT'] = 1,
            ['SPINE'] = 1,
            ['SPINE1'] = 1,
            ['SPINE2'] = 1,
            ['SPINE3'] = 1,
            ['R_UPPERARM'] = 1,
            ['R_FOREARM'] = 1,
            ['R_HAND'] = 1,
            ['R_FINGERS'] = 1,
            ['L_UPPERARM'] = 1,
            ['L_FOREARM'] = 1,
            ['L_HAND'] = 1,
            ['L_FINGERS'] = 1,
            ['NECK'] = 1,
            ['HEAD'] = 1
        }
    })
end)

RegisterCommand('removeCustomDamage', function(playerId, args)
    TriggerEvent('hex_sync:setCustomDamage', playerId, false)
end)