How to play animation? [C# Script Hook V .NET]
-
I wanna play player animation (like Scenarios in Enhanced Native Trainer)
-
Use TASK_START_SCENARIO_IN_PLACE or TASK_START_SCENARIO_AT_POSITION for Scenarios.
-
And... How to use it? (I'm starting with this
)
-
Basically, just use Task.StartScenario for a pedestrian.
Ped p = Game.Player.Character; p.Task.StartScenario("SCENARIO_NAME", p.Position);
Here's the list of different scenarios.
-
@GTATerminal Ok, thanks
-
@TheChilliPL No problem.
-
@GTATerminal I have a question.
I wanna this:
Game.FadeScreenOut(1000)
[Wait 1000 ms]
player.Task.StartScenario(...);
Game.FadeScreenIn(1000);How to do it?
-
@TheChilliPL Well, I haven't tried the FadeScreen stuff yet. But I believe you just about nailed it.
Game.FadeScreenOut(1000); Wait(1000); player.Task.ClearAllImmediately(); player.Task.StartScenario("SCENARIO_NAME", position); Game.FadeScreenIn(1000);
-
Oh...
I tried
playerped.Rotation = (rotation)
after StartScenario, but It isn't working
-
@TheChilliPL That's because playerPed.Rotation is a 3D vector. You cannot define just one value for the whole.
Instead, you either have to use X, Y, or Z for it.playerPed.Rotation.X = rotation;
Or use this:
playerPed.Heading = rotation;
-
@GTATerminal Oh, I see
-
Sadly, when I try to change heading (both before and after Scenario),
I can't - it's 0
-
@TheChilliPL Could you post your code in pastebin so that I can go through it?
-
Can anybody help me?
I cannot rotate player when he's playing scenario...
-
@TheChilliPL Here, try this. Last shot at this. Use this instead of the Task.StartScenario
GTA.Native.Function.Call(Hash._0xFA4EFC79F69D4F07, new InputArgument[]{ playerped, 'SCENARIO_NAME', pos.X, pos.Y, pos.Z, rotation, 0, 1, 1});
-
@GTATerminal Not working