Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- addCommandHandler("deletemap",function(thePlayer, cmd, res)
- if(res) then
- local r = getResourceFromName(res)
- if not(r) then
- for index, key in ipairs ( getResources () ) do
- local map = getResourceInfo ( key, "type" )
- if(map == "map") then
- if ( string.find ( string.upper ( getResourceName(key) ), string.upper ( res ), 1, true ) ) then
- r = key
- break;
- end
- end
- end
- end
- if(r) then
- if(getResourceState(r) == "running") then
- outputChatBox("Die Map "..getResourceName(r).." kann nicht umbenannt werden, da sie gerade am Laufen ist!", thePlayer, 255, 0, 0)
- return
- end
- local tempname = getResourceName(r)
- local sucess = renameResource(r, "[DEL]"..getResourceName(r))
- if(sucess) then
- outputChatBox("The Map "..tempname.." was delelted!", thePlayer, 0, 255, 0)
- else
- outputChatBox("Ein Unbekannter Fehler trat auf!", thePlayer, 255, 0, 0)
- end
- else
- outputChatBox("Resource konnte nicht gefunden werden!", thePlayer, 255, 0, 0)
- end
- else
- outputChatBox("Du musst eine Resource angeben!", thePlayer, 255, 0, 0)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement