timerNameCallBack? working with timers

Status
Not open for further replies.

coersum

Plugin Developer
Plugin Developer
Oct 9, 2014
77
5
8
47
Parts Unknown
So I was trying to make a lil timer for airdrop in my main plugin (misc plugin for my server) with a command to start/stop the run but I can't get the callback to run.


Python:
                if command == "testtimer":
                    Plugin.CreateTimer("droptimer", 60000).Start() #that's 60sec right ? for test only :)
                    Player.Message("Airdrop timer Started")
then the callback is supposed to be evt.Name + "Callback" so:

Python:
    def droptimerCallBack(self, timer):
        Server.Broadcast("TimerCallBackOccured!")
I don't have any test to know if the timer has already been started yet, just trying to figure how timers work as I never get the broadcast even if setting the timer to 10000, 1000, 100 lol (I believe the number should be in milliseconds so 10000 = 10sec.
 
Last edited:

balu92

Moderator
Moderator
Jul 11, 2014
338
75
28
33
So I was trying to make a lil timer for airdrop in my main plugin (misc plugin for my server) with a command to start/stop the run but I can't get the callback to run.


Python:
                if command == "testtimer":
                    Plugin.CreateTimer("droptimer", 60000).Start() #that's 60sec right ? for test only :)
                    Player.Message("Airdrop timer Started")
then the callback is supposed to be evt.Name + "Callback" so:

Python:
    def droptimerCallBack(self, timer):
        Server.Broadcast("TimerCallBackOccured!")
I don't have any test to know if the timer has already been started yet, just trying to figure how timers work as I never get the broadcast even if setting the timer to 10000, 1000, 100 lol (I believe the number should be in milliseconds so 10000 = 10sec.
Callback and not CallBack
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,065
4,488
113
At your house.
github.com
So I was trying to make a lil timer for airdrop in my main plugin (misc plugin for my server) with a command to start/stop the run but I can't get the callback to run.


Python:
                if command == "testtimer":
                    Plugin.CreateTimer("droptimer", 60000).Start() #that's 60sec right ? for test only :)
                    Player.Message("Airdrop timer Started")
then the callback is supposed to be evt.Name + "Callback" so:

Python:
    def droptimerCallBack(self, timer):
        Server.Broadcast("TimerCallBackOccured!")
I don't have any test to know if the timer has already been started yet, just trying to figure how timers work as I never get the broadcast even if setting the timer to 10000, 1000, 100 lol (I believe the number should be in milliseconds so 10000 = 10sec.
Well millisecs are not cool at all. Tho it should work. I gave somewhere an example on the forum

Sent from my Samsung Galaxy S4
 
Status
Not open for further replies.