From db8bf32d69aadeedd76e4fde2bea64a62a6112a3 Mon Sep 17 00:00:00 2001 From: Nordi98 Date: Wed, 16 Jul 2025 23:45:37 +0200 Subject: [PATCH] ed --- .../[Nordi]/snipe-sitting-master.zip | Bin 3900 -> 0 bytes resources/[tools]/snipe-sitting/README.md | 12 + .../[tools]/snipe-sitting/client/cl_main.lua | 248 ++++++++++++++++++ .../[tools]/snipe-sitting/fxmanifest.lua | 22 ++ .../[tools]/snipe-sitting/shared/config.lua | 96 +++++++ 5 files changed, 378 insertions(+) delete mode 100644 resources/[Developer]/[Nordi]/snipe-sitting-master.zip create mode 100644 resources/[tools]/snipe-sitting/README.md create mode 100644 resources/[tools]/snipe-sitting/client/cl_main.lua create mode 100644 resources/[tools]/snipe-sitting/fxmanifest.lua create mode 100644 resources/[tools]/snipe-sitting/shared/config.lua diff --git a/resources/[Developer]/[Nordi]/snipe-sitting-master.zip b/resources/[Developer]/[Nordi]/snipe-sitting-master.zip deleted file mode 100644 index 9ada858070a2b21a41a0dc538fb3d42303f8e1ae..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3900 zcmbW4cT`i^7RD1wLX%FUL_m6x7zAm8^j-|T_XG$fl+dLKiWH?ck&eg^1yo8AK*|adRr?So(Y^9CI)g3Wn6jg!R)G%7~8_aM4k@@pY_kk;gG=Cxjq-55?1Xv6*GIpK@;>b zU&h?VS;~_hD}EO zkYq3b(8LP>i2efM?(6L5ipIcvLtOvP#|D>=Igk8XnSBoKWzFGaKX{_r#0ZynS0x)O zoyjLXm22}R1iIyHNn%`adHbVVz0>+(_m1eF4Z%q-VVWlJq1HjSEV(b|96wuZB*tdk zBd8-1FK=2v@G|0pxsMx=yo7o#e!bJi%f@R8!PnQlAP17VUoFjTdV$NUQu)q!H(k_m zjTceSIWH!h9I>oLljQ{TvH_a*fka2GMPkwn&NG0 zPLk*w@H;u}&sUz>pH=I%k#2;;B9}=s54p;)5*inVUVk=f@apF@xg->mMfkutwvNPh zqq)Ts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H2l{6sW?{JyHWIn?^;)C-LnlcWgYRv)n@BbSB9TsP*l%LSLT1FmCp;vt(E<&jkIh@u1z zILpHDXbY~qhF`+#f;ZPV4<~HWjY|lgWhKz7UKpF(;3^^+pz9D=y)LCw0!Rn!JO*J7sG!H1cY**rb*0@KXTiE{& zy@u_%Jc{LY+Z|$#Yh*o^FVe4ZWxu+`K*Afb7-rB5S^kisHshkA#CsVH9aCf(sY8m; zDHPwMp$qS;YuUKf+iW#pUqgDOlBNJ+gXs{OJ7@z%~wrkQeDNXXna z^9w1_ianA!3Qztp)4|g+vBt@|q)5nUBut4W7y2~L%!v!lJiD`{fFne~3HqCwK|}BY z-I&OTHpQ9ru%y_$uaa?iEO}Vm@U5Oob%fg+TF`m78|oV+0BF4+X@^735`_~^ zq*qg=JwFY#>2|)8NZ)nz|LB>pUamnX-DeWc97A?K{;5dVP;-To!GbOV=DWU|QI#59dxC4#s845~tRI?(>2%DJx^kD2 z=X2Xmm}&@Y20G9WW@&BSy&x*ErY6;!j2KQLfR&qJX*1eGQv`CuwesJh;iI_1>G|&E z-pS{!pG=aRW1?!99nS6k7#hL z5!ig*N|bbXW%WWYv(mv{tG3Ky)7FeS?CnKpDeWG?m2-}?t41h!#~PgNrTG%3(`^Je z!JkWgo4i5HxNe4tx&vCPGi9`UmKKcDme6AajU{E5#u?U(hjVPVo2})~g;(5s)t?yb zptddToHo?Qtn{wgQ#iwL;WwP^WL=I`^xYW2S}^KSw=@$iNxE;IW;H?56W+12*b(a_ zpzD`5RW*dorH!OL8=i09dNI^@g-la~)rp<$8D^;@_Uz#6p%DmiQEbEw`W1PiKP*di zjT>BbE_9>NhZO6T{bBiYj-ZLPN4qh7{Ia_`Uq?gA6sgSMem~yyW;^$9__;^ #Config.Anims then + currentAnimIndex = 1 + end + elseif direction == "previous" then + currentAnimIndex = currentAnimIndex - 1 + if currentAnimIndex < 1 then + currentAnimIndex = #Config.Anims + end + end +end + +local function StartSittingThread() + sitting = true + lib.showTextUI("Press [Q] to cancel") + CreateThread(function () + while sitting do + Wait(1) + if IsControlJustPressed(0, 44) then + sitting = false + lib.hideTextUI() + ClearPedTasksImmediately(PlayerPedId()) + return + end + end + end) +end + +local function MakePedSitDown(coords, heading, animData) + stopPlacing() + TaskGoToCoordAnyMeans(PlayerPedId(), coords.x, coords.y, coords.z, 1.0, 0, 0, 786603, 0xbf800000) + local PlayerCoords = GetEntityCoords(PlayerPedId()) + lib.showTextUI("Press [Right Click] to cancel") + while #(PlayerCoords - coords) > 1.5 do + Wait(1) + PlayerCoords = GetEntityCoords(PlayerPedId()) + if IsControlJustPressed(0, 177) then + lib.hideTextUI() + ClearPedTasksImmediately(PlayerPedId()) + return + end + end + lib.hideTextUI() + SetEntityCoords(PlayerPedId(), coords.x, coords.y, coords.z, 0.0, 0.0, 0.0, false) + TaskPlayAnimAdvanced(PlayerPedId(), animData.dict, animData.anim, coords.x, coords.y, coords.z, 0, 0, heading, 3.0, 3.0, -1, 2, 1.0, false, false) + StartSittingThread() +end + +local function PlacingThread(animData) + if ped == nil then + local playerPed = PlayerPedId() + ped = ClonePed(playerPed, false, false, false) + FreezeEntityPosition(ped, true) + SetEntityAlpha(ped, 0) + + local animToUse = Config.Anims[currentAnimIndex] + + if not animToUse then + lib.notify({ type = "error", description = "No animation found." }) + return + end + + lib.requestAnimDict(animData.dict) + TaskPlayAnim(ped, animData.dict, animData.anim, 8.0, 8.0, -1, 1, 0, false, false, false) + SetEntityCollision(ped, false, false) + SetEntityAlpha(ped, 100) + if Config.SetToFirstPerson then + oldCamView = GetFollowPedCamViewMode() + SetFollowPedCamViewMode(3) + SetCamViewModeForContext(0, 4) + end + SetBlockingOfNonTemporaryEvents(ped, true) + heading = GetEntityHeading(playerPed) + 90.0 + lib.showTextUI(table.concat(txt)) + CreateThread(function () + local currentCoordsZ = 0 + while ped ~= nil do + Wait(1) + DisableControlAction(0, 22, true) + startPlacing() + if currentCoords then + SetEntityCoords(ped, currentCoords.x, currentCoords.y, currentCoords.z + currentCoordsZ) + SetEntityHeading(ped, heading) + end + if IsDisabledControlJustPressed(0, 14) then + heading = heading + 5 + if heading > 360 then heading = 0.0 end + end + if IsDisabledControlPressed(0, 27) then + currentCoordsZ = currentCoordsZ + 0.01 + end + if IsDisabledControlPressed(0, 173) then + currentCoordsZ = currentCoordsZ - 0.01 + end + if IsDisabledControlJustPressed(0, 15) then + heading = heading - 5 + if heading < 0 then heading = 360.0 end + end + if IsControlJustPressed(0, 38) then + if #(GetEntityCoords(PlayerPedId()) - currentCoords) < 5.0 then + MakePedSitDown(GetEntityCoords(ped), GetEntityHeading(ped), animToUse) + else + lib.notify({type = "error", description = "You are too far"}) + end + end + + if IsControlJustPressed(0, 47) then -- G + CycleAnimations("next") + animToUse = Config.Anims[currentAnimIndex] + + if not animToUse then + lib.notify({ type = "error", description = "No animation found." }) + return + end + + lib.requestAnimDict(animToUse.dict) + TaskPlayAnim(ped, animToUse.dict, animToUse.anim, 8.0, 8.0, -1, 1, 0, false, false, false) + end + + if IsControlJustPressed(0, 74) then -- H + CycleAnimations("previous") + animToUse = Config.Anims[currentAnimIndex] + + if not animToUse then + lib.notify({ type = "error", description = "No animation found." }) + return + end + + lib.requestAnimDict(animToUse.dict) + TaskPlayAnim(ped, animToUse.dict, animToUse.anim, 8.0, 8.0, -1, 1, 0, false, false, false) + end + + if IsControlJustPressed(0, 177) then + stopPlacing() + end + end + end) + else + DeleteObject(ped) + ped = nil + stopPlacing() + return + end +end + +function GetForwardVector(rotation) + local rot = (math.pi / 180.0) * rotation + return vector3(-math.sin(rot.z) * math.abs(math.cos(rot.x)), math.cos(rot.z) * math.abs(math.cos(rot.x)), + math.sin(rot.x)) +end + + +local function RotationToDirection(rotation) + local adjustedRotation = + { + x = (math.pi / 180) * rotation.x, + y = (math.pi / 180) * rotation.y, + z = (math.pi / 180) * rotation.z + } + local direction = + { + x = -math.sin(adjustedRotation.z) * math.abs(math.cos(adjustedRotation.x)), + y = math.cos(adjustedRotation.z) * math.abs(math.cos(adjustedRotation.x)), + z = math.sin(adjustedRotation.x) + } + return direction +end + +function Camera(ped) + local cameraRotation = GetGameplayCamRot() + local cameraCoord = GetGameplayCamCoord() + local direction = RotationToDirection(cameraRotation) + local destination = + { + x = cameraCoord.x + direction.x * 10.0, + y = cameraCoord.y + direction.y * 10.0, + z = cameraCoord.z + direction.z * 10.0 + } + + local sphereCast = StartShapeTestSweptSphere( + cameraCoord.x, + cameraCoord.y, + cameraCoord.z, + destination.x, + destination.y, + destination.z, + 0.2, + 339, + ped, + 4 + ); + return GetShapeTestResultIncludingMaterial(sphereCast); +end + +function startPlacing() + local _, hit, endCoords, _, _, _ = Camera(ped) + if hit then + currentCoords = endCoords + end +end + +function stopPlacing() + if ped then + DeleteEntity(ped) + end + ped = nil + heading = 0.0 + currentCoords = nil + lib.hideTextUI() + if Config.SetToFirstPerson then + SetFollowPedCamViewMode(oldCamView) + oldCamView = nil + end +end + +RegisterCommand("sit", function(source, args) + local animToUse = Config.Anims[currentAnimIndex] + + if not animToUse then + lib.notify({ type = "error", description = "No animation found." }) + return + end + + PlacingThread(animToUse) +end) + diff --git a/resources/[tools]/snipe-sitting/fxmanifest.lua b/resources/[tools]/snipe-sitting/fxmanifest.lua new file mode 100644 index 000000000..da463cf58 --- /dev/null +++ b/resources/[tools]/snipe-sitting/fxmanifest.lua @@ -0,0 +1,22 @@ + +-----------------For support, scripts, and more---------------- +--------------- https://discord.gg/AeCVP2F8h7 ------------- +--------------------------------------------------------------- + +fx_version 'cerulean' +game 'gta5' + +description 'Sitting Script' +version '1.0.0' +author 'Snipe' + +lua54 'yes' + +shared_scripts{ + '@ox_lib/init.lua', + 'shared/**/*.lua' +} + +client_scripts{ + 'client/**/*.lua', +} diff --git a/resources/[tools]/snipe-sitting/shared/config.lua b/resources/[tools]/snipe-sitting/shared/config.lua new file mode 100644 index 000000000..8f534d1e7 --- /dev/null +++ b/resources/[tools]/snipe-sitting/shared/config.lua @@ -0,0 +1,96 @@ + +-----------------For support, scripts, and more---------------- +--------------- https://discord.gg/AeCVP2F8h7 ------------- +--------------------------------------------------------------- + +Config = {} +Config.SetToFirstPerson = true + +-- you can add more sitting animations here. +Config.Anims = { + { + dict = "timetable@maid@couch@", + anim = "base", + }, + { + dict = "anim@heists@fleeca_bank@ig_7_jetski_owner", + anim = "owner_idle", + }, + { + dict = "rcm_barry3", + anim = "barry_3_sit_loop", + }, + { + dict = "amb@world_human_picnic@male@idle_a", + anim = "idle_a", + }, + { + dict = "amb@world_human_picnic@female@idle_a", + anim = "idle_a", + }, + { + dict = "anim@heists@fleeca_bank@ig_7_jetski_owner", + anim = "owner_idle", + }, + { + dict = "timetable@jimmy@mics3_ig_15@", + anim = "idle_a_jimmy", + }, + { + dict = "anim@amb@nightclub@lazlow@lo_alone@", + anim = "lowalone_base_laz", + }, + { + dict = "timetable@jimmy@mics3_ig_15@", + anim = "mics3_15_base_jimmy", + }, + { + dict = "amb@world_human_stupor@male@idle_a", + anim = "idle_a", + }, + { + dict = "timetable@ron@ig_5_p3", + anim = "ig_5_p3_base", + }, + { + dict = "timetable@reunited@ig_10", + anim = "base_amanda", + }, + { + dict = "timetable@ron@ig_3_couch", + anim = "base", + }, + { + dict = "timetable@jimmy@mics3_ig_15@", + anim = "mics3_15_base_tracy", + }, + { + dict = "timetable@maid@couch@", + anim = "base", + }, + { + dict = "timetable@ron@ig_5_p3", + anim = "ig_5_p3_base", + }, + { + dict = "timetable@reunited@ig_10", + anim = "base_amanda", + }, + { + dict = "timetable@ron@ig_3_couch", + anim = "base", + }, + { + dict = "timetable@jimmy@mics3_ig_15@", + anim = "mics3_15_base_tracy", + }, + { + dict = "timetable@ron@ron_ig_2_alt1", + anim = "ig_2_alt1_base", + }, + { + dict = "anim@gangops@morgue@table@", + anim = "body_search", + } +} +