Asmgol Posted March 13, 2019 Share Posted March 13, 2019 Spoiler function Player(who, cmd, playah) local targetPlayer = getPlayerFromNamePart(playah) local targetSerial = getPlayerSerial(targetPlayer) local searchForANicks = executeSQLQuery("SELECT `nicks` from `aliases` WHERE `serial`=?", targetSerial) if #searchForANicks == 1 then outputChatBox("#FFD330History of nicks for "..getPlayerName(targetPlayer)..":#FAFAFA "..searchForANicks[1].nicks, who, 0, 0, 0, true) end end addCommandHandler("command", Player) can anyone help me to make this command for admin group only because i try sometimes and it doesn't work Link to comment
XaskeL Posted March 13, 2019 Share Posted March 13, 2019 function Player(who, cmd, playah) if hasObjectPermissionTo(who, "command.HERE_COMMAND_NAME", false) then local targetPlayer = getPlayerFromNamePart(playah) local targetSerial = getPlayerSerial(targetPlayer) local searchForANicks = executeSQLQuery("SELECT `nicks` from `aliases` WHERE `serial`=?", targetSerial) if #searchForANicks == 1 then outputChatBox("#FFD330History of nicks for "..getPlayerName(targetPlayer)..":#FAFAFA "..searchForANicks[1].nicks, who, 0, 0, 0, true) end end end addCommandHandler("command", Player, true, true) and add in acl for your group right "command.HERE_COMMAND_NAME" and change name of command on name your command Link to comment
Jonas^ Posted March 13, 2019 Share Posted March 13, 2019 (edited) addCommandHandler( "comand", function (who, cmd, playah) local acc = getPlayerAccount (who) if isObjectInACLGroup ( "user." ..getAccountName(acc), aclGetGroup ("Admin")) then local targetPlayer = getPlayerFromNamePart(playah) local targetSerial = getPlayerSerial(targetPlayer) local searchForANicks = executeSQLQuery("SELECT `nicks` from `aliases` WHERE `serial`=?", targetSerial) if #searchForANicks == 1 then outputChatBox("#FFD330History of nicks for "..getPlayerName(targetPlayer)..":#FAFAFA "..searchForANicks[1].nicks, who, 0, 0, 0, true) end else outputChatBox("You do not have permission.", who, 255, 50, 50) end end) Edited March 13, 2019 by Jonas^ 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