#DaMiAnO Posted November 19, 2011 Share Posted November 19, 2011 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
Castillo Posted November 19, 2011 Share Posted November 19, 2011 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
#DaMiAnO Posted November 19, 2011 Author Share Posted November 19, 2011 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
Castillo Posted November 19, 2011 Share Posted November 19, 2011 Put the /me command canceler in SERVER SIDE, a different script. the onPlayerChat event is a SERVER ONLY event. Link to comment
#DaMiAnO Posted November 19, 2011 Author Share Posted November 19, 2011 Topic can be closed. 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