SCRIPT ERROR: Execution of native 000000002f7a49e6 in script host failed: Argument at index 1 was null

Hi i just got some error like this

idk why just only me get this error at my server

1 Like

Can you show your code at that line? 595 of server main.lua?

no source as first arg in trigger client eent

sure here where go

client.lua
						local target, distance = ESX.Game.GetClosestPlayer()
						playerheading = GetEntityHeading(GetPlayerPed(-1))
						playerlocation = GetEntityForwardVector(PlayerPedId())
						playerCoords = GetEntityCoords(GetPlayerPed(-1))
						local target_id = GetPlayerServerId(target)
						if distance <= 2.0 then
							TriggerServerEvent('esx_policejob:requestarrest', target_id, playerheading, playerCoords, playerlocation)
							TriggerServerEvent('InteractSound_SV:PlayWithinDistance', 5.0, 'handcuff', 0.8)
						else
							exports['mythic_notify']:SendAlert('inform', 'terlalu jauh untuk memborgol')
							
server.lua
RegisterServerEvent('esx_policejob:requestarrest')
AddEventHandler('esx_policejob:requestarrest', function(targetid, playerheading, playerCoords,  playerlocation)
    _source = source
    TriggerClientEvent('esx_policejob:getarrested', targetid, playerheading, playerCoords, playerlocation)
    TriggerClientEvent('esx_policejob:doarrested', _source)
end)

but just only me, everybody in server didnt have this problem