[DarkRP] Make it so only Superadmins & up can spawn entities

How can I make it so only superadmins and up can spawn entities from the Q menu? Right now admins can spawn them and I don’t want them to be able to.

Think it’s this one:

Place it in an server init.

function GM:PlayerSpawned (ply, ent )
if ( not ply:IsSuperAdmin() ) then
return false

I am NO expert and I haven’t even played DarkRP and I just made this up, but, it should work for your needs.

Stops anyone who isn’t a superadmin from spawning things.

function SpawnProp( ply, model, ent )
if(!ply:IsSuperAdmin) then
return false
return true



No it does not. Because it’s ply:IsSuperAdmin() and not ply:IsSuperAdmin

This is to disable prop spawning, OP wants to disable entity spawning (EG Bouncing balls)

Haha, cant believe I forgot the brackets. :suicide:

edit: are all the entites class type sent?

[editline]24th July 2013[/editline]

Just tested this one, this works.

I suggest using the hook PlayerSpawnSENT, which you can simply return false to.

function BlockSents( ply, sent_type )

if !(ply:IsSuperAdmin()) then

       return false



hook.Add( “PlayerSpawnSENT”, “DarkRPBlockSents”, BlockSents )

In what file do you write this?

DarkRPModification has an option for it, look in the config.

I checked the configs, but I am únable to find where to write that code into:

local hooks = {

for _, v in pairs (hooks) do

    hook.Add("PlayerSpawn"..v, "Disallow_user_"..v, function(client)
        if (client:IsUserGroup("admin") or client:IsUserGroup("superadmin")) then
            return true
        return false

On my Dark RP I want to limit prop spawning and everyhting else, limited to admins and superadmins. But I am too stupid to get that working… in which specific file do I need to add this line of code?
Hint: I am using ulx and more ulx on my server

any serverside lua file

Well, thanks very much! That helped!

erm how did you not see this? https://github.com/FPtje/darkrpmodification/blob/master/lua/darkrp_config/settings.lua#L177

Well it did not work work me, so I needed that custom line of code