SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 21/10/2017, 04:26 AM   #101
DimaShift
Banned
 
Join Date: May 2017
Location: Republic of Moldova
Posts: 123
Reputation: 43
Default Re: Pawn.RakNet - write the best anticheat

Anti-Jetpack (Anti-Cheat)

Tt is allowed to use jetpack, only rcon admin!

Code:
const PLAYER_SYNC = 207;

IPacket:PLAYER_SYNC(playerid, BitStream:bs)
	{
		new onFootData[PR_OnFootSync];
		BS_IgnoreBits(bs, 8);
		BS_ReadOnFootSync(bs, onFootData);
		if(!IsPlayerAdmin(playerid) && onFootData[PR_specialAction] == SPECIAL_ACTION_USEJETPACK) {
			new string[144],name[MAX_PLAYER_NAME];
			GetPlayerName(playerid, name, sizeof(name));
			format(string,sizeof(string),"{FF0000}[Anti-JetpackHack]: {FFFF00}%s {999999}(ID:%d) {00FF00}auto-kicked {FF0000}[Reason: JetpackHack]", name,playerid);
			SendClientMessageToAll(-Unu, string);
			string[0] = EOS;
			Kick(playerid);
			return false;
		}
		return true;
	}
DimaShift is offline   Reply With Quote
Old 21/10/2017, 06:47 AM   #102
Spmn
Gangsta
 
Join Date: Jun 2015
Location: Romania
Posts: 540
Reputation: 129
Default Re: Pawn.RakNet - write the best anticheat

Quote:
Originally Posted by DimaShift View Post
I agree with you that it is possible! but with this plugin works "anti-cheat" faster server!

if we remember (optimization) the server does not like "SetTimer" or "OnPlayerUpdate"! this plug-in is perfect for the server, in them is all we can for "anti-cheat"!
Faster? No.
There is no performance difference between OnPlayerUpdate and callbacks added by raknet manager.
Spmn is offline   Reply With Quote
Old 21/10/2017, 06:51 AM   #103
DimaShift
Banned
 
Join Date: May 2017
Location: Republic of Moldova
Posts: 123
Reputation: 43
Default Re: Pawn.RakNet - write the best anticheat

Anti - CleoFly (Anti-Cheat)

He catches only cleo fly!

Code:
const PLAYER_SYNC = 207;

IPacket:PLAYER_SYNC(playerid, BitStream:bs)
	{
		new onFootData[PR_OnFootSync];
		BS_IgnoreBits(bs, 8);
		BS_ReadOnFootSync(bs, onFootData);
		if(onFootData[PR_animationId] == 958 && onFootData[PR_weaponId] != WEAPON_PARACHUTE || onFootData[PR_animationId] == 959 && onFootData[PR_weaponId] != WEAPON_PARACHUTE){
			new string[144],name[MAX_PLAYER_NAME];
			GetPlayerName(playerid, name, sizeof(name));
			format(string,sizeof(string),"{FF0000}[Anti-CleoFly]: {FFFF00}%s {999999}(ID:%d) {00FF00}auto-kicked {FF0000}[Reason: CleoFly]", name,playerid);
			SendClientMessageToAll(-1, string);
			string[0] = EOS;
			Kick(playerid);
			return false;
		}
		return true;
	}

Last edited by DimaShift; 21/10/2017 at 08:23 AM.
DimaShift is offline   Reply With Quote
Old 21/10/2017, 07:11 AM   #104
DimaShift
Banned
 
Join Date: May 2017
Location: Republic of Moldova
Posts: 123
Reputation: 43
Default Re: Pawn.RakNet - write the best anticheat

Quote:
Originally Posted by Spmn View Post
Faster? No.
There is no performance difference between OnPlayerUpdate and callbacks added by raknet manager.
not correct I said, i used g00gle translate!
I wanted to say "it works better"!
DimaShift is offline   Reply With Quote
Old 21/10/2017, 07:44 AM   #105
Kaperstone
High-roller
 
Kaperstone's Avatar
 
Join Date: May 2011
Location: Russia
Posts: 3,352
Reputation: 824
Default Re: Pawn.RakNet - write the best anticheat

Quote:
Originally Posted by DimaShift View Post
Anti - CleoFly (Anti-Cheat)

He catches only cleo fly!

Code:
const PLAYER_SYNC = 207;

IPacket:PLAYER_SYNC(playerid, BitStream:bs)
	{
		new onFootData[PR_OnFootSync];
		BS_IgnoreBits(bs, 8);
		BS_ReadOnFootSync(bs, onFootData);
		if(onFootData[PR_animationId] == 958 && onFootData[PR_weaponId] != WEAPON_PARACHUTE){
			new string[144],name[MAX_PLAYER_NAME];
			GetPlayerName(playerid, name, sizeof(name));
			format(string,sizeof(string),"{FF0000}[Anti-CleoFly]: {FFFF00}%s {999999}(ID:%d) {00FF00}auto-kicked {FF0000}[Reason: CleoFly]", name,playerid);
			SendClientMessageToAll(-Unu, string);
			string[0] = EOS;
			Kick(playerid);
			return false;
		}
		return true;
	}
afaik animation id 959 is also used for fly hack.

