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

Commit

Permalink
fixed some random issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ghermans committed Apr 1, 2018
1 parent 4c8f0a2 commit f022a9e
Show file tree
Hide file tree
Showing 13 changed files with 273 additions and 236 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## 1.4.3
* Added i18n.
* Added new command /copdept **ID** **DepartmentID**, this will limit the player to only one skin.
* Added armory marker at each police station.

## 1.4.2 (08/01/2018)
* Added auto table creation to reduce installation issues.
Expand Down
32 changes: 22 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,31 @@ A Discord server is available: [![](https://discordapp.com/api/guilds/3611441236
- [Mysql-Async](https://forum.fivem.net/t/beta-mysql-async-library-v0-2-2/21881)

## Installation
1. Download the latest version from the [GitHub repository](https://github.com/FiveM-Scripts/Cops_FiveM/releases/latest).
2. Put the `police` folder in the resources folder on your server.
3. Edit [config file](https://github.com/FiveM-Scripts/Cops_FiveM/blob/master/police/config/config.lua) as you want.
4. Add "start police" in your server.cfg (make sure you start this resource after all dependencies).
1. Verify that you have installed the requirements from above.
2. Download the latest version from the [GitHub repository](https://github.com/FiveM-Scripts/Cops_FiveM/releases/latest).
3. Only copy the subdirectory *police* to the *resources* folder on your server.
4. Edit [config file](https://github.com/FiveM-Scripts/Cops_FiveM/blob/master/police/config/config.lua) as you want.
5. Add *start police* in your server.cfg (make sure you start this resource after all dependencies).
6. The first time when you enter the game you will need to add yourself to the police database.
you can do this in your server console enter `CopAddAdmin 1` press enter and you should receive a confirmation message.

## Commands
**You need to add a rank for each cop, configure the `minRankSetRank` in the config file.**

* /copadd ID : to add a policeman in the database.
* /coprem ID : to remove a policeman from the database.
## Commands
* /copadd ID : Add the player as cop to the database.
* /coprem ID : Remove a player from the database.
* /coprank ID Rank : To change the rank of a police officer.
* /copdept ID Department : Add a player to a specific department id.

**You can also use these commands with RCON (`CopAdd` / `CopAddAdmin` / `CopRem` / `CopRank`).
To see how to use them, just type the command you want without any parameter.**

**You can also use RCON commands (`CopAdd` / `CopAddAdmin` / `CopRem` / `CopRank`). To see how to use them, just type the command you want without any parameter**
## Departments
| ID | Name |
| -- | ---- |
| 0 | Park Rangers |
| 1 | Los Santos Police Department|
| 2 | Sheriff's Department |
| 3 | State Highway Patrol |
| 4 | Prison Department|

## Ranks
| ID | Name |
Expand Down
3 changes: 1 addition & 2 deletions police/__resource.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ files({
'client/html/BebasNeue.otf',
})

server_script '@mysql-async/lib/MySQL.lua'

server_scripts {
'@mysql-async/lib/MySQL.lua',
'config/config.lua',
'server/server.lua'
}
47 changes: 27 additions & 20 deletions police/client/armory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,30 +27,37 @@ end
local hashSkin = GetHashKey("mp_m_freemode_01")

function giveBasicKit()
GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_STUNGUN"), 200, true, true)
GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_NIGHTSTICK"), 200, true, true)
GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_FLASHLIGHT"), 200, true, true)
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_STUNGUN"), -1, true, true)
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_NIGHTSTICK"), -1, true, true)
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_FLASHLIGHT"), 200, true, true)
end

function giveBasicPrisonKit()
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_PISTOL50"), -1, true, true)
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_STUNGUN"), -1, true, true)
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_NIGHTSTICK"), 200, true, true)
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_FLASHLIGHT"), 200, true, true)
end

function addBulletproofVest()
Citizen.CreateThread(function()
if(config.enableOutfits == true) then
if(GetEntityModel(GetPlayerPed(-1)) == hashSkin) then
SetPedComponentVariation(GetPlayerPed(-1), 9, 4, 1, 2)
if(GetEntityModel(PlayerPedId()) == hashSkin) then
SetPedComponentVariation(PlayerPedId(), 9, 4, 1, 2)
else
SetPedComponentVariation(GetPlayerPed(-1), 9, 6, 1, 2)
SetPedComponentVariation(PlayerPedId(), 9, 6, 1, 2)
end
end
SetPedArmour(GetPlayerPed(-1), 100)
SetPedArmour(PlayerPedId(), 100)
end)
end

function removeBulletproofVest()
Citizen.CreateThread(function()
if(config.enableOutfits == true) then
SetPedComponentVariation(GetPlayerPed(-1), 9, 0, 1, 2)
SetPedComponentVariation(PlayerPedId(), 9, 0, 1, 2)
end
SetPedArmour(GetPlayerPed(-1), 0)
SetPedArmour(PlayerPedId(), 0)
end)
end

Expand All @@ -67,32 +74,32 @@ function openWeaponListMenu()
end

function giveCombatPistol()
GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_COMBATPISTOL"), 200, true, true)
GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_COMBATPISTOL"), GetHashKey("COMPONENT_AT_PI_FLSH"))
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_COMBATPISTOL"), -1, true, true)
GiveWeaponComponentToPed(PlayerPedId(), GetHashKey("WEAPON_COMBATPISTOL"), GetHashKey("COMPONENT_AT_PI_FLSH"))
end

function givePistol50()
GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_PISTOL50"), 200, true, true)
GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_PISTOL50"), GetHashKey("COMPONENT_AT_PI_FLSH"))
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_PISTOL50"), -1, true, true)
GiveWeaponComponentToPed(PlayerPedId(), GetHashKey("WEAPON_PISTOL50"), GetHashKey("COMPONENT_AT_PI_FLSH"))
end

function givePumpShotgun()
GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_PUMPSHOTGUN"), 200, true, true)
GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_PUMPSHOTGUN"), GetHashKey("COMPONENT_AT_AR_FLSH"))
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_PUMPSHOTGUN"), -1, true, true)
GiveWeaponComponentToPed(PlayerPedId(), GetHashKey("WEAPON_PUMPSHOTGUN"), GetHashKey("COMPONENT_AT_AR_FLSH"))
end

function giveAssaultSmg()
GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_ASSAULTSMG"), 200, true, true)
GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_ASSAULTSMG"), GetHashKey("COMPONENT_AT_AR_FLSH"))
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_ASSAULTSMG"), -1, true, true)
GiveWeaponComponentToPed(PlayerPedId(), GetHashKey("WEAPON_ASSAULTSMG"), GetHashKey("COMPONENT_AT_AR_FLSH"))
end

function giveAssaultShotgun()
GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_ASSAULTSHOTGUN"), 200, true, true)
GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_ASSAULTSHOTGUN"), GetHashKey("COMPONENT_AT_AR_FLSH"))
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_ASSAULTSHOTGUN"), -1, true, true)
GiveWeaponComponentToPed(PlayerPedId(), GetHashKey("WEAPON_ASSAULTSHOTGUN"), GetHashKey("COMPONENT_AT_AR_FLSH"))
end

function giveHeavySniper()
GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_HEAVYSNIPER"), 200, true, true)
GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_HEAVYSNIPER"), -1, true, true)
end

function OpenArmory()
Expand Down
Loading

0 comments on commit f022a9e

Please sign in to comment.