English Admin Script dont work ??

15 replies
Goto Page
To the start Previous 1 Next To the start
18.07.13 08:08:21 pm
Up
CaneCorso
User
Offline Off
Where is the probleme in this script ??
I Start Make Simple Script " to use in my servers " coming soon , and i have a probleme in say ??
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
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
Owner = {}
Admin = {}
Mod = {}
Controler = {}
VIP = {}

colors = 1

addhook("say","says")
function says(id,t)
for _,usgn in ipairs(Owner) do
if player(id,'usgn') == usgn then
if colors == 1 then
msg("©255000000 >Owner< "..player(id,"name).." : "..t
return 1
end
end
end
for _, usgn in ipairs (Admin) do
if player(id,'usgn') == usgn then
if colors == 1 then
msg("©255255000 >Admin< "..player(id,"name").." : "..t)
end
end
end
for _, usgn in ipairs (Mod) do
if player(id,'usgn') == usgn then
if colors == 1 then
msg("©000255000 >Mod< "..player(id,"name").." : "..t)
end
end
end
for _, usgn in ipairs (Controler) do
if player(id,'usgn') == usgn then
if colors == 1 then
msg("©000000255 >Controler< "..player(id,"name").." : "..t)
end
end
end
for _,usgn in ipairs (VIP) do
if player(id,'usgn') == usgn then
if colors == 1 then
msg("©000255255 >VIP< "player(id,"name").." : "..t)
end
end
end
end

addhook("say","sayss")
function sayss(id,t)
if colors == 0 then
return false
end
end

addhook("say","ed")
function ed(id,txt)
for __, usgn in ipairs(Owner) do
if player(id,'usgn') == usgn then
if txt == "!tagon" then
colors = 1
elseif txt == "!tagoff" then
colors = 0
end
return 1
end
end
for _, usgn in ipairs(Admin) do
if player(id,'usgn') == usgn then
if txt == "!tagon" then
colors = 1
elseif txt == "!tagoff" then
colors = 0
end
return 1
end
end
addhook("say","ed")
function ed(id,txt)
for __, usgn in ipairs(Mod) do
if player(id,'usgn') == usgn then
if txt == "!tagon" then
colors = 1
elseif txt == "!tagoff" then
colors = 0
end
return 1
end
end
for _, usgn in ipairs(Controler) do
if player(id,'usgn') == usgn then
if txt == "!tagon" then
colors = 1
elseif txt == "!tagoff" then
colors = 0
end
return 1
end
end
for _, usgn in ipairs(VIP) do
if player(id,'usgn') == usgn then
if txt == "!tagon" then
colors = 1
elseif txt == "!tagoff" then
colors = 0
end
return 1
end
end
end

where is probleme ?
18.07.13 08:19:54 pm
Up
Necr0
User
Offline Off
code >


i didn't test it but it should work
edited 1×, last 18.07.13 08:30:05 pm
18.07.13 08:33:03 pm
Up
Rainoth
Moderator
Offline Off
Mind that you didn't make it with ID and you didn't enter any usgn IDs in your tables. So it won't work so easily and if lets say admin turns off "tag" then it will turn off for everybody, not just him.
18.07.13 08:40:13 pm
Up
CaneCorso
User
Offline Off
user Rainoth has written:
Mind that you didn't make it with ID and you didn't enter any usgn IDs in your tables. So it won't work so easily and if lets say admin turns off "tag" then it will turn off for everybody, not just him.

No , i added the usgn in my server testing but it dont work , Can You give my code working ?
18.07.13 08:43:25 pm
Up
Conscience
User
Offline Off
Merge all the say hooks, quite an obvious problem.
Remember to learn to forget. Whiskey shots and cheap cigarettes.
18.07.13 08:53:54 pm
Up
CaneCorso
User
Offline Off
i tested it , and it dont work ... xDDD
Code:
1
2
3
4
5
6
7
8
9
10
11
Owner = {112942}

addhook("say","says")
function says(id,t)
for _,usgn in ipairs (Owner) do
if player(id,'usgn') == usgn then
msg("©255000000 >Owner< "..player(id,"name).." : "..t)
return 1
end
end
end

Where is the probleme ?
18.07.13 08:58:18 pm
Up
Rainoth
Moderator
Offline Off
Code:
1
2
3
4
5
6
7
8
9
10
11
Owner = {15476}

addhook("say","says")
function says(id,t)
     for _,usgn in ipairs(Owner) do
          if player(id,'usgn') == usgn then
               msg("\169255000000>Owner< "..player(id,"name")..": "..t)
               return 1
          end
     end
end


Please. Tab your code. It makes it 3 times easier to read everything not just for yourself but for others too.
Your mistake was
Code:
1
player(id,"name)

instead of
Code:
1
player(id,"name")


I tested it. Works fine.
18.07.13 09:07:33 pm
Up
CaneCorso
User
Offline Off
user Rainoth has written:
Code:
1
2
3
4
5
6
7
8
9
10
11
Owner = {15476}

addhook("say","says")
function says(id,t)
     for _,usgn in ipairs(Owner) do
          if player(id,'usgn') == usgn then
               msg("\169255000000>Owner< "..player(id,"name")..": "..t)
               return 1
          end
     end
end


Please. Tab your code. It makes it 3 times easier to read everything not just for yourself but for others too.
Your mistake was
Code:
1
player(id,"name)

instead of
Code:
1
player(id,"name")


I tested it. Works fine.

ah , thanks you all

how to change txt color ?
18.07.13 09:36:37 pm
Up
PyKemis
User
Offline Off
Change the nine numbers after \169.

http://www.tayloredmktg.com/rgb/

Remove the hyphens and append it.

Example:

Code:
msg("\169255000000Red Text")
18.07.13 09:47:15 pm
Up
pbeloto
User
Offline Off
YOU CODE
Code:
1
2
3
4
5
6
7
8
for _,usgn in ipairs (VIP) do
if player(id,'usgn') == usgn then
if colors == 1 then
msg("©000255255 >VIP< "player(id,"name").." : "..t)
end
end
end
end


MY CODE
Code:
1
2
3
4
5
6
7
8
for _,usgn in ipairs (VIP) do
if player(id,'usgn') == usgn then
if colors == 1 then
msg("©000255255 >VIP< "..player(id,"name").." : "..t)
end
end
end
end



ERROR YOU CODE
Code:
1
msg("©000255255 >VIP< "player(id,"name").." : "..t)



REMOVE ERRO
Code:
1
msg("©000255255 >VIP< "..player(id,"name").." : "..t)


Code:
1
you erro = >> "player(id,"name").." << Dont ERRO >> "..player(id"name").." <<
18.07.13 10:25:48 pm
Up
Necr0
User
Offline Off
script >
This should work, too. And it's much less code.
18.07.13 11:01:40 pm
Up
CaneCorso
User
Offline Off
Thx , I Fixed many bug in my Script . in !tagon and !tagoff , it was a asshole mistake , very smallest mistake like : ) , _ .. - : .

and where is probleme in this ?
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("say","commands")
function commands(id,txt)
for _, usgn in ipairs(Owner) do
if player(id,'usgn') == usgn then
     elseif txt == "!restart" then
          parse("restartround 0") 
     elseif txt == "!slap" then 
       parse("slap "..pl)
     elseif txt == "!kick" then
       parse("kick "..pl)
     elseif txt == !ban" then
       parse("banip "..pl)
end
end
end
edited 1×, last 19.07.13 02:15:08 am
19.07.13 10:45:16 am
Up
Rainoth
Moderator
Offline Off
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
addhook("say","commands")
function commands(id,txt)
     for _, usgn in ipairs(Owner) do
          if player(id,'usgn') == usgn then
                  if txt == "!restart" then
                         parse("restart") 
                  elseif txt == "!slap" then 
                          parse("slap "..pl)
                    elseif txt == "!kick" then
                           parse("kick "..pl)
                    elseif txt == !ban" then
                           parse("banip "..player(pl,"ip"))
               end
          end
     end
end


1. You started with "elseif"
2. You missed one end (That's why you have to TAB your code)
3. Where is your "pl" defined ? It won't work because this script doesn't have "pl" defined. You need to make it defined. I'd say a text split function would help you in this case.
19.07.13 06:06:51 pm
Up
CaneCorso
User
Offline Off
Thx You very much , but how i definie pl by
player = pl
?
04.08.13 08:18:08 am
Up
cs2dsuper
User
Offline Off
user Necr0 has written:
code >


i didn't test it but it should work


Can i modifided it ? only for rank (Rank: Owner,Admin,Supervisor,Moderator,VIP)
04.08.13 08:27:39 am
Up
Gajos
BANNED
Offline Off
I like DC design:
Code:
1
msg('©000255220'..player(id,'name')..': ©255220000'..txt)
Banned for Hacking/Cheating in CS2D /DC
To the start Previous 1 Next To the start