xTagz_
xTagz_
CC#
Created by xTagz_ on 11/4/2023 in #help
❔ How to make a line of code run every x seconds?
I have this function:
public override void Process()
{
Suspect.Tasks.PlayAnimation("amb@world_human_aa_smoke@male@idle_a", "idle_a", 1, AnimationFlags.None); //Line that i want to be run every x seconds
Thread.Sleep(1000);
if (STPFunctions.isPedStopped(Suspect))
{
End();
}
base.Process();
}
public override void Process()
{
Suspect.Tasks.PlayAnimation("amb@world_human_aa_smoke@male@idle_a", "idle_a", 1, AnimationFlags.None); //Line that i want to be run every x seconds
Thread.Sleep(1000);
if (STPFunctions.isPedStopped(Suspect))
{
End();
}
base.Process();
}
This function repeats as fast as it can, and i want to keep that but make one line run only once every x seconds. This may sound weird but i think you will understand.
40 replies