Jump to content

doubt delete or not to delete?


manawydan

Recommended Posts

how can I delete images and script mira.lua? when the player leaves the server!

client

addEventHandler( "onClientResourceStart", resourceRoot, 
    function ( startedRes ) 
        exports.crosshairreplace:register( 26, "26.png" ) 
        exports.crosshairreplace:register( 29, "29.png" )  
        exports.crosshairreplace:register( 30, "30.png" )  
        exports.crosshairreplace:register( 28, "29.png" )   
        exports.crosshairreplace:register( 32, "29.png" )    
    end 
) 
  
function apague() 
fileDelete(mira.lua) 
end 
addEventHandler( "onClientPlayerQuit", getRootElement(), apague ) 

Link to comment

Try this:

addEventHandler ( "onClientResourceStart", resourceRoot, 
    function ( startedRes ) 
        exports.crosshairreplace:register( 26, "26.png" ) 
        exports.crosshairreplace:register( 29, "29.png" ) 
        exports.crosshairreplace:register( 30, "30.png" ) 
        exports.crosshairreplace:register( 28, "29.png" )   
        exports.crosshairreplace:register( 32, "29.png" )   
    end 
) 
  
addEventHandler ( "onClientResourceStop", resourceRoot, 
    function ( ) 
        for _, file in ipairs ( { "26.png", "29.png", "30.png", "mira.lua" } ) 
            fileDelete ( file ) 
        end 
    end 
) 

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...