Forum

> > CS2D > Scripts > [Solved]Register steam players in hc admin Lua
Forums overviewCS2D overview Scripts overviewLog in to reply

English [Solved]Register steam players in hc admin Lua

7 replies
To the start Previous 1 Next To the start

old [Solved]Register steam players in hc admin Lua

cs2d_is_a_Gem
User Off Offline

Quote
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

old Re: [Solved]Register steam players in hc admin Lua

Mami Tomoe
User Off Offline

Quote
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).

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

old Re: [Solved]Register steam players in hc admin Lua

DC
Admin Off Offline

Quote
@user Mami Tomoe: 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')

old Re: [Solved]Register steam players in hc admin Lua

cs2d_is_a_Gem
User Off Offline

Quote
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
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
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview