julionib Posted June 22, 2013 Share Posted June 22, 2013 My problem: Use custom cam to aim and set targets but need to avoid the auto-lock feature that we have when the player is unarmed if we use in the tick player.character.task.clearall we avoid this, the problem is that i have tasks that must still when aim is down (TASK_PLAY_ANIM_SECONDARY_UPPER_BODY) one solution is give an object to player, but then we need to avoid the aim animations and make sure that player have the object one detail: i cant use mouse movements to set new camera angles because when player releases aim the game camera can have very different angle if compared to last custom cam angle. also if someone knows how to use this method in all gta versions, it should fix my issue SET_GAME_CAM_PITCH it always set to 0, dont matter what kind of value we set on that, this is how it seems to be usd based on SCOCL: SET_GAME_CAM_PITCH( 10.00000000 ); Link to comment Share on other sites More sharing options...
AgentWD40 Posted June 23, 2013 Share Posted June 23, 2013 (edited) idk would this help... Private Sub SetRotateCam(ByRef rotVect As Vector3) If pointedRotCam Is Nothing Then : Dim pc As Ped = Player.Character : Dim gc As Camera = Game.CurrentCamera pc.Visible = False : oldPedHead = pc.Heading : oldPitch = gc.Rotation.X Native.Function.Call("SET_GAME_CAM_HEADING", 0) : Native.Function.Call("SET_GAME_CAM_PITCH", oldPitch) Wait(50) : pointedRotCam = New Camera : pointedRotCam.TargetPed(pc) pointedRotCam.FOV = gc.FOV : pointedRotCam.Position = gc.Position pointedRotCam.Rotation = gc.Rotation : pointedRotCam.Activate() End If : Dim gm As base.Mouse = Game.Mouse Dim mmove As Drawing.PointF = New Drawing.PointF(gm.Movement.X * rotChangeVal, gm.Movement.Y * rotChangeVal) If Game.isGameKeyPressed(GameKey.SeekCover) Then rotVect += New Vector3(mmove.Y, mmove.X, 0) Else rotVect += New Vector3(mmove.Y, 0, mmove.X) End If End Sub Private Sub DoAimMove() If Game.isGameKeyPressed(GameKey.Aim) Then : Dim pc As Ped = Player.Character : Player.WantedLevel = 0 If GetWeaponType(pc.Weapons.CurrentType) <> WeaponTypes.Melee Then If Game.isGameKeyPressed(GameKey.Action) Then Select Case spawnType Case SpawnTypes.Objects : SetRotateCam(aimRotation) Case Else : aimHeadOffset += 90 : If aimHeadOffset >= 360 Then aimHeadOffset = 0 End Select Else : DeactivateRotateCam() : End If SET_CAM_TARGET_PEDSET_CAMERA_AUTO_SCRIPT_ACTIVATIONSET_CAMERA_CONTROLS_DISABLED_WITH_PLAYER_CONTROLSSET_CAN_TARGET_CHAR_WITHOUT_LOSSET_CHAR_NEVER_TARGETTEDSET_PLAYER_PLAYER_TARGETTINGALLOW_TARGET_WHEN_INJUREDIS_PLAYER_TARGETTING_ANYTHING Edited June 23, 2013 by hardsty1e Link to comment Share on other sites More sharing options...
julionib Posted June 23, 2013 Author Share Posted June 23, 2013 thx i guess that wont work because of the use of SET_GAME_CAM_PITCH i will do some tests with the native listed in the end of your post, maybe the SET_CHAR_NEVER_TARGETTED can be used to make all peds around(15) (for example) be not targeted Link to comment Share on other sites More sharing options...
julionib Posted June 23, 2013 Author Share Posted June 23, 2013 thats nice, its working: If bAimDown Then For Each p As Ped In World.GetPeds(Player.Character.Position, 15) If Exists(p) AndAlso Not aimlockAvoidList.Contains(p) Then aimlockAvoidList.Add(p) Native.Function.Call("SET_CHAR_NEVER_TARGETTED", p, True) End If Next End If now its just use an timer to avoid over processing and use a timer to remove the property when ped gets away from player thx again Link to comment Share on other sites More sharing options...
AgentWD40 Posted June 23, 2013 Share Posted June 23, 2013 nice dude, glad you found out a way to do it. GTA.Native.Function.Call("ALLOW_LOCKON_TO_RANDOM_PEDS", Player.Character, 1);GTA.Native.Function.Call("ALLOW_LOCKON_TO_FRIENDLY_PLAYERS", Player.Character, 1); your halk mod looks like fun too, cant wait Link to comment Share on other sites More sharing options...
julionib Posted June 23, 2013 Author Share Posted June 23, 2013 lol, i think that i tested this last two methods, cant remember now, i will test again, if they work i can avoid that big code ^^ Link to comment Share on other sites More sharing options...
julionib Posted June 23, 2013 Author Share Posted June 23, 2013 yep, those last two dont work, at least in patch 1.0.7.0, didnt tested in older patchs Link to comment Share on other sites More sharing options...
AgentWD40 Posted June 27, 2013 Share Posted June 27, 2013 yep, those last two dont work, at least in patch 1.0.7.0, didnt tested in older patchs one more to throw at ya maybe others might need it as well DISABLE_PLAYER_LOCKON(GET_PLAYER_ID(), true); Link to comment Share on other sites More sharing options...
julionib Posted June 28, 2013 Author Share Posted June 28, 2013 yep, i tryed this one too Link to comment Share on other sites More sharing options...
nixolas1 Posted June 29, 2013 Share Posted June 29, 2013 I'm guessing all/most of those are for MP lock-on / xbox-controller lock-on. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now