[FS|0.2] Player Protections (DB, TK, Heli, Spawnkill, Ping, Spam)
#21

Quote:
Originally Posted by Warriors_Tornado
i have ping kicker in admin script
Then change
Code:
#define PING_PROTECTION 1
to...
Code:
#define PING_PROTECTION 0
and it won't run.
Reply
#22

OMG


now your script is S U B E R B

Run in my server perfectly


regards
Reply
#23

If this filter script have a votekick and boteban system ...


And your excelent SPEC srcipt filtar integrated ...



Its a Auto admin server


regards
Reply
#24

tHIS Script is PERFECT!
It would be more perfect by when someone was trying to drive-by,spam,hellikill, get a warning.
Reply
#25

OMG :O this rux
Reply
#26

Is this working for windows?
Reply
#27

Quote:
Originally Posted by croherzegovina
Is this working for windows?
yes.
Reply
#28

sorry link death please !
Reply
#29

Quote:
Originally Posted by lepompier
sorry link death please !
if you are saying the links are dead

might want to try this one
works fine for me
http://pastebin.ca/611136
Reply
#30

not it not work for me regrettable
snif
Reply
#31

link is not working can u reupload the FS please
i wanna download it
Reply
#32

heres some links:





Reply
#33

thank u very much


very cool script
i love it


Regards
Reply
#34

why i cannot download?
Reply
#35

Copy, paste in pawno and compile

Code:
/*******************************************************************************
 Player Protections (Driveby, teamkill, helikill, spawnkill, chat spam, ping)
 Created 2007 - HAMM3R
 -
 Driveby detection elements adapted from code by Serafim
 -
 Modify it, erase it, explode it with a nuclear warhead... I don't care.
*******************************************************************************/

#include <a_samp>

// ADJUST THESE TO MODIFY EACH PROTECTION'S SETTINGS
#define HELIKILL_PROTECTION 0
#define HELIKILL_MAX_KILLS 2
#define HELIKILL_TIMELIMIT 600 // 10 MINUTES

#define DRIVEBY_PROTECTION 1
#define DRIVEBY_MAX_KILLS 2
#define DRIVEBY_TIMELIMIT 600 // 10 MINUTES

#define TEAMKILL_PROTECTION 0
#define TEAMKILL_MAX_KILLS 5
#define TEAMKILL_TIMELIMIT 600 // 10 MINUTES

#define SPAWNKILL_PROTECTION 0
#define SPAWNKILL_MAX_KILLS 4
#define SPAWNKILL_TIMELIMIT 40 // 40 SECONDS

#define SPAM_PROTECTION 1
#define SPAM_MAX_MSGS 5
#define SPAM_TIMELIMIT 8 // 8 SECONDS

#define PING_PROTECTION 0
#define PING_MAX_EXCEEDS 5 // Do NOT set this to 1 - Pings are very high when a player first joins
#define PING_TIMELIMIT 60 // 1 MINUTE
#define PING_MAX_PING 2000 // 250ms PING

forward Float:GetDistanceBetweenPlayers(p1,p2);
forward PingProtection();

new gSpamCount[MAX_PLAYERS][2];
new gTeamkillCount[MAX_PLAYERS][2];
new gHelikillCount[MAX_PLAYERS][2];
new gSpawnkillCount[MAX_PLAYERS][MAX_PLAYERS][2];
new gDrivebyCount[MAX_PLAYERS][2];
new gPingCount[MAX_PLAYERS][2];

public OnFilterScriptInit()
{
	#if PING_PROTECTION
		SetTimer("PingProtection", 5000, 1);
	#endif
	return 1;
}

public OnPlayerConnect(playerid)
{
	gTeamkillCount[playerid][0] = 0;
	gTeamkillCount[playerid][1] = 0;
	gHelikillCount[playerid][0] = 0;
	gHelikillCount[playerid][1] = 0;
	gDrivebyCount[playerid][0] = 0;
	gDrivebyCount[playerid][1] = 0;
	gSpamCount[playerid][0] = 0;
	gSpamCount[playerid][1] = 0;
	gPingCount[playerid][0] = 0;
	gPingCount[playerid][1] = 0;

	for(new x=0; x<MAX_PLAYERS; x++) {
	  gSpawnkillCount[playerid][x][0] = 0;
	  gSpawnkillCount[playerid][x][1] = 0;
	}
	return 1;
}

public OnPlayerText(playerid, text[])
{
	#if SPAM_PROTECTION
		SpamProtection(playerid);
	#endif
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	if(reason == 50) {
		#if HELIKILL_PROTECTION
	  	HelikillProtection(killerid);
		#endif
	}
	if(GetPlayerTeam(killerid) == GetPlayerTeam(playerid)) {
		#if TEAMKILL_PROTECTION
	  	TeamkillProtection(killerid);
		#endif
	}
	if(!IsPlayerInAnyVehicle(playerid) && GetPlayerState(killerid) == PLAYER_STATE_DRIVER &&
		(reason == WEAPON_TEC9 || reason == WEAPON_UZI || reason == WEAPON_MP5) &&
		GetDistanceBetweenPlayers(playerid,killerid) < 100) {
		#if DRIVEBY_PROTECTION
	  	DrivebyProtection(killerid);
		#endif
	}
	#if SPAWNKILL_PROTECTION
  		SpawnkillProtection(killerid,playerid);
	#endif

	return 1;
}

