Score control and save
6 replies



01.05.14 11:39:56 am
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:
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.
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
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.
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;
pls no
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;
Code:
1
2
3
4
5
6
2
3
4
5
6
[...]
elseif playerScore >= 1000 then
mod[id] = true
elseif playerScore >= 2000 then
admin[id] = true
[...]
elseif playerScore >= 1000 then
mod[id] = true
elseif playerScore >= 2000 then
admin[id] = true
[...]
pls no



Also i need to take log for admin/mod/vip list with usgn Numbers.
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
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


Thanks and I used dinasour tool already, dont worry
Edit: http://www.unrealsoftware.de/files_show.php?file=14110
This code returns the usgn numbers who is joined my server.
How i can reach the player's rank's score?

Edit: http://www.unrealsoftware.de/files_show.php?file=14110
Code:
1
2
3
4
5
2
3
4
5
addhook("join","a")
function a(id)
pl = player(id,"usgn")
GetUserStatsRank(pl)
end
function a(id)
pl = player(id,"usgn")
GetUserStatsRank(pl)
end
This code returns the usgn numbers who is joined my server.
How i can reach the player's rank's score?
edited 1×, last 01.05.14 12:39:45 pm
@
limonata: It seems that you don't read the description correctly
Example how to get player rank score


Example how to get player rank score
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
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





