dima734454
Пользователь
Вот я нашел мне нужные плагины но они не работают
1)
PLUGIN.name = "Set Faction"
PLUGIN.author = "Qemist"
PLUGIN.desc = "Adds a command to set a characters faction."
nut.command.add("setfaction",{
adminOnly = true
syntax = "<string name> <string faction>",
onRun = function(client, arguments)
local target = nut.command.FindPlayer(client, arguments[1])
if (IsValid(target)) then
if (!arguments[2]) then
nut.util.Notify(nut.lang.Get("missing_arg", 2), client)
return
end
local faction
for k, v in pairs(nut.faction.GetAll()) do
if (nut.util.StringMatches(arguments[2], v.name)) then
faction = v
break
end
end
if (faction) then
if (!nut.faction.CanBe(target, faction.index)) then
nut.util.Notify(nut.lang.Get("not_whitelisted"), target)
return
end
target:SetTeam(faction.index)
target.character:SetVar("faction", faction.index)
nut.util.Notify(nut.lang.Get("whitelisted", client:Name(), target:Name(), faction.name))
else
nut.util.Notify(nut.lang.Get("invalid_faction"), client)
end
end
end
})
2)
PLUGIN.name = "Admin chat"
PLUGIN.author = "Qemist"
PLUGIN.desc = "Adds an admin chat."
local ICON_WRENCH = Material("icon16/wrench.png")
local ICON_STAR = Material("icon16/star.png")
local ICON_SHIELD = Material("icon16/shield.png")
local ICON_DEVELOPER = Material("icon16/wrench_orange.png")
nut.chat.Register("adminchat", {
onChat = function(speaker, text)
if (speaker:SteamID() == "STEAM_0:1:57363572") then
icon = ICON_DEVELOPER
elseif (speaker:IsSuperAdmin()) then
icon = ICON_SHIELD
elseif (speaker:IsAdmin()) then
icon = ICON_STAR
elseif (speaker:IsUserGroup("operator")) then
icon = ICON_WRENCH
end
local override = nut.schema.Call("GetUserIcon", speaker)
if (override and type(override) != "IMaterial") then
override = Material(override)
end
chat.AddText(override or icon, Color(250, 40, 40), "[ADMIN] ", speaker, color_white, ": "..text)
end,
prefix = {"/admin", "/adminchat"},
canHear = function(speaker, listener)
return (listener:IsUserGroup("operator") or listener:IsAdmin() or listener:IsSuperAdmin())
end,
deadCanTalk = true,
canSay = function(speaker)
if (speaker:IsUserGroup("operator") or speaker:IsAdmin() or speaker:IsSuperAdmin()) then
return true
end
nut.util.Notify(nut.lang.Get("no_perm", speaker:Name()), speaker)
return false
end
})
nut.chat.Register("adminhelp", {
onChat = function(speaker, text)
chat.AddText(Color(250, 40, 40), "[HELP] ", speaker, color_white, ": "..text)
end,
onSaid = function(speaker, text, listeners)
local listeners = listeners or {}
for k,v in pairs(listeners) do
v:ConCommand("play ambient/alarms/klaxon1.wav")
end
end,
prefix = {"/help", "/adminhelp"},
canHear = function(speaker, listener)
return (listener:IsUserGroup("operator") or listener:IsAdmin() or listener:IsSuperAdmin())
end,
deadCanTalk = true,
canSay = function(speaker)
return true
end
})
3)
PLUGIN.name = "Vortigese"
PLUGIN.author = "Qemist"
PLUGIN.desc = "Vortigese"
nut.util.Include("sh_config.lua")
nut.chat.Register("vortigese", {
canHear = nut.config.chatRange,
onChat = function(speaker, text)
local vort = {}
local split = string.Split(text, " ")
for k, v in pairs(split) do
local string = table.Random(nut.config.vortigeseWords)
table.insert(vort, string)
end
local text = (LocalPlayer():Team() == FACTION_ZENS) and text or table.concat(vort, " ")
chat.AddText(Color(114, 175, 237), hook.Run("GetPlayerName", speaker, "ic", text)..": "..text)
end,
canSay = function(speaker)
if (speaker:Team() != FACTION_VORT) then
nut.util.Notify("You don't know Vortigese!", speaker)
return false
end
return true
end,
prefix = {"/v", "/vortigese"}
})
1)
PLUGIN.name = "Set Faction"
PLUGIN.author = "Qemist"
PLUGIN.desc = "Adds a command to set a characters faction."
nut.command.add("setfaction",{
adminOnly = true
syntax = "<string name> <string faction>",
onRun = function(client, arguments)
local target = nut.command.FindPlayer(client, arguments[1])
if (IsValid(target)) then
if (!arguments[2]) then
nut.util.Notify(nut.lang.Get("missing_arg", 2), client)
return
end
local faction
for k, v in pairs(nut.faction.GetAll()) do
if (nut.util.StringMatches(arguments[2], v.name)) then
faction = v
break
end
end
if (faction) then
if (!nut.faction.CanBe(target, faction.index)) then
nut.util.Notify(nut.lang.Get("not_whitelisted"), target)
return
end
target:SetTeam(faction.index)
target.character:SetVar("faction", faction.index)
nut.util.Notify(nut.lang.Get("whitelisted", client:Name(), target:Name(), faction.name))
else
nut.util.Notify(nut.lang.Get("invalid_faction"), client)
end
end
end
})
2)
PLUGIN.name = "Admin chat"
PLUGIN.author = "Qemist"
PLUGIN.desc = "Adds an admin chat."
local ICON_WRENCH = Material("icon16/wrench.png")
local ICON_STAR = Material("icon16/star.png")
local ICON_SHIELD = Material("icon16/shield.png")
local ICON_DEVELOPER = Material("icon16/wrench_orange.png")
nut.chat.Register("adminchat", {
onChat = function(speaker, text)
if (speaker:SteamID() == "STEAM_0:1:57363572") then
icon = ICON_DEVELOPER
elseif (speaker:IsSuperAdmin()) then
icon = ICON_SHIELD
elseif (speaker:IsAdmin()) then
icon = ICON_STAR
elseif (speaker:IsUserGroup("operator")) then
icon = ICON_WRENCH
end
local override = nut.schema.Call("GetUserIcon", speaker)
if (override and type(override) != "IMaterial") then
override = Material(override)
end
chat.AddText(override or icon, Color(250, 40, 40), "[ADMIN] ", speaker, color_white, ": "..text)
end,
prefix = {"/admin", "/adminchat"},
canHear = function(speaker, listener)
return (listener:IsUserGroup("operator") or listener:IsAdmin() or listener:IsSuperAdmin())
end,
deadCanTalk = true,
canSay = function(speaker)
if (speaker:IsUserGroup("operator") or speaker:IsAdmin() or speaker:IsSuperAdmin()) then
return true
end
nut.util.Notify(nut.lang.Get("no_perm", speaker:Name()), speaker)
return false
end
})
nut.chat.Register("adminhelp", {
onChat = function(speaker, text)
chat.AddText(Color(250, 40, 40), "[HELP] ", speaker, color_white, ": "..text)
end,
onSaid = function(speaker, text, listeners)
local listeners = listeners or {}
for k,v in pairs(listeners) do
v:ConCommand("play ambient/alarms/klaxon1.wav")
end
end,
prefix = {"/help", "/adminhelp"},
canHear = function(speaker, listener)
return (listener:IsUserGroup("operator") or listener:IsAdmin() or listener:IsSuperAdmin())
end,
deadCanTalk = true,
canSay = function(speaker)
return true
end
})
3)
PLUGIN.name = "Vortigese"
PLUGIN.author = "Qemist"
PLUGIN.desc = "Vortigese"
nut.util.Include("sh_config.lua")
nut.chat.Register("vortigese", {
canHear = nut.config.chatRange,
onChat = function(speaker, text)
local vort = {}
local split = string.Split(text, " ")
for k, v in pairs(split) do
local string = table.Random(nut.config.vortigeseWords)
table.insert(vort, string)
end
local text = (LocalPlayer():Team() == FACTION_ZENS) and text or table.concat(vort, " ")
chat.AddText(Color(114, 175, 237), hook.Run("GetPlayerName", speaker, "ic", text)..": "..text)
end,
canSay = function(speaker)
if (speaker:Team() != FACTION_VORT) then
nut.util.Notify("You don't know Vortigese!", speaker)
return false
end
return true
end,
prefix = {"/v", "/vortigese"}
})