GSC Black-Ops 2 Toggles

Se7ensinsMods

Known Member
Messages
1
Reaction score
0
Points
101
Here a cleaner way too toggle on and off scripts
Code:
toggleFOV()
{
    if(self setClientFov(105)&& self.FOV==false&& self iPrintln("Pro Mod ^2ON"))
    {
        self.FOV=true;
    }
    else if(self setClientFov(65)&& self.FOV==true&& self iPrintln("Pro Mod ^1OFF"))
    {
        self.FOV=false;
    }
}
doGmode()
{
    if(self EnableInvulnerability()&& self.gmode==false&& self iprintln("GOD MODE ^2ON"))
    {
        self.maxhealth=99999999;
        self.health=self.maxhealth;
        while(self.health < self.maxhealth)
        {
            self.health=self.maxhealth;
        }
        self.gmode=true;
    }
    else if(self DisableInvulnerability()&& self.gmode==true&& self iPrintln("GOD MODE ^1OFF"))
    {
        self.maxhealth=100;
        self.gmode=false;
    }
}
hearallplayers()
{
    if(self.hall==false&& self iPrintln("Hear All ^2ON"))
    {
        self.hall=true;
        hear=StrTok("EveryoneHearsEveryone,DeadChatWithDead,DeadChatWithTeam,DeadHearTeamLiving,DeadHearAllLiving",",");
        for(j=0;j < hear.size;j++)
        {
            SetMatchTalkFlag(hear[j],1);
        }
    }
    else if(self.hall==true&& self iPrintln("Hear All ^1OFF"))
    {
        self.hall=false;
        hear2=StrTok("EveryoneHearsEveryone,DeadChatWithDead,DeadChatWithTeam,DeadHearTeamLiving,DeadHearAllLiving",",");
        for(j=0;j < hear2.size;j++)
        {
            SetMatchTalkFlag(hear2[j],0);
        }
    }
}
Invisible()
{
    if(self Hide()&& self.ghst==false&& self iprintln("Invisible Mode: [^2Active^7]"))
    {
        self.ghst=true;
    }
    else if(self Show()&& self.ghst==true&& self iprintln("Invisible Mode: [^1Desactive^7]"))
    {
        self.ghst=false;
    }
}
 

candy

G59 Terrorist
Staff member
Donator
Messages
1,327
Reaction score
763
Points
973
Here a cleaner way too toggle on and off scripts
Code:
toggleFOV()
{
    if(self setClientFov(105)&& self.FOV==false&& self iPrintln("Pro Mod ^2ON"))
    {
        self.FOV=true;
    }
    else if(self setClientFov(65)&& self.FOV==true&& self iPrintln("Pro Mod ^1OFF"))
    {
        self.FOV=false;
    }
}
doGmode()
{
    if(self EnableInvulnerability()&& self.gmode==false&& self iprintln("GOD MODE ^2ON"))
    {
        self.maxhealth=99999999;
        self.health=self.maxhealth;
        while(self.health < self.maxhealth)
        {
            self.health=self.maxhealth;
        }
        self.gmode=true;
    }
    else if(self DisableInvulnerability()&& self.gmode==true&& self iPrintln("GOD MODE ^1OFF"))
    {
        self.maxhealth=100;
        self.gmode=false;
    }
}
hearallplayers()
{
    if(self.hall==false&& self iPrintln("Hear All ^2ON"))
    {
        self.hall=true;
        hear=StrTok("EveryoneHearsEveryone,DeadChatWithDead,DeadChatWithTeam,DeadHearTeamLiving,DeadHearAllLiving",",");
        for(j=0;j < hear.size;j++)
        {
            SetMatchTalkFlag(hear[j],1);
        }
    }
    else if(self.hall==true&& self iPrintln("Hear All ^1OFF"))
    {
        self.hall=false;
        hear2=StrTok("EveryoneHearsEveryone,DeadChatWithDead,DeadChatWithTeam,DeadHearTeamLiving,DeadHearAllLiving",",");
        for(j=0;j < hear2.size;j++)
        {
            SetMatchTalkFlag(hear2[j],0);
        }
    }
}
Invisible()
{
    if(self Hide()&& self.ghst==false&& self iprintln("Invisible Mode: [^2Active^7]"))
    {
        self.ghst=true;
    }
    else if(self Show()&& self.ghst==true&& self iprintln("Invisible Mode: [^1Desactive^7]"))
    {
        self.ghst=false;
    }
}
If you're saying this is a cleaner way of doing toggles, no. Just no.
I suppose you mainly went for less lines, which sure, I guess. But doesn't make it 'clean'.
 
Last edited:
Top