I asking for a bit help for you. I just cant fix this script to get work..
Would be nice if there is someone, who can help me.

Spoiler 

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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
-- LUA BY CSENDES MARCELL -- MySQL Connection Details: sql_host = "" -- Host sql_user = "" -- USER sql_password = "" --Pass sql_db_name = "" -- DBNAME sql_port = 3306 -- Default Port usually this, do not change it, if you are not sure what is it. -- Adding Hooks addhook("join", "logPlayer") addhook("minute", "saveStats") addhook("say", "logChat") addhook("say","onSay") -- Load LuaSQL luasql = require "luasql.mysql" -- Create environment object (MySQL) env = assert (luasql.mysql()) -- Create connection (connect to data source) con = assert(env:connect(sql_db_name,sql_user,sql_password,sql_host,sql_port)) -- INIT tables/values -- -- Getting informations for player function logPlayer(id) local usgn = player(id, "usgn") local ip = player(id, "ip") local name = player(id, "name") local datime = os.date("%c") 	 	if usgn > 0 then 	res = assert (con:execute(string.format([[ 		INSERT INTO logins 		VALUES ('%s', '%s', '%s', '%s')]], usgn, ip, name, datime) 	)) 	elseif usgn == 0 then 	res = assert (con:execute(string.format([[ 		INSERT INTO bots 		VALUES ('%s', '%s')]], name, datime) 	)) 	end end -- Saving Chatlog into database function logChat(id, msg) local usgn = player(id, "usgn") local ip = player(id, "ip") local name = player(id, "name") local datime = os.date("%c") 	 	if usgn > 0 then 	res = assert (con:execute(string.format([[ 		INSERT INTO chats 		VALUES ('%s', '%s', '%s', '%s', '%s')]], usgn, ip, name, datime, msg) 	)) 	end end function saveStats(id) 		for _, id in pairs(player(0,"table")) do 		local usgn = player(id, "usgn") 		local level = player(id, "score") 		local ip = player(id, "ip") 		local name = player(id, "name") 		local datime = os.date("%c") 		if usgn > 0 then 		if level > 0 then 			 res = assert (con:execute(string.format([[ 			 INSERT INTO stats 			 VALUES ('%s', '%s', '%s', '%s', '%s')]], usgn, ip, name, datime, level) 			 )) 		print("©000255000The players's stats have been saved into MYSQL on ©255255255"..datime) 		else 			return 0; 		end 		end 	end end -- TIL THIS WORK FINE -- Configuration -- version = "0.1" website = "www.classrpg.net" color = { 	"©55220000", -- CS2D (yellow) 1 	"©255255255", -- white 2 	"©255000000", -- red 3 	"©000255000", -- green 4 	"©000000255", -- blue 5 	"©220220220", -- light grey 6 	"©064179162", -- PM - light blue 7 	"©255025000", -- T 8 	"©050150255", -- CT 9 	"©100100100" -- pretty dark grey - tag 10 } -- Text to be displayed every minute textMin = {"Server: "..game("sv_name").."","Website: "..website.."","Version: "..version..""} -- Functions -- function onSay(id,txt) local space = txt:find(" ") or (#txt + 1) local cmd = txt:sub(1, space - 1) -- LOGIN if cmd == "!login" then cur = con:execute("select * from users") row = cur:fetch({}, 'a') for k, v in pairs(row) do print(k, v) end end 	end -- REGISTER if cmd=="!register" then local regName = txt:sub(cmd+2) local regPW = string.len(regName)+2 			local regDate = os.date("%c") 	if usgn > 0 then res = assert (con:execute(string.format([[ 			INSERT INTO users 			VALUES ('%s', '%s', '%s')]], regName, regPW, regDate) 			)) msg2(id,"Your account has been registered under: ") msg2(id,"Username: "..regName) msg2(id,"Password: "..regPW) msg2(id,"You can now login using "..color[2].."!login <username> <password>") -- Variable from database 		end end