I'm having trouble with ranks saving over gamemode changes.
I also have a script that gets the rank of players on the forum, then changes it later.
At this time, no one has joined since the data folder was cleared and server restarted.
02:14:16 PM: New map cs_office with gamemode Sandbox -- Start the map on sandbox
02:14:30 PM: Client "Socially Awkward Sniper |KS|" spawned in server (192.168.1.2:27006)<STEAM_0:0:43358000>.
02:14:31 PM: Checking the rank of Socially Awkward Sniper |KS|, CURRENT RANK: user, FORUM RANK: superadmin -- Rank is checked, the groups are different so sync kicks in
02:14:31 PM: Socially Awkward Sniper |KS| had their rank synchronised to superadmin -- Rank gets sync'd
02:15:01 PM: Socially Awkward Sniper |KS| slapped Themself with 0 damage -- Commands are working fine
02:15:01 PM: (TEAM) Socially Awkward Sniper |KS|: !slap ^
02:15:08 PM: Socially Awkward Sniper |KS| changed the map to cs_office -- Reload the map, check if rank stays
02:15:09 PM: (TEAM) Socially Awkward Sniper |KS|: !map cs_office
02:15:09 PM: Server is shutting down/changing levels.
02:15:11 PM: New map cs_office with gamemode Sandbox
02:15:25 PM: Client "Socially Awkward Sniper |KS|" spawned in server (192.168.1.2:27006)<STEAM_0:0:43358000>.
02:15:25 PM: Checking the rank of Socially Awkward Sniper |KS|, CURRENT RANK: superadmin, FORUM RANK: superadmin -- Rank is checked, they are the same so do nothing
02:15:50 PM: Socially Awkward Sniper |KS| slapped Themself with 0 damage -- Commands are still working fine
02:15:50 PM: (TEAM) Socially Awkward Sniper |KS|: !slap ^
02:15:56 PM: Socially Awkward Sniper |KS| changed the map to cs_office with gamemode terrortown -- Reload the map and change gamemode
02:15:56 PM: (TEAM) Socially Awkward Sniper |KS|: !map cs_office terrortown
02:15:56 PM: Server is shutting down/changing levels.
02:16:00 PM: New map cs_office with gamemode Trouble in Terrorist Town
02:16:21 PM: Client "Socially Awkward Sniper |KS|" spawned in server (192.168.1.2:27006)<STEAM_0:0:43358000>.
02:16:21 PM: Checking the rank of Socially Awkward Sniper |KS|, CURRENT RANK: user, FORUM RANK: superadmin -- Rank is checked, for some reason I'm now counted as a user and sync kicks in
02:16:21 PM: Socially Awkward Sniper |KS| had their rank synchronised to superadmin -- Rank gets sync'd
From this point chat commands (exluding !menu) will return "You do not have access to this command, *name*.", and ulx console commands (exluding ulx menu) will return "You do not have access to this command, *name*."
Sync code
(this is a PlayerInitialSpawn hook)
AVLog( true, "Checking the rank of " .. ply:Nick() .. ", CURRENT RANK: " .. ply:GetUserGroup() .. ", FORUM RANK: " .. group )
if ply:GetUserGroup() != group then
local userInfo = ULib.ucl.authed[ ply:UniqueID() ]
ULib.ucl.addUser( ply:SteamID(), userInfo.allow, userInfo.deny, group )
ulx.fancyLog( "#T had their rank synchronised to #s", ply, group )
end
It has also happened the other way around, with me starting on trouble in terrorist town and then changing it to sandbox with those same issues.