From 63ce9a008d50e970a6bf114c6f86afef9286a1e3 Mon Sep 17 00:00:00 2001 From: Resxt <55228336+Resxt@users.noreply.github.com> Date: Tue, 21 Mar 2023 22:04:46 +0100 Subject: [PATCH] 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 --- chat_commands/chat_command_god_mode.gsc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/chat_commands/chat_command_god_mode.gsc b/chat_commands/chat_command_god_mode.gsc index c9c2807..4c51635 100644 --- a/chat_commands/chat_command_god_mode.gsc +++ b/chat_commands/chat_command_god_mode.gsc @@ -75,6 +75,19 @@ DoGodMode(enabled) 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.health = health; } \ No newline at end of file