mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 13:53:45 +03:00
Upload
This commit is contained in:
57
lua/arccw/shared/sh_controls.lua
Normal file
57
lua/arccw/shared/sh_controls.lua
Normal file
@@ -0,0 +1,57 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
net.Receive("arccw_firemode", function(len, ply)
|
||||
local wpn = ply:GetActiveWeapon()
|
||||
|
||||
if !wpn.ArcCW then return end
|
||||
|
||||
wpn:ChangeFiremode()
|
||||
end)
|
||||
|
||||
net.Receive("arccw_ubgl", function(len, ply)
|
||||
local on = net.ReadBool()
|
||||
local wpn = ply:GetActiveWeapon()
|
||||
|
||||
if !wpn.ArcCW then return end
|
||||
|
||||
if on then
|
||||
wpn:SelectUBGL()
|
||||
else
|
||||
wpn:DeselectUBGL()
|
||||
end
|
||||
end)
|
||||
|
||||
if CLIENT then
|
||||
net.Receive("arccw_togglecustomize", function()
|
||||
if !LocalPlayer():GetActiveWeapon() or !LocalPlayer():GetActiveWeapon().ArcCW then return end
|
||||
LocalPlayer():GetActiveWeapon():ToggleCustomizeHUD(net.ReadBool())
|
||||
end)
|
||||
elseif SERVER then
|
||||
net.Receive("arccw_togglecustomize", function(len, ply)
|
||||
local wpn = ply:GetActiveWeapon()
|
||||
local onoff = net.ReadBool()
|
||||
|
||||
if !wpn.ArcCW then return end
|
||||
|
||||
wpn:ToggleCustomizeHUD(onoff)
|
||||
end)
|
||||
end
|
||||
|
||||
hook.Add("EntityTakeDamage", "ArcCW_CloseOnHurt", function(ply, dmg)
|
||||
if ply:IsPlayer() and ply:GetActiveWeapon() and ply:GetActiveWeapon().ArcCW
|
||||
and tobool(ply:GetInfo("arccw_attinv_closeonhurt"))
|
||||
and ply:GetActiveWeapon():GetState() == ArcCW.STATE_CUSTOMIZE then
|
||||
net.Start("arccw_togglecustomize")
|
||||
net.WriteBool(false)
|
||||
net.Send(ply)
|
||||
ply:GetActiveWeapon():ToggleCustomizeHUD(false)
|
||||
end
|
||||
end)
|
||||
Reference in New Issue
Block a user