jaZz_KCS Posted November 19, 2012 Share Posted November 19, 2012 Hello there! I've got a quick question regarding the freeroam plugin and it's GUI. I am working on a type of survival server and already successfully disabled all the functions I don't want players to have like giving themselves weapons, cars, warping, gravity, etc.. Besides disabling warping which allows you to warp to different players and disabling the map to be showed after login and death there's also this teleport function which when you open up the map via F1 menu lets you teleport anywhere you want by doing a double click. I successfully disabled warping to other players, but how can I disable the double click warping feature? I don't want my players to be able to warp where they want to.... Thank you in advance. Link to comment
myonlake Posted November 19, 2012 Share Posted November 19, 2012 Try these. Didn't find anything else related to it. Client-side (fr_client.lua) (updatePlayerBlips) (line 708) function updatePlayerBlips() if not g_PlayerData then return end local wnd = isWindowOpen(wndSpawnMap) and wndSpawnMap or wndSetPos local mapControl = getControl(wnd, 'map') for elem,player in pairs(g_PlayerData) do if not player.gui.mapBlip then player.gui.mapBlip = guiCreateStaticImage(0, 0, 9, 9, elem == g_Me and 'localplayerblip.png' or 'playerblip.png', false, mapControl) player.gui.mapLabelShadow = guiCreateLabel(0, 0, 100, 14, player.name, false, mapControl) local labelWidth = guiLabelGetTextExtent(player.gui.mapLabelShadow) guiSetSize(player.gui.mapLabelShadow, labelWidth, 14, false) guiSetFont(player.gui.mapLabelShadow, 'default-bold-small') guiLabelSetColor(player.gui.mapLabelShadow, 255, 255, 255) player.gui.mapLabel = guiCreateLabel(0, 0, labelWidth, 14, player.name, false, mapControl) guiSetFont(player.gui.mapLabel, 'default-bold-small') guiLabelSetColor(player.gui.mapLabel, 0, 0, 0) --[[for i,name in ipairs({'mapBlip', 'mapLabelShadow'}) do addEventHandler('onClientGUIDoubleClick', player.gui[name], function() server.warpMe(elem) closeWindow(wnd) end, false ) end]] end local x, y = getElementPosition(elem) x = math.floor((x + 3000) * g_MapSide / 6000) - 4 y = math.floor((3000 - y) * g_MapSide / 6000) - 4 guiSetPosition(player.gui.mapBlip, x, y, false) guiSetPosition(player.gui.mapLabelShadow, x + 14, y - 4, false) guiSetPosition(player.gui.mapLabel, x + 13, y - 5, false) end end Client-side (fr_client.lua) (spawnMapDoubleClick) (line 854) --[[function spawnMapDoubleClick(relX, relY) setPlayerPosition(relX*6000 - 3000, 3000 - relY*6000, 0) closeWindow(wndSpawnMap) end]] Link to comment
jaZz_KCS Posted November 19, 2012 Author Share Posted November 19, 2012 Replaced the lines with the ones you mentioned. Sadly, double-click map teleportation still works. Link to comment
myonlake Posted November 19, 2012 Share Posted November 19, 2012 Replaced the lines with the ones you mentioned. Sadly, double-click map teleportation still works. I hope you didn't remove the --[[ ]] tags, because they are supposed to be there. In my eyes I can't see anything else than those two areas, which cause the player to be teleported. Link to comment
jaZz_KCS Posted November 19, 2012 Author Share Posted November 19, 2012 Yeah I copied them too. Sadly not working - Double-click teleportation still works like before, weird. Link to comment
myonlake Posted November 19, 2012 Share Posted November 19, 2012 Hmm, perhaps this should prevent any unwanted errors or perhaps fixes it. Client-side (fr_client.lua) (setPosClick) (line 639) --[[function setPosClick() setPlayerPosition(getControlNumbers(wndSetPos, {'x', 'y', 'z'})) closeWindow(wndSetPos) end]] Client-side (fr_client.lua) (wndSetPos) (line 763) wndSetPos = { 'wnd', text = 'Set position', width = g_MapSide + 20, controls = { {'img', id='map', src='map.png', width=g_MapSide, height=g_MapSide, onclick=fillInPosition--[[, ondoubleclick=setPosClick]]}, {'txt', id='x', text='', width=60}, {'txt', id='y', text='', width=60}, {'txt', id='z', text='', width=60}, --[[{'btn', id='ok', onclick=setPosClick},]] {'btn', id='cancel', closeswindow=true}, {'lbl', text='Right click on map to close'} }, oncreate = setPosInit, onclose = closePositionWindow } Client-side (fr_client.lua) (wndSpawnMap) (line 872) wndSpawnMap = { 'wnd', text = 'Select spawn position', width = g_MapSide + 20, controls = { {'img', id='map', src='map.png', width=g_MapSide, height=g_MapSide--[[, ondoubleclick=spawnMapDoubleClick]]}, --{'lbl', text='Welcome to freeroam. Double click a location on the map to spawn.', width=g_MapSide-60, align='center'}, {'btn', id='close', closeswindow=true} }, oncreate = warpMapInit, onclose = closeSpawnMap } Link to comment
jaZz_KCS Posted November 19, 2012 Author Share Posted November 19, 2012 These changes in addition to the aforementioned ones - or only these? Link to comment
myonlake Posted November 19, 2012 Share Posted November 19, 2012 Those are additions Tell me if they worked out. Seems like they should work out. Link to comment
Renkon Posted November 19, 2012 Share Posted November 19, 2012 Excuse me, should you take freeroam out from Play's meta.xml file? Link to comment
myonlake Posted November 19, 2012 Share Posted November 19, 2012 Excuse me, should you take freeroam out from Play's meta.xml file? He doesn't want that, he wants some functions disabled only. Link to comment
jaZz_KCS Posted November 22, 2012 Author Share Posted November 22, 2012 All 5 changes from both of your posts together do indeed disable the double click warping on the map. No errors, no nothing, silently disabled. Thanks. 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