Forum

> > CS2D > Scripts > Script Bug!
Forums overviewCS2D overview Scripts overviewLog in to reply

English Script Bug!

4 replies
To the start Previous 1 Next To the start

old Script Bug!

SpriNG
User Off Offline

Quote
Hi i am creating my own script and i have completed 100 lines then i added a new "say","admsay" hook and it was working fine just the problem was it was not showing the name so i fixed it and when i runed cs2d and checked then error came up :

1
line 1 : unexpected symbol near "i"

and here is the line 1 :
1
admins = {95895}

old Re: Script Bug!

mafia_man
User Off Offline

Quote
It's something with rest of the script, or you're using different script in server. Post whole script.

old Re: Script Bug!

SpriNG
User Off Offline

Quote
here is 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
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
admins = {95895}
mods = {}
vips = {}
miniadmins = {}
minimods = {}
minivips = {}
CleanLeaders = {}
ClanMembers = {}
Clanmods = {}

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

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

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

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

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

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

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

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

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

parse('hudtxt 41 "©100100100F.S.A.K Script v0.1" 100 250 1')
parse('hudtxt 2 "©255128000'..game("sv_name")..'" 90 230 1')

addhook("say","saytag")
function saytag(id,text)
if isadmin(id) then
msg(string.char(169)..player(id,"name").."100100100[ADMIN] :"..text)
return 1
end
if isvip(id) then
msg(string.char(169)..player(id,"name").."100100100[V.I.P] :"..text)
return 1
end
end

it was like this while it was working :
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
admins = {95895}
mods = {}
vips = {}
miniadmins = {}
minimods = {}
minivips = {}
CleanLeaders = {}
ClanMembers = {}
Clanmods = {}

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

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

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

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

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

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

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

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

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

parse('hudtxt 41 "©100100100F.S.A.K Script v0.1" 100 250 1')
parse('hudtxt 2 "©255128000'..game("sv_name")..'" 90 230 1')

addhook("say","saytag")
function saytag(id,text)
if isadmin(id) then
msg(string.char(169)..player(id,"name").."000255000[ADMIN] :"..text)
return 1
end
if isvip(id) then
msg(string.char(169)..player(id,"name").."000255000[V.I.P] :"..text)
return 1
end
end

and it was showing something like this :
1
ed002002020[ADMIN] : bla bla

old Re: Script Bug!

limonata
User Off Offline

Quote
Your msg command is wrong.

Try this.

1
msg(string.char(169).."000255000"..player(id,"name").. "[ADMIN]: "..text)

Also in your script there is a
1
CleanLeaders = {}


you shouldchange it to
1
ClanLeaders = {}

old Re: Script Bug!

SpriNG
User Off Offline

Quote
i don't know what was wrong but now its working fine what I did was deleted the file server.lua and created it again and it worked all right thanks guys
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview