1. /* AW_timers by [A]lien[W]are (Agus Juarez) (c)
  2. v1 - 27/1/2014
  3. EN: use: AW_SetTimer(call, time, repeats);
  4. ES: uso: AW_SetTimer(funcion, tiempo, repeticiones);
  5. */
  6. #include <a_samp>
  7. #define MAX_AW_TIMERS 1000
  8. /* - ---------------------- - */
  9. new aw_timer = -1,aw_aw_timer[MAX_AW_TIMERS],aw_call[MAX_AW_TIMERS],aw_time[MAX_AW_TIMERS],aw_repeat[MAX_AW_TIMERS];
  10. /* - ---------------------- - */
  11. stock AW_SetTimer(call, time, repeats) { aw_timer++; aw_call[aw_timer] = call; aw_time[aw_timer] = repeats; aw_repeat[aw_timer] = repeats; SetTimer(call, time, true); SetTimerEx("AW_D", time, true, "i", aw_timer); }
  12. forward AW_D(t);
  13. public AW_D(t)
  14. {
  15. if(aw_repeat[t] == 0)
  16. {
  17. KillTimer(aw_aw_timer[t]);
  18. aw_repeat[t] = 0;
  19. }
  20. else
  21. {
  22. aw_repeat[t]--;
  23. }
  24. return 1;
  25. }

By [A]lien[W]are - Agus Juarez