Jump to content

Disable F11 Map.


#DaMiAnO

Recommended Posts

Hi!

I have this code:

-- Wylaczanie mapy spod F11. 
function disableMap ( ) 
    toggleControl(source, "radar", false) 
end 
addEventHandler ( "onPlayerConnect", getRootElement(), disableMap ) 

, but this doesn't working.

I'm running that as server-side. Maybe I have wrong luacode. :)

Link to comment

You should read the wiki comment:

This article needs checking for the following reason: Hard-coded MTA commands do not work with toggleControl, return false and bad argument.

Edit: Maybe this way:

-- client side:

function disableMap ( ) 
    toggleControl("radar", false) 
end 
addEventHandler ( "onClientResourceStart", resourceRoot, disableMap ) 

Link to comment
You should read the wiki comment:

This article needs checking for the following reason: Hard-coded MTA commands do not work with toggleControl, return false and bad argument.

Edit: Maybe this way:

-- client side:

function disableMap ( ) 
    toggleControl("radar", false) 
end 
addEventHandler ( "onClientResourceStart", resourceRoot, disableMap ) 

Working, but when I add that to resource, /me command again can be used.

-- Wylaczanie domylnej komendy /me. 
addEventHandler('onPlayerChat', root, function(message, type) 
    if type == 1 then 
      cancelEvent() 
    end 
end) 
  
-- Wylaczanie mapy spod F11. 
function disableMap ( ) 
    toggleControl("radar", false) 
end 
addEventHandler ( "onClientResourceStart", resourceRoot, disableMap ) 

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