mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 21:53:46 +03:00
Upload
This commit is contained in:
54
gamemodes/darkrp/schema/libs/sh_voices.lua
Normal file
54
gamemodes/darkrp/schema/libs/sh_voices.lua
Normal file
@@ -0,0 +1,54 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
Schema.voices = {}
|
||||
Schema.voices.stored = {}
|
||||
Schema.voices.classes = {}
|
||||
|
||||
function Schema.voices.Add(class, key, text, sound, global)
|
||||
class = string.utf8lower(class)
|
||||
key = string.utf8lower(key)
|
||||
|
||||
Schema.voices.stored[class] = Schema.voices.stored[class] or {}
|
||||
Schema.voices.stored[class][key] = {
|
||||
text = text,
|
||||
sound = sound,
|
||||
global = global
|
||||
}
|
||||
end
|
||||
|
||||
function Schema.voices.Get(class, key)
|
||||
class = string.utf8lower(class)
|
||||
key = string.utf8lower(key)
|
||||
|
||||
if (Schema.voices.stored[class]) then
|
||||
return Schema.voices.stored[class][key]
|
||||
end
|
||||
end
|
||||
|
||||
function Schema.voices.AddClass(class, condition)
|
||||
class = string.utf8lower(class)
|
||||
|
||||
Schema.voices.classes[class] = {
|
||||
condition = condition
|
||||
}
|
||||
end
|
||||
|
||||
function Schema.voices.GetClass(client)
|
||||
local classes = {}
|
||||
|
||||
for k, v in pairs(Schema.voices.classes) do
|
||||
if (v.condition(client)) then
|
||||
classes[#classes + 1] = k
|
||||
end
|
||||
end
|
||||
|
||||
return classes
|
||||
end
|
||||
Reference in New Issue
Block a user