Jump to content
Sign in to follow this  
Naiss

Coding anti-Cheat

Recommended Posts

okay so im trying to code an anti-cheat but i don't know how i would check if an variable get changed without the server doing it

someone please explain :)

Thanks

Share this post


Link to post
Share on other sites

somone please :)

Share this post


Link to post
Share on other sites

if ( isPlayer ) then { [] spawn { _endless = false; waitUntil { sleep 5; your-code-goes-here _endless }; }; };

This makes an infinitely-repeating loop that runs every 5 seconds, and happens only on the client.

Share this post


Link to post
Share on other sites

If there are variables which only the server should be using, add them to BattlEye scripts.txt.

If the client should have read-only access to the variable, keep the root variable on server machine and periodically copy it and broadcast the copy.

Alternatively, if the client should have write-access to the variable, pipe it through one function and use BattlEye exceptions to ensure the access is only made through that function.

As for generic anti cheat, just use infistars or spyglass by Tonic. Smart coders have been down this road already, no need to find a different method.

Share this post


Link to post
Share on other sites

I'm not very familiar with script injectors (nor would I feel comfortable downloading one, if I even knew where to), but you can "watch" a variable with code similar to this:

"myGlobalVariable" spawn
{
while {true} do
{
	_temp = missionNamespace getVariable _this;
	waitUntil {(missionNamespace getVariable _this) != _temp};

	//check if change was legitimate
	//if change was not legitimate either warn player and incriment warning count or end mission for player
};
};

Of course, this only works for global variables and specifically for the reason why global variables are recommended to be used sparingly (global vars are available in all scopes)

Edited by DreadedEntity

Share this post


Link to post
Share on other sites
As for generic anti cheat, just use infistars or spyglass by Tonic. Smart coders have been down this road already, no need to find a different method.

we i need to make sure i got permission first from tonic to use it and spyglass is made for altis life, so if i use that in my own framework that i made it may be abit weird stuff happening if you know what im saying :P

Share this post


Link to post
Share on other sites
we i need to make sure i got permission first from tonic to use it and spyglass is made for altis life, so if i use that in my own framework that i made it may be abit weird stuff happening if you know what im saying :P

You are free to nitpick it and stuff so long as you are not selling it like that moron infistar.

Share this post


Link to post
Share on other sites

thanks tonic and it wont happen

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×