Forum

> > CS2D > Scripts > Score control and save
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Score control and save

6 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Score control and save

limonata
User Off Offline

Zitieren
Hi all i want to control player's score but this score should be same in the rank. When player write rank, there is a him score and i want to check it. For example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
playerScore = "him score in rank"
vip = {}
mod = {}
admin = {}
addhook("join","j")
function j(id)
	if playerScore >= 500 then
	vip[id] = true
	elseif playerScore >= 1000 then
	mod[id] = true
	elseif playerScore >= 2000 then
	admin[id] = true
	end
end
Like that. Also i need to take log for admin/mod/vip list with usgn Numbers.

This code is absolutely wrong i know. This codes are just example. Thanks, sorry for my bad english.

alt Re: Score control and save

Yates
Reviewer Off Offline

Zitieren
The only way to get a score is to go into the scores file.

The dinosaur tool will help you with this. Maybe DC will add a return to score/death/kill values when someone says rank some day.

Also;
1
2
3
4
5
6
[...]
elseif playerScore >= 1000 then
	mod[id] = true
elseif playerScore >= 2000 then
	admin[id] = true
[...]
pls no

alt Re: Score control and save

MikuAuahDark
User Off Offline

Zitieren
file cs2d [UNUSED] Get Player Rank v1.4

user limonata hat geschrieben
Also i need to take log for admin/mod/vip list with usgn Numbers.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
adminlist={}
viplist={}
modlist={}
-- to check if mod/admin/vip
fai_contains=fai_contains or function(t,e)
	for _, value in pairs(t) do
		if value == e then
			return true
		end
	end
	return false
end
if fai_contains(adminlist,player_usgn) then
	-- admin
end
if fai_contains(modlist,player_usgn) then
	-- mod
end
if fai_contains(viplist,player_usgn) then
	-- vip
end

alt Re: Score control and save

MikuAuahDark
User Off Offline

Zitieren
@user limonata: It seems that you don't read the description correctly

Example how to get player rank score
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("join","joinhook")
function joinhook(id)
	local usgn=player(id,"usgn")
	if usgn>0 then
		local rank=GetUserStatsRank(usgn)
		if rank.isexists then
			msg2(id,"Score: "..rank.score)
			msg2(id,"Frags: "..rank.frags)
			msg2(id,"Deaths: "..rank.deaths)
			msg2(id,"Time on server: "..rank.time.." seconds!")
		else
			msg2(id,"It seems that you're new in this server.")
		end
	end
end
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht