Re-implemented freemode peds, closes #81

This commit is contained in:
ElPumpo
2018-05-22 20:20:56 +02:00
parent b64cc56939
commit 2cfc8129da
2 changed files with 63 additions and 18 deletions
+36 -15
View File
@@ -1,35 +1,56 @@
# esx_policejob
[REQUIREMENTS]
### Requirements
* Auto mode
* [esx_billing](https://github.com/FXServer-ESX/fxserver-esx_billing)
* Player management (boss actions and armory with buyable weapons)
* [esx_society](https://github.com/FXServer-ESX/fxserver-esx_society)
* [esx_datastore](https://github.com/FXServer-ESX/fxserver-esx_datastore)
* ESX Identity Support
* [esx_identity](https://github.com/ESX-Org/esx_identity)
[INSTALLATION]
* ESX License Support
* [esx_license](https://github.com/ESX-Org/esx_license)
1) CD in your resources/[esx] folder
2) Clone the repository
```
git clone https://github.com/FXServer-ESX/fxserver-esx_policejob esx_policejob
```
3) Import esx_policejob.sql in your database
## Download & Installation
4) Add this in your server.cfg :
### Using [fvm](https://github.com/qlaffont/fvm-installer)
```
fvm install --save --folder=esx esx-org/esx_policejob
```
### Using Git
```
cd resources
git clone https://github.com/ESX-Org/esx_policejob [esx]/esx_policejob
```
### Manually
- Download https://github.com/ESX-Org/esx_policejob/archive/master.zip
- Put it in the `[esx]` directory
## Installation
- Import `esx_policejob.sql` in your database
- Add this in your server.cfg :
```
start esx_policejob
```
5) * If you want player management you have to set Config.EnablePlayerManagement to true in config.lua
* If you want armory management you have to set Config.EnableArmoryManagement to true in config.lua
* If you want license management you have to set Config.EnableLicenses to true in config.lua
- * If you want player management you have to set `Config.EnablePlayerManagement` to `true` in `config.lua`
* If you want armory management you have to set `Config.EnableArmoryManagement` to `true` in `config.lua`
* If you want license management you have to set `Config.EnableLicenses` to `true` in `config.lua`
# Legal
### License
The project is licensed under GPLv3, read the [license](LICENSE.txt) for more information.
esx_policejob - police script for ESX
Copyright (C) 2015-2018 Jérémie N'gadi
This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version.
This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details.
You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/.
+27 -3
View File
@@ -118,9 +118,9 @@ function OpenCloakroomMenu()
end
if Config.EnableNonFreemodePeds then
table.insert(elements, {label = _U('sheriff_wear'), value = 'sheriff_wear_freemode'})
table.insert(elements, {label = _U('lieutenant_wear'), value = 'lieutenant_wear_freemode'})
table.insert(elements, {label = _U('commandant_wear'), value = 'commandant_wear_freemode'})
table.insert(elements, {label = _U('sheriff_wear'), value = 'sheriff_wear_freemode', maleModel = 's_m_y_sheriff_01', femaleModel = 's_f_y_sheriff_01'})
table.insert(elements, {label = _U('lieutenant_wear'), value = 'lieutenant_wear_freemode', maleModel = 's_m_y_swat_01', femaleModel = 's_m_y_swat_01'})
table.insert(elements, {label = _U('commandant_wear'), value = 'commandant_wear_freemode', maleModel = 's_m_y_swat_01', femaleModel = 's_m_y_swat_01'})
end
ESX.UI.Menu.CloseAll()
@@ -154,6 +154,30 @@ function OpenCloakroomMenu()
setUniform(data.current.value, playerPed)
end
if
data.current.value == 'sheriff_wear_freemode' or
data.current.value == 'lieutenant_wear_freemode' or
data.current.value == 'commandant_wear_freemode'
then
local model = nil
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
if skin.sex == 0 then
model = GetHashKey(data.current.maleModel)
else
model = GetHashKey(data.current.femaleModel)
end
end)
RequestModel(model)
while not HasModelLoaded(model) do
RequestModel(model)
Citizen.Wait(1)
end
SetPlayerModel(PlayerId(), model)
SetModelAsNoLongerNeeded(model)
end
CurrentAction = 'menu_cloakroom'
CurrentActionMsg = _U('open_cloackroom')
CurrentActionData = {}