SA-MP Forums Archive
[FilterScript] Anti Crasher for SA:MP 0.3.7 R2 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Anti Crasher for SA:MP 0.3.7 R2 (/showthread.php?tid=647318)



Anti Crasher for SA:MP 0.3.7 R2 - DimaShift - 03.01.2018

Hello friends!

A friend asked me to put my anti-crasher in the forum...

This anti crasher will protect your server from two types of crashers that they use cheaters:

1: Bullet crasher
2: Bad vehicle crasher (Invalid Seat)


The author is me.

If something is not clear, contact me on skype dima.shift or write in the comment!

The first script requires the pawn.RakNet plugin:
Code:
#include <a_samp>
#include <Pawn.RakNet>

#define BulletCrasher -5.5
#define red 0xFF0000FF
#define eight 8
#define two 2
#define NULL 0
#define PASSENGER_SYNC  211
#define VEHICLE_SYNC  200
#define PLAYER_SYNC 207

//Anti Crasher 0.3.7 R2 by [MD]_Shift | skype: dima.shift |
public OnIncomingPacket(playerid, packetid, BitStream:bs){
	switch(packetid) {
	case VEHICLE_SYNC:{
			new inCarData[PR_InCarSync];
			BS_IgnoreBits(bs, eight);
			BS_ReadInCarSync(bs, inCarData);
			if inCarData[PR_position][two] == BulletCrasher *then {
				new string[MAX_CHATBUBBLE_LENGTH];
				format(string,sizeof(string),"[Anti-CrasherHack]: {FFFF00}%s {999999}|ID:%d| {00FF00}auto-kick {FF0000}[Motivo: BulletCrasher]",GetName(playerid),playerid);
				SendClientMessageToAll(red,string);
				Kick(playerid);
				return false;
			}
		}
	case PLAYER_SYNC:{
			new onFootData[PR_OnFootSync];
			BS_IgnoreBits(bs,eight);
			BS_ReadOnFootSync(bs, onFootData);
			if onFootData[PR_position][two] == BulletCrasher *then {
				new string[MAX_CHATBUBBLE_LENGTH];
				format(string,sizeof(string),"[Anti-CrasherHack]: {FFFF00}%s {999999}|ID:%d| {00FF00}auto-kick {FF0000}[Motivo: BulletCrasher]",GetName(playerid),playerid);
				SendClientMessageToAll(red,string);
				Kick(playerid);
				return false;
			}
		}
	case PASSENGER_SYNC:{
			new passengerData[PR_PassengerSync];
			BS_IgnoreBits(bs, eight);
			BS_ReadPassengerSync(bs, passengerData);
			if GetPlayerVehicleSeat(playerid) == NULL *then {
				new string[MAX_CHATBUBBLE_LENGTH];
				format(string,sizeof(string),"[Anti-CrasherHack]: {FFFF00}%s {999999}|ID:%d| {00FF00}auto-kick {FF0000}[Motivo: BadVehicleCrasher]",GetName(playerid),playerid);
				SendClientMessageToAll(red,string);
				Kick(playerid);
				return false;
			}
			if passengerData[PR_position][two] == BulletCrasher *then {
				new string[MAX_CHATBUBBLE_LENGTH];
				format(string,sizeof(string),"[Anti-CrasherHack]: {FFFF00}%s {999999}|ID:%d| {00FF00}auto-kick {FF0000}[Motivo: BulletCrasher]",GetName(playerid),playerid);
				SendClientMessageToAll(red,string);
				Kick(playerid);
				return false;
			}
		}

	}
	return true;
}


stock GetName(playerid)
{
	new Name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, Name, sizeof(Name));
	return Name;
}
DOWNLOAD


For the second script there is no need for a plugin or something, just put the script in filterscripts and activate it in server.cfg:
Code:
#include <a_samp>
#define BulletCrasher -5.5
#define InvalidSeat1 -1000000.0
#define InvalidSeat2 1000000.0
#define red 0xFF0000FF

//Anti Crasher 0.3.7 R2 by [MD]_Shift | skype: dima.shift |

public OnPlayerUpdate(playerid){
	new Float:X,Float:Y,Float:Z;
	GetPlayerPos(playerid,X,Y,Z);
	if Z == BulletCrasher || !(InvalidSeat1 <= Z <= InvalidSeat2) *then {
		new tipcrasher[20];
		tipcrasher="BadVehicleCrasher";
		if Z == BulletCrasher *then tipcrasher="BulletCrasher";
		new string[MAX_CHATBUBBLE_LENGTH];
		format(string,sizeof(string),"[Anti-CrasherHack]: {FFFF00}%s {999999}|ID:%d| {00FF00}auto-kick {FF0000}[Motivo: %s]",GetName(playerid),playerid,tipcrasher);
		SendClientMessageToAll(red,string);
		Kick(playerid);
		return false;
	}
	return true;
}

stock GetName(playerid)
{
	new Name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, Name, sizeof(Name));
	return Name;
}
DOWNLOAD


Re: Anti Crasher for SA:MP 0.3.7 R2 - RogueDrifter - 03.01.2018

Interesting... you should mention that you need pawn.raknet for people who don't notice it.


Re: Anti Crasher for SA:MP 0.3.7 R2 - rfr - 03.01.2018

it's already stated in the includes @roguedrifter


Re: Anti Crasher for SA:MP 0.3.7 R2 - DimaShift - 03.01.2018

Quote:
Originally Posted by RogueDrifter
View Post
Interesting... you should mention that you need pawn.raknet for people who don't notice it.
is already in the file you are downloading


Re: Anti Crasher for SA:MP 0.3.7 R2 - DimaShift - 03.01.2018

Quote:
Originally Posted by rfr
View Post
it's already stated in the includes @roguedrifter
i have long put in commenting on the raknet plugin .. you can check it out


Re: Anti Crasher for SA:MP 0.3.7 R2 - DimaShift - 03.01.2018

Quote:
Originally Posted by rfr
View Post
it's already stated in the includes @roguedrifter
https://sampforum.blast.hk/showthread.php?tid=640306&page=6
you can check the date when i wrote .. and when did the @roguedrifter


Re: Anti Crasher for SA:MP 0.3.7 R2 - RogueDrifter - 03.01.2018

Quote:
Originally Posted by rfr
View Post
it's already stated in the includes @roguedrifter
I realize it's in the includes but i'm saying he should say that in his post. Anyway good job i'm gonna test this and see how it goes.


Re: Anti Crasher for SA:MP 0.3.7 R2 - DimaShift - 03.01.2018

Quote:
Originally Posted by RogueDrifter
View Post
I realize it's in the includes but i'm saying he should say that in his post. Anyway good job i'm gonna test this and see how it goes.

I added, and without plugin


Re: Anti Crasher for SA:MP 0.3.7 R2 - Trucksamp - 03.01.2018

thanks to the user


Re: Anti Crasher for SA:MP 0.3.7 R2 - IlanZ - 03.01.2018

Niice job.