English Score control and save

6 replies
Goto Page
To the start Previous 1 Next To the start
01.05.14 11:39:56 am
Up
limonata
User
Offline Off
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:

Code:
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.
01.05.14 11:49:16 am
Up
Yates
Reviewer
Offline Off
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;
Code:
1
2
3
4
5
6
[...]
elseif playerScore >= 1000 then
     mod[id] = true
elseif playerScore >= 2000 then
     admin[id] = true
[...]

pls no
01.05.14 12:12:23 pm
Up
MikuAuahDark
User
Offline Off
file cs2d [UNUSED] Get Player Rank v1.4 (14)

user limonata has written:
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
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
file cs2d LuaJIT for Dedicated Server (11) JIT POWER! | Know your Lua errors! | Draw stuff at Pixelize Art --xx-- server!
01.05.14 12:17:23 pm
Up
limonata
User
Offline Off
Thanks and I used dinasour tool already, dont worry

Edit: http://www.unrealsoftware.de/files_show.php?file=14110

Code:
1
2
3
4
5
addhook("join","a")
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
02.05.14 10:47:16 am
Up
AlcatrazZ
BANNED
Offline Off
I prefer to use rank[id]
eg. for admin rank[id] = 5
Ban Reason: Multiple Accounts
02.05.14 12:09:59 pm
Up
MikuAuahDark
User
Offline Off
@user limonata: It seems that you don't read the description correctly

Example how to get player rank score
Code:
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
file cs2d LuaJIT for Dedicated Server (11) JIT POWER! | Know your Lua errors! | Draw stuff at Pixelize Art --xx-- server!
02.05.14 08:18:51 pm
Up
limonata
User
Offline Off
Thanks! @user MikuAuahDark:
To the start Previous 1 Next To the start