Skip to content

Commit

Permalink
Initial conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
GhzGarage committed Mar 31, 2022
1 parent 8d86981 commit f5bb0dd
Show file tree
Hide file tree
Showing 6 changed files with 158 additions and 158 deletions.
16 changes: 8 additions & 8 deletions client/evidence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ RegisterNetEvent('evidence:client:SetStatus', function(statusId, time)
text = StatusList[statusId],
time = time
}
QBCore.Functions.Notify(CurrentStatusList[statusId].text, 'error')
exports['qbr-core']:Notify(CurrentStatusList[statusId].text, 'error')
end
elseif StatusList[statusId] then
CurrentStatusList[statusId] = nil
Expand Down Expand Up @@ -126,7 +126,7 @@ end)
RegisterNetEvent('evidence:client:ClearBlooddropsInArea', function()
local pos = GetEntityCoords(PlayerPedId())
local blooddropList = {}
QBCore.Functions.Progressbar('clear_blooddrops', Lang:t("progressbar.blood_clear"), 5000, false, true, {
exports['qbr-core']:Progressbar('clear_blooddrops', Lang:t("progressbar.blood_clear"), 5000, false, true, {
disableMovement = false,
disableCarMovement = false,
disableMouse = false,
Expand All @@ -141,10 +141,10 @@ RegisterNetEvent('evidence:client:ClearBlooddropsInArea', function()
end
end
TriggerServerEvent('evidence:server:ClearBlooddrops', blooddropList)
QBCore.Functions.Notify(Lang:t("success.blood_clear"), "success")
exports['qbr-core']:Notify(Lang:t("success.blood_clear"), "success")
end
end, function() -- Cancel
QBCore.Functions.Notify(Lang:t("error.blood_not_cleared"), "error")
exports['qbr-core']:Notify(Lang:t("error.blood_not_cleared"), "error")
end)
end)

Expand All @@ -168,7 +168,7 @@ end)
RegisterNetEvent('evidence:client:ClearCasingsInArea', function()
local pos = GetEntityCoords(PlayerPedId())
local casingList = {}
QBCore.Functions.Progressbar('clear_casings', Lang:t("progressbar.bullet_casing"), 5000, false, true, {
exports['qbr-core']:Progressbar('clear_casings', Lang:t("progressbar.bullet_casing"), 5000, false, true, {
disableMovement = false,
disableCarMovement = false,
disableMouse = false,
Expand All @@ -182,11 +182,11 @@ RegisterNetEvent('evidence:client:ClearCasingsInArea', function()
end
end
TriggerServerEvent('evidence:server:ClearCasings', casingList)
QBCore.Functions.Notify(Lang:t("success.bullet_casing_removed"), "success")
exports['qbr-core']:Notify(Lang:t("success.bullet_casing_removed"), "success")

end
end, function() -- Cancel
QBCore.Functions.Notify(Lang:t("error.bullet_casing_not_removed"), "error")
exports['qbr-core']:Notify(Lang:t("error.bullet_casing_not_removed"), "error")
end)
end)

Expand Down
90 changes: 45 additions & 45 deletions client/interactions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ end

local function IsTargetDead(playerId)
local retval = false
QBCore.Functions.TriggerCallback('police:server:isPlayerDead', function(result)
exports['qbr-core']:TriggerCallback('police:server:isPlayerDead', function(result)
retval = result
end, playerId)
Wait(100)
Expand All @@ -34,7 +34,7 @@ end)
RegisterNetEvent('police:client:PutInVehicle', function()
local ped = PlayerPedId()
if isHandcuffed or isEscorted then
local vehicle = QBCore.Functions.GetClosestVehicle()
local vehicle = exports['qbr-core']:GetClosestVehicle()
if DoesEntityExist(vehicle) then
for i = GetVehicleMaxNumberOfPassengers(vehicle), 1, -1 do
if IsVehicleSeatFree(vehicle, i) then
Expand All @@ -53,46 +53,46 @@ RegisterNetEvent('police:client:PutInVehicle', function()
end)

RegisterNetEvent('police:client:SearchPlayer', function()
local player, distance = QBCore.Functions.GetClosestPlayer()
local player, distance = exports['qbr-core']:GetClosestPlayer()
if player ~= -1 and distance < 2.5 then
local playerId = GetPlayerServerId(player)
TriggerServerEvent("inventory:server:OpenInventory", "otherplayer", playerId)
TriggerServerEvent("police:server:SearchPlayer", playerId)
else
QBCore.Functions.Notify(Lang:t("error.none_nearby"), "error")
exports['qbr-core']:Notify(Lang:t("error.none_nearby"), "error")
end
end)

RegisterNetEvent('police:client:SeizeCash', function()
local player, distance = QBCore.Functions.GetClosestPlayer()
local player, distance = exports['qbr-core']:GetClosestPlayer()
if player ~= -1 and distance < 2.5 then
local playerId = GetPlayerServerId(player)
TriggerServerEvent("police:server:SeizeCash", playerId)
else
QBCore.Functions.Notify(Lang:t("error.none_nearby"), "error")
exports['qbr-core']:Notify(Lang:t("error.none_nearby"), "error")
end
end)

RegisterNetEvent('police:client:SeizeDriverLicense', function()
local player, distance = QBCore.Functions.GetClosestPlayer()
local player, distance = exports['qbr-core']:GetClosestPlayer()
if player ~= -1 and distance < 2.5 then
local playerId = GetPlayerServerId(player)
TriggerServerEvent("police:server:SeizeDriverLicense", playerId)
else
QBCore.Functions.Notify(Lang:t("error.none_nearby"), "error")
exports['qbr-core']:Notify(Lang:t("error.none_nearby"), "error")
end
end)


RegisterNetEvent('police:client:RobPlayer', function()
local player, distance = QBCore.Functions.GetClosestPlayer()
local player, distance = exports['qbr-core']:GetClosestPlayer()
local ped = PlayerPedId()
if player ~= -1 and distance < 2.5 then
local playerPed = GetPlayerPed(player)
local playerId = GetPlayerServerId(player)

if IsEntityPlayingAnim(playerPed, 'mech_busted@arrest', 'hands_up_transition', 3) then
QBCore.Functions.Progressbar("robbing_player", Lang:t("progressbar.robbing"), math.random(5000, 7000), false, true, {
if IsEntityPlayingAnim(playerPed, 'mech_busted@arrest', 'hands_up_transition', 3) then
exports['qbr-core']:Progressbar("robbing_player", Lang:t("progressbar.robbing"), math.random(5000, 7000), false, true, {
disableMovement = true,
disableCarMovement = true,
disableMouse = false,
Expand All @@ -104,14 +104,14 @@ RegisterNetEvent('police:client:RobPlayer', function()
TriggerServerEvent("inventory:server:OpenInventory", "otherplayer", playerId)
TriggerEvent("inventory:server:RobPlayer", playerId)
else
QBCore.Functions.Notify(Lang:t("error.none_nearby"), "error")
exports['qbr-core']:Notify(Lang:t("error.none_nearby"), "error")
end
end, function() -- Cancel
QBCore.Functions.Notify(Lang:t("error.canceled"), "error")
exports['qbr-core']:Notify(Lang:t("error.canceled"), "error")
end)
end
else
QBCore.Functions.Notify(Lang:t("error.none_nearby"), "error")
exports['qbr-core']:Notify(Lang:t("error.none_nearby"), "error")
end
end)

Expand All @@ -124,73 +124,73 @@ RegisterNetEvent('police:client:BillCommand', function(playerId, price)
end)

RegisterNetEvent('police:client:JailPlayer', function()
local player, distance = QBCore.Functions.GetClosestPlayer()
local player, distance = exports['qbr-core']:GetClosestPlayer()
if player ~= -1 and distance < 2.5 then
local playerId = GetPlayerServerId(player)
local dialogInput = LocalInput(Lang:t('info.jail_time_input'), 11)
if tonumber(dialogInput) > 0 then
if tonumber(dialogInput) > 0 then
TriggerServerEvent("police:server:JailPlayer", playerId, tonumber(dialogInput))
else
QBCore.Functions.Notify(Lang:t("error.time_higher"), "error")
exports['qbr-core']:Notify(Lang:t("error.time_higher"), "error")
end
else
QBCore.Functions.Notify(Lang:t("error.none_nearby"), "error")
exports['qbr-core']:Notify(Lang:t("error.none_nearby"), "error")
end
end)

RegisterNetEvent('police:client:BillPlayer', function()
local player, distance = QBCore.Functions.GetClosestPlayer()
local player, distance = exports['qbr-core']:GetClosestPlayer()
if player ~= -1 and distance < 2.5 then
local playerId = GetPlayerServerId(player)
local dialogInput = LocalInput(Lang:t('info.jail_time_input'), 11)
if tonumber(dialogInput) > 0 then
if tonumber(dialogInput) > 0 then
TriggerServerEvent("police:server:BillPlayer", playerId, tonumber(dialogInput))
else
QBCore.Functions.Notify(Lang:t("error.amount_higher"), "error")
exports['qbr-core']:Notify(Lang:t("error.amount_higher"), "error")
end
else
QBCore.Functions.Notify(Lang:t("error.none_nearby"), "error")
exports['qbr-core']:Notify(Lang:t("error.none_nearby"), "error")
end
end)

RegisterNetEvent('police:client:PutPlayerInVehicle', function()
local player, distance = QBCore.Functions.GetClosestPlayer()
local player, distance = exports['qbr-core']:GetClosestPlayer()
if player ~= -1 and distance < 2.5 then
local playerId = GetPlayerServerId(player)
if not isHandcuffed and not isEscorted then
TriggerServerEvent("police:server:PutPlayerInVehicle", playerId)
end
else
QBCore.Functions.Notify(Lang:t("error.none_nearby"), "error")
exports['qbr-core']:Notify(Lang:t("error.none_nearby"), "error")
end
end)

RegisterNetEvent('police:client:SetPlayerOutVehicle', function()
local player, distance = QBCore.Functions.GetClosestPlayer()
local player, distance = exports['qbr-core']:GetClosestPlayer()
if player ~= -1 and distance < 2.5 then
local playerId = GetPlayerServerId(player)
if not isHandcuffed and not isEscorted then
TriggerServerEvent("police:server:SetPlayerOutVehicle", playerId)
end
else
QBCore.Functions.Notify(Lang:t("error.none_nearby"), "error")
exports['qbr-core']:Notify(Lang:t("error.none_nearby"), "error")
end
end)

RegisterNetEvent('police:client:EscortPlayer', function()
local player, distance = QBCore.Functions.GetClosestPlayer()
local player, distance = exports['qbr-core']:GetClosestPlayer()
if player ~= -1 and distance < 2.5 then
local playerId = GetPlayerServerId(player)
if not isHandcuffed and not isEscorted then
TriggerServerEvent("police:server:EscortPlayer", playerId)
end
else
QBCore.Functions.Notify(Lang:t("error.none_nearby"), "error")
exports['qbr-core']:Notify(Lang:t("error.none_nearby"), "error")
end
end)

RegisterNetEvent('police:client:KidnapPlayer', function()
local player, distance = QBCore.Functions.GetClosestPlayer()
local player, distance = exports['qbr-core']:GetClosestPlayer()
if player ~= -1 and distance < 2.5 then
local playerId = GetPlayerServerId(player)
if not IsPedInAnyVehicle(GetPlayerPed(player)) then
Expand All @@ -199,23 +199,23 @@ RegisterNetEvent('police:client:KidnapPlayer', function()
end
end
else
QBCore.Functions.Notify(Lang:t("error.none_nearby"), "error")
exports['qbr-core']:Notify(Lang:t("error.none_nearby"), "error")
end
end)

RegisterNetEvent('police:client:CuffPlayerSoft', function()
if not IsPedRagdoll(PlayerPedId()) then
local player, distance = QBCore.Functions.GetClosestPlayer()
local player, distance = exports['qbr-core']:GetClosestPlayer()
if player ~= -1 and distance < 1.5 then
local playerId = GetPlayerServerId(player)
if not IsPedInAnyVehicle(GetPlayerPed(player)) and not IsPedInAnyVehicle(PlayerPedId()) then
TriggerServerEvent("police:server:CuffPlayer", playerId, true)
-- HandCuffAnimation()
else
QBCore.Functions.Notify(Lang:t("error.vehicle_cuff"), "error")
exports['qbr-core']:Notify(Lang:t("error.vehicle_cuff"), "error")
end
else
QBCore.Functions.Notify(Lang:t("error.none_nearby"), "error")
exports['qbr-core']:Notify(Lang:t("error.none_nearby"), "error")
end
else
Wait(2000)
Expand All @@ -224,23 +224,23 @@ end)

RegisterNetEvent('police:client:CuffPlayer', function()
if not IsPedRagdoll(PlayerPedId()) then
local player, distance = QBCore.Functions.GetClosestPlayer()
local player, distance = exports['qbr-core']:GetClosestPlayer()
if player ~= -1 and distance < 1.5 then
QBCore.Functions.TriggerCallback('QBCore:HasItem', function(result)
exports['qbr-core']:TriggerCallback('QBCore:HasItem', function(result)
if result then
local playerId = GetPlayerServerId(player)
if not IsPedInAnyVehicle(GetPlayerPed(player)) and not IsPedInAnyVehicle(PlayerPedId()) then
TriggerServerEvent("police:server:CuffPlayer", playerId, false)
-- HandCuffAnimation()
else
QBCore.Functions.Notify(Lang:t("error.vehicle_cuff"), "error")
exports['qbr-core']:Notify(Lang:t("error.vehicle_cuff"), "error")
end
else
QBCore.Functions.Notify(Lang:t("error.no_cuff"), "error")
exports['qbr-core']:Notify(Lang:t("error.no_cuff"), "error")
end
end, Config.HandCuffItem)
else
QBCore.Functions.Notify(Lang:t("error.none_nearby"), "error")
exports['qbr-core']:Notify(Lang:t("error.none_nearby"), "error")
end
else
Wait(2000)
Expand All @@ -249,7 +249,7 @@ end)

RegisterNetEvent('police:client:GetEscorted', function(playerId)
local ped = PlayerPedId()
QBCore.Functions.GetPlayerData(function(PlayerData)
exports['qbr-core']:GetPlayerData(function(PlayerData)
if PlayerData.metadata["isdead"] or isHandcuffed or PlayerData.metadata["inlaststand"] then
if not isEscorted then
isEscorted = true
Expand All @@ -274,7 +274,7 @@ end)

RegisterNetEvent('police:client:GetKidnappedTarget', function(playerId)
local ped = PlayerPedId()
QBCore.Functions.GetPlayerData(function(PlayerData)
exports['qbr-core']:GetPlayerData(function(PlayerData)
if PlayerData.metadata["isdead"] or PlayerData.metadata["inlaststand"] or isHandcuffed then
if not isEscorted then
isEscorted = true
Expand All @@ -298,7 +298,7 @@ RegisterNetEvent('police:client:GetKidnappedTarget', function(playerId)
end)

RegisterNetEvent('police:client:GetKidnappedDragger', function(playerId)
QBCore.Functions.GetPlayerData(function(PlayerData)
exports['qbr-core']:GetPlayerData(function(PlayerData)
if not isEscorting then
draggerId = playerId
local dragger = PlayerPedId()
Expand Down Expand Up @@ -332,11 +332,11 @@ RegisterNetEvent('police:client:GetCuffed', function(playerId, isSoftcuff)
if not isSoftcuff then
cuffType = 16
-- GetCuffedAnimation(playerId)
QBCore.Functions.Notify(Lang:t("info.cuff"), 'primary')
exports['qbr-core']:Notify(Lang:t("info.cuff"), 'primary')
else
cuffType = 49
-- GetCuffedAnimation(playerId)
QBCore.Functions.Notify(Lang:t("info.cuffed_walk"), 'primary')
exports['qbr-core']:Notify(Lang:t("info.cuffed_walk"), 'primary')
end
else
isHandcuffed = false
Expand All @@ -353,7 +353,7 @@ RegisterNetEvent('police:client:GetCuffed', function(playerId, isSoftcuff)
FreezeEntityPosition(ped, false)
end
-- TriggerServerEvent("InteractSound_SV:PlayOnSource", "Uncuff", 0.2)
QBCore.Functions.Notify(Lang:t("success.uncuffed"),"success")
exports['qbr-core']:Notify(Lang:t("success.uncuffed"),"success")
end
end)

Expand Down Expand Up @@ -390,7 +390,7 @@ CreateThread(function()
end

if isHandcuffed then
-- if (not IsEntityPlayingAnim(PlayerPedId(), "mp_arresting", "idle", 3) and not IsEntityPlayingAnim(PlayerPedId(), "mp_arrest_paired", "crook_p2_back_right", 3)) and not QBCore.Functions.GetPlayerData().metadata["isdead"] then
-- if (not IsEntityPlayingAnim(PlayerPedId(), "mp_arresting", "idle", 3) and not IsEntityPlayingAnim(PlayerPedId(), "mp_arrest_paired", "crook_p2_back_right", 3)) and not exports['qbr-core']:GetPlayerData().metadata["isdead"] then
-- loadAnimDict("mp_arresting")
-- TaskPlayAnim(PlayerPedId(), "mp_arresting", "idle", 8.0, -8, -1, cuffType, 0, 0, 0, 0)
-- end
Expand Down
Loading

0 comments on commit f5bb0dd

Please sign in to comment.