Jump to content

command remove map


Young$

Recommended Posts

Server-side:

addCommandHandler('deletemap', 
    function(player,cmd,...) 
        local map = table.concat(...,' ') 
        local search = getResourceFromName(map) 
        if search then 
            deleteResource(search) 
            outputChatBox("Map sucessfully deleted!",player,255,255,255,false) 
        else 
            outputChatBox("Map not found!",player,255,255,255,false) 
        end 
    end 
) 

Add to meta.xml:

<min_mta_version server="1.1.1-9.03316" /> 

Not tested.

Command: /deletemap MapResourceName

Link to comment
  
addCommandHandler( 'deletemap', 
    function( uPlayer, _, ... ) 
        local map = table.concat( { ... } ,' ' ) 
        local search = getResourceFromName( map ) 
        if search then 
            deleteResource( search ) 
            outputChatBox( 'Map sucessfully deleted!', uPlayer, 255, 255, 255, false ) 
        else 
            outputChatBox( 'Map not found!', uPlayer, 255, 255, 255, false ) 
        end 
    end 
) 
  

Draken,Your code wrong, because 1 argument in function table.concat is table, but you use string.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...