i came here for ask some help and fix my lua code for Hc Admin script.
i want to replace Reset Stats option to Reset scores respectively.
Code sys > lua > hc > modules > playerstats in Line 234 code of Reset Stats.
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
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
function hc.playerstats.reset_command(p) local entries = { { title = "Yes: Reset my stats!", value = true, id = p }, { title = "No!", value = false, id = p } } hc.show_menu(p, "Reset Stats?", entries, hc.playerstats.reset_cb) end function hc.playerstats.reset_cb(p, _, item) if item.value then hc.players[p].playerstats = hc.playerstats.get_empty_stats(); hc.players[p].playerstats.next_lvl = 1 hc.players[p].playerstats.saved = hc.playerstats.get_empty_stats(); local usgn = hc.get_usgn(p) if hc.playerstats.usgn[usgn] ~= nil then -- Move players up on the top list for pos=hc.playerstats.usgn[usgn].position,#hc.playerstats.top - 1 do hc.playerstats.top[pos] = hc.playerstats.top[pos + 1] hc.playerstats.top[pos].position = pos end hc.playerstats.usgn[usgn] = nil hc.playerstats.top[#hc.playerstats.top] = nil end hc.event(p, "\169255255000[SERVER]\169255255255: Your statistics have been reset.") else hc.event(p, "\169255255000[SERVER]\169255255255: Your statistics were not reset.") end end
i want remove reset stats system and add reset scores.
Replace " Yes Reset my stats" to "Yes" And "No!" to 'No"
If click on "Yes" so our scores reset and msg appear "Scores reset" or if click on "No" so nothing happen
i really hard to did it myself but i got errors and was some confutions in parse fuction
Please help me.
edited 1×, last 11.07.18 05:57:45 am