i need to finish unnecessary problems that are necessary
When i die or someone dies,
The Level and Rank Text in the Screen won't Update. It Updates every Roundstart but i dont find any startround Hook
and also i set the script,
when the XP reaches 0, it will derank or bring you back to the previous rank, well it doesnt seem to be an error but when we die it stays -2 until next round starts and it changes into 25 but in a lower rank
here take alook
sorry that i still cant speak engrish
Also thank you for TrialAndError that helped me alot today, so im giving him a break
how to make the stat updates whenever we die? because i used die hook and it doesnt work well
More
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
------Ranked Lua------ -------Radeon2D------- ---Copyright © 2016--- function array(size,value) 	local array = {} 	for i = 1, size do 		array[i]=value 	end 	return array end initarray = function(size) local initarray = {} 	for i = 1, size do 	 initarray[i] = size 	end 	return initarray end function totable(t,match) 	local cmd = {} 	if not match then match = "[^%s]+" end 	for word in string.gmatch(t, match) do 		table.insert(cmd, word) 	end 	return cmd end function rj_msg(clr,txt) 	msg(string.char(169)..""..clr..""..txt) end function rj_msg2(id,clr,txt) 	msg2(id,string.char(169)..""..clr..""..txt) end function hudtext(tid,color,txt,x,y) local toprint = (string.char(169)..""..color.." "..txt) parse('hudtxt '..tid..' "'..toprint..'" '..x.." "..y) end function hudtext2(id,tid,color,txt,x,y) local toprint = (string.char(169)..""..color.." "..txt) parse('hudtxt2 '..id..' '..tid..' "'..toprint..'" '..x.." "..y) end function SaveUsers(id,UsgnID) local UsgnID = usgnids[id] file = io.output(io.open("sys/lua/deathliger/"..UsgnID..".txt","w+")) local text = "" text = tostring(rj_level[id]) text = text .." "..rj_exp[id] text = text .." "..rj_maxexp[id] text = text .." "..rj_rankimg[id] file:write(text) file:close() end function LoadUsers(id,UsgnID) local UsgnID = usgnids[id] local filename = "sys/lua/deathliger/%s.txt" if usgnids[id]~=0 then local file = io.open(filename:format(UsgnID,"r")) if file then for line in file:lines() do local p = totable(line) local level = tonumber(p[1]) local rexp = tonumber(p[2]) local maxexp = tonumber(p[3]) local rankimg = tonumber(p[4]) if level ~= nil then rj_level[id] = level end if rexp ~= nil then rj_exp[id] = rexp end if maxexp ~= nil then rj_maxexp[id] = maxexp end if rankimg ~= nil then rj_rankimg[id] = rankimg end end rj_msg2(id,"000255000","Load Succesfully!") file:close() else rj_msg2(id,"255000000","File not found!") end end end _statshud = function(id) if player(id,"exists") then 	 hudtext2(id,1,"192192192","Level : "..rj_level[id].."/"..rj_maxlevel[id],275,426) 		hudtext2(id,2,"192192192","EXP : "..rj_exp[id].."/"..rj_maxexp[id],275,441) 		hudtext2(id,3,"192192192","Rank : "..rj_rank[id],275,456) 		_ranklist(id) 		_loseexp(id) 		_checkexp(id) 	end end _checkexp = function(id) if rj_exp[id] >= rj_maxexp[id] then 	 rj_level[id] = rj_level[id]+1 	 rj_maxexp[id] = rj_level[id]*25 		rj_rankimg[id] = rj_level[id] 		rj_exp[id] = 0 		_checkrankimg(id) end end addhook("die","_diee") function _diee(id) 		rj_exp[id] = rj_exp[id]-2 		_checkexp(id) end _loseexp = function(id) 	if rj_exp[id] < 0 and rj_level[id] > 1 then 		rj_level[id] = rj_level[id]-1 		rj_maxexp[id] = rj_level[id]*25 		rj_exp[id] = rj_maxexp[id] - 5 		rj_rankimg[id] = rj_level[id] 		_checkrankimg(id) 	elseif rj_exp[id] < 0 and rj_level[id] == 1 then 		rj_exp[id] = 0 	end end _checkrankimg = function(id) 	if rj_img[id] ~= nil then 	 freeimage(rj_img[id]) 		rj_img[id] = nil 	 rj_img[id] = image("gfx/deathliger/ranks/"..rj_rankimg[id]..".png",0,0,id+200) 	end end _rankimg = function(id) if rj_img[id] ~= nil then freeimage(rj_img[id]) 	 rj_img[id] = nil 	end rj_img[id] = image("gfx/deathliger/ranks/"..rj_rankimg[id]..".png",0,0,id+200) end _freeimage = function(id) if rj_img[id] ~= nil then freeimage(rj_img[id]) 	 rj_img[id] = nil 	end end --ranklist here function _ranklist(id) local tab = { "Silver 1", "Silver 2", "Silver 3", "Silver 4", "Silver Elite", "Silver Elite Master", "Gold Nova 1", "Gold Nova 2", "Gold Nova 3", "Gold Nova Master", "Master Guardian 1", "Master Guardian 2", "Master Guardian Elite", "Distinguished Master Guardian", "Legendary Eagle", "Legendary Eagle Master", "Supreme Master First Class", "Global Elite", } local rank_name = tab[rj_level[id]] if rank_name then rj_rank[id] = rank_name end end rj_level = array(32,1) rj_maxlevel = array(32,25) rj_exp = array(32,0) rj_maxexp = array(32,25) rj_rank = array(32,"Silver 1") rj_rankimg = array(32,1) rj_img = array(32,nil) usgnids = initarray(32) addhook("join","_rjoin") _rjoin = function(id) 	_rankimg(id) 	_checkrankimg(id) 	--usgnids[id] = 0 	--for _, i in pairs(player(0,"table")) do 	 -- if player(i,"usgn") == player(id,"usgn") and i~=id then 		 --parse("kick "..id) 		--end 	--end 	usgnids[id] = player(id,"usgn") 	if usgnids[id] == 0 then 		rj_msg2(id,"255000000","Please register a U.S.G.N. account at http://www.unrealsoftware.de/ and make sure that you are logged in!") 		rj_msg2(id,"255000000","Your data will not be saved on the Server!") 		rj_level[id] = 1 		rj_maxlevel[id] = 25 		rj_exp[id] = 0 		rj_maxexp[id] = 25 		rj_rank[id] = "Silver 1" 		rj_rankimg[id] = 1 		rj_img[id] = nil 	else 	LoadUsers(id,UsgnID) 	end end addhook("leave","_rleave") _rleave = function(id) if usgnids[id] > 0 then 	 SaveUsers(id,UsgnID) 	end rj_level[id] = 1 	rj_maxlevel[id] = 25 rj_exp[id] = 0 	rj_maxexp[id] = 25 rj_rank[id] = "Noob" rj_rankimg[id] = 1 	rj_img[id] = nil 	_freeimage(id) 	usgnids[id] = 0 end addhook("ms100","_rms100") _rms100 = function() for _,id in ipairs(player(0,"tableliving")) do 		_loseexp(id) 	 _statshud(id) 		_checkexp(id) 	end end addhook("spawn","_rspawn") _rspawn = function(id) _rankimg(id) end addhook("kill","_rkill") _rkill = function(kil,vic,wpn) if rj_level[kil] < rj_maxlevel[kil] then 	 if rj_exp[kil] < rj_maxexp[kil] then 		 rj_exp[kil] = rj_exp[kil]+3 		end 	end end addhook("minute","_rminute") _rminute = function() for _,id in ipairs(player(0,"tableliving")) do 	 if usgnids[id] > 0 then 		 SaveUsers(id,UsgnID) 		end 	end end
edited 1×, last 16.06.17 11:39:10 pm