xF_Micka Posted January 27, 2014 Share Posted January 27, 2014 Hello. I need help about the MapInfo function of my race gamemode (adapted for DD/DM). Here are the part of script : function handleMapInfo(mapInfo) name = mapInfo.name or "Unknown" author = mapInfo.author or "Unknown" playedCount = tostring(mapInfo.playedCount or "N/A") lastTimePlayed = timestampToDate(mapInfo.lastTimePlayed) or "Unknown" modename = mapInfo.modename ~= "Destruction derby" and mapInfo.modename or "DD / DM" outputChatBox("#FFFFFF* #E1AA5AMap created by: #FFFFFF"..author.."",255,255,255,true) outputChatBox("#FFFFFF* #E1AA5APlayed: #FFFFFF"..playedCount.." #E1AA5Atimes",255,255,255,true) outputChatBox("#FFFFFF* #E1AA5ALast time: #ffffff"..lastTimePlayed.."",255,255,255,true) startTick = getTickCount() if not enabled then addEventHandler("onClientRender",getRootElement(),handleOnRender) enabled = true end end addEvent("onClientMapStarting",true) addEventHandler("onClientMapStarting",getRootElement(),handleMapInfo) I would like to use "modename" for example to display if it's a DM or DD map (we check if ghostmode is enabled or not, on DD : GM disabled, on DM : ghost enabled). For outputChatBox I have already the line : outputChatBox("#FFFFFF* #E1AA5AMode: #ffffff"..modename.."",255,255,255,true) Can help me please ? Thanks. Link to comment
Gallardo9944 Posted January 27, 2014 Share Posted January 27, 2014 modename = "" if string.find(name,"%[DM]") then modename = "[DM]" elseif string.find(name,"%[DD]") then modename = "[DD]" end Link to comment
xF_Micka Posted January 27, 2014 Author Share Posted January 27, 2014 Awesome! With the tag in map name, it's better, we can adapt without difficult. Thank you very much guy ! Link to comment
Gallardo9944 Posted January 27, 2014 Share Posted January 27, 2014 no problem, anytime. 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