-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: great rebuild bpt_ambulancejob
- Loading branch information
1 parent
a60981f
commit f994030
Showing
36 changed files
with
2,425 additions
and
737 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 19 additions & 11 deletions
30
server-data/resources/[bpt_addons]/bpt_ambulancejob/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,27 @@ | ||
<h1 align='center'>bpt_ambulancejob</a></h1> | ||
<p align='center'><a href='https://discord.gg/ksGfNvDEfq'>Discord</a> | ||
<h1 align='center'>[ESX] Ambulance Job</a></h1><p align='center'><b><a href='https://discord.esx-framework.org/'>Discord</a> - <a href='https://documentation.esx-framework.org/legacy/installation'>Documentation</a></b></h5> | ||
|
||
Copyright (C) 2024 bitpredator | ||
ESX Ambulance Job is an plugin for ESX with features: | ||
|
||
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. | ||
- Adds death screen, with early respawn timer and bleed out timer | ||
- Vehicle garages, revive menu and more for on duty EMS | ||
|
||
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. | ||
## Requirements | ||
|
||
`Required`: | ||
|
||
- [esx_skin](https://github.com/esx-framework/esx-legacy/tree/main/%5Bcore%5D/esx_skin) | ||
- [esx_vehicleshop](https://github.com/esx-framework/esx_vehicleshop) | ||
|
||
ATTENTION: | ||
You are not authorized to change the name of the resource and the resources within it. | ||
## Legal | ||
|
||
If you want to contribute you can open a pull request. | ||
### License | ||
|
||
You are not authorized to sell this software (this is free project). | ||
bpt_ambulancejob - ambulance script for fivem | ||
|
||
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. | ||
Copyright (C) 2015-2024 bitpredator | ||
|
||
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/. | ||
You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/. |
18 changes: 8 additions & 10 deletions
18
server-data/resources/[bpt_addons]/bpt_ambulancejob/bpt_ambulancejob.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
server-data/resources/[bpt_addons]/bpt_ambulancejob/client/deathcam.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
function GetShapeTestResultSync(shape) | ||
local handle, hit, coords, normal, entity | ||
repeat | ||
handle, hit, coords, normal, entity = GetShapeTestResult(shape) | ||
until handle ~= 1 or Wait() | ||
return hit, coords, normal, entity | ||
end | ||
|
||
local camera | ||
local x = 0 | ||
local y = 0 | ||
local camera_radius = 5 | ||
local zoom = Config.zoom | ||
local playerPed | ||
|
||
function StartDeathCam() | ||
camera = CreateCamWithParams("DEFAULT_SCRIPTED_CAMERA", 0, 0, 0, 0, 0, 0, GetGameplayCamFov(), 1) | ||
RenderScriptCams(true, true, 1000, true, false) | ||
|
||
playerPed = PlayerPedId() | ||
end | ||
|
||
function EndDeathCam() | ||
RenderScriptCams(0) | ||
camera = DestroyCam(camera) | ||
end | ||
|
||
function ProcessCamControls() | ||
local playerCoords = GetEntityCoords(playerPed) | ||
if camera_radius < zoom.max and IsDisabledControlPressed(0, 14) then | ||
camera_radius += zoom.step | ||
elseif camera_radius > zoom.min and IsDisabledControlPressed(0, 15) then | ||
camera_radius -= zoom.step | ||
end | ||
|
||
local coords = ProcessNewPosition(playerCoords) | ||
SetCamCoord(camera, coords) | ||
PointCamAtCoord(camera, playerCoords.x, playerCoords.y, playerCoords.z) | ||
end | ||
|
||
function ProcessNewPosition(playerCoords) | ||
x -= GetDisabledControlNormal(0, 1) | ||
y -= GetDisabledControlNormal(0, 2) | ||
if y < math.rad(15) then | ||
y = math.rad(15) | ||
elseif y > math.rad(90) then | ||
y = math.rad(90) | ||
end | ||
local normal = vector3(math.sin(y) * math.cos(x), math.sin(y) * math.sin(x), math.cos(y)) | ||
local pos = playerCoords + normal * camera_radius | ||
local hit, coords = GetShapeTestResultSync(StartShapeTestLosProbe(playerCoords, pos, -1, playerPed)) | ||
return (hit == 1 and playerCoords + normal * (#(playerCoords - coords) - 1)) or pos | ||
end |
Oops, something went wrong.