EDIT: this include checks for more animations
https://github.com/pds2k12/OnPlayerF...yerFly.inc#L59
(Ain't sure what they are)

There is a hack as I remember to fly with swimming animation.
__________________
Kaperstone is offline   Reply With Quote
Old 21/10/2017, 07:57 AM   #106
DimaShift
Banned
 
Join Date: May 2017
Location: Republic of Moldova
Posts: 123
Reputation: 43
Default Re: Pawn.RakNet - write the best anticheat

Quote:
Originally Posted by Kaperstone View Post
afaik animation id 959 is also used for fly hack.

EDIT: this include checks for more animations
https://github.com/pds2k12/OnPlayerF...yerFly.inc#L59
(Ain't sure what they are)

There is a hack as I remember to fly with swimming animation.
thanks!

I just made this type fly of cleo https://www.*******.com/watch?v=6W0r1LWlQ8c&t=42s
DimaShift is offline   Reply With Quote
Old 22/10/2017, 09:56 AM   #107
Mcc
Huge Clucker
 
Join Date: May 2015
Posts: 468
Reputation: 19
Default Re: Pawn.RakNet - write the best anticheat

anti car-jack pls))
Mcc is offline   Reply With Quote
Old 22/10/2017, 02:02 PM   #108
DimaShift
Banned
 
Join Date: May 2017
Location: Republic of Moldova
Posts: 123
Reputation: 43
Default Re: Pawn.RakNet - write the best anticheat

Anti-CarJack (Anti-Cheat)
Cheat https://www.*******.com/watch?v=W3lnsY_DNBg

Code:
#include <a_samp>
#include <Pawn.RakNet>

new GetPlayerVehicleId[MAX_PLAYERS];
const VEHICLE_SYNC = 200;

IPacket:VEHICLE_SYNC(playerid, BitStream:bs)
{
	new inCarData[PR_InCarSync];
	BS_IgnoreBits(bs, 8);
	BS_ReadInCarSync(bs, inCarData);
	if(IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleId[playerid] != inCarData[PR_vehicleId]) {//I put it IsPlayerInAnyVehicle(playerid), the packet gets updated faster than PutPlayerInVehicle so we do not get bug
		new string[144],name[MAX_PLAYER_NAME];
		GetPlayerName(playerid, name, sizeof(name));
		format(string,sizeof(string),"{FF0000}[Anti-CarJack]: {FFFF00}%s {999999}(ID:%d) {00FF00}auto-kicked {FF0000}[Reason: CarJack]", name,playerid);
		SendClientMessageToAll(-1, string);
		string[0] = EOS;
		Kick(playerid);
		return false;
	}
	return true;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) return GetPlayerVehicleId[playerid] = vehicleid;


public OnPlayerStateChange(playerid, newstate, oldstate){
	switch(oldstate){
	case PLAYER_STATE_PASSENGER: return GetPlayerVehicleId[playerid] = -1;
	case PLAYER_STATE_DRIVER: return GetPlayerVehicleId[playerid] = -1;}
	return true;
}

public OnPlayerDisconnect(playerid, reason)
{
	GetPlayerVehicleId[playerid] = 0;
	return true;
}


/*exemple if you will use it PutPlayerInVehicle

cmd:infernus(playerid)
{
	static Float:X,Float:Y,Float:Z,Float:Angle;
	GetPlayerPos(playerid,X,Y,Z);
	GetPlayerFacingAngle(playerid,Angle);
	GetPlayerVehicleId[playerid] = CreateVehicle(411,X,Y,Z+2,Angle,random(255),random(255),-1,-1);
	SetVehicleVirtualWorld(GetPlayerVehicleId[playerid],GetPlayerVirtualWorld(playerid));
	LinkVehicleToInterior(GetPlayerVehicleId[playerid], GetPlayerInterior(playerid));
	PutPlayerInVehicle(playerid,GetPlayerVehicleId[playerid],0);
	return true;
}*/
DimaShift is offline   Reply With Quote
Old 22/10/2017, 06:49 PM   #109
HydraHumza
Gangsta
 
HydraHumza's Avatar
 
Join Date: Oct 2014
Posts: 651
Reputation: 130
Default Re: Pawn.RakNet - write the best anticheat

Really appreciate ur effort Dima Shift why not make a different thread with all this anti cheat would help all the other people.
__________________
Quote:
Originally Posted by Kalcor View Post
The fact is, I am right. And if you think I'm wrong, you are wrong.
HydraHumza is offline   Reply With Quote
Old 23/10/2017, 04:21 PM   #110
DimaShift
Banned
 
Join Date: May 2017
Location: Republic of Moldova
Posts: 123
Reputation: 43
Default Re: Pawn.RakNet - write the best anticheat

Quote:
Originally Posted by HydraHumza View Post
Really appreciate ur effort Dima Shift why not make a different thread with all this anti cheat would help all the other people.
I've written a few (anti-crashers) but administrators deleted! because I do not explain every word, but I'm not a poet to write texts!
DimaShift is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tutorial] Pacotes - Pawn.RakNet Jelly23 Lançamentos/Releases 33 23/06/2018 09:49 PM
[Tutorial] Handlers - Pawn.RakNet Jelly23 Tutorials 6 29/01/2018 11:46 PM
[Tutorial] Handlers - Pawn.RakNet Jelly23 Lançamentos/Releases 14 02/01/2018 11:04 PM
[Tutorial] RPC - Pawn.RakNet Jelly23 Tutorials 21 13/12/2017 09:51 PM
[Tutorial] Packets - Pawn.RakNet Jelly23 Tutorials 2 16/11/2017 05:46 PM


All times are GMT. The time now is 05:55 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.