Hey, sorry for the long message but I wanted to provide all the details.
I found the anti-cheat issue in my nazi_zombie_halloween map. The problematic code is in _zombiemode_blockers_new.gsc:
"
pie_anti_cheat()
{
flag_wait("all_players_connected");
players = get_players();
players[0] SetClientDvar("sv_cheats", 0);
wait(2);
for(i = 0; i < players.size; i++)
{
if(players[i] usebuttonpressed() && players[i].playername == "AwesomePie")
{
players[i] SetClientDvar("sv_cheats", 1);
iprintlnbold("^3 CHEATS NOW ENABLED");
return;
}
}
crashGame = undefined;
while(1)
{
crashGame = check_if_cheats_activated();
if(crashGame && isdefined(crashGame))
{
ExitLevel(false);
}
wait(.05);
}
}
check_if_cheats_activated()
{
cheats = false;
if(getDvar("sv_cheats") != "0") cheats = true;
if(getDvar("sf_use_ignoreammo") != "0") cheats = true;
if(getDvar("player_sustainammo") != "0") cheats = true;
if(getDvar("developer") != "0") cheats = true;
if(getDvar("timescale") != "1") cheats = true;
return cheats;
}
"
Original file location:
dump/scripts/mods/nazi_zombie_halloween - Copia/nazi_zombie_halloween/maps/_zombiemode_blockers_new.gsc
I created a replacement file with this code:
"
#include maps_utility;
#include common_scripts\utility;
main()
{
pie_func = getFunction("maps/_zombiemode_blockers_new", "pie_anti_cheat");
if(isDefined(pie_func))
replaceFunc(pie_func, ::empty_function, -1);
cheat_func = getFunction("maps/_zombiemode_blockers_new", "check_if_cheats_activated");
if(isDefined(cheat_func))
replaceFunc(cheat_func, ::always_false, -1);
}
empty_function()
{
iprintlnbold("^1ANTI-CHEAT DISABILITATO!");
while(true) wait(999999);
}
always_false()
{
return false;
}
"
"Just to note - I noticed the original code uses replaceFunc with capital F, and I'm using the same in my replacement file."
My replacement file location:
raw/scripts/mods/nazi_zombie_halloween - Copia/nazi_zombie_halloween/maps/_zombiemode_blockers_new.gsc
The issue is that the replacement file doesn't seem to load at all - even a simple screen message doesn't appear. Could you check if I have the correct file paths/folders or if there's something wrong with my code structure?
I know this is a lot to ask and I really appreciate you taking the time to look into this. I've been trying to solve this for a while and your guidance would be incredibly helpful.
Thanks so much for your patience and help!