FiveM-Scripts / Cops_FiveM

A cops script for FiveM
https://forum.fivem.net/t/release-cops-fivem/17460
GNU Affero General Public License v3.0
69 stars 56 forks source link

Cops FiveM breaks 'DisablePlayerFiring' and 'DisableControlAction' natives in other scripts #183

Closed Drift91 closed 3 years ago

Drift91 commented 4 years ago

It appears that lines 621 to 624 and lines 674 to 683 of client.lua interfere with other scripts. The DisableControlAction native needs to be run each frame, so running EnableControlAction in an else statement may not even be necessary.

As an example, the following block of code in another resource is rendered useless by the above mentioned lines of code.

Citizen.CreateThread(function()
    while true do
        DisablePlayerFiring(GetPlayerPed(-1), true)
        DisablePlayerFiring(PlayerId(), true)
        DisablePlayerFiring(GetPlayerServerId(PlayerId()), true)

        DisableControlAction(0, 24, true)

        Citizen.Wait(0)
    end
end)

The above code works perfectly after entering stop police in the server console to stop the Cops FiveM resource.