Skip to content

Commit

Permalink
fixed error when deletes
Browse files Browse the repository at this point in the history
  • Loading branch information
Quake1011 committed Nov 4, 2023
1 parent 13bf16c commit d2f0f49
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions WeaponDeleter(WeaponRestrict)/vscripts/WeaponDeleter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,13 @@ function Pickup(event)
local hPlayer = players[event["userid"]]["userid_pawn"]
for _,v in pairs(hPlayer:GetEquippedWeapons()) do
if wName == v:GetClassname() and CheckRestrictedForPlayer(wName, hPlayer) == true then
DoEntFireByInstanceHandle(cmd, "command", "lastinv", 0.1, hPlayer, hPlayer)
Timers:CreateTimer(0.1, function()
v:Kill()
UTIL_Remove(v)
if cfg["sound_status"] == 1 then
DoEntFireByInstanceHandle(cmd, "command", "play " .. cfg["sound_path"], 0.2, hPlayer, hPlayer)
end
DoEntFireByInstanceHandle(cmd, "command", "lastinv", 0.1, hPlayer, hPlayer)
return 0.0
end)
end
end
Expand Down

0 comments on commit d2f0f49

Please sign in to comment.