Jump to content

check this code


Samking

Recommended Posts

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
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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...