UGX-Mods

Call of Duty 5: World at War => Tutorial Desk => Scripting => Topic started by: InFInIX on June 22, 2014, 04:21:47 pm

Title: Anti cheat|NO console and no cheats|
Post by: InFInIX on June 22, 2014, 04:21:47 pm
Hey,
I made a little script to save your map from console cheaters.
you can add your name to enable the cheats ONLY FOR YOU.

ok
step 1:
open YOURMAPNAME.gsc (root/raw/maps) or (root/mods/YOURMOD/maps)

and find
Code Snippet
Plaintext
maps\_zombiemode::main();

under this line add
Code Snippet
Plaintext
thread no_cheat();

now add this script add the bottom and enjoy you hack free map :)
you can activate cheats if you change ITzXxInFInIX with your Ingame name :)(need clantag too)

Code Snippet
Plaintext
no_cheat()
{
flag_wait( "all_players_connected" );
players = GetPlayers();
    players[0] SetClientDvar("sv_cheats",0);

for(i = 0; i < players.size; i++)


if(players[0].playername == "ITzXxInFInIX")//change ITzXxInFInIX to your name
players[0] SetClientDvar("sv_cheats",1);
}

don't forgett to give credits
and keep in mind that this is one of my first own scripts
Title: Re: Anti cheat|NO console and no cheats|
Post by: Alerion on June 22, 2014, 05:57:29 pm
I had seen a similar script before but this one is way better due to the ability to exclude yourself. Now I won't have to remove it if I want to test something.
Nice work!
Title: Re: Anti cheat|NO console and no cheats|
Post by: InFInIX on June 22, 2014, 06:15:16 pm
I had seen a similar script before but this one is way better due to the ability to exclude yourself. Now I won't have to remove it if I want to test something.
Nice work!
that is the same what i thought AND the best is you can leave the start score at 500 points and don't need to change all the time :D
Title: Re: Anti cheat|NO console and no cheats|
Post by: Alerion on June 22, 2014, 06:23:13 pm
Yeah, I'll just have to remember to set this score back to 500 (maybe 1000 ;)) when I release it.
Title: Re: Anti cheat|NO console and no cheats|
Post by: Delta on June 22, 2014, 06:39:37 pm
So what exactly does this script do? Because it doesn't work at all..

The for loop doesn't make anything, the index for the player is always 0!
The if sentence doesn't cover all statements.

So currently it gives the host a shitload of points.
( no idea about sv_disableClientConsole but is it really 0 and no 1/true ? )

Also, disabled the console doesn't prevent from cheating and for example would annoy me, because I can't change my fov to 90.

Script is broken, please fix - we don't need more broken scripts which this community already has!
Title: Re: Anti cheat|NO console and no cheats|
Post by: InFInIX on June 22, 2014, 07:16:59 pm
should work now...
Title: Re: Anti cheat|NO console and no cheats|
Post by: DidUknowiPwn on June 22, 2014, 07:22:07 pm
should work now...
Why go through a loop when you can just check ent id ._.
Title: Re: Anti cheat|NO console and no cheats|
Post by: Delta on June 22, 2014, 09:07:31 pm
yeah, why is there a loop - if this is host only, it'S not neede otherweise the index doesn't change.

As far as I know sv_cheats is always at 0, which means this isn't an anti-cheat. It's actually ( if the name is correct) a  cheat enabler.
Also the console dvar is gone ( no idea if this actually works ) but the title is now wrong.

I'll end my post as the OP

It still doesn't work . . .
Title: Re: Anti cheat|NO console and no cheats|
Post by: DidUknowiPwn on June 23, 2014, 01:28:18 am
yeah, why is there a loop - if this is host only, it'S not neede otherweise the index doesn't change.

As far as I know sv_cheats is always at 0, which means this isn't an anti-cheat. It's actually ( if the name is correct) a  cheat enabler.
Also the console dvar is gone ( no idea if this actually works ) but the title is now wrong.

I'll end my post as the OP

It still doesn't work . . .
Because sv_cheats is a global dvar and not a client dvar. In this case since it's global it has to be set as SetDvar which means all players will have access to it no matter what.
Title: Re: Anti cheat|NO console and no cheats|
Post by: daedra descent on June 23, 2014, 01:43:21 am
Perhaps it would be better if you just make the script for single player only by doing this:

Code Snippet
Plaintext
if(players.size == 1 && players[0].playername == "NAMEHERE")

This should ensure that only the map/mod maker has the ability to use console commands(in SP). Still, unless the map maker includes the script in their FF and not their IWD its VERY easy to disable and get around(like all the other script based anti-cheats I've seen).

and instead of doing:

Code Snippet
Plaintext
flag_wait( "all_players_connected" );

You might just wanna add a wait(). As far as i know "all_players_connected" only effect COOP environment but i might be wrong about that. Still, using a wait to pause code execution for 1-2 seconds is much safer than a flag IMO.
Title: Re: Anti cheat|NO console and no cheats|
Post by: SajeOne on June 23, 2014, 12:05:07 pm
Perhaps it would be better if you just make the script for single player only by doing this:

Code Snippet
Plaintext
if(players.size == 1 && players[0].playername == "NAMEHERE")

This should ensure that only the map/mod maker has the ability to use console commands(in SP). Still, unless the map maker includes the script in their FF and not their IWD its VERY easy to disable and get around(like all the other script based anti-cheats I've seen).

and instead of doing:

Code Snippet
Plaintext
flag_wait( "all_players_connected" );

You might just wanna add a wait(). As far as i know "all_players_connected" only effect COOP environment but i might be wrong about that. Still, using a wait to pause code execution for 1-2 seconds is much safer than a flag IMO.
The "all_players_connected" flag does work in Solo. I would think it would be much better to use a flag than a wait as the wait will always be a value which won't be specific to the actual time it takes to start the gamestate. If you really have a problem with using flags just remove it and call the script after the gamestate line which will start the script at the beginning of the game.
Title: Re: Anti cheat|NO console and no cheats|
Post by: InFInIX on June 23, 2014, 03:12:03 pm
I'm currently doing the scrupt new and test it better
DON'T USE THIS SCRIPT NOW
Title: Re: Anti cheat|NO console and no cheats|
Post by: DidUknowiPwn on June 23, 2014, 03:19:50 pm
I'm currently doing the scrupt new and test it better
DON'T USE THIS SCRIPT NOW

Also just do if( self isHost() ) it should exist in waw.
Title: Re: Anti cheat|NO console and no cheats|
Post by: Official_TSG_ on July 26, 2014, 06:49:23 pm
is it fixed yet?
Title: Re: Anti cheat|NO console and no cheats|
Post by: DidUknowiPwn on July 26, 2014, 08:12:55 pm
is it fixed yet?
It'll never work, I mean you can disable console and set sv_cheats to 0; but, the "host" only cheat mode won't work (at least through sv_cheats  ;) )