I making currently a Save System to MySQL which works a bit, but i need a bit help..
Well the question is the next: its saves USGN ID and your score"level", but i only want to save if level changes. so whenever you do level up its should save, but whenever no, its shouldn't.. any idea how to do it?
(I dont know userstats how should be readed, but maybe thats the solution).
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
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
dofile("sys/lua/configs/main_config.lua") function GetUsgn(id) 	if player(id, "bot") then 		return 0 end 	return player(id, "usgn") end function GetScore(id) 	if GetUsgn(id) then 		return player(id, "score") 	end end addhook("minute","saveStats") function saveStats(id) 		for _, id in pairs(player(0,"table")) do 		local usgn = GetUsgn(id) 		local level = GetScore(id) 		if usgn > 0 then 		if level > 0 then 			 res = assert (con:execute(string.format([[ 			 INSERT INTO stats 			 VALUES ('%s', '%s')]], usgn, level) 			 )) 		print("©000255000Adatok mentve") 		else 			return 0; 		end 	end end end