Ulysses
Home
Help
Ulysses
»
General
»
Developers Corner
»
Automatically move someone to a group if they join the steam group?
« previous next »
Print
Pages:
1
[
2
]
Go Down
Author
Topic: Automatically move someone to a group if they join the steam group? (Read 15156 times)
0 Members and 1 Guest are viewing this topic.
Jaden Zepeda
Newbie
Posts: 28
Karma: 0
Re: Automatically move someone to a group if they join the steam group?
«
Reply #15 on:
December 21, 2014, 05:39:36 pm »
Error, bad server command ulx adduserid STEAM_0:0:86623958 member
:/
Logged
Neku
Hero Member
Posts: 549
Karma: 27
Re: Automatically move someone to a group if they join the steam group?
«
Reply #16 on:
December 21, 2014, 05:47:14 pm »
Try RunConsoleCommand() instead.
ex: RunConsoleCommand( "ulx", "adduserid", ply:SteamID(), "member" )
«
Last Edit: December 21, 2014, 05:59:07 pm by Neku
»
Logged
Out of the Garry's Mod business.
Jaden Zepeda
Newbie
Posts: 28
Karma: 0
Re: Automatically move someone to a group if they join the steam group?
«
Reply #17 on:
December 21, 2014, 06:10:28 pm »
This is it! Thank you everyone who helped me with this!
Code: Lua
if
SERVER
then
function
CommunityCheckStatus
(
ply
)
if
not
IsValid
(
ply
)
then
return
end
local
id
=
util
.
SteamIDTo64
(
ply
:
SteamID
(
)
)
http
.
Fetch
(
"http://steamcommunity.com/groups/sandboxwars/memberslistxml/?xml=1&lolwat="
..
os.time
(
)
,
function
(
body
,
_
,
_
,
_
)
if
string.find
(
body
,
id
)
then
SetPlayerMember
(
ply
)
else
print
(
"FALSE"
)
end
end
,
function
(
error
)
print
(
"Something went terribly wrong!"
)
print
(
error
)
end
)
end
function
SetPlayerMember
(
ply
)
if
not
IsValid
(
ply
)
then
return
end
if
ply
:
GetUserGroup
(
)
==
"user"
then
RunConsoleCommand
(
"ulx"
,
"adduserid"
,
ply
:
SteamID
(
)
,
"member"
)
end
end
hook
.
Add
(
"PlayerSpawn"
,
"SteamGroupMemberCheck"
,
function
(
ply
)
CommunityCheckStatus
(
ply
)
end
)
end
Once Again, thanks everyone! I can confirm this works!
«
Last Edit: December 21, 2014, 06:13:13 pm by Jaden Zepeda
»
Logged
Print
Pages:
1
[
2
]
Go Up
« previous next »
Ulysses
»
General
»
Developers Corner
»
Automatically move someone to a group if they join the steam group?