Kayl Posted December 8, 2009 Share Posted December 8, 2009 (edited) Hello, So first of all I am not talking about the HUD radar in the lower left corner. I am talking about the full size radar map that you can toggle using the "radar" command, bound to the F11 key by default. I am looking for a way to hide this radar map for specific players. I know there is a server side function forcePlayerMap. However it seems to force or stop forcing the display of the map. It can not force the radar map "off". On the client side there are isPlayerMapForced and isPlayerMapVisible, only getters, no setters. I tried: toggleControl("radar",false"): it only affects the availability of the "radar" command, it doesn't change the current state setControlState("radar",true): when isPlayerMapVisible() return true to try to hide it, doesn't work executeCommandHandler("radar"): this returns false so I guess it's not possible. If it was that easy I guess the forcePlayerMap function wouldn't exist I'm out of ideas. Is there any undocumented function that would to the job or am I misusing one of the aforementioned techniques? Edited January 5, 2010 by Guest Link to comment
eAi Posted December 8, 2009 Share Posted December 8, 2009 showPlayerHudComponent is probably what you're after. Link to comment
Kayl Posted December 8, 2009 Author Share Posted December 8, 2009 I'm sorry but in my initial post I started with: So first of all I am not talking about the HUD radar in the lower left corner. And on the page you provided the only radar mentioned that can be disabled is the bottom left one. So I guess showPlayerHudComponent is not what I'm after. Am i missing an item in showPlayerHudComponent ? Link to comment
Kayl Posted January 4, 2010 Author Share Posted January 4, 2010 I take the liberty to request fresh ideas again for my problem since it still isn't solve. Once again I'm not talking about the HUD radar but the map that can be forced on with forcePlayerMap but can not be forced off (at least I don't know how, hence the topic). Link to comment
DEFCON1 Posted January 5, 2010 Share Posted January 5, 2010 Hello, I do not understand what you are trying to do, please explain better. Do you want to block players from using the "radar" command and key ? Maybe what you need is forcePlayerMap( player, false ) ? Link to comment
Kayl Posted January 5, 2010 Author Share Posted January 5, 2010 Well you got it right. I want to disable the F11 functionality. I can disable the key to avoid the player to show it. But I can not force it off when it is already on, since forcePlayerMap( player, false ) only seem to "stop forcing" but doesn't remove the map if it is shown. Link to comment
x86 Posted January 5, 2010 Share Posted January 5, 2010 Well you got it right.I want to disable the F11 functionality. I can disable the key to avoid the player to show it. But I can not force it off when it is already on, since forcePlayerMap( player, false ) only seem to "stop forcing" but doesn't remove the map if it is shown. toggleControl("radar", false) Link to comment
DakiLLa Posted January 5, 2010 Share Posted January 5, 2010 Well you got it right.I want to disable the F11 functionality. I can disable the key to avoid the player to show it. But I can not force it off when it is already on, since forcePlayerMap( player, false ) only seem to "stop forcing" but doesn't remove the map if it is shown. toggleControl("radar", false) I tried:toggleControl("radar",false"): it only affects the availability of the "radar" command, it doesn't change the current state Link to comment
robhol Posted January 6, 2010 Share Posted January 6, 2010 Force the radar on, then setControlState("radar", true) which should hide it again. From there, you can proceed to disable the control with toggleControl. You might want to setControlState("radar", false) after a short delay so it doesn't "stay pressed", although it might not matter... Edit: I should mention I have no freaking idea whether this'll actually work, but it's worth a try. Link to comment
Kayl Posted January 7, 2010 Author Share Posted January 7, 2010 Thanks for the ideas. Below you'll find the code of what I have tried so far. + forcePlayerMap(player,false) seems to hide the map only if it was shown due to a previous forcePlayerMap(player,true), it doesn't work if it was shown with F11 + the "radar" command works when typed in F8 but I can't seem to make it work from code + setting the control state of the radar "control" doesn't seem to work Server test: function testserver(player,cmd,id) local test_id = tonumber(id) if test_id == 1 then --show & hide > works forcePlayerMap(player,true) setTimer(forcePlayerMap,5000,1,player,false) elseif test_id == 2 then --try to see if the "radar" input can show the map setControlState(player,"radar",true) setTimer(setControlState,1000,1,player,"radar",false) setTimer(forcePlayerMap,5000,1,player,false) elseif test_id == 3 then --try to see if the "radar" command can be called executeCommandHandler("radar",player) setTimer(forcePlayerMap,1000,1,player,false) elseif test_id == 4 then --gives 5 seconds for player to show map and then try to hide it setTimer(forcePlayerMap,5000,1,player,false) elseif test_id == 5 then --gives 5 seconds for player to show map and then try to hide it with input setTimer(setControlState,5000,1,player,"radar",true) setTimer(setControlState,6000,1,player,"radar",false) elseif test_id == 6 then --gives 5 seconds for player to show map and then try to hide it with force on & off setTimer(forcePlayerMap,5000,1,player,true) setTimer(forcePlayerMap,5500,1,player,false) else outputChatBox("No test executed") end end addCommandHandler("stest",testserver) Client test: function testclient(cmd,id) local test_id = tonumber(id) if test_id == 1 then setControlState("radar",true) setTimer(setControlState,1000,1,"radar",false) elseif test_id == 2 then executeCommandHandler("radar") elseif test_id == 3 then --gives 5 seconds to enable map and try to hide it with input setTimer(setControlState,5000,1,"radar",true) setTimer(setControlState,5500,1,"radar",false) else outputChatBox("No test executed") end end addCommandHandler("ctest",testclient) Link to comment
Kayl Posted January 7, 2010 Author Share Posted January 7, 2010 Thanks for the ideas. Below you'll find the code of what I have tried so far. + forcePlayerMap(player,false) seems to hide the map only if it was shown due to a previous forcePlayerMap(player,true), it doesn't work if it was shown with F11 + the "radar" command works when typed in F8 but I can't seem to make it work from code + setting the control state of the radar "control" doesn't seem to work Server test: function testserver(player,cmd,id) local test_id = tonumber(id) if test_id == 1 then --show & hide > works forcePlayerMap(player,true) setTimer(forcePlayerMap,5000,1,player,false) elseif test_id == 2 then --try to see if the "radar" input can show the map setControlState(player,"radar",true) setTimer(setControlState,1000,1,player,"radar",false) setTimer(forcePlayerMap,5000,1,player,false) elseif test_id == 3 then --try to see if the "radar" command can be called executeCommandHandler("radar",player) setTimer(forcePlayerMap,1000,1,player,false) elseif test_id == 4 then --gives 5 seconds for player to show map and then try to hide it setTimer(forcePlayerMap,5000,1,player,false) elseif test_id == 5 then --gives 5 seconds for player to show map and then try to hide it with input setTimer(setControlState,5000,1,player,"radar",true) setTimer(setControlState,6000,1,player,"radar",false) elseif test_id == 6 then --gives 5 seconds for player to show map and then try to hide it with force on & off setTimer(forcePlayerMap,5000,1,player,true) setTimer(forcePlayerMap,5500,1,player,false) else outputChatBox("No test executed") endendaddCommandHandler("stest",testserver) Client test: function testclient(cmd,id) local test_id = tonumber(id) if test_id == 1 then setControlState("radar",true) setTimer(setControlState,1000,1,"radar",false) elseif test_id == 2 then executeCommandHandler("radar") elseif test_id == 3 then --gives 5 seconds to enable map and try to hide it with input setTimer(setControlState,5000,1,"radar",true) setTimer(setControlState,5500,1,"radar",false) else outputChatBox("No test executed") endendaddCommandHandler("ctest",testclient) Link to comment
DEFCON1 Posted January 7, 2010 Share Posted January 7, 2010 I think that is a bug. forcePlayerMap( player, false ) should hide the map if shown by command "radar" and not only if shown by forcePlayerMap( player, true ). I think you have no chance to fix it by yourself. Link to comment
DEFCON1 Posted January 7, 2010 Share Posted January 7, 2010 I think that is a bug. forcePlayerMap( player, false ) should hide the map if shown by command "radar" and not only if shown by forcePlayerMap( player, true ). I think you have no chance to fix it by yourself. Link to comment
Kayl Posted January 10, 2010 Author Share Posted January 10, 2010 I guess you are right. I would like the confirmation from a MTA dev member that indeed forcePlayerMap( player, false ) is supposed to hide the map however it was opened. Shall I create a bug report about that? Link to comment
Kayl Posted January 10, 2010 Author Share Posted January 10, 2010 I guess you are right. I would like the confirmation from a MTA dev member that indeed forcePlayerMap( player, false ) is supposed to hide the map however it was opened. Shall I create a bug report about that? Link to comment
Gamesnert Posted January 10, 2010 Share Posted January 10, 2010 forceOn: A boolean value representing whether or not the players radar map will be forced on Not being forced on isn't the same as being forced off. There should just be a 3rd parameter of sorts (nil?) to hide it. Or, replace the entire map. (example resource) Link to comment
Gamesnert Posted January 10, 2010 Share Posted January 10, 2010 forceOn: A boolean value representing whether or not the players radar map will be forced on Not being forced on isn't the same as being forced off. There should just be a 3rd parameter of sorts (nil?) to hide it. Or, replace the entire map. (example resource) Link to comment
eAi Posted January 10, 2010 Share Posted January 10, 2010 I'd suggest forcePlayerMap(forceOn, forceOff=false) Link to comment
eAi Posted January 10, 2010 Share Posted January 10, 2010 I'd suggest forcePlayerMap(forceOn, forceOff=false) Link to comment
robhol Posted January 10, 2010 Share Posted January 10, 2010 I'd suggest forcePlayerMap(forceOn, forceOff=false) That sounds a little illogical IMO.. what about (state) where it could be either false (force off), true (force on) or nil to stop any.. "forcing"? Link to comment
robhol Posted January 10, 2010 Share Posted January 10, 2010 I'd suggest forcePlayerMap(forceOn, forceOff=false) That sounds a little illogical IMO.. what about (state) where it could be either false (force off), true (force on) or nil to stop any.. "forcing"? Link to comment
Gamesnert Posted January 10, 2010 Share Posted January 10, 2010 How about scrapping forcePlayerMap and just make it setPlayerMapShowing? Perhaps some compatibility issues but sounds a lot more logical. Link to comment
Gamesnert Posted January 10, 2010 Share Posted January 10, 2010 How about scrapping forcePlayerMap and just make it setPlayerMapShowing? Perhaps some compatibility issues but sounds a lot more logical. Link to comment
robhol Posted January 10, 2010 Share Posted January 10, 2010 How about scrapping forcePlayerMap and just make it setPlayerMapShowing? Perhaps some compatibility issues but sounds a lot more logical. That's even better. Setting the actual "showing" state like that makes more sense, and you could always replace this old functionality with toggleControl. There is a difference, but you could still do the same kind of things. Link to comment
robhol Posted January 10, 2010 Share Posted January 10, 2010 How about scrapping forcePlayerMap and just make it setPlayerMapShowing? Perhaps some compatibility issues but sounds a lot more logical. That's even better. Setting the actual "showing" state like that makes more sense, and you could always replace this old functionality with toggleControl. There is a difference, but you could still do the same kind of things. 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