I think you were setting the wrong element datas, try this code
function apagarRadar ()
setPlayerHudComponentVisible(source,"radar",false)
setElementData(source,"showRadar",false)
end
addEventHandler("onPlayerJoin",getRootElement(),apagarRadar)
function mostrarRadar (source)
if not ( getElementData(source,"showRadar") ) then
setElementData(source,"showRadar",true)
setPlayerHudComponentVisible(source,"radar",true)
else
outputChatBox("Já tens um mapa.",source)
end
end
addCommandHandler("mapa",mostrarRadar)