TOP3 in Server Info 
2 comments

Comments
2 comments



Log in!
You need to log in to be able to write comments!Log in
On line 10 of serverinfo.lua, change this
stats
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:
And do this within Lua:
I didn't test any of the code, but the concept is there.
stats(steam,"rank")
to this steamstats(steam,"rank")
.

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
2
3
4
<text size = "15" color="#BABABA" align="left">
<!-- FIRST PLACE -->
To be updated
</text>
<!-- 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
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
-- 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.



