Forum

> > CS2D > Scripts > Does anyone have this script?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Does anyone have this script?

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Re: Does anyone have this script?

Talented Doge
User Off Offline

Zitieren
That is a easy counting script. But wouldn't that be a little bit crazy? Kills for moderator...

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
dir = "sys/lua/data/"
title = {
{"VIP", 5, 1};
{"Mod", 100, 2}
}
score = {}
ranking = {}
USGN = {}

addhook("kill", "_kill")
addhook("join", "_join")
addhook("leave", "_leave")
addhook("say", "_say")

function loaduser(p)
	if USGN[p] > 0 then
		local file = io.open(dir..USGN[p]..".txt", "r")
		if file then 
			local score_ = file:read("*n")
			score[p] = score_ or 0
			file:close() 
		else 
			score[p] = 0 
		end
		if score[p] >= title[1][2] and score[p] < title[2][2] then 
			ranking[p] = title[1][1]
		elseif score[p] >= title[2][2] then
			ranking[p] = title[2][1]
		end
	else score[p] = 0
	end
end

function saveuser(p)
	if USGN[p] > 0 then
		local file = io.open(dir..USGN[p]..".txt", "w")
		file:write(score[p])
		file:close()
	end
end

function _join(p)
	USGN[p] = player(p, "usgn")
	ranking[p] = {}
	loaduser(p)
end

function _leave(p)
	saveuser(p)
end

function _kill(k, v)
	score[k] = score[k] + 1
	saveuser(k)
	loaduser(k)
end

function _say(p, t)
	if ranking[p] then
		msg ("#"..ranking[p].." "..player(p, "name")..": "..t)
		return 1
	end
end

I think my code is not good enough though it works. Excluding administration scripts. Only load and such.

alt Re: Does anyone have this script?

Mora
User Off Offline

Zitieren
@user lennon: i think HC admin script have this, or just you may every second add value in array and if your total time is time you've set = you will be vip/mod/admin/owner,whoever.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht