C#C
C#3y ago
xTagz_

❔ 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();
}

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.
Was this page helpful?
❔ How to make a line of code run every x seconds? - C#