vXHazE Posted May 5, 2014 Posted May 5, 2014 Hi I would like to disable the map function in F1 so that nobody can teleport except the admins Cheers
tosfera Posted May 5, 2014 Posted May 5, 2014 Check if the player is an admin, if not then disable the button.
tosfera Posted May 5, 2014 Posted May 5, 2014 guiSetEnabled ( guiElement, bool ); If you want to know how to see if someone is an administrator, use the following function; IsObjectInACLGroup
vXHazE Posted May 5, 2014 Author Posted May 5, 2014 What do you mean? im kinda confused what do I do with the line you wrote? Cheers for replying tho
Toffbrown Posted May 6, 2014 Posted May 6, 2014 if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then guiSetEnabled ( guiElement, true ) elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "Everyone" ) ) then guiSetEnabled ( guiElement, false ) cancelEvent(true) end end this is what you need, for the guiElement you enter in what the element your GUI uses
Toffbrown Posted May 6, 2014 Posted May 6, 2014 (edited) removed cause im an idiot LOL Edited May 7, 2014 by Guest
Arnold-1 Posted May 6, 2014 Posted May 6, 2014 aaaah, true but you can use "isObjectInACLGroup" in client sided scripts No, You can't Bind the key serverside, and trigger it to client. server: function bound (theplayer) account=getPlayerAccount(theplayer) if isObjectInACLGroup("user."..account,"Admin") then triggerClientEvent("onMapAllowed",theplayer) else triggerClientEvent("onMapUnallowed",theplayer) end end addEventHandler("onPlayerJoin",root,function () for i,v in ipairs(getElementsByType("player")) do bindKey(v,"F1","down",bound) end end ) client: addEvent("onMapAllowed",true) addEvent("onMapUnallowed",true) function allowed () guiSetEnabled(button,true) end function unallowed () guiSetEnabled(button,false) end addEventHandler("onMapAllowed",root,allowed) addEventHandler("onMapUnallowed",root,unallowed)
Karuzo Posted May 6, 2014 Posted May 6, 2014 aaaah, true but you can use "isObjectInACLGroup" in client sided scripts I think you don't know what you're talkin bout.
Toffbrown Posted May 6, 2014 Posted May 6, 2014 sorry, i was tired and at school so rushed it and i was meaning to use setPlayerData
Twisted Posted May 6, 2014 Posted May 6, 2014 You'll have to edit the fr_client.lua if you're talking about Freeroam. All the buttons are stored in a table too. So you may wanna check on that. I'll see if I can do it later and PM it you
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now