yToPzz Posted July 18, 2022 Share Posted July 18, 2022 how do I make only whoever is in the ACL access this command? function allvehiclesaredoomed() vehicles = getElementsByType("vehicle") for i,v in ipairs(vehicles) do destroyElement(v) end end addCommandHandler("dv", allvehiclesaredoomed) Link to comment
Shady1 Posted July 18, 2022 Share Posted July 18, 2022 (edited) hello @yToPzzforum welcome to the site, you can find the answer about your topic from the link below. IsObjectInACLGroup function allvehiclesaredoomed(player) local acc = getAccountName(getPlayerAccount(player)) if not (isObjectInACLGroup("user."..acc, aclGetGroup("Admin"))) then vehicles = getElementsByType("vehicle") for i,v in ipairs(vehicles) do destroyElement(v) end end return false end addCommandHandler("dv", allvehiclesaredoomed) Edited July 18, 2022 by Shady1 Link to comment
Shady1 Posted July 18, 2022 Share Posted July 18, 2022 function allvehiclesaredoomed() local acc = getAccountName(getPlayerAccount(player)) if not (isObjectInACLGroup("user."..acc, aclGetGroup("Admin"))) then return end vehicles = getElementsByType("vehicle") for i,v in ipairs(vehicles) do destroyElement(v) end end addCommandHandler("dv", allvehiclesaredoomed) I changed the old code I recommend you to try this code 1 Link to comment
yToPzz Posted July 19, 2022 Author Share Posted July 19, 2022 8 hours ago, Shady1 said: function allvehiclesaredoomed() local acc = getAccountName(getPlayerAccount(player)) if not (isObjectInACLGroup("user."..acc, aclGetGroup("Admin"))) then return end vehicles = getElementsByType("vehicle") for i,v in ipairs(vehicles) do destroyElement(v) end end addCommandHandler("dv", allvehiclesaredoomed) I changed the old code I recommend you to try this code [2022-07-19 01:09:53] WARNING: Dv\S.lua:2: Bad argument @ 'getPlayerAccount' [Expected element at argument 1, got nil] [2022-07-19 01:09:59] WARNING: Dv\S.lua:2: Bad argument @ 'getAccountName' [Expected account at argument 1, got boolean] [2022-07-19 01:09:59] ERROR: Dv\S.lua:3: attempt to concatenate local 'acc' (a boolean value) Link to comment
#\_oskar_/# Posted July 19, 2022 Share Posted July 19, 2022 player must be added in the function function allvehiclesaredoomed(player) 1 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