Forum

> > CS2D > Scripts > Admin Script dont work ??
Forums overviewCS2D overview Scripts overviewLog in to reply

English Admin Script dont work ??

15 replies
To the start Previous 1 Next To the start

old Admin Script dont work ??

CaneCorso
User Off Offline

Quote
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 ??
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 ?

old Re: Admin Script dont work ??

Necr0
User Off Offline

Quote
code >


i didn't test it but it should work
edited 1×, last 18.07.13 08:30:05 pm

old Re: Admin Script dont work ??

Rainoth
Moderator Off Offline

Quote
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.

old Re: Admin Script dont work ??

CaneCorso
User Off Offline

Quote
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 ?

old Re: Admin Script dont work ??

CaneCorso
User Off Offline

Quote
i tested it , and it dont work ... xDDD
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 ?

old Re: Admin Script dont work ??

Rainoth
Moderator Off Offline

Quote
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
1
player(id,"name)
instead of
1
player(id,"name")

I tested it. Works fine.

old Re: Admin Script dont work ??

CaneCorso
User Off Offline

Quote
user Rainoth has written
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
1
player(id,"name)
instead of
1
player(id,"name")

I tested it. Works fine.

ah , thanks you all

how to change txt color ?

old Re: Admin Script dont work ??

pbeloto
User Off Offline

Quote
YOU 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
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
1
msg("©000255255 >VIP< "player(id,"name").." : "..t)


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

1
you erro = >> "player(id,"name").." << Dont ERRO >> "..player(id"name").." <<

old Re: Admin Script dont work ??

Necr0
User Off Offline

Quote
script >
This should work, too. And it's much less code.

old Re: Admin Script dont work ??

CaneCorso
User Off Offline

Quote
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 ?
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

old Re: Admin Script dont work ??

Rainoth
Moderator Off Offline

Quote
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.

old Re: Admin Script dont work ??

cs2dsuper
User Off Offline

Quote
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)
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview