English TOP3 in Server Info icon

2 comments
12.05.22 11:46:59 pm
like 1 likes it!
74 kb, 158 Downloads
BcY
Reviewer
Offline Off
• Show top3 players in server info with a stylish way.
image
ok This file has been reviewed and approved by Gaios (05.01.23 09:42:49 pm)

Comments

2 comments
Goto Page
To the start Previous 1 Next To the start

Log in!

You need to log in to be able to write comments!Log in
18.05.22 07:06:09 pm
like I like it!
Up
UrNightmaree
User
Offline Off
gotta install it on my client
13.05.22 06:46:25 am
Up
Mami Tomoe
User
Offline Off
On line 10 of serverinfo.lua, change this
stats(steam,"rank")
to this
steamstats(steam,"rank")
.

cs2d lua cmd stats
cs2d lua cmd steamstats

In addition to that, you didn't mention that this wouldn't update until the server changes map.
This is ineffective for servers that don't often (or at all) change their maps.
You might want to include an automatic map reload when the server is empty (and other variables), but that could be up to the user.
Regardless, you must mention how it updates.

Furthermore, this is a very static way of doing this.
That means if the average kiddo tries to modify either serverinfo.txt or serverinfo.lua then they most likely will end up breaking something.

I do like the concept, but the execution is flawed.
I would much prefer if you had just added comments inside serverinfo.txt that will be read by serverinfo.lua to know when exactly to place each player.

Like this:
Code:
1
2
3
4
<text size = "15" color="#BABABA" align="left">
<!-- FIRST PLACE -->
To be updated
</text>


And do this within Lua:
Code:
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
--- Undefined:
-- id // Player ID
-- position // Player position on the board
-- playerLogin // Player login ID, U.S.G.N. or STEAM

local filePath     = 'sys/serverinfo.txt'
local file, _     = io.open(filePath, 'r')

if not file then

     return
end

local output     = { }

for line in file:lines() do
     if position == 1 and line:find('FIRST PLACE')
          or position == 2 and line:find('SECOND PLACE')
          or position == 3 and line:find('THIRD PLACE') then

          output[#output+1] = player(id, 'name') .. '#' .. playerLogin
     else
          output[#output+1] = line
     end
end


I didn't test any of the code, but the concept is there.
To the start Previous 1 Next To the start