[Plugin] Pawn.RakNet
#41

how can I know when player do ESC?
Reply
#42

Quote:
Originally Posted by DimaShift
Посмотреть сообщение
Anti-InvalidSeat (Anti-Crasher)



Код:
const PASSENGER_SYNC = 211;

IPacket:PASSENGER_SYNC(playerid, BitStream:bs){
	if GetPlayerVehicleSeat(playerid) == 0 *then{
		new string[100],name[MAX_PLAYER_NAME];
		GetPlayerName(playerid, name, sizeof(name));
		format(string,sizeof(string),"[Anti-CrasherHack]: %q (ID:%d) auto-kicked [Reason: InvalidSeat]",name,playerid);
		SendClientMessageToAll(-1,string);
		string[0] = EOS;
		Kick(playerid);
		return false;
	}
	return true;
}
Very good!!!
Reply
#43

I need an anti-airbreak for my server because my server has system build base and not with airbreak spoils the whole game. Is it possible to do an anti-airbreak with this plugin?

Sorry my bad english
Reply
#44

Quote:
Originally Posted by KoloradO
Посмотреть сообщение
I need an anti-airbreak for my server because my server has system build base and not with airbreak spoils the whole game. Is it possible to do an anti-airbreak with this plugin?

Sorry my bad english
Look for onplayerairbreak.inc
Reply
#45

Wrong place, sorry!
Reply
#46

I've tried to use it, but for my server this does not help much. I need something to detect at the same time.
Reply
#47

won't it increase latency?

As I understood it works like so
sampgdk(Receive data) > pawn(Pawn.RakNet) > sampgdk(Process) >pawn(the rest) ?
Reply
#48

It works without sampgdk.
Reply
#49

Quote:
Originally Posted by YourShadow
Посмотреть сообщение
It works without sampgdk.
I meant the latency, won't it increase the time taken to process data?
Reply
#50

Quote:
Originally Posted by YourShadow
Посмотреть сообщение
It works without sampgdk.
Can you publish us examples of this plugin.
Reply
#51

Quote:
Originally Posted by Max_Andolini
Посмотреть сообщение
Can you publish us examples of this plugin.
There are some on GitHub's wiki
https://github.com/urShadow/Pawn.RakNet/wiki
Reply
#52

Quote:
Originally Posted by Kaperstone
Посмотреть сообщение
I meant the latency, won't it increase the time taken to process data?
Insignificantly.

Plugin works well with 1000 players online.
Reply
#53

Quote:
Originally Posted by YourShadow
Посмотреть сообщение
Insignificantly.

Plugin works well with 1000 players online.
Can I detect ESC?
Reply
#54

Quote:
Originally Posted by GuyYahood1
Посмотреть сообщение
Can I detect ESC?
test this!


Код:
#include <a_samp>
#include <Pawn.RakNet>


new bool:PlayerAFK[MAX_PLAYERS],TimerEx[MAX_PLAYERS];

forward OnPlayerAFK(playerid);

public OnPlayerConnect(playerid)
{
   TimerEx[playerid] = SetTimerEx("OnPlayerAFK", 1000, true, "i", playerid);
   return true;
}

public OnIncomingPacket(playerid, packetid, BitStream:bs) 
{
    PlayerAFK[playerid] = false;
    return true;
}


public OnPlayerAFK(playerid) return PlayerAFK[playerid] = true;


public OnPlayerDisconnect(playerid, reason)
{
    KillTimer(TimerEx[playerid]);
    TimerEx[playerid] = 0;
    PlayerAFK[playerid] = false;
    return true;
}
    

/* if(PlayerAFK[playerid] == true){
 player is pause
 }else{
not in pause
}*/
Reply
#55

Can you make anti-airbreak system with that?
Reply
#56

Quote:
Originally Posted by CodeStyle175
Посмотреть сообщение
Can you make anti-airbreak system with that?
If you meant is it possible to make such system, yes.
Reply
#57

Quote:
Originally Posted by CodeStyle175
Посмотреть сообщение
Can you make anti-airbreak system with that?
No.


This plugin gives you functions to manipulate/modify packets before they are being processed by your server. (as well as deny them)

I don't think there is a callback that is being triggered like a "OnPlayerRequestAirbreak" therefore you'd need to play with player coordinates to detect it, there is an include by Kar as far as I know, that does that job.


@DimaShift, I like your approach, tho, I think it would be nicer to do it with y_iterate and a single timer than timer for each player.
Reply
#58

That Kar include sucks, because those distances and false rates are too big and it detects when player is flying to the other side of the map and then also its questionable.
Reply
#59

Quote:
Originally Posted by CodeStyle175
Посмотреть сообщение
That Kar include sucks, because those distances and false rates are too big and it detects when player is flying to the other side of the map and then also its questionable.
Emmet wrote an airbreak include which I think is pretty accurate. OnPlayerAirbreak. Isn't being updated though as he has pretty much abandoned SA-MP from what I know.
Reply
#60

Anti-SpeedHack

Anti-SpeedCar
Код:
const VEHICLE_SYNC = 200;

IPacket:VEHICLE_SYNC(playerid, BitStream:bs)
	{
		new inCarData[PR_InCarSync];
		BS_IgnoreBits(bs, 8);
		BS_ReadInCarSync(bs, inCarData);
		static Float:S = floatsqroot(floatpower(floatabs(inCarData[PR_velocity][0]), 2.0) + floatpower(floatabs(inCarData[PR_velocity][1]), 2.0) + floatpower(floatabs(inCarData[PR_velocity][2]), 2.0)) * 253.3;
		if(S > 350.0) {
			new string[144],name[MAX_PLAYER_NAME];
			GetPlayerName(playerid, name, sizeof(name));
			format(string,sizeof(string),"{FF0000}[Anti-SpeedCar]: {FFFF00}%s {999999}(ID:%d) {00FF00}auto-kicked {FF0000}[Reason: SpeedCar]", name,playerid);
			SendClientMessageToAll(-Unu, string);
			string[0] = EOS;
			Kick(playerid);
			return false;
		}
		return true;
	}
Anti-SpeedSkin
Код:
const PLAYER_SYNC = 207;

IPacket:PLAYER_SYNC(playerid, BitStream:bs)
	{
		new onFootData[PR_OnFootSync];
		BS_IgnoreBits(bs, 8);
		BS_ReadInCarSync(bs, onFootData);
		static Float:S = floatsqroot(floatpower(floatabs(onFootData[PR_velocity][0]), 2.0) + floatpower(floatabs(onFootData[PR_velocity][1]), 2.0) + floatpower(floatabs(onFootData[PR_velocity][2]), 2.0)) * 253.3;
		if(S > 100.0) {
			new string[144],name[MAX_PLAYER_NAME];
			GetPlayerName(playerid, name, sizeof(name));
			format(string,sizeof(string),"{FF0000}[Anti-SpeedSkin]: {FFFF00}%s {999999}(ID:%d) {00FF00}auto-kicked {FF0000}[Reason: SpeedSkin]", name,playerid);
			SendClientMessageToAll(-Unu, string);
			string[0] = EOS;
			Kick(playerid);
			return false;
		}
		return true;
	}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)