Skip to content

Commit

Permalink
fix: second look through
Browse files Browse the repository at this point in the history
  • Loading branch information
mafewtm committed Sep 23, 2023
1 parent 00f8351 commit a7e15f7
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 29 deletions.
8 changes: 4 additions & 4 deletions client/binoculars.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ local storeBinoclarKey = 177 -- Backspace

--FUNCTIONS--

local function CheckInputRotation(cam, zoomvalue)
local function checkInputRotation(cam, zoomvalue)
local rightAxisX = GetControlNormal(0, 220)
local rightAxisY = GetControlNormal(0, 221)
local rotation = GetCamRot(cam, 2)
Expand All @@ -21,7 +21,7 @@ local function CheckInputRotation(cam, zoomvalue)
end
end

local function HandleZoom(cam)
local function handleZoom(cam)
if not IsPedSittingInAnyVehicle(cache.ped) then
if IsControlJustPressed(0, 241) then -- Scrollup
fov = math.max(fov - zoomspeed, fov_min)
Expand Down Expand Up @@ -90,8 +90,8 @@ RegisterNetEvent('binoculars:Toggle', function()
end

local zoomvalue = (1.0 / (fov_max-fov_min)) * (fov-fov_min)
CheckInputRotation(cam, zoomvalue)
HandleZoom(cam)
checkInputRotation(cam, zoomvalue)
handleZoom(cam)
DrawScaleformMovieFullscreen(scaleform, 255, 255, 255, 255, 0)
Wait(0)
end
Expand Down
35 changes: 19 additions & 16 deletions client/consumables.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local alcoholCount, parachuteEquipped, currentVest, currentVestTexture, healing,

-- Functions

local function EquipParachuteAnim()
local function equipParachuteAnim()
local hasLoaded = lib.requestAnimDict('clothingshirt')
if not hasLoaded then return end
TaskPlayAnim(cache.ped, 'clothingshirt', 'try_shirt_positive_d', 8.0, 1.0, -1, 49, 0, false, false, false)
Expand Down Expand Up @@ -375,7 +375,7 @@ RegisterNetEvent('consumables:client:UseJoint', function()
end)

RegisterNetEvent('consumables:client:UseParachute', function()
EquipParachuteAnim()
equipParachuteAnim()
if lib.progressBar({
duration = 5000,
label = 'Putting on parachute...',
Expand All @@ -401,24 +401,27 @@ end)

RegisterNetEvent('consumables:client:ResetParachute', function()
if parachuteEquipped then
EquipParachuteAnim()
QBCore.Functions.Progressbar('reset_parachute', 'Packing parachute..', 40000, false, true, {
disableMovement = false,
disableCarMovement = false,
disableMouse = false,
disableCombat = true,
}, {}, {}, {}, function() -- Done
TriggerEvent('inventory:client:ItemBox', QBCore.Shared.Items['parachute'], 'add')
local ParachuteRemoveData = {
outfitData = {
['bag'] = { item = 0, texture = 0} -- Removing Parachute Clothing
}
equipParachuteAnim()
if lib.progressBar({
duration = 40000,
label = 'Packing parachute...',
useWhileDead = false,
canCancel = true,
disable = {
move = false,
car = false,
mouse = false,
combat = true
}
TriggerEvent('qb-clothing:client:loadOutfit', ParachuteRemoveData)
}) then -- if completed
local parachuteRemoveData = {
outfitData = {['bag'] = {item = 0, texture = 0}} -- Removing Parachute Clothing
}
TriggerEvent('qb-clothing:client:loadOutfit', parachuteRemoveData)
TaskPlayAnim(cache.ped, 'clothingshirt', 'exit', 8.0, 1.0, -1, 49, 0, false, false, false)
TriggerServerEvent('qb-smallpenis:server:AddParachute')
parachuteEquipped = false
end)
end
else
QBCore.Functions.Notify('You don\'t have a parachute...', 'error')
end
Expand Down
2 changes: 1 addition & 1 deletion client/tackle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ lib.addKeybind({
defaultKey = 'E',
onReleased = function(self)
if cache.vehicle then return end
if QBCore.Functions.GetPlayerData().metadata["ishandcuffed"] then return end
if PlayerData.metadata.ishandcuffed then return end
if IsPedSprinting(cache.ped) or IsPedRunning(cache.ped) then
local coords = GetEntityCoords(cache.ped)
local targetId, targetPed, _ = lib.getClosestPlayer(coords, 1.6, false)
Expand Down
15 changes: 7 additions & 8 deletions client/teleports.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ CreateThread(function()
local sleep
while true do
sleep = 1000
local ped = PlayerPedId()
local pos = GetEntityCoords(ped)
local pos = GetEntityCoords(cache.ped)

for loc in pairs(Config.Teleports) do
for k, v in pairs(Config.Teleports[loc]) do
Expand All @@ -17,23 +16,23 @@ CreateThread(function()
if IsControlJustReleased(0, 51) then
if k == 1 then
if v.AllowVehicle then
SetPedCoordsKeepVehicle(ped, Config.Teleports[loc][2].coords.x, Config.Teleports[loc][2].coords.y, Config.Teleports[loc][2].coords.z)
SetPedCoordsKeepVehicle(cache.ped), Config.Teleports[loc][2].coords.x, Config.Teleports[loc][2].coords.y, Config.Teleports[loc][2].coords.z)
else
SetEntityCoords(ped, Config.Teleports[loc][2].coords.x, Config.Teleports[loc][2].coords.y, Config.Teleports[loc][2].coords.z)
SetEntityCoords(cache.ped), Config.Teleports[loc][2].coords.x, Config.Teleports[loc][2].coords.y, Config.Teleports[loc][2].coords.z)
end

if type(Config.Teleports[loc][2].coords) == 'vector4' then
SetEntityHeading(ped, Config.Teleports[loc][2].coords.w)
SetEntityHeading(cache.ped), Config.Teleports[loc][2].coords.w)
end
elseif k == 2 then
if v.AllowVehicle then
SetPedCoordsKeepVehicle(ped, Config.Teleports[loc][1].coords.x, Config.Teleports[loc][1].coords.y, Config.Teleports[loc][1].coords.z)
SetPedCoordsKeepVehicle(cache.ped), Config.Teleports[loc][1].coords.x, Config.Teleports[loc][1].coords.y, Config.Teleports[loc][1].coords.z)
else
SetEntityCoords(ped, Config.Teleports[loc][1].coords.x, Config.Teleports[loc][1].coords.y, Config.Teleports[loc][1].coords.z)
SetEntityCoords(cache.ped), Config.Teleports[loc][1].coords.x, Config.Teleports[loc][1].coords.y, Config.Teleports[loc][1].coords.z)
end

if type(Config.Teleports[loc][1].coords) == 'vector4' then
SetEntityHeading(ped, Config.Teleports[loc][1].coords.w)
SetEntityHeading(cache.ped), Config.Teleports[loc][1].coords.w)
end
end
end
Expand Down

0 comments on commit a7e15f7

Please sign in to comment.