stock TeamkillProtection(killerid)
{
	new string[64];
	if(gTeamkillCount[killerid][0] == 0) { gTeamkillCount[killerid][1] = TimeStamp(); }

  gTeamkillCount[killerid][0]++;
	if(TimeStamp() - gTeamkillCount[killerid][1] > DRIVEBY_TIMELIMIT) {
		gTeamkillCount[killerid][0] = 1;
		gTeamkillCount[killerid][1] = TimeStamp();
	}
	else if(gTeamkillCount[killerid][0] == DRIVEBY_MAX_KILLS) {
		format(string,sizeof(string),"*** %s has been kicked (Excessive teamkilling)",GetName(killerid));
		SendClientMessageToAll(0xC8BEBEAA,string);
		Kick(killerid);
	}
	else if(gTeamkillCount[killerid][0] == DRIVEBY_MAX_KILLS-1) {
	  SendClientMessage(killerid,0xC8BEBEAA,"*** Stop teamkilling - Next one is a kick");
 	}
	return 1;
}

stock HelikillProtection(killerid)
{
	new string[64];
	if(gHelikillCount[killerid][0] == 0) { gHelikillCount[killerid][1] = TimeStamp(); }

  gHelikillCount[killerid][0]++;
	if(TimeStamp() - gHelikillCount[killerid][1] > HELIKILL_TIMELIMIT) {
		gHelikillCount[killerid][0] = 1;
		gHelikillCount[killerid][1] = TimeStamp();
	}
	else if(gHelikillCount[killerid][0] == HELIKILL_MAX_KILLS) {
		format(string,sizeof(string),"*** %s has been kicked (Excessive helikilling)",GetName(killerid));
		SendClientMessageToAll(0xC8BEBEAA,string);
		Kick(killerid);
	}
	else if(gHelikillCount[killerid][0] == HELIKILL_MAX_KILLS-1) {
	  SendClientMessage(killerid,0xC8BEBEAA,"*** Stop helikilling - Next one is a kick");
	}
	return 1;
}

stock DrivebyProtection(killerid)
{
	new string[64];
	if(gDrivebyCount[killerid][0] == 0) { gDrivebyCount[killerid][1] = TimeStamp(); }

  gDrivebyCount[killerid][0]++;
	if(TimeStamp() - gDrivebyCount[killerid][1] > DRIVEBY_TIMELIMIT) {
	  gDrivebyCount[killerid][1] = TimeStamp();
		gDrivebyCount[killerid][0] = 1;
	}
	else if(gDrivebyCount[killerid][0] == DRIVEBY_MAX_KILLS) {
		format(string,sizeof(string),"*** %s has been kicked (Excessive drivebying)",GetName(killerid));
		SendClientMessageToAll(0xC8BEBEAA,string);
		Kick(killerid);
	}
	else if(gDrivebyCount[killerid][0] == DRIVEBY_MAX_KILLS-1) {
	  SendClientMessage(killerid,0xC8BEBEAA,"*** Pбra com o drivebying - Prуxima vez serб kick ou BAN !!!");
	}
	return 1;
}

stock SpawnkillProtection(killerid, playerid)
{
	new string[64];
	if(gSpawnkillCount[killerid][playerid][0] == 0) { gSpawnkillCount[killerid][playerid][1] = TimeStamp(); }

  gSpawnkillCount[killerid][playerid][0]++;
	if(TimeStamp() - gSpawnkillCount[killerid][playerid][1] > SPAWNKILL_TIMELIMIT) {
		gSpawnkillCount[killerid][playerid][0] = 1;
		gSpawnkillCount[killerid][playerid][1] = TimeStamp();
	}
	else if(gSpawnkillCount[killerid][playerid][0] == SPAWNKILL_MAX_KILLS) {
		format(string,sizeof(string),"*** %s has been kicked (Spawnkilling)",GetName(killerid));
		SendClientMessageToAll(0xC8BEBEAA,string);
		Kick(killerid);
	}
	else if(gSpawnkillCount[killerid][playerid][0] == SPAWNKILL_MAX_KILLS-1) {
	  SendClientMessage(killerid,0xC8BEBEAA,"*** Stop spawnkilling - Next one is a kick");
	}
 	return 1;
}

