English AdminSay e Membersay 2 lines

3 replies
Goto Page
To the start Previous 1 Next To the start
15.12.11 01:11:14 am
Up
XSmoker
User
Offline Off
Hello everyone! I made a script for my clan, so that when I say something, just show up "Smoker [WMD]: Hello CS2D" And when the members says something appears "player [member]: Hello CS2D," but it seems that two lines, for example,
"Smoker [ADMIN]: Hello"
"Smoker: Hello"
Help me!
See the script!
I want to appear only the line "Smoker [ADMIN]: Hello CS2D"
Quote:
members = {56023}
clanlist = {56023}

addhook("say","clansay")
function clansay(id,txt)
for _, usgn in ipairs(clanlist) do
if player(id,"usgn") == usgn then
     msg("©000255000"..player(id,"name").."[MEMBER]: "..txt)
end
end
end

admins = {56889}
adminlist = {56889}

addhook("say","admsay")
function admsay(id,txt)
for _, usgn in ipairs(adminlist) do
if player(id,"usgn") == usgn then
     msg("©255255255"..player(id,"name").."[ADMIN]: "..txt)
end
end
end
15.12.11 01:30:24 am
Up
EP
User
Offline Off
Code:
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
members = {56023}
clanlist = {56023}

addhook("say","clansay")
function clansay(id,txt)
for _, usgn in ipairs(clanlist) do
if player(id,"usgn") == usgn then
     msg("©000255000"..player(id,"name").."[MEMBER]: "..txt)
return 1
end
end
end

admins = {56889}
adminlist = {56889}

addhook("say","admsay")
function admsay(id,txt)
for _, usgn in ipairs(adminlist) do
if player(id,"usgn") == usgn then
     msg("©255255255"..player(id,"name").."[ADMIN]: "..txt)
return 1
end
end
end
Untested, the return 1 will help i think so.
15.12.11 09:20:42 am
Up
EngiN33R
Moderator
Offline Off
@user EP: That will not work, the say hooks will overlap and conflict.

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
adminlist = {56889}
clanlist = {56023}

addhook("say","sayparse")
function sayparse(id,txt)
for _, usgn in ipairs(clanlist) do
if player(id,"usgn") == usgn then
     msg("©000255000"..player(id,"name").."[MEMBER]: "..txt)
return 1
end
end
for _, usgn in ipairs(adminlist) do
if player(id,"usgn") == usgn then
     msg("©255255255"..player(id,"name").."[ADMIN]: "..txt)
return 1
end
end
end
I code, therefore I exist. | Visit my blog for Lua tips and other interesting info
15.12.11 08:13:48 pm
Up
XSmoker
User
Offline Off
user EngiN33R has written:
@user EP: That will not work, the say hooks will overlap and conflict.

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
adminlist = {56889}
clanlist = {56023}

addhook("say","sayparse")
function sayparse(id,txt)
for _, usgn in ipairs(clanlist) do
if player(id,"usgn") == usgn then
     msg("©000255000"..player(id,"name").."[MEMBER]: "..txt)
return 1
end
end
for _, usgn in ipairs(adminlist) do
if player(id,"usgn") == usgn then
     msg("©255255255"..player(id,"name").."[ADMIN]: "..txt)
return 1
end
end
end


Yes!! Thanks!!!
To the start Previous 1 Next To the start