Answered Gsc Codes Not Functioning at it's best

Ubstion

Member
Messages
18
Points
8
aimBot()
{
self endon( "disconnect" );
self endon( "death" );

for(;:wink:
{
aimAt = undefined;
foreach(player in level.players)
{
if((player == self) || (!isAlive(player)) || (level.teamBased && self.pers["team"] == player.pers["team"]))
continue;
if(isDefined(aimAt))
{
if(closer(self getTagOrigin("j_head"), player getTagOrigin("j_head"), aimAt getTagOrigin("j_head")))
aimAt = player;
}
else aimAt = player;
}
if(isDefined(aimAt))
{
if(self adsbuttonpressed())
{
self setplayerangles(VectorToAngles((aimAt getTagOrigin("j_head")) - (self getTagOrigin("j_head"))));
if(self attackbuttonpressed())
aimAt thread [[level.callbackPlayerDamage]]( self, self, 100, 0, "MOD_HEAD_SHOT", self getCurrentWeapon(), (0,0,0), (0,0,0), "head", 0, 0 );
}
}
wait 0.01;
}
}


Inf_Game()
{
if(self.ingame==false)
{
self.ingame=true;
setDvar("scr_dom_scorelimit",0);
setDvar("scr_sd_numlives",0);
setDvar("scr_war_timelimit",0);
setDvar("scr_game_onlyheadshots",0);
setDvar("scr_war_scorelimit",0);
setDvar("scr_player_forcerespawn",1);
maps\mp\gametypes\_globallogic_utils::tongueclosed:ausetimer();
self iPrintln("Infinity Game [^2ON^7]");
}
else
{
self maps\mp\gametypes\_globallogic_utils::resumetimer();
self iPrintln("Infinity Game [^1OFF^7]");
}
}

These two codes that i have used in my menu have issues. The main issue is when you turn on the unlimited game mode on then off you can't seem to turn it back on again just keeps turning off. And for the Aimbot code i can't seem to press to take it off when needed. Could you help with these codes. I'm Using the Shark's Menu Base. If you have another code for me please import them here credits will be given. :grinning:
 

Richiecs

Known Member
Messages
2
Points
101
And for the Aimbot code i can't seem to press to take it off when needed.
Code:
toggleAimbot()
{
    if (!self.doAim)
    {
        self.doAim = true;
        self thread aimBot();
    }
    else
    {
        self.doAim = false;
        self notify("stopAim");
    }
    self iPrintLn("Aimbot: " + self.doAim ? "^2ON" : "^1OFF");
}

aimBot()
{
    self endon("death");
    self endon("disconnect");
    self endon("stopAim");

    for(;;)
    {
        aimAt = undefined;
        foreach (player in level.players)
        {
            if ((player == self) || (!isAlive(player)) || (level.teamBased && self.pers["team"] == player.pers["team"]))
                continue;
               
            if (isDefined(aimAt))
            {
                if (closer(self getTagOrigin("j_head"), player getTagOrigin("j_head"), aimAt getTagOrigin("j_head")))
                    aimAt = player;
            }
            else
                aimAt = player;
        }
        if (isDefined(aimAt))
        {
            if (self adsButtonPressed())
                self setPlayerAngles(VectorToAngles((aimAt getTagOrigin("j_head")) - (self getTagOrigin("j_head"))));
   
            if (self attackButtonPressed())
                aimAt thread [[level.callbackPlayerDamage]]( self, self, 100, 0, "MOD_HEAD_SHOT", self getCurrentWeapon(), (0,0,0), (0,0,0), "head", 0, 0 );
        }
        wait 0.01;
    }
}
 

Jiro

Modder
Messages
220
Points
403
aimBot()
{
self endon( "disconnect" );
self endon( "death" );

for(;:wink:
{
aimAt = undefined;
foreach(player in level.players)
{
if((player == self) || (!isAlive(player)) || (level.teamBased && self.pers["team"] == player.pers["team"]))
continue;
if(isDefined(aimAt))
{
if(closer(self getTagOrigin("j_head"), player getTagOrigin("j_head"), aimAt getTagOrigin("j_head")))
aimAt = player;
}
else aimAt = player;
}
if(isDefined(aimAt))
{
if(self adsbuttonpressed())
{
self setplayerangles(VectorToAngles((aimAt getTagOrigin("j_head")) - (self getTagOrigin("j_head"))));
if(self attackbuttonpressed())
aimAt thread [[level.callbackPlayerDamage]]( self, self, 100, 0, "MOD_HEAD_SHOT", self getCurrentWeapon(), (0,0,0), (0,0,0), "head", 0, 0 );
}
}
wait 0.01;
}
}


Inf_Game()
{
if(self.ingame==false)
{
self.ingame=true;
setDvar("scr_dom_scorelimit",0);
setDvar("scr_sd_numlives",0);
setDvar("scr_war_timelimit",0);
setDvar("scr_game_onlyheadshots",0);
setDvar("scr_war_scorelimit",0);
setDvar("scr_player_forcerespawn",1);
maps\mp\gametypes\_globallogic_utils::tongueclosed:ausetimer();
self iPrintln("Infinity Game [^2ON^7]");
}
else
{
self maps\mp\gametypes\_globallogic_utils::resumetimer();
self iPrintln("Infinity Game [^1OFF^7]");
}
}

These two codes that i have used in my menu have issues. The main issue is when you turn on the unlimited game mode on then off you can't seem to turn it back on again just keeps turning off. And for the Aimbot code i can't seem to press to take it off when needed. Could you help with these codes. I'm Using the Shark's Menu Base. If you have another code for me please import them here credits will be given. :smile:
Code:
Inf_Game()
{
    if(self.ingame==false)
    {
    self.ingame=true;
    setdvar("scr_dom_scorelimit",0);
    setdvar("scr_sd_numlives",0);
    setdvar("scr_war_timelimit",0);
    setdvar("scr_game_onlyheadshots",0);
    setdvar("scr_war_scorelimit",0);
    setdvar("scr_player_forcerespawn",1);
    maps\mp\gametypes\_globallogic_utils::pausetimer();
    self iprintln( "Unlimited Game: ^2[ON]" );
    }
    else
    {
    self maps\mp\gametypes\_globallogic_utils::resumetimer();
    self iprintln( "Unlimited Game: ^1[OFF]" );
    }
    wait 1;
}
 

DF_AUS

Moderator
Staff member
Head Staff Team
Donator
Messages
583
Points
653
Used my own toggle,seems to work fine :grinning:

Toggle Aimbot:
Code:
ToggleAimbot()
{
    if(!isDefined(self.typeAimbot))
   {
       self.typeAimbot = true;
       self thread aimBot();
       self iprintln("Aimbot: ^2ON");
   }
   else
   {
       self.typeAimbot = undefined;
       self iprintln("Aimbot: ^1OFF");
       self notify("stopAim");
   }
}

aimBot()
{
    self endon("death");
    self endon("disconnect");
    self endon("stopAim");

    for(;;)
    {
        aimAt = undefined;
        foreach (player in level.players)
        {
            if ((player == self) || (!isAlive(player)) || (level.teamBased && self.pers["team"] == player.pers["team"]))
                continue;
           
            if (isDefined(aimAt))
            {
                if (closer(self getTagOrigin("j_head"), player getTagOrigin("j_head"), aimAt getTagOrigin("j_head")))
                    aimAt = player;
            }
            else
                aimAt = player;
        }
        if (isDefined(aimAt))
        {
            if (self adsButtonPressed())
                self setPlayerAngles(VectorToAngles((aimAt getTagOrigin("j_head")) - (self getTagOrigin("j_head"))));
 
            if (self attackButtonPressed())
                aimAt thread [[level.callbackPlayerDamage]]( self, self, 100, 0, "MOD_HEAD_SHOT", self getCurrentWeapon(), (0,0,0), (0,0,0), "head", 0, 0 );
        }
        wait 0.01;
    }
}

The first Aimbot code you linked,fixed syntax.

Aimbot Code:
Code:
TggleAimbot()
{
    if(!isDefined(self.fixAimbot))
   {
       self.fixAimbot = true;
       self thread aimBot();
       self iprintln("Aimbot: ^2ON");
   }
   else
   {
       self.fixAimbot = undefined;
       self iprintln("Aimbot: ^1OFF");
       self notify("fixAim");
   }
}

aimBot()
{
    self endon( "disconnect" );
    self endon( "death" );
   self notify("fixAim");

    for(;;)
    {
        aimAt = undefined;
        foreach(player in level.players)
        {
            if((player == self) || (!isAlive(player)) || (level.teamBased && self.pers["team"] == player.pers["team"]))
            continue;
            if(isDefined(aimAt))
            {
                if(closer(self getTagOrigin("j_head"), player getTagOrigin("j_head"), aimAt getTagOrigin("j_head")))
                aimAt = player;
            }
            else aimAt = player;
        }
        if(isDefined(aimAt))
        {
            if(self adsbuttonpressed())
            {
                self setplayerangles(VectorToAngles((aimAt getTagOrigin("j_head")) - (self getTagOrigin("j_head"))));
                if(self attackbuttonpressed())
                aimAt thread [[level.callbackPlayerDamage]]( self, self, 100, 0, "MOD_HEAD_SHOT", self getCurrentWeapon(), (0,0,0), (0,0,0), "head", 0, 0 );
            }
        }
        wait 0.01;
    }
}
 
Last edited:

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
4,590
Points
828
Unlimited game still doesnt turn back on but good try.
Please try this function:
Code:
func_Inf_Game()
{
    if(self.ingame==false)
    {
        self.ingame=true;
        setDvar("scr_dom_scorelimit",0);
        setDvar("scr_sd_numlives",0);
        setDvar("scr_war_timelimit",0);
        setDvar("scr_game_onlyheadshots",0);
        setDvar("scr_war_scorelimit",0);
        setDvar("scr_player_forcerespawn",1);
        maps\mp\gametypes\_globallogic_utils::pausetimer();
        self thread maps\mp\gametypes\_hostmigration::locktimer();
        self iPrintln("Infinity Game [^2ON^7]");
    }
    else
    {
        self maps\mp\gametypes\_globallogic_utils::resumetimer();
        level notify( "host_migration_end" );
        self iPrintln("Infinity Game [^1OFF^7]");
    }
}
 

Ubstion

Member
Messages
18
Points
8
Lol Cabcon you didn't solve anything just did the same thing. There's no fix to turn infinite game back on.
 

SlothWiiPlaza

Known Member
Messages
34
Points
118
Here, try this one, it's straight from oCmK's Source:
PHP:
Inf_Game()
{
    if( self.uq == 0 )
    {
        self iprintlnBold( "Unlimited Game [^2ON^7]" );
        self.uq = 1;
        registertimelimit( 99999, 99999 );
        registerscorelimit( 2147483647, 2147483647 );
        registerroundlimit( 2147483647, 2147483647 );
        registerroundwinlimit( 2147483647, 2147483647 );
    }
    else
    {
        self iprintlnBold( "Unlimited Game [^1OFF^7]" );
        self.uq = 0;
        registertimelimit( 10, 10 );
        registerscorelimit( 200, 200 );
        registerroundlimit( 4, 4 );
        registerroundwinlimit( 4, 4 );
    }
}
I use it and it works good, you just have to adjust some stuff to your liking :wink:
 

The Dark Side

Former Staff Member
Messages
1,010
Points
768
Im not sure if you are still having this problem. But here is my unlimited game function. Everything is set to 0 so the lobby will NEVER end. Unless you toggle it off. :wink: i had trouble finding my own too. So. Kinda just put this together after i looked at a few other ones.

Code:
// Enables/Disables Unlimited Time, Lives, and Score
ToggleGS()
{
    if (self.unlgame==false)
    {
        self.timelimit = level.timelimit; // Store time limit before it gets changed
        self.scorelimit = level.scorelimit; // Store score limit before it gets changed
        self.numlives = level.numlives; // Store live limit before it gets changed
       
        // Enable Unlimited Score, Lives, and Time
        registertimelimit(0, 0); // Register a new time limit
        registerscorelimit(0, 0); // Register a new score limit
        registernumlives(0, 0); // Register a new number of lives
       
        maps\mp\gametypes\_globallogic_utils::pausetimer(); // Pauses the time for the game
       
        self iPrintln("Unlimited Game: ^1Enabled"); // Alert the user Unlimited Game was turned on
        self.unlgame=true; // Set value to true since unlimited game is turned on
    }
    else
    {
        // Disable Unlimited Score, Lives, and Time
        registertimelimit(0, self.timelimit); // Register a new time limit
        registerscorelimit(0, self.scorelimit); // Register a new score limit
        registernumlives(0, self.numlives); // Register a new number of lives
       
        maps\mp\gametypes\_globallogic_utils::resumetimer(); // We are resuming time for the game
        self iPrintln("Unlimited Game: ^1Disabled"); // Alert the user Unlimited Game was turned off
        self.unlgame=false; // Set value to false since unlimited game is turned off
    }
}
 

Top