mirror of
https://github.com/Resxt/Plutonium-IW5-Scripts.git
synced 2025-04-19 12:42:54 +00:00
Added disable_explosive_damage
Moved disable_explosive_damage to small scripts (deleted disable_explosive_damage folder) Updated small_scripts README to respect files ordering Refactor Fix for useless warnings in console
This commit is contained in:
parent
5f6d5b95fe
commit
dbb53a7008
@ -1,7 +0,0 @@
|
|||||||
# Disable Self Explosive Damage
|
|
||||||
|
|
||||||
Prevents players from dying to their own grenades and rockets.
|
|
||||||
Note that if you shoot enough rockets (around 15/20) you can still kill yourself.
|
|
||||||
This also doesn't prevent players from killing themselves when they hold a frag grenade in their hands.
|
|
||||||
|
|
||||||
You can add `iprintlnbold(iDamage);` at the beginning of `cancelDamage()` or any other variable found in `cancelDamage()` to debug it (see attacked player, attacker, damage, weapon used, damage type etc.)
|
|
@ -1,15 +0,0 @@
|
|||||||
init()
|
|
||||||
{
|
|
||||||
level.callbackplayerdamagestub = level.callbackplayerdamage;
|
|
||||||
level.callbackplayerdamage = ::cancelDamage;
|
|
||||||
}
|
|
||||||
|
|
||||||
cancelDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset )
|
|
||||||
{
|
|
||||||
if (eAttacker.name == self.name && sMeansOfDeath == "MOD_PROJECTILE_SPLASH" || eAttacker.name == self.name && sMeansOfDeath == "MOD_GRENADE_SPLASH" || eAttacker.name == self.name && sMeansOfDeath == "MOD_EXPLOSIVE")
|
|
||||||
{
|
|
||||||
iDamage = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
self [[level.callbackplayerdamagestub]]( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset );
|
|
||||||
}
|
|
@ -2,6 +2,16 @@
|
|||||||
|
|
||||||
Simple drag and drop scripts
|
Simple drag and drop scripts
|
||||||
|
|
||||||
|
## change_team_names.gsc
|
||||||
|
|
||||||
|
Change the team names to custom names depending on the game mode
|
||||||
|
|
||||||
|
## disable_self_explosive_damage.gsc
|
||||||
|
|
||||||
|
Prevents players from dying to their own grenades and rockets.
|
||||||
|
Note that if you shoot enough rockets (around 20/30) you can still kill yourself.
|
||||||
|
This also doesn't prevent players from killing themselves when they hold a frag grenade in their hands.
|
||||||
|
|
||||||
## display_player_stats.gsc
|
## display_player_stats.gsc
|
||||||
|
|
||||||
Display the player's killstreak, total kills and deaths on top of the screen
|
Display the player's killstreak, total kills and deaths on top of the screen
|
||||||
@ -10,7 +20,3 @@ Display the player's killstreak, total kills and deaths on top of the screen
|
|||||||
|
|
||||||

|

|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
## change_team_names.gsc
|
|
||||||
|
|
||||||
Change the team names to custom names depending on the game mode
|
|
29
small_scripts/disable_self_explosive_damage.gsc
Normal file
29
small_scripts/disable_self_explosive_damage.gsc
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
Init()
|
||||||
|
{
|
||||||
|
level.callbackplayerdamagestub = level.callbackplayerdamage;
|
||||||
|
level.callbackplayerdamage = ::DisableSelfExplosiveDamage;
|
||||||
|
}
|
||||||
|
|
||||||
|
DisableSelfExplosiveDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset )
|
||||||
|
{
|
||||||
|
if (isDefined(eAttacker))
|
||||||
|
{
|
||||||
|
if (isDefined(eAttacker.guid) && isDefined(self.guid))
|
||||||
|
{
|
||||||
|
if (eAttacker.guid == self.guid)
|
||||||
|
{
|
||||||
|
switch (sMeansOfDeath)
|
||||||
|
{
|
||||||
|
case "MOD_PROJECTILE_SPLASH": iDamage = 0;
|
||||||
|
break;
|
||||||
|
case "MOD_GRENADE_SPLASH": iDamage = 0;
|
||||||
|
break;
|
||||||
|
case "MOD_EXPLOSIVE": iDamage = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
self [[level.callbackplayerdamagestub]]( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset );
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user