حصلته بس ما يقبل التلوين ليه ؟؟
السطر 59
addEventHandler("onResourceStart", rootElement,
function (startedResource)
--Is this resource a gamemode?
if isGamemode(startedResource) then
--Check no gamemode is running already
if getRunningGamemode() then
return
end
if triggerEvent("onGamemodeStart", getResourceRootElement(startedResource), startedResource) then
currentGamemode = startedResource
--Setup our announcements
local gamemodeName = getResourceInfo(currentGamemode, "name") or getResourceName(currentGamemode)
if get("ASE") then
setGameType(gamemodeName)
end
if get("messages") then
local name = getInstigatorName ( " by " ) or ""
outputMapManager("[RooM]: Gamemode '"..gamemodeName.."' started" .. name .. "." )
end
--We need to wait a while to see if any maps were started. If not, lets try and start a random one
setTimer(
function()
if not getRunningGamemodeMap() then
--Lets check if there are any maps for this gamemode
local maps = getMapsCompatibleWithGamemode(getRunningGamemode())
--If we have any, we'll start a random one
if #maps > 0 then
changeGamemodeMap (maps[math.random(1,#maps)])
end
end
end,
50, 1 )
else
currentGamemode = nil
end
elseif isMap(startedResource) then --If its a map
--Make sure there is a gamemode running
if not getRunningGamemode() then
return
end
--Is there a map running already?
if getRunningGamemodeMap() then
return
end
--Is it compatible with our gamemode?
if isGamemodeCompatibleWithMap ( getRunningGamemode(), startedResource ) then
--Lets link the map with the gamemode
if ( triggerEvent("onGamemodeMapStart", getResourceRootElement(startedResource), startedResource) ) then
currentGamemodeMap = startedResource
--Setup our announcements
local gamemodeMapName = getResourceInfo(currentGamemodeMap, "name") or getResourceName(currentGamemodeMap)
applyMapSettings( currentGamemodeMap )
if get("ASE") then
setMapName(gamemodeMapName)
end
if get("messages") then
local name = getInstigatorName ( " by " ) or ""
outputChatBox("#ffffff[Room] '"..gamemodeMapName.."' started" .. name .. ".")
end
else
currentGamemodeMap = nil
end
end
end
end
)