mirror of
https://github.com/nzp-team/quakec.git
synced 2025-02-16 17:10:55 +00:00
SERVER: Make the anti-cheat respond to sv_cheats
This commit is contained in:
parent
790fe2a3d7
commit
377453f04b
4 changed files with 12 additions and 6 deletions
|
@ -61,7 +61,7 @@ void(float id, string graphic, string name, string description) Achievement_Crea
|
|||
|
||||
void() Achievement_Save =
|
||||
{
|
||||
local float file, i;
|
||||
float file, i;
|
||||
|
||||
// re-write the achievement file
|
||||
file = fopen("ach.dat", FILE_WRITE);
|
||||
|
|
|
@ -36,6 +36,8 @@
|
|||
|
||||
#define STR_NOTENOUGHPOINTS "Not Enough Points\n" // To help aid consistency with these..
|
||||
|
||||
float cheats_have_been_activated;
|
||||
|
||||
// Quake assumes these are defined.
|
||||
string string_null;
|
||||
.string killtarget;
|
||||
|
|
|
@ -33,7 +33,7 @@ void() SUB_Remove = {remove(self);}
|
|||
//called when starting server/loading the map
|
||||
void() main =
|
||||
{
|
||||
localcmd("echo Server starting...\n");
|
||||
cheats_have_been_activated = false;
|
||||
}
|
||||
|
||||
float ai_delay_time;
|
||||
|
@ -462,6 +462,10 @@ void() LinkZombiesHitbox =
|
|||
void() EndFrame =
|
||||
{
|
||||
RelinkZombies();
|
||||
|
||||
if (cheats_have_been_activated == false && cvar("sv_cheats") == 1) {
|
||||
cheats_have_been_activated = true;
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
|
|
|
@ -41,7 +41,7 @@ float client_parse_override;
|
|||
float(string params) Command_give =
|
||||
{
|
||||
// Anti-Cheat in Co-Op.
|
||||
if (coop) {
|
||||
if (coop && cheats_have_been_activated == false) {
|
||||
bprint(PRINT_HIGH, "Someone tried to issue Give in a Co-Op match. Nice try!\n");
|
||||
return COMMAND_FAILURE;
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ float(string params) Command_give =
|
|||
float(string params) Command_addmoney =
|
||||
{
|
||||
// Anti-Cheat in Co-Op.
|
||||
if (coop) {
|
||||
if (coop && cheats_have_been_activated == false) {
|
||||
bprint(PRINT_HIGH, "Someone tried to issue Add Money in a Co-Op match. Nice try!\n");
|
||||
return COMMAND_FAILURE;
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ float(string params) Command_softrestart =
|
|||
float(string params) Command_godmode =
|
||||
{
|
||||
// Anti-Cheat in Co-Op.
|
||||
if (coop) {
|
||||
if (coop && cheats_have_been_activated == false) {
|
||||
bprint(PRINT_HIGH, "Someone tried to issue God Mode in a Co-Op match. Nice try!\n");
|
||||
return COMMAND_FAILURE;
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ float(string params) Command_godmode =
|
|||
float(string params) Command_noclip =
|
||||
{
|
||||
// Anti-Cheat in Co-Op.
|
||||
if (coop) {
|
||||
if (coop && cheats_have_been_activated == false) {
|
||||
bprint(PRINT_HIGH, "Someone tried to issue No-Clip in a Co-Op match. Nice try!\n");
|
||||
return COMMAND_FAILURE;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue