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

Commit c2eef48

Browse files
committed
v1.4.4
1 parent f9a2d96 commit c2eef48

26 files changed

+1482
-863
lines changed

CHANGELOG.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
* Added i18n.
33
* Added new command /copdept **ID** **DepartmentID**, this will limit the player to only one skin.
44
* Added armory marker at each police station.
5-
* Added more props.
6-
* Changed the height for the cops menu.
5+
* Added the feature in **config.lua** to add more objects to the **Objects menu**.
6+
* Added the feature in **config.lua** to add more weapons to the **Armory menu**.
7+
* Restyled the cops menu.
8+
* Improved the update notification system.
9+
* Updated license to AGPL v3.
710

811
## 1.4.2 (08/01/2018)
912
* Added auto table creation to reduce installation issues.

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Good bug reports are extremely helpful, so thankes!
1010
Guidelines for bug reports:
1111

1212
2. **Use the Github issue search function** - check if the issue has already reported.
13-
3. **Check if the issue has been fixed** - try to reproduce it using the latest `master` or `development`branch in the repo.
13+
3. **Check if the issue has been fixed** - try to reproduce it using the latest `master` or `dev`branch in the repo.
1414
4. **Isolate the problem** - So the developers doesn't have hard times finding the possible bug.
1515

1616
A good bug report shouldn't have leave others needing to chase up for more information.

LICENSE

