-
Notifications
You must be signed in to change notification settings - Fork 1
/
12_say.lua
74 lines (71 loc) · 3.12 KB
/
12_say.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
sBot = SetMan.GetString(21)
tProfile = {
[0] = 1, [1] = 0,
}
tVIP = {
[""] = 1,
}
function ChatArrival(user,sData)
local sData = string.sub(sData,1,-2)
local _,_,cmd = string.find(sData, "%b<>%s+(%S*)")
if cmd == "!say" then
local _,_,sNick,sMsg = string.find(sData, "%b<>%s+%S*%s*(%S*)%s*(.*)")
if tProfile[user.iProfile] == 1 or tVIP[user.sNick] == 1 then
if sNick == "" then
Core.SendToUser(user,"<"..sBot.."> Ïîæàëóéñòà, ââåäèòå íèê, îò êîòîðîãî áóäåò ïîñëàíî ñîîáùåíèå")
elseif sMsg == "" then
Core.SendToUser(user,"<"..sBot.."> Ïîæàëóéñòà, ââåäèòå ñîîáùåíèå äëÿ "..sNick.." , êîòîðîå îí ïðîèçíåñåò.")
else
Core.SendToAll("<"..sNick.."> ".. sMsg)
Core.SendPmToOps(SetMan.GetString(24), "*** "..user.sNick.." ñêàçàë îò íèêà "..sNick.." ñîîáùåíèå: \""..sMsg.."\"")
end
return true
else
Core.SendToUser(user,"<"..sBot.."> Ó Âàñ íåò äîñòóïà ê äàííîé êîìàíäå!")
Core.SendPmToOps(SetMan.GetString(24), "*** "..user.sNick.." ïîïûòàëñÿ ñêàçàòü îò íèêà "..sNick.." ñîîáùåíèå: \""..sMsg.."\", íî ó íåãî íè÷åãî íå âûøëî.")
end
return true
end
if cmd == "!sysay" then
local _,_,sMsg = string.find(sData, "%b<>%s+%S+%s+(.*)")
if tProfile[user.iProfile] == 1 or tVIP[user.sNick] == 1 then
if sMsg == "" then
Core.SendToUser(user,"<"..sBot.."> Ïîæàëóéñòà, ââåäèòå ñàìî ñîîáùåíè!")
return true
else
Core.SendToAll(sMsg)
Core.SendPmToOps(SetMan.GetString(24), "*** "..user.sNick.." ñêàçàë áåç íèêà ñîîáùåíèå: \""..sMsg.."\"")
end
return true
else
Core.SendToUser(user,"<"..sBot.."> Ó Âàñ íåò äîñòóïà ê äàííîé êîìàíäå!")
Core.SendPmToOps(SetMan.GetString(24), "*** "..user.sNick.." ïîïûòàëñÿ ñêàçàòü áåç íèêà ñîîáùåíèå: \""..sMsg.."\", íî ó íåãî íè÷åãî íå âûøëî")
end
return true
end
if cmd == "!pm_say" then
local _,_, to, from, say = string.find(sData, "%b<>%s+%S+%s+(%S*)%s*(%S*)%s*(.*)")
if tProfile[user.iProfile] == 1 or tVIP[user.sNick] == 1 then
if say == "" then
Core.SendToUser(user,"<"..sBot.."> Ïîæàëóéñòà, ââåäèòå ñàìî ñîîáùåíè!")
return true
else
Core.SendPmToNick(to,from,say)
Core.SendPmToOps(SetMan.GetString(24), "*** "..user.sNick.." íàïèñàë â PM îò íèêà "..from.." äëÿ íèêà "..to.." ñîîáùåíèå: \""..say.."\"")
end
else
Core.SendToUser(user,"<"..sBot.."> Ó Âàñ íåò äîñòóïà ê äàííîé êîìàíäå!")
Core.SendPmToOps(SetMan.GetString(24), "*** "..user.sNick.." ïîïûòàëñÿ íàïèñàòü â PM îò íèêà "..from.." äëÿ íèêà "..to.." ñîîáùåíèå: \""..say.."\", íî ó íåãî íè÷åãî íå âûøëî")
end
return true
end
end
function UserConnected(user)
if tProfile[user.iProfile] == 1 or tVIP[user.sNick] == 1 then
Core.SendToUser(user,"$UserCommand 1 3 ÑÎÎÁÙÅÍÈß\\Ñêàçàòü îò íèêà..$<%[mynick]> !say %[line:Ââåäèòå íèê] %[line:Ââåäèòå òåêñò]|")
Core.SendToUser(user,"$UserCommand 1 3 ÑÎÎÁÙÅÍÈß\\Ñêàçàòü áåç íèêà..$<%[mynick]> !sysay %[line:Ââåäèòå òåêñò]|")
Core.SendToUser(user,"$UserCommand 1 3 ÑÎÎÁÙÅÍÈß\\Ñêàçàòü îò íèêà â PM..$<%[mynick]> !pm_say %[line:Êîìó] %[line:Îò êîãî] %[line:Ââåäèòå òåêñò ñîîáùåíèÿ]|")
end
end
OpConnected = UserConnected
RegConnected = UserConnected