Post: Keep a function on even if its the next game/round
06-25-2016, 12:41 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); How would I keep a function on if its the next game/round.

For example with the godmode code

Toggle_God()
{
if(self.God==false)
{
self iPrintln("God Mode [^2ON^7]");
self.maxhealth=999999999;
self.health=self.maxhealth;
if(self.health<self.maxhealth)self.health=self.maxhealth;
self enableInvulnerability();
self.God=true;
}
else
{
self iPrintln("God Mode [^1OFF^7]");
self.maxhealth=100;
self.health=self.maxhealth;
self disableInvulnerability();
self.God=false;
}
}
(adsbygoogle = window.adsbygoogle || []).push({});
06-25-2016, 01:29 AM #2
ODLeslie
Do a barrel roll!
Originally posted by Mrtbyhyourwme View Post
How would I keep a function on if its the next game/round.

For example with the godmode code

Toggle_God()
{
if(self.God==false)
{
self iPrintln("God Mode [^2ON^7]");
self.maxhealth=999999999;
self.health=self.maxhealth;
if(self.health<self.maxhealth)self.health=self.maxhealth;
self enableInvulnerability();
self.God=true;
}
else
{
self iPrintln("God Mode [^1OFF^7]");
self.maxhealth=100;
self.health=self.maxhealth;
self disableInvulnerability();
self.God=false;
}
}




I've never thought of that being usuful, because a function like super speed that's a dvar will stay for the next game if you don't disable it, which i find stupid, but it may be handy for some functions, someone might be able to do this but i don't see how it's useful

You've got "Demi-God" and God Mode in the one function mate, it's not a big deal but it's alot cleaner if you want to use this instead:
    
Toggle_God()
{
if(self.God==false)
{
self.God=true;
self enableInvulnerability();
self iPrintln("God Mode [^2ON^7]");
}
else
{
self.God=false;
self disableInvulnerability();
self iPrintln("God Mode [^1OFF^7]");
}
}
06-25-2016, 01:39 AM #3
I would think the only real way of doing this would be through dvar but it would then do it for everyone that is a certain rank so still no good way of doing it.
06-25-2016, 01:40 AM #4
HiddenHour
I defeated!
You must login or register to view this content. could work

    Toggle_God()
{
if(GetClientDvar(self, "cus_godmode", "int") == 0)
{
SetClientDvar(self, "cus_godmode", 1)
self enableInvulnerability();
self iPrintln("God Mode [^2ON^7]");
}
else
{
SetClientDvar(self, "cus_godmode", 0)
self disableInvulnerability();
self iPrintln("God Mode [^1OFF^7]");
}
}

onPlayerSpawned()
{
if(GetClientDvar(self, "cus_godmode", "int")==1)
self enableInvulnerability();
}

//SetClientDvar(player, dvar, dvar_value)
//GetClientDvar(player, dvar, type)


Haven't tested but you get the idea

The following user thanked HiddenHour for this useful post:

Mrtbyhyourwme

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo