Block gm_spawn

I want only one team to be able to use gm_spawn, how can this be done? (The only attempts I have made so far were blocking the spawn menu until I realized that this was a command.)

I would have made an attempt at it, but i have completely no clue where to start.

Use one below

:suicide:

**[Gamemode.PlayerSpawnProp

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Gamemode.PlayerSpawnProp)**

So I was thinking something like this would work, not sure if i should hook onto it or overwrite it but feel free to
correct me if i did it wrong.



function DeleteAnti( ply prop )
	if ply:Team() != 2 then --Team 2 is the only team allowed to spawn props
		prop:Remove()
	end
end
hook.Add( "PlayerSpawnProp", "DeleteAnti", DeleteAnti )




function DeleteAnti( ply )
	if ply:Team() != 2 then --Team 2 is the only team allowed to spawn props
		return true
	else
		return false
	end
end
hook.Add( "PlayerSpawnProp", "DeleteAnti", DeleteAnti )


Would ^^^^^^ work?

Why don’t you test it?

I did, spawn menu won’t even pop.

[lua]hook.Add(“PlayerSpawnProp”,“Delete”, function(ply, prop)
return ply:Team() == 2
end)
[/lua]

That only changes their team doesn’t it?

No, not once does it even hint at a team change.

When a calculation is ran like that, it returns true if it is equal to, or false if not.

So you dont need any if x == y then return true else return false end
You only need to return the comparison.

Yet if you ask any professional they will say use…

[lua]
if(“a” == “a”)then
return true
else
return false
end

then
[/lua]

[lua]
return “a” == “a”
[/lua]

You’re right, works like a charm, thanks. ^^

No they won’t.
Gheez. I teach you something new and easy and you still complain.