+661-21
Large diffs are not rendered by default.

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Cops_FiveM
22
[![Version](https://img.shields.io/badge/Version-v1.4.3-orange.svg)](https://github.com/Kyominii/Cops_FiveM/releases/tag/v1.4.3)
3+
[![GitHub license](https://img.shields.io/github/license/FiveM-Scripts/Cops_FiveM.svg)](https://github.com/FiveM-Scripts/Cops_FiveM/blob/master/LICENSE)
34

45
Cops_FiveM is a script for RP server mainly. It let servers to have a cops system with loadout, vehicles, inventory check, ...
56
You can find the complete list with all the features [here](docs/features.md).

police/__resource.lua

+25-10
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,43 @@
11
resource_manifest_version '05cfa83c-a124-4cfa-a768-c24a5811d8f9'
2+
resource_version 'v1.4.3'
3+
resource_versionNum '143'
4+
resource_Isdev 'yes'
5+
6+
dependency 'mysql-async'
7+
8+
ui_page('client/html/index.html')
9+
10+
files({
11+
'client/html/index.html',
12+
'client/html/js/script.js',
13+
'client/html/css/style.css',
14+
'client/html/img/background.png',
15+
'client/html/img/arrows_upanddown.jpg',
16+
'client/html/fonts/SignPainter-HouseScript.ttf'
17+
})
218

319
client_scripts {
4-
'config/config.lua',
520
'client/i18n.lua',
621
'locales/en.lua',
722
'locales/fr.lua',
23+
'locales/de.lua',
24+
'config/cloackroom.lua',
25+
'config/config.lua',
26+
'config/objects.lua',
27+
'config/weapons.lua',
828
'client/client.lua',
929
'client/cloackroom.lua',
1030
'client/menu.lua',
1131
'client/garage.lua',
1232
'client/armory.lua'
1333
}
1434

15-
ui_page('client/html/index.html')
16-
17-
files({
18-
'client/html/index.html',
19-
'client/html/script.js',
20-
'client/html/style.css',
21-
'client/html/BebasNeue.otf',
22-
})
23-
2435
server_scripts {
2536
'@mysql-async/lib/MySQL.lua',
37+
'client/i18n.lua',
38+
'locales/en.lua',
39+
'locales/fr.lua',
40+
'locales/de.lua',
2641
'config/config.lua',
2742
'server/server.lua'
2843
}

police/client/armory.lua

+84-51
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
--[[
2+
Cops_FiveM - A cops script for FiveM RP servers.
3+
Copyright (C) 2018 FiveM-Scripts
4+
5+
This program is free software: you can redistribute it and/or modify
6+
it under the terms of the GNU Affero General Public License as published by
7+
the Free Software Foundation, either version 3 of the License, or
8+
(at your option) any later version.
9+
This program is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU Affero General Public License for more details.
13+
You should have received a copy of the GNU Affero General Public License
14+
along with Cops_FiveM in the file "LICENSE". If not, see <http://www.gnu.org/licenses/>.
15+
]]
16+
117
local buttonsCategories = {}
218
local buttonWeaponList = {}
319

@@ -14,53 +30,99 @@ function load_armory()
1430
buttonsCategories[#buttonsCategories+1] = {name = i18n.translate("armory_add_bulletproof_vest_title"), func = "addBulletproofVest", params = ""}
1531
buttonsCategories[#buttonsCategories+1] = {name = i18n.translate("armory_remove_bulletproof_vest_title"), func = "removeBulletproofVest", params = ""}
1632
buttonsCategories[#buttonsCategories+1] = {name = i18n.translate("armory_weapons_list"), func = "openWeaponListMenu", params = ""}
33+
buttonsCategories[#buttonsCategories+1] = {name = "Close", func = "CloseArmory", params = ""}
1734

18-
buttonWeaponList[#buttonWeaponList+1] = {name = i18n.translate("WEAPON_COMBATPISTOL"), func = 'giveCombatPistol', params = ""}
19-
buttonWeaponList[#buttonWeaponList+1] = {name = i18n.translate("WEAPON_PISTOL50"), func = 'givePistol50', params = ""}
20-
buttonWeaponList[#buttonWeaponList+1] = {name = i18n.translate("WEAPON_PUMPSHOTGUN"), func = 'givePumpShotgun', params = ""}
21-
22-
buttonWeaponList[#buttonWeaponList+1] = {name = i18n.translate("WEAPON_ASSAULTSMG"), func = 'giveAssaultSmg', params = ""}
23-
buttonWeaponList[#buttonWeaponList+1] = {name = i18n.translate("WEAPON_ASSAULTSHOTGUN"), func = 'giveAssaultShotgun', params = ""}
24-
buttonWeaponList[#buttonWeaponList+1] = {name = i18n.translate("WEAPON_HEAVYSNIPER"), func = 'giveHeavySniper', params = ""}
35+
for k,v in pairs(weapons) do
36+
buttonWeaponList[#buttonWeaponList+1] = {name = tostring(v.name), func = 'GiveCustomWeapon', params = tostring(v.hash)}
37+
end
2538
end
2639

2740
local hashSkin = GetHashKey("mp_m_freemode_01")
2841

42+
function createArmoryPed()
43+
if not DoesEntityExist(armoryPed) then
44+
local model = GetHashKey("s_m_y_cop_01")
45+
46+
RequestModel(model)
47+
while not HasModelLoaded(model) do
48+
Wait(0)
49+
end
50+
51+
local armoryPed = CreatePed(26, model, 454.165, -979.999, 30.690, 92.298, false, false)
52+
SetEntityInvincible(armoryPed, true)
53+
TaskTurnPedToFaceEntity(armoryPed, PlayerId(), -1)
54+
55+
return armoryPed
56+
end
57+
end
58+
2959
function giveBasicKit()
3060
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_STUNGUN"), -1, true, true)
3161
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_NIGHTSTICK"), -1, true, true)
3262
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_FLASHLIGHT"), 200, true, true)
63+
64+
PlaySoundFrontend(-1, "PICK_UP", "HUD_FRONTEND_DEFAULT_SOUNDSET", true)
3365
end
3466

3567
function giveBasicPrisonKit()
3668
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_PISTOL50"), -1, true, true)
3769
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_STUNGUN"), -1, true, true)
3870
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_NIGHTSTICK"), 200, true, true)
3971
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_FLASHLIGHT"), 200, true, true)
72+
73+
PlaySoundFrontend(-1, "PICK_UP", "HUD_FRONTEND_DEFAULT_SOUNDSET", true)
4074
end
4175

4276
function addBulletproofVest()
43-
Citizen.CreateThread(function()
44-
if(config.enableOutfits == true) then
45-
if(GetEntityModel(PlayerPedId()) == hashSkin) then
46-
SetPedComponentVariation(PlayerPedId(), 9, 4, 1, 2)
47-
else
48-
SetPedComponentVariation(PlayerPedId(), 9, 6, 1, 2)
49-
end
77+
if(config.enableOutfits == true) then
78+
if(GetEntityModel(PlayerPedId()) == hashSkin) then
79+
SetPedComponentVariation(PlayerPedId(), 9, 4, 1, 2)
80+
else
81+
SetPedComponentVariation(PlayerPedId(), 9, 6, 1, 2)
5082
end
51-
SetPedArmour(PlayerPedId(), 100)
52-
end)
83+
end
84+
85+
SetPedArmour(PlayerPedId(), 100)
86+
PlaySoundFrontend(-1, "PICK_UP", "HUD_FRONTEND_DEFAULT_SOUNDSET", true)
5387
end
5488

5589
function removeBulletproofVest()
56-
Citizen.CreateThread(function()
57-
if(config.enableOutfits == true) then
58-
SetPedComponentVariation(PlayerPedId(), 9, 0, 1, 2)
59-
end
60-
SetPedArmour(PlayerPedId(), 0)
61-
end)
90+
if(config.enableOutfits == true) then
91+
SetPedComponentVariation(PlayerPedId(), 9, 0, 1, 2)
92+
end
93+
94+
SetPedArmour(PlayerPedId(), 0)
95+
PlaySoundFrontend(-1, "PICK_UP", "HUD_FRONTEND_DEFAULT_SOUNDSET", true)
96+
end
97+
98+
function GiveCustomWeapon(weaponData)
99+
GiveWeaponToPed(PlayerPedId(), GetHashKey(weaponData), -1, false, true)
100+
PlaySoundFrontend(-1, "PICK_UP", "HUD_FRONTEND_DEFAULT_SOUNDSET", true)
101+
end
102+
103+
function CloseArmory()
104+
CloseMenu()
105+
106+
RenderScriptCams(false, 1, 1000, 1, 0, 0)
107+
SetCamActive(ArmoryRoomCam, false)
108+
DestroyCam(ArmoryRoomCam, true)
109+
110+
Citizen.Wait(500)
111+
DoScreenFadeOut(500)
112+
Citizen.Wait(600)
113+
114+
if DoesEntityExist(armoryPed) then
115+
DeleteEntity(armoryPed)
116+
end
117+
118+
FreezeEntityPosition(PlayerPedId(), false)
119+
SetEntityCoords(PlayerPedId(), Lx, Ly, Lz)
120+
121+
Citizen.Wait(500)
122+
DoScreenFadeIn(500)
62123
end
63124

125+
64126
function openWeaponListMenu()
65127
CloseMenu()
66128
SendNUIMessage({
@@ -73,35 +135,6 @@ function openWeaponListMenu()
73135
anyMenuOpen.isActive = true
74136
end
75137

76-
function giveCombatPistol()
77-
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_COMBATPISTOL"), -1, true, true)
78-
GiveWeaponComponentToPed(PlayerPedId(), GetHashKey("WEAPON_COMBATPISTOL"), GetHashKey("COMPONENT_AT_PI_FLSH"))
79-
end
80-
81-
function givePistol50()
82-
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_PISTOL50"), -1, true, true)
83-
GiveWeaponComponentToPed(PlayerPedId(), GetHashKey("WEAPON_PISTOL50"), GetHashKey("COMPONENT_AT_PI_FLSH"))
84-
end
85-
86-
function givePumpShotgun()
87-
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_PUMPSHOTGUN"), -1, true, true)
88-
GiveWeaponComponentToPed(PlayerPedId(), GetHashKey("WEAPON_PUMPSHOTGUN"), GetHashKey("COMPONENT_AT_AR_FLSH"))
89-
end
90-
91-
function giveAssaultSmg()
92-
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_ASSAULTSMG"), -1, true, true)
93-
GiveWeaponComponentToPed(PlayerPedId(), GetHashKey("WEAPON_ASSAULTSMG"), GetHashKey("COMPONENT_AT_AR_FLSH"))
94-
end
95-
96-
function giveAssaultShotgun()
97-
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_ASSAULTSHOTGUN"), -1, true, true)
98-
GiveWeaponComponentToPed(PlayerPedId(), GetHashKey("WEAPON_ASSAULTSHOTGUN"), GetHashKey("COMPONENT_AT_AR_FLSH"))
99-
end
100-
101-
function giveHeavySniper()
102-
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_HEAVYSNIPER"), -1, true, true)
103-
end
104-
105138
function OpenArmory()
106139
if((anyMenuOpen.menuName ~= "armory" and anyMenuOpen.menuName ~= "armory-weapon_list") and not anyMenuOpen.isActive) then
107140
SendNUIMessage({

0 commit comments

Comments
 (0)