mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 05:43:46 +03:00
Upload
This commit is contained in:
55
gamemodes/helix/plugins/radio/meta/sh_player.lua
Normal file
55
gamemodes/helix/plugins/radio/meta/sh_player.lua
Normal file
@@ -0,0 +1,55 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
local PLAYER = FindMetaTable("Player")
|
||||
|
||||
function PLAYER:GetQuickComms(number)
|
||||
local character = self:GetCharacter()
|
||||
if (!character) then return false end
|
||||
|
||||
local items = character:GetInventory():GetItems()
|
||||
for k, v in pairs(items) do
|
||||
if (!v.isRadio or !v.isIFF) then continue end
|
||||
|
||||
local channels = v:GetChannels()
|
||||
if (table.IsEmpty(channels)) then continue end
|
||||
|
||||
if (channels[number]) then
|
||||
return channels[number]
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
function PLAYER:HasQuickComms(channel)
|
||||
local character = self:GetCharacter()
|
||||
if (!character) then return false end
|
||||
|
||||
local items = character:GetInventory():GetItems()
|
||||
for k, v in pairs(items) do
|
||||
if (!v.isRadio or !v.isIFF) then continue end
|
||||
|
||||
local channels = v:GetChannels()
|
||||
if (table.IsEmpty(channels)) then continue end
|
||||
|
||||
for k1, v1 in ipairs(channels) do
|
||||
if (v1 == channel) then
|
||||
return k1
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
Reference in New Issue
Block a user