stock SpamProtection(playerid)
{
	new string[64];
	if(gSpamCount[playerid][0] == 0) { gSpamCount[playerid][1] = TimeStamp(); }

  gSpamCount[playerid][0]++;
	if(TimeStamp() - gSpamCount[playerid][1] > SPAM_TIMELIMIT) {
		gSpamCount[playerid][0] = 1;
		gSpamCount[playerid][1] = TimeStamp();
	}
	else if(gSpamCount[playerid][0] == SPAM_MAX_MSGS) {
		format(string,sizeof(string),"*** %s foi expluso por Flood/Spam (Protection)",GetName(playerid));
		SendClientMessageToAll(0xC8BEBEAA,string);
		Kick(playerid);
	}
	// Best not to help them figure out the time limits
	/*else if(gSpamCount[playerid][0] == SPAM_MAX_MSGS-1) {
	  SendClientMessage(playerid,0xC8BEBEAA,"*** Stop spamming - Next one is a kick");
	}*/
 	return 1;
}

public PingProtection()
{
	new string[64];
	for(new x=0; x<MAX_PLAYERS; x++) {
	  if(GetPlayerPing(x) > PING_MAX_PING) {

			if(gPingCount[x][0] == 0) { gPingCount[x][1] = TimeStamp(); }

  		gPingCount[x][0]++;
			if(TimeStamp() - gPingCount[x][1] > PING_TIMELIMIT) {
	  		gPingCount[x][1] = TimeStamp();
				gPingCount[x][0] = 1;
			}
			else if(gPingCount[x][0] == PING_MAX_EXCEEDS) {
				format(string,sizeof(string),"*** %s desliga os downloads (Ping Exceeds %dms)",GetName(x), PING_MAX_PING);
				SendClientMessageToAll(0xC8BEBEAA,string);
				Kick(x);
			}
		}
	}
	return 1;
}

stock Float:GetDistanceBetweenPlayers(p1,p2)
{
	new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;

	if (!IsPlayerConnected(p1) || !IsPlayerConnected(p2)){
		return -1.00;
	}
	GetPlayerPos(p1,x1,y1,z1);
	GetPlayerPos(p2,x2,y2,z2);
	return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
}

stock GetName(playerid)
{
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid,name,sizeof(name));

	return name;
}

stock TimeStamp()
{
	new time = GetTickCount() / 1000;
	return time;
}
Reply
#36

Quote:
Originally Posted by Vyorel
C:\Documents and Settings\Huni.MONICA\Desktop\samp02Xserver.win32\f ilterscripts\playerprotection.pwn(115) : warning 217: loose indentation
C:\Documents and Settings\Huni.MONICA\Desktop\samp02Xserver.win32\f ilterscripts\playerprotection.pwn(116) : warning 217: loose indentation
C:\Documents and Settings\Huni.MONICA\Desktop\samp02Xserver.win32\f ilterscripts\playerprotection.pwn(136) : warning 217: loose indentation
C:\Documents and Settings\Huni.MONICA\Desktop\samp02Xserver.win32\f ilterscripts\playerprotection.pwn(137) : warning 217: loose indentation
C:\Documents and Settings\Huni.MONICA\Desktop\samp02Xserver.win32\f ilterscripts\playerprotection.pwn(157) : warning 217: loose indentation
C:\Documents and Settings\Huni.MONICA\Desktop\samp02Xserver.win32\f ilterscripts\playerprotection.pwn(15 : warning 217: loose indentation
C:\Documents and Settings\Huni.MONICA\Desktop\samp02Xserver.win32\f ilterscripts\playerprotection.pwn(160) : warning 217: loose indentation
C:\Documents and Settings\Huni.MONICA\Desktop\samp02Xserver.win32\f ilterscripts\playerprotection.pwn(17 : warning 217: loose indentation
C:\Documents and Settings\Huni.MONICA\Desktop\samp02Xserver.win32\f ilterscripts\playerprotection.pwn(179) : warning 217: loose indentation
C:\Documents and Settings\Huni.MONICA\Desktop\samp02Xserver.win32\f ilterscripts\playerprotection.pwn(199) : warning 217: loose indentation
C:\Documents and Settings\Huni.MONICA\Desktop\samp02Xserver.win32\f ilterscripts\playerprotection.pwn(200) : warning 217: loose indentation
C:\Documents and Settings\Huni.MONICA\Desktop\samp02Xserver.win32\f ilterscripts\playerprotection.pwn(224) : warning 217: loose indentation
C:\Documents and Settings\Huni.MONICA\Desktop\samp02Xserver.win32\f ilterscripts\playerprotection.pwn(225) : warning 217: loose indentation
C:\Documents and Settings\Huni.MONICA\Desktop\samp02Xserver.win32\f ilterscripts\playerprotection.pwn(227) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


14 Warnings.
Ohh yeah xd
Reply
#37

lol just some warnings ... so ?
Reply
#38

Add:
pawn Code:
#pragma tabzise 0
under
pawn Code:
#include a_samp
________
BODY SCIENCE
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)