..:D&G:.. Posted January 31, 2015 Share Posted January 31, 2015 Hello guys, I am trying to make a small function to delete all the vehicles from the server, but it doesn't seem to work and there are no errors: function delAllVehs(player) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)), aclGetGroup("Admin")) then for key, value in pairs( getElementsByType( "vehicle" ) ) do if isElement( value ) then destroyElement( value ) outputChatBox(#value.." vehicles deleted!", player) end end end end addCommandHandler("delvehs", delAllVehs) Thank you. Link to comment
iPrestege Posted February 1, 2015 Share Posted February 1, 2015 function delAllVehs(player) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)), aclGetGroup("Admin")) then for key, value in pairs( getElementsByType( "vehicle" ) ) do if isElement( value ) then destroyElement( value ) count = key end end if count ~= nil then outputChatBox(count.." vehicles deleted!", player) end end end addCommandHandler("delvehs", delAllVehs) 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