Jump to content

Hide map


Extremo

Recommended Posts

Hey MTA Community,

I would love to know if it is possible to make people not able to see the map at all. I don't only mean the radar map but also the one in the escape menu. Any help is very well appreciated.

Please point me into the right direction too if it is possible. I already know you can hide the radar map with showPlayerHud, what I care most about is the map in the escape menu.

Regards.

Link to comment
Can't you cancel the button with cancelevent?

wtf. don't reply for the sake of it if you have no idea what u talking about.. You can't cancel buttons with scripts.

ontopic:

there is no map in the escape menu.. so what map are you talking about? The only map in the escape menu is in the GTA:SA menu not MTA's

If you mean that you want to forbid a player from seeing the menu then you cannot do this.

If you mean that you want to remove the transparency from the menu so that the players can't see the gameplay anymore then you can detect when the menu is started by checking onClientKey + isChatBoxInputActive must return false and then simply draw a black picture onto the screen.

edit: also u gotta check that console is not displayed either I dont remember the function for it you'll have to search the mtasa wiki for it

Link to comment
  • Moderators

wtf. don't reply for the sake of it if you have no idea what u talking about.. You can't cancel buttons with scripts.

He isn't clear about "map" he is talking about. Yes you are right about that.

I have never seen the map in the escape menu, so I thought he meant "f11".

I don't know all the possibility's of lua in combination with mta, so please.

Stop flaming at me, everybody have the right to reply as long it is no spam and it has to do with the subject.

Link to comment

Hey,

I am very sorry for not being clear. Yes I meant the map on F11. I'll go ahead and try the unbindKey immediatly! Thanks for the help, I'll report back as soon as I have some more news =).

EDIT:

Ok, it didn't work. Neither on the server nor on the client.

Regards.

Link to comment

This is my script for admin or any one select what you want ..

--- for admin only  
---serverSide 
function show () 
local acc = getAccountName(getPlayerAccount( source)) 
if isObjectInACLGroup('user.'..acc, aclGetGroup('Admin')) then 
toggleControl("radar", false) 
outputChatBox('Admin Has Hide the Map',source,255,0,0) 
else 
toggleControl("radar", true) 
outputChatBox('Admin Has Show the Map',source,0,255,255) 
end 
addCommandHandler('hide', show) 
----- all time hide  
---clientSide 
addEventHandler('onClientResourceStart', resourceRoot, 
function() 
toggleControl("radar", false) 
end) 
end 

Link to comment
  • Moderators

https://wiki.multitheftauto.com/wiki/ToggleControl

client and server side and you want client side

client: toggleControl("radar", false)

You better take a good look at X-SHADOW his script.

  
function stopMap ( ) 
local getElementData ( "radar_allow" ) 
    if radar_allow == 1 then 
        toggleControl("radar", true) 
    else 
        toggleControl("radar", false) 
    end 
end 
addEventHandler ( "onClientResourceStart", resourceRoot, stopMap ) 
  

Edited by Guest
Link to comment
https://wiki.multitheftauto.com/wiki/ToggleControl

client and server side and you want client side

client: toggleControl("radar", false)

You better take a good look at X-SHADOW his script.

I don't think you understood my question precisely.

I am trying to toggle the F11 map for everybody though if I give them a map script-wise I want to re-enable the map for them, but only for those who DO have a map.

Link to comment
Actually it does. The F11 map is disabled. I tried it myself.

Weird, for me it still displays it.

Are you sure you made it all clientside?

  
function DisableMap() 
    toggleControl("radar", false) 
end 
  
addEventHandler("onClientResourceStart", getRootElement(), DisableMap) 
  

Works flawless on clientside.

@ Shadow

Your script enables it for everybody or disables it for everybody doesn't it? I want to disable it for everybody and renable it for specific players - not everybody.

Regards.

Link to comment
  • Moderators

Script by Shadow(add by this person......):

---serverSide 
function show () 
local acc = getAccountName(getPlayerAccount( source)) 
if isObjectInACLGroup('user.'..acc, aclGetGroup('RADAR_ENABLE')) then 
toggleControl("radar", false) 
outputChatBox('radar disable',source,255,0,0) 
else 
toggleControl("radar", true) 
outputChatBox('radar enable',source,0,255,255) 
end 
addCommandHandler('radar', show) 

  
---clientSide 
addEventHandler('onClientResourceStart', resourceRoot, 
function() 
toggleControl("radar", false) 
end) 
end 

1 On your server.

admin> resources > manage acl > adgroupe "RADAR_ENABLE"

2 Ad user login names to this group and they will be able to have f11 map. (adobjects "user.")

The command to make it visible is now: "radar"

thx to shadow.

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