[C#] Custom Timer - serversided 1.1

   (3 reviews)

About This File

With this script you can easily create custom timer.
The file is fully commented and should be easy to understand.

You have to use Timer.SetTimer to create the timer.



// Yes, the method can be private //
private void testTimerFunc(Client player, string text)
    NAPI.Chat.SendChatMessageToPlayer(player, "[TIMER] " + text);

void testTimerFunc()
    NAPI.Chat.SendChatMessageToAll("[TIMER2] Hello");

public void timerTesting(Client player)
    // Lamda for parameter //
    Timer.SetTimer(() => testTimerFunc(player, "hi"), 1000, 1);
    // Normal without parameters //
    Timer.SetTimer(testTimerFunc, 1000, 1);
    // Without existing method //
    Timer.SetTimer(() => { NAPI.Chat.SendChatMessageToPlayer(player, "[TIMER3] Bonus is da best"); }, 1000, 0);


What's New in Version 1.1   See changelog


Use Stopwatch instead of Environment.TickCount as it's only an int and can be negative.

Thx to Max Jackson for reporting the bug.

  • Like 2
  • Mask 1

User Feedback

Create an account or sign in to leave a review

You need to be a member in order to leave a review

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


   1 of 1 member found this review helpful 1 / 1 member

very nice file, 

  • Like 1

Share this review

Link to review

   1 of 2 members found this review helpful 1 / 2 members

I like it. It looks like MTA method.

  • Like 1
  • Confused 1

Share this review

Link to review

   1 of 2 members found this review helpful 1 / 2 members


Share this review

Link to review