Jump to content

[HELP] getMapName on client


Kutlu35

Recommended Posts

-- CLIENT
mapName = ""

function requestMapName()
	triggerServerEvent("requestMapName", localPlayer)
end

addEvent("getMapName", true)
function getMapName(name)
	mapName = name
end
addEventHandler("getMapName", getRootElement(), getMapName)
--SERVER
addEvent("requestMapName", true)
function requestMapName()
	local mapName = getMapName()
	if mapName and mapName ~= "None" then
		triggerClientEvent(source, "getMapName", source, mapName)
    end
end
addEventHandler("requestMapName", getRootElement(), requestMapName)

 

when using the "requestMapName" function, the "mapName" variable will equal the name of the current map

  • Like 1
Link to comment
On 24/01/2020 at 21:34, Motar2k said:

-- CLIENT
mapName = ""

function requestMapName()
	triggerServerEvent("requestMapName", localPlayer)
end

addEvent("getMapName", true)
function getMapName(name)
	mapName = name
end
addEventHandler("getMapName", getRootElement(), getMapName)

--SERVER
addEvent("requestMapName", true)
function requestMapName()
	local mapName = getMapName()
	if mapName and mapName ~= "None" then
		triggerClientEvent(source, "getMapName", source, mapName)
    end
end
addEventHandler("requestMapName", getRootElement(), requestMapName)

 

when using the "requestMapName" function, the "mapName" variable will equal the name of the current map

didn't test it yet but thanks for effort

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