vXHazE Posted May 5, 2014 Share Posted May 5, 2014 Hi I would like to disable the map function in F1 so that nobody can teleport except the admins Cheers Link to comment
tosfera Posted May 5, 2014 Share Posted May 5, 2014 Check if the player is an admin, if not then disable the button. Link to comment
vXHazE Posted May 5, 2014 Author Share Posted May 5, 2014 Cheers but how do you disable the button Link to comment
tosfera Posted May 5, 2014 Share 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 Link to comment
vXHazE Posted May 5, 2014 Author Share Posted May 5, 2014 What do you mean? im kinda confused what do I do with the line you wrote? Cheers for replying tho Link to comment
Toffbrown Posted May 6, 2014 Share 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 Link to comment
Karuzo Posted May 6, 2014 Share Posted May 6, 2014 You can't use server functions in a clientsided file. Link to comment
Toffbrown Posted May 6, 2014 Share Posted May 6, 2014 (edited) removed cause im an idiot LOL Edited May 7, 2014 by Guest Link to comment
Arnold-1 Posted May 6, 2014 Share 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) Link to comment
Karuzo Posted May 6, 2014 Share 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. Link to comment
Toffbrown Posted May 6, 2014 Share Posted May 6, 2014 sorry, i was tired and at school so rushed it and i was meaning to use setPlayerData Link to comment
Twisted Posted May 6, 2014 Share 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 Link to comment
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