Jump to content

How To Disable The Map Function In F1


Recommended Posts

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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...