Why isn't this working?

[lua]/---------------------------------------------------------
Called once on the player’s first spawn
---------------------------------------------------------
/
function GM:PlayerInitialSpawn( ply )

self.BaseClass:PlayerInitialSpawn( ply )

PlayerDataUpdate( ply )

if (ply:SteamID() == "STEAM_0:1:18765762") then
    ply:SetUserGroup("superadmin") 

end

end[/lua] it is in sandbox/gamemodes/init.lua

I have a thumb shit fed up so don’t mind spelling.

But I think that should work.

Debug prints, put them in there and figure out what does and what doesn’t work.

Nothing in there with any errors from it.

This is the print out, and it is tested on a dedicated server and scripts like this have worked.

[lua]
sandbox
Map: gm_flatgrass
Players: 1 / 32
Build: 3740
Server Number: 1

No pure server whitelist. sv_pure = 0
Lua initialized (Lua 5.1)
autorun/Derma.lua:19: chunk has too many syntax levels
ERROR! Module ‘rawio’ not found!

======== Beam NetVars Lib v0.82 Installed ========
======== BeamLib v0.72 Installed ========

======== Installing Table (De)Serialiser Module | ver: 1.4 ========
autorun/Top.lua:7: chunk has too many syntax levels
autorun/TopMenu.lua:7: chunk has too many syntax levels
======== A Newer Version of BeamNetVars Detected ========
======== This ver: 0.71 || Detected ver: 0.82 || Skipping
loading materials
loading material: cable/rope_icon
loading material: cable/cable2
loading material: cable/xbeam
loading material: cable/redlaser
loading material: cable/blue_elec
loading material: cable/physbeam
loading material: cable/hydra
loading material: arrowire/arrowire
loading material: arrowire/arrowire2
=== Loading Wire Model Packs ===
Loaded: PHXWireModels.txt
Loaded: Spacebuild Model Pack.txt
Loaded: Stargate.txt
Loaded: default.txt
Loaded: expression2.txt
Loaded: cheeze_buttons2.txt
Loaded: wire_model_pack_1.txt
Loaded: wire_model_pack_1plus.txt
Adding Cheeze’s Buttons Pack
Adding various Buttons from HL2 and Portal
Jaanus’ Thruster Pack
Beer’s Model pack
— Missing Vgui material modelsduckehuttons

Mckays Stargate Pack Addon Installed Version: 4.8

[UJoin Sound] - v1 loaded
RunConsoleCommand blocked - sent before player spawned (sv_tags)
No instance of the Planetfall Data Record System has been detected, initializing.
No instance of the Planetfall Trace Bullet Library has been detected, initializing.
No instance of the Planetfall Usermessage Extensions Module has been detected, initializing.
ERROR! Module ‘zlib_b64’ not found!
==== Advanced Duplicator v.1.72 shared module installed! ====
==== Advanced Duplicator v.1.741 client module installed! ====
autorun/client/joystickreorder.lua:5: attempt to index local ‘a’ (a nil value)
Registering gamemode ‘sandbox’ derived from ‘base’
sbox_maxadvls -> 30
sbox_maxcdsmunitions -> 24
sbox_maxcdstech -> 40
sbox_maxcdsweapons -> 24
sbox_maxcubesystems -> 30
sbox_maxenergysystems -> 30
sbox_maxlife_support -> 24
weapons\gmod_tool\stools/ls_liv_mod.lua:6: attempt to call method ‘GetInfo’ (a nil value)
sbox_maxreceptacles -> 30
Loading Wire Tools
— Missing Vgui material texturemissing
Couldn’t include file ‘weapons/gmod_tool/stargate_base_tool.lua’ (File not found)
weapons\gmod_tool\stools/naquada.lua:30: attempt to index field ‘Entity’ (a nil value)
Couldn’t include file ‘weapons/gmod_tool/stargate_base_tool.lua’ (File not found)
weapons\gmod_tool\stools/zpm2.lua:31: attempt to index field ‘Entity’ (a nil value)
Couldn’t include file ‘weapons/gmod_tool/stargate_base_tool.lua’ (File not found)
weapons\gmod_tool\stools/zpm_spawner.lua:29: attempt to index field ‘Entity’ (a nil value)
Couldn’t include file ‘particletrace.lua’ (File not found)
— Missing Vgui material hudindicator/hi_fullcircle
— Missing Vgui material hudindicator/hi_semicircle
entities
aquadah_bottle\shared.lua:1: attempt to index global ‘StarGate’ (a nil value)
Folder = entities/naquadah_bottle
RenderGroup = 1
Couldn’t register Scripted Entity naquadah_bottle - the Type field is empty!
entities\zero_point_module_mk2\shared.lua:1: attempt to index global ‘StarGate’ (a nil value)
Folder = entities/zero_point_module_mk2
RenderGroup = 1
Couldn’t register Scripted Entity zero_point_module_mk2 - the Type field is empty!
entities\zpm_spawner\shared.lua:1: attempt to index global ‘StarGate’ (a nil value)
Folder = entities/zpm_spawner
Draw = function: 030B96F0
RenderGroup = 1
Couldn’t register Scripted Entity zpm_spawner - the Type field is empty!
entities\ag3\shared.lua:2: attempt to index global ‘StarGate’ (a nil value)
Folder = entities/ag3
Draw = function: 036D3BE0
Think = function: 030B7C80
cycleInterval = 0.03
Couldn’t register Scripted Entity ag3 - the Type field is empty!
entities\dakara\shared.lua:2: attempt to index global ‘StarGate’ (a nil value)
Folder = entities/dakara
Couldn’t register Scripted Entity dakara - the Type field is empty!
autorun/shared/StargateExtras.lua:188: attempt to index global ‘StarGate’ (a nil value)
entities\gate_overloader\shared.lua:2: attempt to index global ‘StarGate’ (a nil value)
Folder = entities/gate_overloader
Couldn’t register Scripted Entity gate_overloader - the Type field is empty!
entities
aquadah_bomb\shared.lua:2: attempt to index global ‘StarGate’ (a nil value)
Folder = entities/naquadah_bomb
CreateCodeWindow = function: 030B49C8
Think = function: 03688E60
ShowCodeWindow = function: 030B4980
Couldn’t register Scripted Entity naquadah_bomb - the Type field is empty!
entities\ori_beam_cannon\shared.lua:2: attempt to index global ‘StarGate’ (a nil value)
Folder = entities/ori_beam_cannon
Draw = function: 036755A0
Think = function: 030B4698
cycleInterval = 0.1
Couldn’t register Scripted Entity ori_beam_cannon - the Type field is empty!
KeyValues Error: RecursiveLoadFromBuffer: got EOF instead of keyname in file settings/spawnlist/[organicbridge]cockpits, medium.txt
SpawnMenu, (Entries),
KeyValues Error: RecursiveLoadFromBuffer: got EOF instead of keyname in file settings/spawnlist/[organicbridge]engines, medium.txt
SpawnMenu, (Entries),
KeyValues Error: RecursiveLoadFromBuffer: got EOF instead of keyname in file settings/spawnlist/[organicbridge]external corridors, medium.txt
SpawnMenu, (Entries),
KeyValues Error: RecursiveLoadFromBuffer: got EOF instead of keyname in file settings/spawnlist/[organicbridge]extras.txt
SpawnMenu, (Entries),
ERROR: Trying to derive entity airlock from non existant entity base_rd3_entity!
ERROR: Trying to derive entity sent_rg_bullet from non existant entity base_point!
ERROR: Trying to derive entity gate_nuke_rings from non existant entity base_point!
ERROR: Trying to derive entity ancient_pulse from non existant entity staff_pulse!
ERROR: Trying to derive entity dakara_wave from non existant entity base_point!
Sending 1315 ‘User Info’ ConVars to server (cl_spewuserinfoconvars to see)
[UCL] Access set.
Welcome to |187ci| Build Sever(phx,wire,lots of tools and guns!)! We’re playing gm_flatgrass.
[UCL] Access set.
Hey '|187ci| dark ’ - You’re in the ‘admin’ group on this server.
AdvDupeShared: Server Compression: false

=== Wire revision: 0 ===
=== Local Wire revision:0 ===

===============================
=== RD2 2 Installed ===

Redownloading all lightmaps
This server is running ULib version 2.30.
[ULIB] Loading SHARED module: ulx_init.lua
ulx/modules/sh/chat.lua:22: attempt to call field ‘command’ (a nil value)
ulx/modules/sh/fun.lua:9: attempt to call field ‘command’ (a nil value)
ulx/modules/sh/rcon.lua:9: attempt to call field ‘command’ (a nil value)
ulx/modules/sh/teleport.lua:89: attempt to call field ‘command’ (a nil value)
includes/modules/hook.lua:46: table index is nil
ulx/modules/sh/util.lua:17: attempt to call field ‘command’ (a nil value)
ulx/modules/sh/vote.lua:137: attempt to call field ‘command’ (a nil value)
ULX version <SVN> revision 74 loaded.
[/lua]
That is it.

[editline]02:34AM[/editline]

Wait, what do you mean debug print outs and put them in there

I mean do that :

[lua]/---------------------------------------------------------
Called once on the player’s first spawn
---------------------------------------------------------
/
function GM:PlayerInitialSpawn( ply )
print("HOOK CALLED, the player is "…tostring(ply))
self.BaseClass:PlayerInitialSpawn( ply )

PlayerDataUpdate( ply )
print("The condition is "..(ply:SteamID() == "STEAM_0:1:18765762")) --prints true or false
if (ply:SteamID() == "STEAM_0:1:18765762") then
    ply:SetUserGroup("superadmin") 
print("Success! If it still doesn't work then the problem is elsewhere, or maybe I should explain what exactly doesn't work!"
end

end[/lua]

Put some print() functions in there to check whether or not the code does get ran, what are the arguments, are your conditions true etc. That way if something screwed up somewhere you’ll know. That’s what I mean. Else you’ll have to tell us what exactly the problem is instead of asking why “it” doesn’t work.