manawydan Posted January 3, 2013 Share Posted January 3, 2013 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
Castillo Posted January 3, 2013 Share Posted January 3, 2013 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now