• DarkRP Disable Prop Spawning for users only?
    7 replies, posted
Is there any way to only allow prop spawning for admins or superadmins etc (I'm using ULX) in DarkRP or just in general. I know it's a weird request seeing as building is a key part in normal DarkRP but I'm making a Serious RP server (won't go into detail) and I could really use not having people running around spawning props. I'd like to say thanks beforehand for anyone who's willing to help me with this :)
Use the PlayerSpawnProp hook and check the spawner's user group.
[QUOTE=SexyBeast70;49077890]Use the PlayerSpawnProp hook and check the spawner's user group.[/QUOTE] Can you expand more on that please I'm very new to lua
[code] hook.Add("PlayerSpawnProp", "Disallow_user_props", function(client) if (client:IsUserGroup("admin") or client:IsUserGroup("superadmin")) then return true end return false end) [/code] Stick it somewhere serverside. Alternatively if you want to stop spawning all together: [code] local hooks = { "Effect", "NPC", "Prop", "Ragdoll", "SENT", "Vehicle" } 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 end return false end) end [/code]
[QUOTE=Lolcats;49078626][code] hook.Add("PlayerSpawnProp", "Disallow_user_props", function(client) if (client:IsUserGroup("admin") or client:IsUserGroup("superadmin")) then return true end return false end) [/code] Stick it somewhere serverside. Alternatively if you want to stop spawning all together: [code] local hooks = { "Effect", "NPC", "Prop", "Ragdoll", "SENT", "Vehicle" } 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 end return false end) end [/code][/QUOTE] Worked thanks!
lua/autorun/server or client i think
deadass, stop reviving old threads. If your using sandbox as a base, put this in ur cl_init.lua file in your gamemode folder. local function DisallowSpawnMenu( ) if not LocalPlayer():IsAdmin() then return false end end  
Sorry, you need to Log In to post a reply to this thread.