chat_command_god_mode 1.0.2

Give dead silence pro to avoid dying when falling from a high height.

This only gives it if the player doesn't have it already and it only takes it away if it was granted by the god mode in the first time
This commit is contained in:
Resxt 2023-03-21 22:04:46 +01:00
parent 28679c87d7
commit 63ce9a008d

View File

@ -75,6 +75,19 @@ DoGodMode(enabled)
health = GetDvarInt("scr_player_maxhealth"); health = GetDvarInt("scr_player_maxhealth");
} }
deadSilencePro = "specialty_falldamage";
if (enabled && !self maps\mp\_utility::_hasPerk(deadSilencePro)) // if god mode is on and player doesn't have dead silence pro
{
self maps\mp\_utility::givePerk(deadSilencePro, false); // give dead silence pro
self.pers["god_mode_gave_perk"] = true;
}
else if (!enabled && self maps\mp\_utility::_hasPerk(deadSilencePro) && self.pers["god_mode_gave_perk"]) // if god mode is off and player has dead silence pro and it was given by god mode on
{
self maps\mp\_utility::_unsetperk(deadSilencePro); // remove dead silence pro
self.pers["god_mode_gave_perk"] = false;
}
self.maxhealth = health; self.maxhealth = health;
self.health = health; self.health = health;
} }