Advertisement
Noneatme

Untitled

Sep 12th, 2012
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. addCommandHandler("deletemap",function(thePlayer, cmd, res)
  2. if(res) then
  3. local r = getResourceFromName(res)
  4. if not(r) then
  5. for index, key in ipairs ( getResources () ) do
  6. local map = getResourceInfo ( key, "type" )
  7. if(map == "map") then
  8. if ( string.find ( string.upper ( getResourceName(key) ), string.upper ( res ), 1, true ) ) then
  9. r = key
  10. break;
  11. end
  12. end
  13. end
  14. end
  15. if(r) then
  16. if(getResourceState(r) == "running") then
  17. outputChatBox("Die Map "..getResourceName(r).." kann nicht umbenannt werden, da sie gerade am Laufen ist!", thePlayer, 255, 0, 0)
  18. return
  19. end
  20. local tempName = getResourceName(r)
  21. local sucess = renameResource(r, "[DEL]"..getResourceName(r))
  22. if(sucess) then
  23. outputChatBox("The Map "..tempname.." was delelted!", thePlayer, 0, 255, 0)
  24. else
  25. outputChatBox("Ein Unbekannter Fehler trat auf!", thePlayer, 255, 0, 0)
  26. end
  27. else
  28. outputChatBox("Resource konnte nicht gefunden werden!", thePlayer, 255, 0, 0)
  29. end
  30. else
  31. outputChatBox("Du musst eine Resource angeben!", thePlayer, 255, 0, 0)
  32. end
  33. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement