Hey, Ich habe mich mal ein einem Script versucht. und komme nun nicht weiter.
und zwar möchte ich ein /deletemap script machen aber es funktioniert nicht:
der eigentliche Command
Lua
addCommandHandler("delmap", function(p) if isObjectInACLGroup (aclgetGroup("Admin")) then local map = exports.mapmanager:getRunningGamemodeMap() triggerEvent("onDeleteMap", p) outputChatBox("Map: "..getMapName(map).." has been deleted by "..getPlayerName(p), root, 200, 100, 50, true) setTimer(function() deleteResource(map) outputDebugString("Map deleted.") end, 2000, 1) end
der serverseitige trigger denke ich :s
Lua
function startRandomMap() -- CADU HERE
-- Handle forced nextmap setting if maybeApplyForcedNextMap() then return end
-- Get a random map chosen from the 10% of least recently player maps, with enough spawn points for all the players (if required) local map = getRandomMapCompatibleWithGamemode( getThisResource(), 10, g_GameOptions.ghostmode and 0 or getTotalPlayerCount() ) if map then g_IgnoreSpawnCountProblems = map -- Uber hack 4000 if not exports.mapmanager:changeGamemodeMap ( map, nil, true ) then problemChangingMap() end else outputWarning( 'startRandomMap failed' ) endend
addEvent("onDeleteMap", true)addEventHandler("onDeleteMap", root, startRandomMap)