03-11-2014, 01:37 AM
03-11-2014, 06:07 AM
cTask is an interface class. When you want to use it, you declare a new class that derives from it, and overrides its Execute method. Then you create a new instance of that class on the heap (new cMyTask(...)) and pass that to cWorld::ScheduleTask()
03-12-2014, 04:53 AM
How must be the code to use a method as variable in cAntiCheatTask?
Current Code:
Current Code:
#pragma once #include "../World.h" class cAntiCheatTask : public cWorld::cTask { public: cAntiCheatTask() { } protected: virtual void Run(cWorld & a_World) override { } };
03-12-2014, 09:33 PM
Just add a member variable and possibly initialize it in the constructor, or provide a setter to call:
class cAntiCheatTask : public cWorld::cTask { public: cAntiCheatTask(int a_Var1) : m_Var1(a_Var1) { } void SetVar2(int a_Var2) { m_Var2 = a_Var2; } protected: int m_Var1; int m_Var2; virtual void Run(cWorld & a_World) override { int Total = m_Var1 + m_Var2; // example } };
03-15-2014, 04:54 AM
nice ;D
09-09-2014, 03:09 AM
This thread seems to be abandoned, however, if someone is still interested in how to detect mods,
You can always take a look how does the nocheat does it.
https://github.com/NoCheatPlus/NoCheatPlus
You can always take a look how does the nocheat does it.
https://github.com/NoCheatPlus/NoCheatPlus