Skip to content
This repository has been archived by the owner on May 13, 2021. It is now read-only.

Commit

Permalink
1.4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
ghermans committed Aug 4, 2019
1 parent 2b0571b commit 54c375d
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 47 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.4.8
* Server admins can now configure basic loadouts in config/weapons.lua.
* Various issues regarding handcuffing have been fixed.
* Support for [Simple Banking](https://forum.fivem.net/t/discontinued-simple-banking-2-0-now-with-gui/13896) has been removed.

## 1.4.7
* Fixed character selector.

Expand Down
4 changes: 2 additions & 2 deletions police/__resource.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
resource_version '1.4.7'
resource_versionNum '147'
resource_version '1.4.8'
resource_versionNum '148'
resource_Isdev 'no'
resource_fname 'Cops FiveM'

Expand Down
8 changes: 3 additions & 5 deletions police/client/armory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,12 @@ function createArmoryPed()
end

function giveBasicKit()
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_PISTOL"), -1, true, false)
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_STUNGUN"), -1, true, false)
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_NIGHTSTICK"), -1, true, false)
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_FLASHLIGHT"), 200, true, false)
for k,v in pairs(basic_kit) do
GiveWeaponToPed(PlayerPedId(), GetHashKey(v), -1, true, false)
end

SetCurrentPedWeapon(PlayerPedId(), GetHashKey("WEAPON_UNARMED"), true)
PlaySoundFrontend(-1, "PICK_UP", "HUD_FRONTEND_DEFAULT_SOUNDSET", true)

end

function giveBasicPrisonKit()
Expand Down
46 changes: 28 additions & 18 deletions police/client/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ along with Cops_FiveM in the file "LICENSE". If not, see <http://www.gnu.org/lic
--
--Local variables : Please do not touch theses variables
--
handCuffed = false

if(config.useCopWhitelist == true) then
isCop = false
Expand Down Expand Up @@ -173,11 +172,7 @@ AddEventHandler('police:payFines', function(amount, sender)
end

if IsControlPressed(1, config.bindings.accept_fine) then
if(config.useModifiedBanking == true) then
TriggerServerEvent('bank:withdrawAmende', amount)
else
TriggerServerEvent('bank:withdraw', amount)
end
TriggerServerEvent('bank:withdraw', amount)
Notification(i18n.translate("pay_fine_success_before_amount")..amount..i18n.translate("pay_fine_success_after_amount"))
TriggerServerEvent('police:finesETA', sender, 0)
lockAskingFine = false
Expand All @@ -196,7 +191,9 @@ AddEventHandler('police:payFines', function(amount, sender)
end)
end)


-- Copy/paste from fs_freemode (by FiveM-Script: https://github.com/FiveM-Scripts/fs_freemode)

RegisterNetEvent("police:notify")
AddEventHandler("police:notify", function(icon, type, sender, title, text)
SetNotificationTextEntry("STRING")
Expand Down Expand Up @@ -647,38 +644,51 @@ Citizen.CreateThread(function()
end

if (handCuffed == true) then

local myPed = PlayerPedId()
local animation = 'idle'
local flags = 50

while(IsPedBeingStunned(myPed, 0)) do
while IsPedBeingStunned(myPed, 0) do
ClearPedTasksImmediately(myPed)
end

if not cuffing then
DisableControlAction(1, 12, true)
DisableControlAction(1, 13, true)
DisableControlAction(1, 14, true)
DisableControlAction(1, 12, true)
DisableControlAction(1, 13, true)
DisableControlAction(1, 14, true)

DisableControlAction(1, 15, true)
DisableControlAction(1, 16, true)
DisableControlAction(1, 17, true)
DisableControlAction(1, 23, true)
DisableControlAction(1, 24, true)

SetCurrentPedWeapon(myPed, GetHashKey("WEAPON_UNARMED"), true)
TaskPlayAnim(myPed, "mp_arresting", animation, 8.0, -8.0, -1, flags, 0, 0, 0, 0 )
DisableControlAction(1, 15, true)
DisableControlAction(1, 16, true)
DisableControlAction(1, 17, true)

Wait(4000)
if not cuffing then
SetCurrentPedWeapon(myPed, GetHashKey("WEAPON_UNARMED"), true)
RemoveAllPedWeapons(myPed, true)
cuffing = true
end

if not IsEntityPlayingAnim(myPed, "mp_arresting", animation, 3) then
TaskPlayAnim(myPed, "mp_arresting", animation, 8.0, -8.0, -1, flags, 0, 0, 0, 0 )
end
else
EnableControlAction(1, 12, false)
EnableControlAction(1, 13, false)
EnableControlAction(1, 14, false)

EnableControlAction(1, 23, false)
EnableControlAction(1, 24, false)

EnableControlAction(1, 15, false)
EnableControlAction(1, 16, false)
EnableControlAction(1, 17, false)

if IsEntityPlayingAnim(PlayerPedId(), "mp_arresting", "idle", 3) then
StopAnimTask(PlayerPedId(), "mp_arresting", animation, 3)
ClearPedTasksImmediately(PlayerPedId())
end

cuffing = false
end

Expand Down
51 changes: 32 additions & 19 deletions police/client/menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,38 +95,51 @@ end

function DoTraffic()
Citizen.CreateThread(function()
TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_CAR_PARK_ATTENDANT", 0, false)
Citizen.Wait(60000)
ClearPedTasksImmediately(PlayerPedId())
end)
drawNotification(i18n.translate("menu_doing_traffic_notification"))
if not IsPedInAnyVehicle(PlayerPedId(), false) then
TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_CAR_PARK_ATTENDANT", 0, false)
Citizen.Wait(60000)
ClearPedTasksImmediately(PlayerPedId())
drawNotification(i18n.translate("menu_doing_traffic_notification"))
else
drawNotification(GetLabelText("PEN_EXITV"))
end
end)
end

function Note()
Citizen.CreateThread(function()
TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_CLIPBOARD", 0, false)
Citizen.Wait(20000)
ClearPedTasksImmediately(PlayerPedId())
end)
drawNotification(i18n.translate("menu_taking_notes_notification"))
if not IsPedInAnyVehicle(PlayerPedId(), false) then
TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_CLIPBOARD", 0, false)
Citizen.Wait(20000)
ClearPedTasksImmediately(PlayerPedId())
else
drawNotification(GetLabelText("PEN_EXITV"))
end
end)
end

function StandBy()
Citizen.CreateThread(function()
TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_COP_IDLES", 0, true)
Citizen.Wait(20000)
ClearPedTasksImmediately(PlayerPedId())
if not IsPedInAnyVehicle(PlayerPedId(), false) then
TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_COP_IDLES", 0, true)
Citizen.Wait(20000)
ClearPedTasksImmediately(PlayerPedId())
else
drawNotification(GetLabelText("PEN_EXITV"))
end
end)
drawNotification(i18n.translate("menu_being_stand_by_notification"))
end

function StandBy2()
Citizen.CreateThread(function()
TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_GUARD_STAND", 0, 1)
Citizen.Wait(20000)
ClearPedTasksImmediately(PlayerPedId())
end)
drawNotification(i18n.translate("menu_being_stand_by_notification"))
if not IsPedInAnyVehicle(PlayerPedId(), false) then
TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_GUARD_STAND", 0, 1)
Citizen.Wait(20000)
ClearPedTasksImmediately(PlayerPedId())
else
drawNotification(GetLabelText("PEN_EXITV"))
end
end)
end

function CancelEmote()
Expand Down
4 changes: 1 addition & 3 deletions police/config/config.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
config = {
enableVersionNotifier = true, --notify if a new version is available (server console)

useModifiedBanking = false, --require Simple Banking
enableOutfits = false, --require Skin Customization
enableOutfits = false,

stationBlipsEnabled = true, -- switch between true or false to enable/disable blips for police stations
useCopWhitelist = true,
Expand Down
7 changes: 7 additions & 0 deletions police/config/weapons.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-- Configure the items that cops receive when they get on duty.
basic_kit = {
"WEAPON_STUNGUN",
"WEAPON_NIGHTSTICK",
"WEAPON_FLASHLIGHT"
}

-- Configure the weapons that cops can choose in the armory room.
weapons = {
{name="Assault SMG", hash="WEAPON_ASSAULTSMG"},
Expand Down

0 comments on commit 54c375d

Please sign in to comment.