Jump to content

[BF4/BFHL] Insane Limits - Sniperlimit (v1.5)


ImportBot

Recommended Posts

Originally Posted by Grovax*:

 

Sniperlimit for Insane Limits [bF4]

a modified version of "Sniper limiter by Tarreltje*" for Insane Limits

 

With this script you can limit snipers and dmrs on your server.

 

Functions:

- command !sniper for show active slots

- any sniperlimit

- controllable weapons and weapon-categorys limits

- snipers and dmrs share slots

New Functions:

- reservedslots player / admins / certain players can use all weapons without sniperlimitslot (optional)

- command !sinfo for information about sniperlimit

- controllable timeban function for ignoring warnings

- player lose his reserved slot by teamchange (teamchange and moved)

- whitlisted weapons: SR/DMR, Handguns, Knifes, Explosives and Vehicles

 

ATTENTION:

You must set the limit in CODE#2!

 

 

SETUP LIMIT#1

limit_evaluation: OnKill

limit_first_check: Expression

limit_first_check_code: paste the CODE#1 here

 

CODE#1

Code:

(true)
ENABLE SECOND CHECK

limit_second_check: Code

limit_second_check_code: paste the CODE#2 here

 

CODE#2:

Code:

// Insane Limits - Sniperlimit by Grovax v1.5

// Set max. snipers/dmrs each team
int maxSnipers = 2;

// Set kills for timeban
// Info: at 3 the user get 2 warnings before being timebanned
int warnKick = 3;

// ReservedSlots Player can use sr/dmr without sniperslot
// 0 = not allowed  |  1 = allowed
int vipAllowed = 1;

// Admins can use sr/dmr without sniperslot
// 0 = not allowed  |  1 = allowed
int adminAllowed = 1;

// Certain players can use sr/dmr without sniperslot
// For activate remove slashes in the next two rows and insert playername without clantags
//bool playerAllowed = (Regex.Match(kill.Name, @"(_:Playername1|Playername2|Playername3)", RegexOptions.IgnoreCase).Success);
//if (playerAllowed) return false;

// Set (main) allowed weapons and weaponcategory
bool sniperLimit = (kill.Category == "SniperRifle" || kill.Category == "DMR");

// Set (second) allowed weapons and weaponcategory
bool sniperAllowed = (kill.Category == "Handgun" || kill.Category == "Explosive" || kill.Weapon == "Melee" || Regex.Match(kill.Weapon, @"(_:Shorty)").Success);

// Allowed all vehicles
bool vehiclesAllowed = (Regex.Match(kill.Weapon, @"(_:Death|Roadkill|AMTRAC|Vehicle|Jeep|Growler|MRAP|Buggy|Venom|APC|Anti-Air|PGZ-95|HIMARS|MBT|Tank|Jet|Heli|AC-130|Lancer|Xian|Global|CB90|DV-15|RHIB|Bird)", RegexOptions.IgnoreCase).Success);


// Dont edit
if (vipAllowed == 1) {
	List<String> ReservervedSlots = plugin.GetReservedSlotsList();
	if (ReservervedSlots.Contains(killer.Name))	return false;
}

if (adminAllowed == 1) {
	bool isAdmin = false;
	bool bKill   = false;
	bool bKick   = false;
	bool bBan    = false;
	bool bMove   = false;
	bool bLevel  = false;
	if (plugin.CheckAccount(player.Name, out bKill, out bKick, out bBan, out bMove, out bLevel)) {
		if (bKill && bKick && bBan) return false;
	}
}

String globalMessage = null;
String globalMessage2 = null;
String privateMessage = null;
String playerKey = "sl_" + killer.Name;
String factionName = null;
int warnings = 0;
int countSnipers = 0;

if (plugin.RoundData.issetInt(playerKey)) warnings = plugin.RoundData.getInt(playerKey);

if (!plugin.RoundData.issetInt("sniperSlots")) plugin.RoundData.setInt("sniperSlots", maxSnipers);

if (!plugin.RoundData.issetObject("slEntries1")) plugin.RoundData.setObject("slEntries1", new List<String>());
if (!plugin.RoundData.issetObject("slEntries2")) plugin.RoundData.setObject("slEntries2", new List<String>());
List<String> sniperTeam1 = (List<String>)plugin.RoundData.getObject("slEntries1");
List<String> sniperTeam2 = (List<String>)plugin.RoundData.getObject("slEntries2");

if (killer.TeamId == 1) countSnipers = sniperTeam1.Count;
else if (killer.TeamId == 2) countSnipers = sniperTeam2.Count;

if (server.GetFaction(player.TeamId) == 0) factionName = "US";
else if (server.GetFaction(player.TeamId) == 1) factionName = "RU";
else if (server.GetFaction(player.TeamId) == 2) factionName = "CN";

