Modme Forums

How to make an Anti Perkaholic Script

Game Modding | Call of Duty: Black Ops 3 | Scripting


ModmeBot:

Thread By: Zixology
I always see so many people playing custom maps and automatically using things like mod menus or instant perkaholic mods without even giving the maps a chance first. I'm not great at scripting, but I'm sure that someone can figure this out. I'd want a script that would kill a player if they somehow had every perk in the match or at least more perks than legitimately possible (in case your map has a free perk easter egg or something). Obviously, this would not work in maps where you have a legitimate way to get a perkaholic. However, I feel like this would definitely get more people to actually try some of the custom maps out there instead of basically cheating from the start.


ModmeBot:

Reply By: D-2-K
for Gobble gum

http://modme.co/index.php?view=topic&tid=1858


how to stop cheats

http://modme.co/index.php?view=topic&tid=223


ModmeBot:

Reply By: Zixology

D-2-K
for Gobble gum http://modme.co/index.php?view=topic&tid=1858 how to stop cheats http://modme.co/index.php?view=topic&tid=223

I've seen both of those and while I think they are good and useful, they will not stop people using other mods with people's maps. I'm talking about a map with no gobblegum machine and console commands already disabled; someone goes in using another mod that instantly grants them all perks. For people trying to create elaborate maps with special easter eggs and such, this is a huge pain to see people doing to all their hard work.


ModmeBot:

Reply By: tbone-5
i think someone has done restrict mods or restrict certain mods, but i can't remember who & it was probably not a public script. Some mod menus disable death barriers by default to, can be bad for some maps. i would look into figuring it out but my PC is having issues, I'll try to ask someone if they know how. i think you could put a script you need in your own mod to load up your map or else it would not load without your mod, don't know if that's recommend way to go about it though


ModmeBot:

Reply By: Harry Bo21

tbone-5
i think someone has done restrict mods or restrict certain mods, but i can't remember who & it was probably not a public script. Some mod menus disable death barriers by default to, can be bad for some maps. i would look into figuring it out but my PC is having issues, I'll try to ask someone if they know how. i think you could put a script you need in your own mod to load up your map or else it would not load without your mod, don't know if that's recommend way to go about it though

the easiest way to do this

is to make your map "require" a mod, even if its a blank mod that does nothing

all youd need to do is move "one" of your required scripts from your map into a standalone mod, and link them on steam workshop ( RDVs old map had a way to do that )

then if people boot your map, without your mod - itll crash due to the missing script


ModmeBot:

Reply By: mathfag

Harry Bo21
tbone-5 i think someone has done restrict mods or restrict certain mods, but i can't remember who & it was probably not a public script. Some mod menus disable death barriers by default to, can be bad for some maps. i would look into figuring it out but my PC is having issues, I'll try to ask someone if they know how. i think you could put a script you need in your own mod to load up your map or else it would not load without your mod, don't know if that's recommend way to go about it though the easiest way to do this is to make your map "require" a mod, even if its a blank mod that does nothing all youd need to do is move "one" of your required scripts from your map into a standalone mod, and link them on steam workshop ( RDVs old map had a way to do that ) then if people boot your map, without your mod - itll crash due to the missing script

An alternative to this is to sacrifice one of your powerups/perks/anything that NEEDS a .csc file to work.
Basically copy over the file to your mapname script folder and delete the REGISTER_SYSTEM line in the gsc and csc and make sure you add the files in your zone file.
Basically what this will do is make it almost impossible to run any mods on the map because if you do, you'll get a clientfield error.
I did this with the death machine.


ModmeBot:

Reply By: tbone-5

Harry Bo21
the easiest way to do this is to make your map "require" a mod, even if its a blank mod that does nothing all youd need to do is move "one" of your required scripts from your map into a standalone mod, and link them on steam workshop ( RDVs old map had a way to do that ) then if people boot your map, without your mod - itll crash due to the missing script

This is exactly what i was thinking just crash your map without the mod that you made. I'm not a mapper, so i was not sure if that was the way to go about it


ModmeBot:

Reply By: Frost Iceforge
If you still want what you originally asked for, a script rather than telling everyone to download a separate mod, I made one.

