Sign in to follow this  
#DaMiAnO

Disable F11 Map.

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

Share this post


Link to post

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 ) 

Share this post


Link to post
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 ) 

Share this post


Link to post

Put the /me command canceler in SERVER SIDE, a different script.

the onPlayerChat event is a SERVER ONLY event.

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.