if (sniperTeam1.Contains(killer.Name) || sniperTeam2.Contains(killer.Name)) {
	if (!sniperLimit && !sniperAllowed && !vehiclesAllowed) {
		globalMessage = "(" + factionName + ") " + killer.Name + " has lost his SNIPER/DMR slot! (used "+ plugin.FriendlyWeaponName(kill.Weapon).Name + ")";
		globalMessage2 = "(" + factionName + ") " + killer.Name + " has lost his SNIPER/DMR slot! (change team)";
		privateMessage = "You have lost your SNIPER/DMR slot!";
		
		if (killer.TeamId == 1 && sniperTeam1.Contains(killer.Name)) {
			sniperTeam1.Remove(killer.Name);
			plugin.SendTeamMessage(killer.TeamId, globalMessage);
			plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage);
			plugin.SendPlayerYell(killer.Name, privateMessage, 10);
			plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage);
		} else if (killer.TeamId == 1 && sniperTeam2.Contains(killer.Name)) {
			sniperTeam2.Remove(killer.Name);
			plugin.SendTeamMessage(2, globalMessage2);
			plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage2);
			plugin.SendPlayerYell(killer.Name, privateMessage, 10);
			plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage);
		} else if (killer.TeamId == 2 && sniperTeam2.Contains(killer.Name)) {
			sniperTeam2.Remove(killer.Name);
			plugin.SendTeamMessage(killer.TeamId, globalMessage);
			plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage);
			plugin.SendPlayerYell(killer.Name, privateMessage, 10);
			plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage);
		} else if (killer.TeamId == 2 && sniperTeam1.Contains(killer.Name)) {
			sniperTeam1.Remove(killer.Name);
			plugin.SendTeamMessage(1, globalMessage2);
			plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage2);
			plugin.SendPlayerYell(killer.Name, privateMessage, 10);
			plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage);
		}
		return false;
	}
	return false;
} else if (sniperLimit) {
	if (countSnipers < maxSnipers) {
		if (killer.TeamId == 1) sniperTeam1.Add(killer.Name);
		else if (killer.TeamId == 2) sniperTeam2.Add(killer.Name);
		countSnipers += 1;
		warnings = 0;
		globalMessage = "(" + factionName + ") " + killer.Name + " has now a SNIPER/DMR Slot! (" + countSnipers + "/" + maxSnipers + ")";
		privateMessage = "You have now a SNIPER/DMR slot! (" + countSnipers + "/" + maxSnipers + ")";
		plugin.SendTeamMessage(killer.TeamId, globalMessage);
		plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage);
		plugin.SendPlayerYell(killer.Name, privateMessage, 10);
		plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage);
		return false;
	} else {
		if (limit.Activations(killer.Name, TimeSpan.FromSeconds(2)) > 1) return false;
		warnings += 1;
		plugin.RoundData.setInt(playerKey, warnings);
		if (warnings <= (warnKick-1)) {
			privateMessage = "You are killed by SNIPER/DMR LIMIT! Warning (" + warnings + "/" + warnKick +") Type !sinfo for more information";
			plugin.SendPlayerMessage(killer.Name, privateMessage);
			plugin.SendPlayerYell(killer.Name, privateMessage, 10);
			plugin.KillPlayer(killer.Name, 1);
			plugin.PRoConChat("Sniperlimit > PlayerSay/Yell[10] > " + killer.Name + " > " + privateMessage);
			return false;
		} else if (warnings == warnKick) {
			globalMessage = "Timeban for ignoring warnings of SNIPER/DMR LIMIT!";
			plugin.EABanPlayerWithMessage(EABanType.Name, EABanDuration.Temporary, killer.Name, 20, globalMessage);
			return false;
		}
	}
}

return false;
SETUP LIMIT#2

limit_evaluation: OnAnyChat

limit_first_check: Code

limit_first_check_code: paste the CODE#3 here

 

CODE#3

Code:

List<String> sniperTeam = new List<string>();
int maxSnipers = 0;
String factionName = null;

Match sniperCommand = Regex.Match(player.LastChat, @"!sniper", RegexOptions.IgnoreCase);
Match sinfoCommand = Regex.Match(player.LastChat, @"!sinfo", RegexOptions.IgnoreCase);

if (plugin.RoundData.issetInt("sniperSlots")) maxSnipers = plugin.RoundData.getInt("sniperSlots");

if (!plugin.RoundData.issetObject("slEntries1")) plugin.RoundData.setObject("slEntries1", new List<String>());
if (!plugin.RoundData.issetObject("slEntries2")) plugin.RoundData.setObject("slEntries2", new List<String>());
List<String> sniperTeam1 = (List<String>)plugin.RoundData.getObject("slEntries1");
List<String> sniperTeam2 = (List<String>)plugin.RoundData.getObject("slEntries2");

