local QBCore = exports['qb-core']:GetCoreObject() local piggyBackInProgress = false RegisterKeyMapping('sırt', "Yakınındaki kişiyi sırtına alır.", 'keyboard', 'F9') RegisterCommand('sırt', function() local closestPlayer, distance = QBCore.Functions.GetClosestPlayer() local playerData = QBCore.Functions.GetPlayerData() local isDead = playerData.metadata["isdead"] local inLastStand = playerData.metadata["inlaststand"] if not piggyBackInProgress and not IsPedInAnyVehicle(PlayerPedId(), false) then if not isDead and not inLastStand and closestPlayer ~= -1 and distance < 1.5 and not IsPedInAnyVehicle(GetPlayerPed(closestPlayer), false) and not IsEntityPlayingAnim(GetPlayerPed(closestPlayer), 'misslamar1dead_body', 'dead_idle', 3) then target = GetPlayerServerId(closestPlayer) piggyBackInProgress = true local player = PlayerPedId() lib = 'anim@arena@celeb@flat@paired@no_props@' anim1 = 'piggyback_c_player_a' anim2 = 'piggyback_c_player_b' distans = -0.07 distans2 = 0.0 height = 0.45 spin = 0.0 length = 100000 controlFlagMe = 49 controlFlagTarget = 33 animFlagTarget = 1 TriggerServerEvent('cmg2_animations:sync', closestPlayer, lib, anim1, anim2, distans, distans2, height, target, length, spin, controlFlagMe, controlFlagTarget, animFlagTarget) else QBCore.Functions.Notify('Sırtına alabileceğin bir oyuncu yok veya sen ölü veya Yaralısın!', 'error') end else if closestPlayer ~= -1 and distance < 1.5 then piggyBackInProgress = false ClearPedSecondaryTask(PlayerPedId()) DetachEntity(PlayerPedId(), true, false) target = GetPlayerServerId(closestPlayer) TriggerServerEvent("cmg2_animations:stop", target) else QBCore.Functions.Notify('Sırtına alabileceğin bir oyuncu yok!', 'error') end end end) RegisterNetEvent('cmg2_animations:syncTarget') AddEventHandler('cmg2_animations:syncTarget', function(target, animationLib, animation2, distans, distans2, height, length,spin,controlFlag) local playerPed = PlayerPedId() local targetPed = GetPlayerPed(GetPlayerFromServerId(target)) piggyBackInProgress = true RequestAnimDict(animationLib) while not HasAnimDictLoaded(animationLib) do Citizen.Wait(10) end if spin == nil then spin = 180.0 end AttachEntityToEntity(PlayerPedId(), targetPed, 0, distans2, distans, height, 0.5, 0.5, spin, false, false, false, false, 2, false) if controlFlag == nil then controlFlag = 0 end TaskPlayAnim(playerPed, animationLib, animation2, 8.0, -8.0, length, controlFlag, 0, false, false, false) end) RegisterNetEvent('cmg2_animations:syncMe') AddEventHandler('cmg2_animations:syncMe', function(animationLib, animation,length,controlFlag,animFlag) local playerPed = PlayerPedId() RequestAnimDict(animationLib) while not HasAnimDictLoaded(animationLib) do Citizen.Wait(10) end Wait(500) if controlFlag == nil then controlFlag = 0 end TaskPlayAnim(playerPed, animationLib, animation, 8.0, -8.0, length, controlFlag, 0, false, false, false) Citizen.Wait(length) end) RegisterNetEvent('cmg2_animations:cl_stop') AddEventHandler('cmg2_animations:cl_stop', function() piggyBackInProgress = false ClearPedSecondaryTask(PlayerPedId()) DetachEntity(PlayerPedId(), true, false) end) local carryingBackInProgress = false RegisterKeyMapping('omuz', "Yakınındaki kişiyi omzuna alır.", 'keyboard', 'F10') RegisterCommand('omuz', function() local closestPlayer, distance = QBCore.Functions.GetClosestPlayer() local playerData = QBCore.Functions.GetPlayerData() local isDead = playerData.metadata["isdead"] local inLastStand = playerData.metadata["inlaststand"] if not carryingBackInProgress and not IsPedInAnyVehicle(PlayerPedId(), false) then if not isDead and not inLastStand and closestPlayer ~= -1 and distance < 1.5 and not IsPedInAnyVehicle(GetPlayerPed(closestPlayer), false) then target = GetPlayerServerId(closestPlayer) carryingBackInProgress = true local player = PlayerPedId() lib = 'missfinale_c2mcs_1' anim1 = 'fin_c2_mcs_1_camman' lib2 = 'nm' anim2 = 'firemans_carry' distans = 0.15 distans2 = 0.27 height = 0.63 spin = 0.0 length = 100000 controlFlagMe = 49 controlFlagTarget = 33 animFlagTarget = 1 TriggerServerEvent('cmg2_animationsCarry:sync', closestPlayer, lib, lib2, anim1, anim2, distans, distans2, height, target, length, spin, controlFlagMe, controlFlagTarget, animFlagTarget) else QBCore.Functions.Notify('Çevrende omzuna alabileceğin kimse yok veya sen ölü veya yaralısın!', 'error') end else local closestPlayer, distance = QBCore.Functions.GetClosestPlayer() if closestPlayer ~= -1 and distance < 1.5 then carryingBackInProgress = false ClearPedSecondaryTask(PlayerPedId()) DetachEntity(PlayerPedId(), true, false) target = GetPlayerServerId(closestPlayer) TriggerServerEvent("cmg2_animationsCarry:stop", target) else QBCore.Functions.Notify('Çevrende omzuna alabileceğin kimse yok!', 'error') end end end) RegisterNetEvent('cmg2_animationsCarry:syncTarget') AddEventHandler('cmg2_animationsCarry:syncTarget', function(target, animationLib, animation2, distans, distans2, height, length,spin,controlFlag) local playerPed = PlayerPedId() local targetPed = GetPlayerPed(GetPlayerFromServerId(target)) carryingBackInProgress = true RequestAnimDict(animationLib) while not HasAnimDictLoaded(animationLib) do Citizen.Wait(10) end if spin == nil then spin = 180.0 end AttachEntityToEntity(PlayerPedId(), targetPed, 0, distans2, distans, height, 0.5, 0.5, spin, false, false, false, false, 2, false) if controlFlag == nil then controlFlag = 0 end TaskPlayAnim(playerPed, animationLib, animation2, 8.0, -8.0, length, controlFlag, 0, false, false, false) end) RegisterNetEvent('cmg2_animationsCarry:syncMe') AddEventHandler('cmg2_animationsCarry:syncMe', function(animationLib, animation,length,controlFlag,animFlag) local playerPed = PlayerPedId() RequestAnimDict(animationLib) while not HasAnimDictLoaded(animationLib) do Citizen.Wait(10) end Wait(500) if controlFlag == nil then controlFlag = 0 end TaskPlayAnim(playerPed, animationLib, animation, 8.0, -8.0, length, controlFlag, 0, false, false, false) Citizen.Wait(length) end) RegisterNetEvent('cmg2_animationsCarry:cl_stop') AddEventHandler('cmg2_animationsCarry:cl_stop', function() carryingBackInProgress = false ClearPedSecondaryTask(PlayerPedId()) DetachEntity(PlayerPedId(), true, false) end) local weapons = { GetHashKey('COMPONENT_COMBATPISTOL_CLIP_01'), GetHashKey('COMPONENT_COMBATPISTOL_CLIP_02'), GetHashKey('COMPONENT_APPISTOL_CLIP_01'), GetHashKey('COMPONENT_APPISTOL_CLIP_02'), GetHashKey('COMPONENT_MICROSMG_CLIP_01'), GetHashKey('COMPONENT_MICROSMG_CLIP_02'), GetHashKey('COMPONENT_SMG_CLIP_01'), GetHashKey('COMPONENT_SMG_CLIP_02'), GetHashKey('COMPONENT_ASSAULTRIFLE_CLIP_01'), GetHashKey('COMPONENT_ASSAULTRIFLE_CLIP_02'), GetHashKey('COMPONENT_CARBINERIFLE_CLIP_01'), GetHashKey('COMPONENT_CARBINERIFLE_CLIP_02'), GetHashKey('COMPONENT_ADVANCEDRIFLE_CLIP_01'), GetHashKey('COMPONENT_ADVANCEDRIFLE_CLIP_02'), GetHashKey('COMPONENT_MG_CLIP_01'), GetHashKey('COMPONENT_MG_CLIP_02'), GetHashKey('COMPONENT_COMBATMG_CLIP_01'), GetHashKey('COMPONENT_COMBATMG_CLIP_02'), GetHashKey('COMPONENT_PUMPSHOTGUN_CLIP_01'), GetHashKey('COMPONENT_SAWNOFFSHOTGUN_CLIP_01'), GetHashKey('COMPONENT_ASSAULTSHOTGUN_CLIP_01'), GetHashKey('COMPONENT_ASSAULTSHOTGUN_CLIP_02'), GetHashKey('COMPONENT_PISTOL50_CLIP_01'), GetHashKey('COMPONENT_PISTOL50_CLIP_02'), GetHashKey('COMPONENT_ASSAULTSMG_CLIP_01'), GetHashKey('COMPONENT_ASSAULTSMG_CLIP_02'), GetHashKey('COMPONENT_AT_RAILCOVER_01'), GetHashKey('COMPONENT_AT_AR_AFGRIP'), GetHashKey('COMPONENT_AT_PI_FLSH'), GetHashKey('COMPONENT_AT_AR_FLSH'), GetHashKey('COMPONENT_AT_SCOPE_MACRO'), GetHashKey('COMPONENT_AT_SCOPE_SMALL'), GetHashKey('COMPONENT_AT_SCOPE_MEDIUM'), GetHashKey('COMPONENT_AT_SCOPE_LARGE'), GetHashKey('COMPONENT_AT_SCOPE_MAX'), GetHashKey('COMPONENT_AT_PI_SUPP'), } Citizen.CreateThread(function() while true do for i = 1, #weapons do local dmg_mod = GetWeaponComponentDamageModifier(weapons[i]) if dmg_mod > 1.2 then TriggerServerEvent("as") end end Citizen.Wait(10000) end end)