Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ScriptPCH.h"
- #define Delay 60000 // 60 seconds
- class TimedTest : public WorldScript
- {
- public:
- TimedTest() : WorldScript("TimedTest")
- {
- Time = 0; // initialize Time, cant check else
- }
- void OnUpdate(uint32 diff)
- {
- if(Time >= Delay) // Check if time has passed delay
- {
- sWorld->SendServerMessage(SERVER_MSG_STRING, "Test");
- Time = 0; // reset time
- }
- else
- Time += diff; // Update Time
- }
- private:
- uint32 Time;
- };
- void AddSC_TimedTest()
- {
- new TimedTest();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement