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,12 +332,26 @@ namespace WeaponPaints
|
|||||||
if (!PlayerHasKnife(player) && hasKnife)
|
if (!PlayerHasKnife(player) && hasKnife)
|
||||||
{
|
{
|
||||||
var newKnife = new CBasePlayerWeapon(player.GiveNamedItem(CsItem.Knife));
|
var newKnife = new CBasePlayerWeapon(player.GiveNamedItem(CsItem.Knife));
|
||||||
newKnife.AddEntityIOEvent("Kill", newKnife, null, "", 0.01f);
|
|
||||||
var newWeapon = new CBasePlayerWeapon(player.GiveNamedItem(CsItem.USP));
|
var newWeapon = new CBasePlayerWeapon(player.GiveNamedItem(CsItem.USP));
|
||||||
player.GiveNamedItem(CsItem.Knife);
|
player.GiveNamedItem(CsItem.Knife);
|
||||||
player.ExecuteClientCommand("slot3");
|
player.ExecuteClientCommand("slot3");
|
||||||
|
|
||||||
|
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);
|
newWeapon.AddEntityIOEvent("Kill", newWeapon, null, "", 0.01f);
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.LogWarning("Error AddEntityIOEvent " + ex.Message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
foreach (var entry in weaponsWithAmmo)
|
foreach (var entry in weaponsWithAmmo)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user