SAbJaN Posted April 11, 2012 Posted April 11, 2012 Hey guys, I just need help, is this correct, I'm owner, on LVL 6, And it's not letting me /makeadmin [user] [rank] It's only letting me do it from the console.. addCommandHandler("gotoplace", teleportToPresetPoint, false, false) function makePlayerAdmin(thePlayer, commandName, who, rank) if ( hasObjectPermissionTo ( thePlayer, "command.aexec", true ) ) then if not (who) then outputChatBox("SYNTAX: /" .. commandName .. " [Player Partial Name/ID] [Rank]", thePlayer, 255, 194, 14) else local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, who) if (targetPlayer) then local username = getPlayerName(thePlayer) local accountID = getElementData(targetPlayer, "gameaccountid") exports['anticheat-system']:changeProtectedElementDataEx(targetPlayer, "adminlevel", tonumber(rank)) rank = tonumber(rank) if (rank<1337) then exports['anticheat-system']:changeProtectedElementDataEx(targetPlayer, "hiddenadmin", 0) end local query = mysql:query_free("UPDATE accounts SET admin='" .. mysql:escape_string(tonumber(rank)) .. "', hiddenadmin='0' WHERE id='" .. mysql:escape_string(accountID) .. "'") outputChatBox("You set " .. targetPlayerName .. "'s Admin rank to " .. rank .. ".", thePlayer, 0, 255, 0) local hiddenAdmin = getElementData(thePlayer, "hiddenadmin") -- Fix for scoreboard & nametags local targetAdminTitle = exports.global:getPlayerAdminTitle(targetPlayer) if (rank>0) or (rank==-999999999) then exports['anticheat-system']:changeProtectedElementDataEx(targetPlayer, "adminduty", 1) else exports['anticheat-system']:changeProtectedElementDataEx(targetPlayer, "adminduty", 0) end mysql:query_free("UPDATE accounts SET adminduty=" .. mysql:escape_string(getElementData(targetPlayer, "adminduty")) .. " WHERE id = " .. mysql:escape_string(getElementData(targetPlayer, "gameaccountid")) ) exports.global:updateNametagColor(targetPlayer) if (hiddenAdmin==0) then local adminTitle = exports.global:getPlayerAdminTitle(thePlayer) outputChatBox(adminTitle .. " " .. username .. " set your admin rank to " .. rank .. ".", targetPlayer, 255, 194, 14) exports.global:sendMessageToAdmins("AdmCmd: " .. tostring(adminTitle) .. " " .. username .. " set " .. targetPlayerName .. "'s admin level to " .. rank .. ".") else outputChatBox("Hidden admin set your admin rank to " .. rank .. ".", targetPlayer, 255, 194, 14) end end end end end addCommandHandler("makeadmin", makePlayerAdmin, false, false)
SAbJaN Posted April 11, 2012 Author Posted April 11, 2012 I don't think so, How do I make it so It does?
Castillo Posted April 11, 2012 Posted April 11, 2012 You have to add your account name to "acl.xml" to a group which has access to command "aexec".
SAbJaN Posted April 11, 2012 Author Posted April 11, 2012 Yep I've done that now, But it's still not working. EDIT: I've got it working, I've replaced the rights to 'true' because all of them where 'false' Maybe that's why when I tried kicking someone, It didn't work.
Jaysds1 Posted April 11, 2012 Posted April 11, 2012 (edited) DELETE POST*** Edited April 11, 2012 by Guest
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