if (player.TeamId == 1) sniperTeam = sniperTeam1;
else if (player.TeamId == 2) sniperTeam = sniperTeam2;

if (server.GetFaction(player.TeamId) == 0) factionName = "US";
else if (server.GetFaction(player.TeamId) == 1) factionName = "RU";
else if (server.GetFaction(player.TeamId) == 2) factionName = "CN";

List<String> showSniper = new List<String>();

if (sniperCommand.Success) {
	if (sniperTeam.Count == 0) {
		showSniper.Add("No SNIPERS/DMRS on your team (" + factionName + ")");
	} else {
		showSniper.Add("SNIPERS/DMRS on your team (" + factionName + "):");
		foreach (string sniper in sniperTeam) {
			showSniper.Add("Slot (" + (sniperTeam.IndexOf(sniper)+1) + "/" + maxSnipers + ") is " + sniper);
		}
	}
} else if (sinfoCommand.Success) {
	showSniper.Add("First SNIPER/DMR kills get a slot");
	showSniper.Add("You lose your slot with NON-SNIPER/DMR kill");
	showSniper.Add("Allowed: SR/DMR, Handguns, Knifes, Explosives and Vehicles");
	showSniper.Add("Type !sniper to show active slots");
}

foreach (string show in showSniper) {
	plugin.SendPlayerMessage(player.Name, show);
	plugin.PRoConChat("Sniperlimit > PlayerSay > " + show);
}

return false;
SETUP LIMIT#3

limit_evaluation: OnLeave

limit_first_check: Code

limit_first_check_code: paste the CODE#4 here

 

CODE#4

Code:

String globalMessage = null;
String factionName = null;

if (!plugin.RoundData.issetObject("slEntries1")) plugin.RoundData.setObject("slEntries1", new List<String>());
if (!plugin.RoundData.issetObject("slEntries2")) plugin.RoundData.setObject("slEntries2", new List<String>());
List<String> sniperTeam1 = (List<String>)plugin.RoundData.getObject("slEntries1");
List<String> sniperTeam2 = (List<String>)plugin.RoundData.getObject("slEntries2");

if (server.GetFaction(player.TeamId) == 0) factionName = "US";
else if (server.GetFaction(player.TeamId) == 1) factionName = "RU";
else if (server.GetFaction(player.TeamId) == 2) factionName = "CN";

globalMessage = "(" + factionName + ") " + player.Name + " gave up his SNIPER/DMR slot! (left server)";

if (sniperTeam1.Contains(player.Name)) {
	sniperTeam1.Remove(player.Name);
	plugin.SendTeamMessage(player.TeamId, globalMessage);
	plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage);
} else if (sniperTeam2.Contains(player.Name)) {
	sniperTeam2.Remove(player.Name);
	plugin.SendTeamMessage(player.TeamId, globalMessage);
	plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage);
}

return false;
--------------------------------------------

v1.5 (12-03-2016)

- added BFHL Version (Link*)

 

v1.5 (01-02-2016)