function perkaholic_monitor_anticheat() //Checks at the start of each round if any player has a perkaholic and will end the game
{
	WAIT_SERVER_FRAME;
	level flag::wait_till( "all_players_connected" );
	while ( 1 )
	{
		level waittill( "between_round_over" );
		foreach(player in GetPlayers())
		{
			a_perks = player GetPerks();
			if(a_perks.size == level._custom_perks.size) //level._custom_perks.size is the total number of perks in your map; can change to some other number to monitor extra perks lower than a perkaholic.
			{
				IPrintLnBold("NO FREE PERK MODS ALLOWED!"); //Tell players not to use perk mods for this map
				player PlayLocalSound("zmb_bgb_deny_plr"); //Some pre-loaded error noise sound effects for flare
				wait(2);
				level notify("end_game");
			} 
		}
	}
}
This script will check at the beginning of every round if anyone has all of the perks, and will end the game after telling them not to use perk mods for your map. You can edit the if statement to check for 5 perks instead of a perkaholic if there are no ways to get free perks in your map.

Also, you could make a variable that keeps track if their perkaholic is legit and earned from an easter egg. If you want that, change the if statement with this:
if(!level.earned_perkaholic && a_perks.size == level._custom_perks.size)
and add this to your function main in mapname gsc:
level.earned_perkaholic = false;
then add this to the part of your script that gives a legit perkaholic:
level.earned_perkaholic = true;


ModmeBot:

Reply By: Harry Bo21
thats not "anti perkaholic" thats a "punishment" if people obtain all perks if they bought them on a map with no perk limit for example


ModmeBot:

Reply By: Frost Iceforge

Harry Bo21
thats not "anti perkaholic" thats a "punishment" if people obtain all perks if they bought them on a map with no perk limit for example

"I'd want a script that would kill a player if they somehow had every perk in the match or at least more perks than legitimately possible (in case your map has a free perk easter egg or something). Obviously, this would not work in maps where you have a legitimate way to get a perkaholic."
The original poster explicitly requested a punishment for any kind of perkaholic, and acknowledged it wouldn't work on maps that have ways for legit perkaholics. This is for maps with perk limits and no gobblegum machines.


ModmeBot:

Reply By: Harry Bo21
Why not at least be smart and just check if they are also over th perk limit rather ban “has all perks”


ModmeBot:

Reply By: Zixology

Frost Iceforge
If you still want what you originally asked for, a script rather than telling everyone to download a separate mod, I made one. function perkaholic_monitor_anticheat() //Checks at the start of each round if any player has a perkaholic and will end the game { WAIT_SERVER_FRAME; level flag::wait_till( "all_players_connected" ); while ( 1 ) { level waittill( "between_round_over" ); foreach(player in GetPlayers()) { a_perks = player GetPerks(); if(a_perks.size == level._custom_perks.size) //level._custom_perks.size is the total number of perks in your map; can change to some other number to monitor extra perks lower than a perkaholic. { IPrintLnBold("NO FREE PERK MODS ALLOWED!"); //Tell players not to use perk mods for this map player PlayLocalSound("zmb_bgb_deny_plr"); //Some pre-loaded error noise sound effects for flare wait(2); level notify("end_game"); } } } } This script will check at the beginning of every round if anyone has all of the perks, and will end the game after telling them not to use perk mods for your map. You can edit the if statement to check for 5 perks instead of a perkaholic if there are no ways to get free perks in your map. Also, you could make a variable that keeps track if their perkaholic is legit and earned from an easter egg. If you want that, change the if statement with this: if(!level.earned_perkaholic && a_perks.size == level._custom_perks.size) and add this to your function main in mapname gsc: level.earned_perkaholic = false; then add this to the part of your script that gives a legit perkaholic: level.earned_perkaholic = true;

Thank you! I didn't want to force people to have to download another mod. To be honest, I'd rather them get caught off guard if they were trying to cheat. This works well since the current map has no way of obtaining additional perks via EE or power up.
I'm also glad you included a way to change it to identify a perk limit. That way, I can actually use it in my future maps as well.
Again, thank you so much for this and don't worry, I will not forget to credit you! :D