Jump to content

[HELP] VIP


1LoL1

Recommended Posts

Hello i created VIP code and i want to /setvip but player must be in the server and this can only "Admin".

function vip(thePlayer, command) 
        local VIP = aclGetGroup("VIP") 
        local player = getAccountName(getPlayerAccount(thePlayer)) 
        aclGroupAddObject (VIP, "user."..player) 
        givePlayerMoney(thePlayer, 1) 
        outputChatBox("test", thePlayer, 255, 255, 255, true)    
end 
addCommandHandler("setvip", vip) 

please can anyone help me or get me example or functions?

Link to comment

function vip(thePlayer, command,account) 
if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("admin")) then 
        local VIP = aclGetGroup("VIP") 
        local account = getAccountName(getPlayerAccount(account)) 
        if ( account ) then 
        aclGroupAddObject (VIP, "user."..account) 
        givePlayerMoney(thePlayer, 1) 
        outputChatBox("test", thePlayer, 255, 255, 255, true)    
                     end 
             end 
     end 
addCommandHandler("setvip", vip) 

setvip

add script to acl Console Group

Link to comment
function vip(thePlayer, command,account) 
if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("admin")) then 
        local VIP = aclGetGroup("VIP") 
        local account = getAccountName(getPlayerAccount(account)) 
        if ( account ) then 
        aclGroupAddObject (VIP, "user."..account) 
        givePlayerMoney(thePlayer, 1) 
        outputChatBox("test", thePlayer, 255, 255, 255, true)    
                     end 
             end 
     end 
addCommandHandler("setvip", vip) 

setvip

add script to acl Console Group

thanks but not work. :(

Link to comment

The script needs admin rights as well edit your acl and add this resource to admin example :

Also if you're using it like this /setvip 'Account name' then the code has to be like this :

     
function vip(thePlayer, command,accountname) 
    if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Admin")) then 
            local VIP = aclGetGroup("VIP") 
            local account = getAccount(accountname) 
            if ( account ) then 
                aclGroupAddObject (VIP, "user."..accountname) 
                if getAccountPlayer(account) then 
                     givePlayerMoney(getAccountPlayer(account), 1) 
                end 
                outputChatBox("Account '"..accountname.."' has been successfully added to VIP.", thePlayer, 255, 255, 255, true)   
            end 
      end 
end 
addCommandHandler("setvip", vip) 
  

Link to comment

add script to admin group

function vip(thePlayer, command,account) 
if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Admin")) then 
        if ( account ) then 
        local VIP = aclGetGroup("VIP") 
        local name = getAccountName ( account ) 
        aclGroupAddObject (VIP, "user."..name) 
        givePlayerMoney(thePlayer, 1) 
        outputChatBox("test", thePlayer, 255, 255, 255, true)   
                     end 
             end 
     end 
addCommandHandler("setvip", vip) 
Link to comment
  
function vip(thePlayer, command,tplayer) 
    if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Admin")) then 
            local VIP = aclGetGroup("VIP") 
            local tplayer = getPlayerFromName(tplayer) 
            if ( tplayer ) and isGuestAccount(getPlayerAccount(tplayer) ~= true then 
                acladd = aclGroupAddObject (VIP, "user."..getAccountName(getPlayerAccount(tplayer)) 
                if (acladd) then 
                    givePlayerMoney(tplayer, 1) 
                    outputChatBox("test passed.", tplayer, 255, 255, 255, true) 
                 else 
                    outputChatBox(getPlayerName(tplayer).." is already VIP.", thePlayer, 255, 0, 0, true) 
                end 
            else 
                    outputChatBox("Player not online or not logged in.", thePlayer, 255, 0, 0, true) 
            end 
      end 
end 
addCommandHandler("setvip", vip) 
  

Alright so you have to enter the player's name now not the account name, like a player is called "test" you type /setvip test and the player gets added to the ACL group VIP gets 1$ and an output, if the account has been added already or the player doesnt exist / is not logged in you'll get an error output.

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