Forum

> > CS2D > Scripts > Admin Script dont work ??
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Admin Script dont work ??

15 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Admin Script dont work ??

CaneCorso
User Off Offline

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

alt Re: Admin Script dont work ??

Necr0
User Off Offline

Zitieren
code >


i didn't test it but it should work
1× editiert, zuletzt 18.07.13 20:30:05

alt Re: Admin Script dont work ??

Rainoth
Moderator Off Offline

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

alt Re: Admin Script dont work ??

CaneCorso
User Off Offline

Zitieren
user Rainoth hat geschrieben
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 ?

alt Re: Admin Script dont work ??

CaneCorso
User Off Offline

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

alt Re: Admin Script dont work ??

Rainoth
Moderator Off Offline

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

alt Re: Admin Script dont work ??

CaneCorso
User Off Offline

Zitieren
user Rainoth hat geschrieben
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 ?

alt Re: Admin Script dont work ??

pbeloto
User Off Offline

Zitieren
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").." <<

alt Re: Admin Script dont work ??

Necr0
User Off Offline

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

alt Re: Admin Script dont work ??

CaneCorso
User Off Offline

Zitieren
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
1× editiert, zuletzt 19.07.13 02:15:08

alt Re: Admin Script dont work ??

Rainoth
Moderator Off Offline

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

alt Re: Admin Script dont work ??

cs2dsuper
User Off Offline

Zitieren
user Necr0 hat geschrieben
code >


i didn't test it but it should work


Can i modifided it ? only for rank (Rank: Owner,Admin,Supervisor,Moderator,VIP)
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht