Spawn Menu Should Show

[lua]function GM:SpawnMenuEnabled()
LocalPlayer():SendMessage(“You must buy your furniture from a shop, and get a builder to work your welds!”)
return RP.Config[“allowspawnmenu”]
end[/lua]

I’ve tried using this code to restrict the spawn menu, but nothing is happening. My gamemode loads correctly, but the spawn menu still opens. PrintTable says that RP.Config has the value set correctly.

Help?

Can you show the PrintTable() results of RP.Config?

[editline]7th July 2011[/editline]

Also, is playerMeta:SendMessage() defined?

[lua]
Stocks:
Config:
allowspawnmenu = false
spawnmode:
swep = 1
ent = 2
name = GMRP
deathtime = 60
messagecolor:
a = 255
b = 0
g = 140
r = 255
instantrespawn = false
suicidemode = 1
Vars:
DB:
Properties:
Plugins:
Business:
[/lua]

Removed some other table contents out.

[editline]7th July 2011[/editline]

The problem I’m having, is that if the name had a typo, it would still return nil. Running some tests, it seems like my function is not getting called. Tried in cl_init and sharing it across client and server.

I think I know your problem. I think I read that the hook you are using is only called once on startup to determine if the spawnmenu is enabled at all. I think you need to try to stop them with a different hook.

[editline]7th July 2011[/editline]

I am correct, I found it on the wiki.

Why don’t you render it, but remove the ability to open it?

Sec ill whip up an example.

[editline]7th July 2011[/editline]

[lua]
– Serverside Data
concommand.Add(“cvarCheck”,function(ply,cmd,args)
if(args[1]==“spawnmenu”)then
umsg.Start(“return_cvarCheck_spawnmenu”,ply);
umsg.Bool(RP.Config[“allowspawnmenu”]);
umsg.End();
end
end)

– Clientside Data

function GM:ShowSpare2()
RunConsoleCommand(“cvarCheck spawnmenu”);
usermessage.Hook(“return_cvarCheck_spawnmenu”,function(um)
if(um:ReadBool())
// open spawn menu
end
end)
end
[/lua]

Untested … and written in Notepad