View Single Post
deejayy
Junior Member
Join Date: Mar 2005
Old 03-11-2014 , 08:53   Re: HLDS-V8: Extending HLDS with V8 JavaScript engine
Reply With Quote #9

Detecting no-spread cheat ("shaky" screen):

Code:
function CmdStart(params)
{
	var p = players[params.id] || new player();
	if (p.viewangles.x == params.viewangles.x || p.viewangles.y == params.viewangles.y) {
		p.nospread *= 0.9;
	} else {
		p.nospread += 1;
	}
	if (p.nospread > 1000) {
		console.log("No-spread cheat detected! " + v8.getPlayerName(params.id));
	}
	p.viewangles.x = params.viewangles.x;
	p.viewangles.y = params.viewangles.y;
};
__________________

Last edited by deejayy; 03-11-2014 at 09:04.
deejayy is offline