- /* AW_timers by [A]lien[W]are (Agus Juarez) (c)
- v1 - 27/1/2014
- EN: use: AW_SetTimer(call, time, repeats);
- ES: uso: AW_SetTimer(funcion, tiempo, repeticiones);
- */
- #include <a_samp>
- #define MAX_AW_TIMERS 1000
- /* - ---------------------- - */
- 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];
- /* - ---------------------- - */
- /*EN: Fix the 'call'
- ES: Funcion arreglada*/
- stock AW_SetTimer(call[], time, repeats) { aw_timer++; aw_call[aw_timer] = call; aw_time[aw_timer] = time; aw_repeat[aw_timer] = repeats; SetTimer(call, time, true); SetTimerEx("AW_D", time, true, "i", aw_timer); }
- forward AW_D(t);
- public AW_D(t)
- {
- if(aw_repeat[t] == 0)
- {
- KillTimer(aw_aw_timer[t]);
- aw_repeat[t] = 0;
- }
- else
- {
- aw_repeat[t]--;
- }
- return 1;
- }