- improved code (CODE#2 / CODE#3 / CODE#4)

- removed expression for !sniper (ex-CODE#3)

- added !sinfo command for sniperlimit informations (CODE#3)

- remove manuell set of sniperlimit (CODE#3)

- edit all messages (CODE#2 / CODE#3)

- added team messages for has/lost slot (CODE#2)

- added certain player function (CODE#2)

- added admin function (CODE#2)

- added new reservedslots player function (CODE#2)

 

v1.4.1 (23-01-2016)

- added number of warnings to kill message (CODE#2)

 

v1.4 (22-01-2016)

- remove code for teamchange (LIMIT#4 & CODE#6)

- added new teamchange function (CODE#2)

- fixed bug at !sniper command (CODE#4)

 

v1.3 (20-01-2016)

v1.2 (18-01-2016)

v1.1 (11-01-2016)

v1.0 (10-01-2016)

- original version

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Grovax*:

 

BFHL Version

 

NOTICE:

This script works 100% with an outdated bfhl.def file!

 

ATTENTION:

You must set the limit in CODE#2!

 

 

SETUP LIMIT#1

limit_evaluation: OnKill

limit_first_check: Expression

limit_first_check_code: paste the CODE#1 here

 

CODE#1

Code:

(true)
ENABLE SECOND CHECK

limit_second_check: Code

limit_second_check_code: paste the CODE#2 here

 

CODE#2:

Code:

// Insane Limits - Sniperlimit by Grovax v1.5

// Set max. snipers/dmrs each team
int maxSnipers = 2;

// Set kills for timeban
// Info: at 3 the user get 2 warnings before being timebanned
int warnKick = 3;

// ReservedSlots Player can use sr/dmr without sniperslot
// 0 = not allowed  |  1 = allowed
int vipAllowed = 1;

// Admin can use sr/dmr without sniperslot
// 0 = not allowed  |  1 = allowed
int adminAllowed = 1;

// Set (main) allowed weapons and weaponcategory
bool sniperLimit = (kill.Category == "SniperRifle" || Regex.Match(kill.Weapon, @"(_:R700|L96A1|SRS|98B|AWS|M1903|SOCOM16|SR25ECC|SCR308|PTI91|M82|M12MOD1|FNAR|M110K5|M39EBR)", RegexOptions.IgnoreCase).Success);

// Set (second) allowed weapons and weaponcategory
bool sniperAllowed = (kill.Category == "Handgun" || kill.Category == "Explosive" || kill.Weapon == "Melee" || Regex.Match(kill.Weapon, @"(_:KNIFE|BASEBALL|KARAMBIT|G17RACE|SLEDGEHAMMER|POLICEBATON|PRISONSHANK|CLEAVER|SWORD|BATON|ImprovisedGun|BallisticShield|Crowbar)", RegexOptions.IgnoreCase).Success);

// Allowed all vehicles
bool vehiclesAllowed = (Regex.Match(kill.Weapon, @"(_:Death|Roadkill|TANK|HELI|CAT|GUNBOAT|AIRBOAT|TUNER|EXOTIC|TRUCK|SUV|SEDAN|MSP|MOBILE|STREET)", RegexOptions.IgnoreCase).Success);

// Dont edit
if (vipAllowed == 1) {
	List<String> ReservervedSlots = plugin.GetReservedSlotsList();
	if (ReservervedSlots.Contains(killer.Name))	return false;
}


if (adminAllowed == 1) {
	bool isAdmin = false;
	bool bKill   = false;
	bool bKick   = false;
	bool bBan    = false;
	bool bMove   = false;
	bool bLevel  = false;
	if (plugin.CheckAccount(player.Name, out bKill, out bKick, out bBan, out bMove, out bLevel)) {
		if (bKill && bKick && bBan) return false;
	}
}

String globalMessage = null;
String globalMessage2 = null;
String privateMessage = null;
String playerKey = "sl_" + killer.Name;
String factionName = null;
int warnings = 0;
int countSnipers = 0;

if (plugin.RoundData.issetInt(playerKey)) warnings = plugin.RoundData.getInt(playerKey);

if (!plugin.RoundData.issetInt("sniperSlots")) plugin.RoundData.setInt("sniperSlots", maxSnipers);

if (!plugin.RoundData.issetObject("slEntries1")) plugin.RoundData.setObject("slEntries1", new List<String>());
if (!plugin.RoundData.issetObject("slEntries2")) plugin.RoundData.setObject("slEntries2", new List<String>());
List<String> sniperTeam1 = (List<String>)plugin.RoundData.getObject("slEntries1");
List<String> sniperTeam2 = (List<String>)plugin.RoundData.getObject("slEntries2");

if (killer.TeamId == 1) countSnipers = sniperTeam1.Count;
else if (killer.TeamId == 2) countSnipers = sniperTeam2.Count;

if (player.TeamId == 2) factionName = "Criminals";
else if (player.TeamId == 1) factionName = "Cops";

if (sniperTeam1.Contains(killer.Name) || sniperTeam2.Contains(killer.Name)) {
	if (!sniperLimit && !sniperAllowed && !vehiclesAllowed) {
		globalMessage = "(" + factionName + ") " + killer.Name + " has lost his SNIPER/DMR slot! (used "+ plugin.FriendlyWeaponName(kill.Weapon).Name + ")";
		globalMessage2 = "(" + factionName + ") " + killer.Name + " has lost his SNIPER/DMR slot! (change team)";
		privateMessage = "You have lost your SNIPER/DMR slot!";
		
		if (killer.TeamId == 1 && sniperTeam1.Contains(killer.Name)) {
			sniperTeam1.Remove(killer.Name);
			plugin.SendTeamMessage(killer.TeamId, globalMessage);
			plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage);
			plugin.SendPlayerYell(killer.Name, privateMessage, 10);
			plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage);
		} else if (killer.TeamId == 1 && sniperTeam2.Contains(killer.Name)) {
			sniperTeam2.Remove(killer.Name);
			plugin.SendTeamMessage(2, globalMessage2);
			plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage2);
			plugin.SendPlayerYell(killer.Name, privateMessage, 10);
			plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage);
		} else if (killer.TeamId == 2 && sniperTeam2.Contains(killer.Name)) {
			sniperTeam2.Remove(killer.Name);
			plugin.SendTeamMessage(killer.TeamId, globalMessage);
			plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage);
			plugin.SendPlayerYell(killer.Name, privateMessage, 10);
			plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage);
		} else if (killer.TeamId == 2 && sniperTeam1.Contains(killer.Name)) {
			sniperTeam1.Remove(killer.Name);
			plugin.SendTeamMessage(1, globalMessage2);
			plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage2);
			plugin.SendPlayerYell(killer.Name, privateMessage, 10);
			plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage);
		}
		return false;
	}
	return false;
} else if (sniperLimit) {
	if (countSnipers < maxSnipers) {
		if (killer.TeamId == 1) sniperTeam1.Add(killer.Name);
		else if (killer.TeamId == 2) sniperTeam2.Add(killer.Name);
		countSnipers += 1;
		warnings = 0;
		globalMessage = "(" + factionName + ") " + killer.Name + " has now a SNIPER/DMR Slot! (" + countSnipers + "/" + maxSnipers + ")";
		privateMessage = "You have now a SNIPER/DMR slot! (" + countSnipers + "/" + maxSnipers + ")";
		plugin.SendTeamMessage(killer.TeamId, globalMessage);
		plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage);
		plugin.SendPlayerYell(killer.Name, privateMessage, 10);
		plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage);
		return false;
	} else {
		if (limit.Activations(killer.Name, TimeSpan.FromSeconds(2)) > 1) return false;
		warnings += 1;
		plugin.RoundData.setInt(playerKey, warnings);
		if (warnings <= (warnKick-1)) {
			privateMessage = "You are killed by SNIPER/DMR LIMIT! Warning (" + warnings + "/" + warnKick +") Type !sinfo for more information";
			plugin.SendPlayerMessage(killer.Name, privateMessage);
			plugin.SendPlayerYell(killer.Name, privateMessage, 10);
			plugin.KillPlayer(killer.Name, 1);
			//plugin.PRoConChat("Sniperlimit > PlayerSay/Yell[10] > " + killer.Name + " > " + privateMessage);
			return false;
		} else if (warnings == warnKick) {
			globalMessage = "Timeban for ignoring warnings of SNIPER/DMR LIMIT!";
			plugin.EABanPlayerWithMessage(EABanType.Name, EABanDuration.Temporary, killer.Name, 20, globalMessage);
			return false;
		}
	}
}

return false;
SETUP LIMIT#2

limit_evaluation: OnAnyChat

limit_first_check: Code

limit_first_check_code: paste the CODE#3 here

 

CODE#3

Code:

List<String> sniperTeam = new List<string>();
int maxSnipers = 0;
String factionName = null;

Match sniperCommand = Regex.Match(player.LastChat, @"!sniper", RegexOptions.IgnoreCase);
Match sinfoCommand = Regex.Match(player.LastChat, @"!sinfo", RegexOptions.IgnoreCase);

if (plugin.RoundData.issetInt("sniperSlots")) maxSnipers = plugin.RoundData.getInt("sniperSlots");

if (!plugin.RoundData.issetObject("slEntries1")) plugin.RoundData.setObject("slEntries1", new List<String>());
if (!plugin.RoundData.issetObject("slEntries2")) plugin.RoundData.setObject("slEntries2", new List<String>());
List<String> sniperTeam1 = (List<String>)plugin.RoundData.getObject("slEntries1");
List<String> sniperTeam2 = (List<String>)plugin.RoundData.getObject("slEntries2");

if (player.TeamId == 1) sniperTeam = sniperTeam1;
else if (player.TeamId == 2) sniperTeam = sniperTeam2;

if (player.TeamId == 2) factionName = "Criminals";
else if (player.TeamId == 1) factionName = "Cops";

List<String> showSniper = new List<String>();

if (sniperCommand.Success) {
	if (sniperTeam.Count == 0) {
		showSniper.Add("No SNIPERS/DMRS on your team (" + factionName + ")");
	} else {
		showSniper.Add("SNIPERS/DMRS on your team (" + factionName + "):");
		foreach (string sniper in sniperTeam) {
			showSniper.Add("Slot (" + (sniperTeam.IndexOf(sniper)+1) + "/" + maxSnipers + ") is " + sniper);
		}
	}
} else if (sinfoCommand.Success) {
	showSniper.Add("First round SNIPER/DMR kills get a slot");
	showSniper.Add("You lose your slot with NON-SNIPER/DMR kill");
	showSniper.Add("Allowed: Sniper, Handguns, Knifes, Explosives and Vehicles");
	showSniper.Add("Type !sniper to show active slots");
}

foreach (string show in showSniper) {
	plugin.SendPlayerMessage(player.Name, show);
	plugin.PRoConChat("Sniperlimit > PlayerSay > " + show);
}

return false;
SETUP LIMIT#3

limit_evaluation: OnLeave

limit_first_check: Code

limit_first_check_code: paste the CODE#4 here

 

CODE#4

Code:

String globalMessage = null;
String factionName = null;

if (!plugin.RoundData.issetObject("slEntries1")) plugin.RoundData.setObject("slEntries1", new List<String>());
if (!plugin.RoundData.issetObject("slEntries2")) plugin.RoundData.setObject("slEntries2", new List<String>());
List<String> sniperTeam1 = (List<String>)plugin.RoundData.getObject("slEntries1");
List<String> sniperTeam2 = (List<String>)plugin.RoundData.getObject("slEntries2");

if (player.TeamId == 2) factionName = "Criminals";
else if (player.TeamId == 1) factionName = "Cops";

globalMessage = "(" + factionName + ") " + player.Name + " gave up his SNIPER/DMR slot! (left server)";

if (sniperTeam1.Contains(player.Name)) {
	sniperTeam1.Remove(player.Name);
	plugin.SendTeamMessage(player.TeamId, globalMessage);
	plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage);
} else if (sniperTeam2.Contains(player.Name)) {
	sniperTeam2.Remove(player.Name);
	plugin.SendTeamMessage(player.TeamId, globalMessage);
	plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage);
}

return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Grovax*:

 

What about Shorty 12G? It is not sniper allowed weapon.

Currently not, Shorty 12G is weapon category shotgun. But you can add it to whitelist

 

Replace in CODE#2

 

Code:

// Set (second) allowed weapons and weaponcategory
bool sniperAllowed = (kill.Category == "Handgun" || kill.Category == "Explosive" || kill.Weapon == "Melee");
with

 

Code:

// Set (second) allowed weapons and weaponcategory
bool sniperAllowed = (kill.Category == "Handgun" || kill.Category == "Explosive" || kill.Weapon == "Melee" || Regex.Match(kill.Weapon, @"(_:Shorty)").Success);
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Grovax*:

 

Thanks. Just a suggestion, you can add Roadkill too. :ohmy:

 

Is this code ok?

Code:

Regex.Match(kill.Weapon, @"(_:RoadKill)").Success
New version available (v1.3), added Shorty 12G and all vehicles to whitelist :ohmy:
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Grovax*:

 

New version available (v1.4)

 

v1.4 (22-01-2016)

- remove code for teamchange (LIMIT#4 & CODE#6)

- added new teamchange function (CODE#2)

- fixed bug at !sniper command (CODE#4)

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Mamba334*:

 

Ok, I'm sorry for asking this silly question, but I'm not good at coding these things.

 

What we are trying to accomplish is the following: 32 man server

- 3 snipers per team

- warn player with message to change his kit and not allow them to use sniper, if there is already 3 snipers

- limit 2 battle pickups (the snipers on the ground that are one shot kills)

- type !sniperx and !sniper to show how many are sniping

 

DMR's are fine. This would only apply to sniper rifle category.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Grovax*:

 

Ok, I'm sorry for asking this silly question, but I'm not good at coding these things.

 

What we are trying to accomplish is the following: 32 man server

- 3 snipers per team

- warn player with message to change his kit and not allow them to use sniper, if there is already 3 snipers

- limit 2 battle pickups (the snipers on the ground that are one shot kills)

- type !sniperx and !sniper to show how many are sniping

 

DMR's are fine. This would only apply to sniper rifle category.

@1:

Edit "int maxSnipers = 2;" to "int maxSnipers = 3;" in Code#2 and Code#4

 

@2:

Player get a message and will be killed. Edit "int warnKick = 3;" in Code#2 for number of warnings, after ignoring this warnings player get a 20m timeban.

 

@3:

U can only set weapons on one limit (share limit)

 

@4:

!sniper is included

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Mamba334*:

 

[19:57:02] Mamba334 > !sniper

[19:57:05] Sniperlimit > PlayerSay > You lose your slot with NON-SNIPER kill!

[19:57:05] Sniperlimit > PlayerSay > Allowed: SR/DMR, Handguns, Knifes, Explosives and Vehicles

[19:57:05] Sniperlimit > PlayerSay > (0/3) SNIPERS on your team (CN)

 

Ok, I had a sniper rifle and it still says 0/3

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Grovax*:

 

[19:57:02] Mamba334 > !sniper

[19:57:05] Sniperlimit > PlayerSay > You lose your slot with NON-SNIPER kill!

[19:57:05] Sniperlimit > PlayerSay > Allowed: SR/DMR, Handguns, Knifes, Explosives and Vehicles

[19:57:05] Sniperlimit > PlayerSay > (0/3) SNIPERS on your team (CN)

 

Ok, I had a sniper rifle and it still says 0/3

you must kill one to get a sniper slot, script informs you if you get a sniperslot
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Mamba334*:

 

Thanks. I am using your v 1.4 Insane Limits and working like a charm! I couldn't get the Procon Rulz one to work right.

 

However, I just read this comment on another thread: Insane Limit Request Thread

rcon does not replay what someone is spawning with. The only thing you can do is limit how many people are currently getting kills with sniper rifles. Not a very clean approach since the only time someone will know if there are 'too many' snipers is once they've spawned in and actually kill someone.

 

Thanks again for the hard work. :smile:

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Grovax*:

 

Would it be possible to only whitelist certain players, regardless of reserved slots?

Yes, its possible. Add these lines in Code#2 after line 20

 

Code:

// Whitelist certain players
bool playerAllowed = (Regex.Match(kill.Name, @"(_:Playername1|Playername2|Playername3)", RegexOptions.IgnoreCase).Success);
if (playerAllowed) return false;
Replace Playername1|Playername2|Playername3 with your Playernames without Clantag
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Mamba334*:

 

Hey Grovax, thanks again for your work on this. A few people get mad about it, but it is what it is ya know. Lol.

 

My quick question for you is this;

 

Is there a code to make it give a message to the player to tell the player they cannot spawn in with sniper rifle because limit reached for now? Press !sniper to view available slots?

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Grovax*:

 

Is there a code to make it give a message to the player to tell the player they cannot spawn in with sniper rifle because limit reached for now? Press !sniper to view available slots?

You can add this text to the kill warning.

 

In Code#2 at line 80

Code:

msg = "You are killed by SNIPER/DMR LIMIT! Warning (" + warnings + "/" + warnKick +")";
Example:

Code:

msg = "You are killed by SNIPER/DMR LIMIT! Warning (" + warnings + "/" + warnKick +") Type !sniper to view available slots";
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Grovax*:

 

New version available (v1.5)

 

v1.5 (01-02-2016)

- improved code (CODE#2 / CODE#3 / CODE#4)

- removed expression for !sniper (ex-CODE#3)

- added !sinfo command for sniperlimit informations (CODE#3)

- remove manuell set of sniperlimit (CODE#3)

- edit all messages (CODE#2 / CODE#3)

- added team messages for has/lost slot (CODE#2)

- added certain player function (CODE#2)

- added admin function (CODE#2)

- added new reservedslots player function (CODE#2)

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Mamba334*:

 

I think the idea of this is great, but how it works is not how I expected.

 

It affects pickup snipers as well, which bothers me, because that means at any time a player can block your team from getting a sniper, while also at the same time completely devaluing pickups because you don't know if there are 3 snipers queued for your team or not when you pick up that .50 MID or the long range bolt pickup.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Grovax*:

 

I think the idea of this is great, but how it works is not how I expected.

 

It affects pickup snipers as well, which bothers me, because that means at any time a player can block your team from getting a sniper, while also at the same time completely devaluing pickups because you don't know if there are 3 snipers queued for your team or not when you pick up that .50 MID or the long range bolt pickup.

you can edit the main allowed weapons, default are all snipers and dmr. But you can also add them individually. To add a queue is to complex and the most player ignore them
* Restored post. It could be that the author is no longer active.
Link to comment
  • 3 weeks later...

Originally Posted by Grovax*:

 

It is possible only set the limit to sniperrifle ? Not DMR ?

yes its possible

 

edit in CODE#2 line 22

Code:

bool sniperLimit = (kill.Category == "SniperRifle" || kill.Category == "DMR");
to

Code:

bool sniperLimit = (kill.Category == "SniperRifle");
and replace all SNIPER/DMR with SNIPER for usermessages
* Restored post. It could be that the author is no longer active.
Link to comment
  • 4 weeks later...
  • 2 weeks later...

Originally Posted by NEXSO*:

 

in BFHL

 

Problem ?

Code:

[07:26:47 44] ProconRulz: *******************OnServerInfo*****************************
[07:26:53 24] [Insane Limits] Thread(settings): Compiling Limit #1 - Name1 - OnKill
[07:26:53 27] [Insane Limits] Thread(settings): ERROR: 3 errors compiling Expression
[07:26:53 27] [Insane Limits] Thread(settings): ERROR: (CS1040, line: 178, column: 24):  Präprozessordirektiven müssen als Zeichen in einer Zeile angezeigt werden, das kein Leerzeichen ist.
[07:26:53 27] [Insane Limits] Thread(settings): ERROR: (CS1040, line: 181, column: 51):  Präprozessordirektiven müssen als Zeichen in einer Zeile angezeigt werden, das kein Leerzeichen ist.
[07:26:53 27] [Insane Limits] Thread(settings): ERROR: (CS1040, line: 183, column: 17):  Präprozessordirektiven müssen als Zeichen in einer Zeile angezeigt werden, das kein Leerzeichen ist.
[07:26:57 40] ProconRulz: *******************OnServerInfo*****************************
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by El-aFreak*:

 

He the script is wonderful und works great. But I have a question. How do I turn off the top left of chat from the display? I would only like that the data are only displayed via !sniper and not in chat

 

[22:22:41] Sniperlimit > TeamSay > (CN) Name... has now a SNIPER/DMR Slot! (7/8)

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Grovax*:

 

@El$aFreak:

 

Glad to hear that :smile:

 

You mean the messages at procon chatframe or? When you mean that, you can deactivate this messages with two backslashes

 

example:

 

original:

Code:

plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage);
new: (deactivated)

Code:

//plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage);
the command plugin.PRoConChat is for all proconchat messages
* Restored post. It could be that the author is no longer active.
Link to comment

Archived

This topic is now archived and is closed to further replies.



  • Our picks

    • Game Server Hosting:

      We're happy to announce that EZRCON will branch out into the game server provider scene. This is a big step for us so please having patience if something doesn't go right in this area. Now, what makes us different compared to other providers? Well, we're going with the idea of having a scaleable server hosting and providing more control in how you set up your server. For example, in Minecraft, you have the ability to control how many CPU cores you wish your server to have access to, how much RAM you want to use, how much disk space you want to use. This type of control can't be offered in a single service package so you're able to configure a custom package the way you want it.

      You can see all the available games here. Currently, we have the following games available.

      Valheim (From $1.50 USD)


      Rust (From $3.20 USD)


      Minecraft (Basic) (From $4.00 USD)


      Call of Duty 4X (From $7.00 USD)


      OpenTTD (From $4.00 USD)


      Squad (From $9.00 USD)


      Insurgency: Sandstorm (From $6.40 USD)


      Changes to US-East:

      Starting in January 2022, we will be moving to a different provider that has better support, better infrastructure, and better connectivity. We've noticed that the connection/routes to this location are not ideal and it's been hard getting support to correct this. Our contract for our two servers ends in March/April respectively. If you currently have servers in this location you will be migrated over to the new provider. We'll have more details when the time comes closer to January. The new location for this change will be based out of Atlanta, GA. If you have any questions/concerns please open a ticket and we'll do our best to answer them.
      • 5 replies
    • Hello All,

      I wanted to give an update to how EZRCON is doing. As of today we have 56 active customers using the services offered. I'm glad its doing so well and it hasn't been 1 year yet. To those that have services with EZRCON, I hope the service is doing well and if not please let us know so that we can improve it where possible. We've done quite a few changes behind the scenes to improve the performance hopefully. 

      We'll be launching a new location for hosting procon layers in either Los Angeles, USA or Chicago, IL. Still being decided on where the placement should be but these two locations are not set in stone yet. We would like to get feedback on where we should have a new location for hosting the Procon Layers, which you can do by replying to this topic. A poll will be created where people can vote on which location they would like to see.

      We're also looking for some suggestions on what else you would like to see for hosting provider options. So please let us know your thoughts on this matter.
      • 4 replies
    • Added ability to disable the new API check for player country info


      Updated GeoIP database file


      Removed usage sending stats


      Added EZRCON ad banner



      If you are upgrading then you may need to add these two lines to your existing installation in the file procon.cfg. To enable these options just change False to True.

      procon.private.options.UseGeoIpFileOnly False
      procon.private.options.BlockRssFeedNews False



       
      • 2 replies
    • I wanted I let you know that I am starting to build out the foundation for the hosting services that I talked about here. The pricing model I was originally going for wasn't going to be suitable for how I want to build it. So instead I decided to offer each service as it's own product instead of a package deal. In the future, hopefully, I will be able to do this and offer discounts to those that choose it.

      Here is how the pricing is laid out for each service as well as information about each. This is as of 7/12/2020.

      Single MySQL database (up to 30 GB) is $10 USD per month.



      If you go over the 30 GB usage for the database then each additional gigabyte is charged at $0.10 USD each billing cycle. If you're under 30GB you don't need to worry about this.


      Databases are replicated across 3 zones (regions) for redundancy. One (1) on the east coast of the USA, One (1) in Frankfurt, and One (1) in Singapore. Depending on the demand, this would grow to more regions.


      Databases will also be backed up daily and retained for 7 days.




      Procon Layer will be $2 USD per month.


      Each layer will only allow one (1) game server connection. The reason behind this is for performance.


      Each layer will also come with all available plugins installed by default. This is to help facilitate faster deployments and get you up and running quickly.


      Each layer will automatically restart if Procon crashes. 


      Each layer will also automatically restart daily at midnight to make sure it stays in tip-top shape.


      Custom plugins can be installed by submitting a support ticket.




      Battlefield Admin Control Panel (BFACP) will be $5 USD per month


      As I am still working on building version 3 of the software, I will be installing the last version I did. Once I complete version 3 it will automatically be upgraded for you.





      All these services will be managed by me so you don't have to worry about the technical side of things to get up and going.

      If you would like to see how much it would cost for the services, I made a calculator that you can use. It can be found here https://ezrcon.com/calculator.html

       
      • 11 replies
    • I have pushed out a new minor release which updates the geodata pull (flags in the playerlisting). This should be way more accurate now. As always, please let me know if any problems show up.

       
      • 9 replies
×
×
  • Create New...

Important Information

Please review our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.