• Restricted SpawnMenu / Contextmenu
    5 replies, posted
Hey reader, at first I want to tell you that my english isn`t the best. Currently we are running an StarWarsRP server (DarkRP) and I want that only users with a specific ULX rank can open the Context and Spawn menu. But I dont know how to do this. A fast answer would be nice
Make a check if the player is the specific ULX rank, return true on GM/OnSpawnMenuOpen otherwise, false. So only that rang can open the spawn menu Same with context GM/OnContextMenuOpen
I tried this before but it doesnt worked function GM:ContextMenuOpen()  if (ply:GetUserGroup() == "superadmin") then return true else return false end end function GM:SpawnMenuOpen()  if (ply:GetUserGroup() == "superadmin") then return true else return false end end
It should worked, do you have it in the client folder or the server folder?
its in my darkrp_module folder And is called sv_spawnmenu.lua
Please put it in the code tag next time "{ }" function GM:ContextMenuOpen() if (ply:GetUserGroup() == "superadmin") then return true else return false end end function GM:SpawnMenuOpen() if (ply:GetUserGroup() == "superadmin") then return true else return false end end You never define ply, is it? Dont use GM:ContextMenuOpen(), youre overwriting the old function with it. Which means the you WILL break something..use the actual hook instead you can do if ply:GetUserGroup() == "superadmin" then return end which will instantly return if the player is superadmin or not. it will instantly return true or false, no need for the return true else return false stuff
Sorry, you need to Log In to post a reply to this thread.