mirror of
https://github.com/Nereziel/cs2-WeaponPaints.git
synced 2026-02-17 18:39:07 +00:00
Compare commits
2 Commits
129b34f5c0
...
9e59456c9f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e59456c9f | ||
|
|
1f03e1c4f0 |
@@ -332,13 +332,27 @@ namespace WeaponPaints
|
||||
if (!PlayerHasKnife(player) && hasKnife)
|
||||
{
|
||||
var newKnife = new CBasePlayerWeapon(player.GiveNamedItem(CsItem.Knife));
|
||||
newKnife.AddEntityIOEvent("Kill", newKnife, null, "", 0.01f);
|
||||
var newWeapon = new CBasePlayerWeapon(player.GiveNamedItem(CsItem.USP));
|
||||
player.GiveNamedItem(CsItem.Knife);
|
||||
player.ExecuteClientCommand("slot3");
|
||||
newWeapon.AddEntityIOEvent("Kill", newWeapon, null, "", 0.01f);
|
||||
|
||||
Server.NextFrame(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
if (newKnife != null && newKnife.IsValid)
|
||||
newKnife.AddEntityIOEvent("Kill", newKnife, null, "", 0.01f);
|
||||
if (newWeapon != null && newWeapon.IsValid)
|
||||
newWeapon.AddEntityIOEvent("Kill", newWeapon, null, "", 0.01f);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogWarning("Error AddEntityIOEvent " + ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
foreach (var entry in weaponsWithAmmo)
|
||||
{
|
||||
foreach (var ammo in entry.Value)
|
||||
|
||||
Reference in New Issue
Block a user