English [Solved]Register steam players in hc admin Lua

7 replies
Goto Page
To the start Previous 1 Next To the start
Up
M3_Quick
User
Offline Off
Hello dear unrealsofware team

Has anyone already developed a patch to save steam data in the hc command sequence?
(And administrate it from hc Lua )
Before hand thanks , bye
edited 1×, last 10.12.19 11:02:13 pm
IMG:https://i.imgur.com/DCz9Dko.png
29.09.19 10:48:21 am
Up
Gaios
Security Supporter
Offline Off
Nobody did it already.
29.09.19 01:02:42 pm
Up
Goo
User
Offline Off
I have, it's quite easy.

It's like one line of code in every save sector that you need to edit.

Here's an example of the general idea, place this at the top priority Lua execution file (usually server.lua).

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
local _p = player

function player(p, s)
     if s == 'usgn' then
          local usgn, steam = _p(p, s), _p(p, 'steamid')
          
          return (((usgn and usgn > 0) and usgn) or steam)
     elseif s == 'usgnid' then
          return _p(p, 'usgn')
     else
          return _p(p, s)
     end
end
29.09.19 01:36:18 pm
Up
DC
Admin
Offline Off
@user Goo: You should mention that this hack will make
player(id, 'usgn')
return the Steam ID instead of the USGN ID for every player who is using Steam but no USGN.

This may lead to unexpected results when using any additional scripts which rely on the original behavior of
player(id, 'usgn')
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
29.09.19 01:46:13 pm
Up
Goo
User
Offline Off
Yeah, for that I've added 'usgnid' as a parameter.
30.09.19 08:03:36 pm
Up
M3_Quick
User
Offline Off
Thank you very much for your kindness, I am very grateful to you, arriving at my house I will try the code since I am now in my work and I can not verify that it is correct, apparently this can work, when I have news I will paste the details of the console editing this post.

Edit 1: I found the first error, now I can register bots within the game, these bots are registered with the number 0.
This means that I can also register users without usgn or steam id.

Inside the file users.hcu we find the saved data
Code:
1
0,Mod2,[b]AgainstCheaters

after this I enter without usgn or steam id, and if I am registered as mod 2, but this is not capable of using f3 mod powers.
edited 1×, last 30.09.19 08:35:14 pm
IMG:https://i.imgur.com/DCz9Dko.png
30.09.19 09:49:23 pm
Up
Goo
User
Offline Off
That is because STEAMID is a string and USGN is a number.
Turn any return from my function into a string and then check if its not "0" instead of if its bigger than 0.
To the start Previous 1 Next To the start