AntiCheat
#21
How can i use the ScheduleTask function of the World in C++?
I need the DelayTicks and cTask. What is cTask and how can i create them?
Reply
Thanks given by:
#22
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()
Reply
Thanks given by: daniel0916
#23
How must be the code to use a method as variable in cAntiCheatTask?
Current Code:
#pragma once

#include "../World.h"





class cAntiCheatTask :
	public cWorld::cTask
{
public:
	cAntiCheatTask()
	{
	}

protected:
	virtual void Run(cWorld & a_World) override
	{


	}
};
Reply
Thanks given by:
#24
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
    }
};
Reply
Thanks given by:
#25
nice ;D
Reply
Thanks given by:
#26
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
Reply
Thanks given by:




Users browsing this thread: 5 Guest(s)