mirror of
https://github.com/Nereziel/cs2-WeaponPaints.git
synced 2026-03-16 18:40:08 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6d4108ca7 | ||
|
|
7b45169d8d | ||
|
|
42bd45c3f0 |
@@ -195,6 +195,7 @@ public class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig>
|
||||
}
|
||||
Server.NextFrame(() =>
|
||||
{
|
||||
try {
|
||||
if (!weapon.IsValid) return;
|
||||
if (weapon.OwnerEntity.Value == null) return;
|
||||
if (!weapon.OwnerEntity.Value.EntityIndex.HasValue) return;
|
||||
@@ -225,6 +226,7 @@ public class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig>
|
||||
var skeleton = GetSkeletonInstance(weapon.CBodyComponent.SceneNode);
|
||||
skeleton.ModelState.MeshGroupMask = 2;
|
||||
}
|
||||
} catch(Exception) {}
|
||||
});
|
||||
}
|
||||
public void GiveKnifeToPlayer(CCSPlayerController player)
|
||||
@@ -267,6 +269,7 @@ public class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig>
|
||||
}
|
||||
public void RefreshPlayerKnife(CCSPlayerController player)
|
||||
{
|
||||
if (!player.IsValid || !player.PawnIsAlive) return;
|
||||
if (!PlayerHasKnife(player))
|
||||
GiveKnifeToPlayer(player);
|
||||
}
|
||||
@@ -320,11 +323,11 @@ public class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig>
|
||||
|
||||
public bool PlayerHasKnife(CCSPlayerController player)
|
||||
{
|
||||
if (!Config.Additional.KnifeEnabled) return true;
|
||||
if (!Config.Additional.KnifeEnabled) return false;
|
||||
|
||||
if (!player.IsValid || !player.PlayerPawn.IsValid)
|
||||
if (!player.IsValid || !player.PawnIsAlive)
|
||||
{
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
var weapons = player.PlayerPawn.Value.WeaponServices!.MyWeapons;
|
||||
|
||||
Reference in New Issue
Block a user