Forum

> > CS2D > Scripts > Need to fix a Script
Forums overviewCS2D overview Scripts overviewLog in to reply

English Need to fix a Script

5 replies
To the start Previous 1 Next To the start

old Need to fix a Script

ExecL
User Off Offline

Quote
i have this new project but there are some errors that i cant fix.

the error is when i talk its says...

[Chat box]

Execl [ADMIN]: testing
Execl: testing


heres the Script
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
ownerlist = {81792}

viceownerlist = {}

adminlist = {}

modlist = {72075,76021}

viplist = {}



addhook("say","ownersay")
function ownersay(id,txt)
for _, usgn in ipairs(ownerlist) do
if player(id,'usgn') == usgn then
	msg("©000255255"..player(id,"name").." [OWNER]: "..txt)
return 1
end
end
end

addhook("say","viceownersay")
function viceownersay(id,txt)
for _, usgn in ipairs(viceownerlist) do
if player(id,'usgn') == usgn then
	msg("©255000255"..player(id,"name").." [VICE-OWNER]: "..txt)
return 1
end
end
end

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

addhook("say","modsay")
function modsay(id,txt)
for _, usgn in ipairs(modlist) do
if player(id,'usgn') == usgn then
	msg("©000000255"..player(id,"name").." [MODERATOR]: "..txt)
return 1
end
end
end

addhook("say","vipsay")
function vipsay(id,txt)
for _, usgn in ipairs(viplist) do
if player(id,'usgn') == usgn then
	msg("©255155000"..player(id,"name").." [VIP]: "..txt)
return 1
end
end
end

old Re: Need to fix a Script

ExecL
User Off Offline

Quote
user Jynxxx has written
Apparently Execl, i just tested it and i didn't find any problems

but when i talk it says

Execl [ADMIN]: testing
Execl: testing

old Re: Need to fix a Script

Crash13
User Off Offline

Quote
user ExecL has written
i have this new project but there are some errors that i cant fix.

the error is when i talk its says...

[Chat box]

Execl [ADMIN]: testing
Execl: testing


heres the Script
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
ownerlist = {81792}

viceownerlist = {}

adminlist = {}

modlist = {72075,76021}

viplist = {}



addhook("say","ownersay")
function ownersay(id,txt)
for _, usgn in ipairs(ownerlist) do
if player(id,'usgn') == usgn then
	msg("©000255255"..player(id,"name").." [OWNER]: "..txt)
return 1
end
end
end

addhook("say","viceownersay")
function viceownersay(id,txt)
for _, usgn in ipairs(viceownerlist) do
if player(id,'usgn') == usgn then
	msg("©255000255"..player(id,"name").." [VICE-OWNER]: "..txt)
return 1
end
end
end

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

addhook("say","modsay")
function modsay(id,txt)
for _, usgn in ipairs(modlist) do
if player(id,'usgn') == usgn then
	msg("©000000255"..player(id,"name").." [MODERATOR]: "..txt)
return 1
end
end
end

addhook("say","vipsay")
function vipsay(id,txt)
for _, usgn in ipairs(viplist) do
if player(id,'usgn') == usgn then
	msg("©255155000"..player(id,"name").." [VIP]: "..txt)
return 1
end
end
end


I had same prroblem, but with another script
Make a photo
edited 1×, last 11.12.11 09:41:38 am

old Re: Need to fix a Script

Cure Pikachu
User Off Offline

Quote
Conflicting scripts, especially with 5 say addhooks with return 1s on each.
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
if p == nil then p = {} end

p.owner = {81792}
p.viceowner = {}
p.admin = {}
p.mod = {72075,76021}
p.vip = {}

function status(table,id)
	for _, u in ipairs(table) do
		if player(id,"usgn") == u then
			return true
		end
	end
	return false
end

addhook("say","p.psay")
function p.psay(id,txt)
	if status(p.owner,id) then
		msg("©000255255"..player(id,"name").." [OWNER]: "..txt)
		return 1
	end
	if status(p.viceowner,id) then
		msg("©255000255"..player(id,"name").." [VICE-OWNER]: "..txt)
		return 1
	end
	if status(p.admin,id) then
		msg("©000255000"..player(id,"name").." [ADMINISTRADOR]: "..txt)
		return 1
	end
	if status(p.mod,id) then
		msg("©000000255"..player(id,"name").." [MODERATOR]: "..txt)
		return 1
	end
	if status(p.vip,id) then
		msg("©255155000"..player(id,"name").." [VIP]: "..txt)
		return 1
	end
	return 0
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview