Samking Posted September 14, 2018 Share Posted September 14, 2018 function givevip (playerSource, commandName, accountName) local accName = getAccountName ( getPlayerAccount ( playerSource ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if accountName then aclGroupAddObject (aclGetGroup("VIP"), "user."..accountName) outputChatBox ("Account '"..accountName.."' add to VIPs successfully!", playerSource) else outputChatBox ("Wrong Account ", playerSource) end end end addCommandHandler ("addvip", givevip) function remvip (playerSource, commandName, accountName) local accName = getAccountName ( getPlayerAccount ( playerSource ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if accountName then aclGroupRemoveObject (aclGetGroup("VIP"), "user."..accountName) outputChatBox ("Account '"..accountName.."' Remove from VIPs", playerSource) else outputChatBox ("Wrong Account ", playerSource) end end end addCommandHandler ("delvip", remvip) The problem is When I type /addvip accname This only give output Account samking add to VIPs Successfully but not add to VIP acl group Please help Link to comment
Dimos7 Posted September 14, 2018 Share Posted September 14, 2018 function givevip (playerSource, commandName, accountName) local accName = getAccountName ( getPlayerAccount ( playerSource ) ) local accountName= getAccountName (getPlayerAccount(accountName)) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if accountName then aclGroupAddObject (aclGetGroup("VIP"), "user."..accountName) outputChatBox ("Account '"..accountName.."' add to VIPs successfully!", playerSource) else outputChatBox ("Wrong Account ", playerSource) end end end addCommandHandler ("addvip", givevip) function remvip (playerSource, commandName, accountName) local accName = getAccountName ( getPlayerAccount ( playerSource ) ) local accountName = getAccountName (getPlayerAccount(accountName)) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if accountName then aclGroupRemoveObject (aclGetGroup("VIP"), "user."..accountName) outputChatBox ("Account '"..accountName.."' Remove from VIPs", playerSource) else outputChatBox ("Wrong Account ", playerSource) end end end addCommandHandler ("delvip", remvip) Try this Link to comment
Samking Posted September 14, 2018 Author Share Posted September 14, 2018 7 minutes ago, Dimos7 said: function givevip (playerSource, commandName, accountName) local accName = getAccountName ( getPlayerAccount ( playerSource ) ) local accountName= getAccountName (getPlayerAccount(accountName)) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if accountName then aclGroupAddObject (aclGetGroup("VIP"), "user."..accountName) outputChatBox ("Account '"..accountName.."' add to VIPs successfully!", playerSource) else outputChatBox ("Wrong Account ", playerSource) end end end addCommandHandler ("addvip", givevip) function remvip (playerSource, commandName, accountName) local accName = getAccountName ( getPlayerAccount ( playerSource ) ) local accountName = getAccountName (getPlayerAccount(accountName)) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if accountName then aclGroupRemoveObject (aclGetGroup("VIP"), "user."..accountName) outputChatBox ("Account '"..accountName.."' Remove from VIPs", playerSource) else outputChatBox ("Wrong Account ", playerSource) end end end addCommandHandler ("delvip", remvip) Try this Now this only give output Wrong Account And it's not working Link to comment
Dimos7 Posted September 14, 2018 Share Posted September 14, 2018 1 minute ago, Samking said: Now this only give output Wrong Account And it's not working You have put resource in acl admin group? Link to comment
Samking Posted September 14, 2018 Author Share Posted September 14, 2018 (edited) 14 minutes ago, Dimos7 said: You have put resource in acl admin group? yup Edited September 14, 2018 by Samking Link to comment
Dimos7 Posted September 14, 2018 Share Posted September 14, 2018 5 minutes ago, Samking said: yup /debugscipt 3 say any errors or warnings? Link to comment
Samking Posted September 14, 2018 Author Share Posted September 14, 2018 2 minutes ago, Dimos7 said: /debugscipt 3 say any errors or warnings? warning BadArgument @getPlayerAccount [Excepted] Element at argument 1 got nill warning BadArgument @getAccountName [Excepted account at argument 1 got boolean] Link to comment
Dimos7 Posted September 14, 2018 Share Posted September 14, 2018 With your code say something in debugscipt 3? Link to comment
Samking Posted September 14, 2018 Author Share Posted September 14, 2018 Just now, Dimos7 said: With your code say something in debugscipt 3? no Link to comment
Samking Posted September 14, 2018 Author Share Posted September 14, 2018 Just now, Dimos7 said: Wired 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