English Script Bug!

4 replies
Goto Page
To the start Previous 1 Next To the start
25.05.13 03:45:04 pm
Up
SpriNG
User
Offline Off
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 :

Code:
1
line 1 : unexpected symbol near "i"


and here is the line 1 :
Code:
1
admins = {95895}
25.05.13 03:48:53 pm
Up
mafia_man
User
Offline Off
It's something with rest of the script, or you're using different script in server. Post whole script.
25.05.13 03:51:46 pm
Up
SpriNG
User
Offline Off
here is the script :

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
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 :
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
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 :
Code:
1
ed002002020[ADMIN] : bla bla
25.05.13 06:43:07 pm
Up
limonata
User
Offline Off
Your msg command is wrong.

Try this.

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


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


you shouldchange it to
Code:
1
ClanLeaders = {}
31.05.13 06:40:36 pm
Up
SpriNG
User
Offline Off
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