Timers: Wiki misunderstanding
Hi, I'm using timers very often, and try to avoid handles as far as possible.
But I'm having troubles with the callback of a one-time timer using client serial (or user id) because the English wiki and RU wiki don't say the exact same. I also searched here: https://sm.alliedmods.net/new-api/timers/Timer Concerning the callback return, it says "Plugin_Stop to stop a repeating timer, any other value for default behavior." So I'd like to know what to write at the end of such a timer: PHP Code:
St00ne |
Re: Timers: Wiki misunderstanding
The documentation for the API page should be correct. (If it's not, file a bug report with code to reproduce and an explanation of what it is doing and what you think it should be doing.)
Since your example doesn't have a repeating timer, it doesn't actually matter what you return. |
Re: Timers: Wiki misunderstanding
Thx for your answer. The logic of a repeated timer is well explained. I am wondering about a one-time timer situation, like in the example.
|
Re: Timers: Wiki misunderstanding
You are not using a repeating timer, so you can return any value or nothing, it doesn't matter for one time timers.
If you use a repeating timer, return Plugin_Continue will make the timer to repeat again, Plugin_Handled or Plugin_Stop will stop it. You can use this without problems: PHP Code:
|
Re: Timers: Wiki misunderstanding
Mmh ok, so "continue" or "handled" doesn't have a consequence here. Thx for your answers. I'll put this as solved if there are no more answers for a couple of days.
|
Re: Timers: Wiki misunderstanding
You are working with defines/enums, which are defined in sourcemod\scripting\include\core.inc
PHP Code:
I bet that the timers would just have an if like: "if(bla == Plugin_Stop) ... else...", so it's possible that any other value than 4 might serve your needs. |
All times are GMT -4. The time now is 04:39. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.