Jump to content

[SOLVED]VipPayDAy


Electro88

Recommended Posts

Posted (edited)

Bad Argument@ 'getPlayerAccount' [EXpected Element at argument 1, got nil]

Bad Argument@ 'getaccountname' [Expected Account at argument 1, got boolean ]

attempt to concatenate local 'account' (a boolean value)

please help :/

function VipPayDay() 
local account = getAccountName(getPlayerAccount(source)) 
local amount = math.random(100) 
 if isObjectInACLGroup ( "user." .. account, aclGetGroup ( "V.İ.P" ) ) then 
        givePlayerMoney( source, amount ) 
        outputChatBox ( "*------------ V.İ.P BONUS ------------*", source, 142, 6, 0) 
        outputChatBox ( " #00ff00"..amount.." $ ", source, 255, 255, 255, true ) 
end 
end 
  
addEventHandler("onResourceStart",root, 
    function () 
      setTimer ( VipPayDay, 3000, 0 ) 
    end 
    ) 

Edited by Guest
Posted

Try this:

function vipPayDay ( ) 
    for k, player in ipairs ( getElementsByType ( 'player' ) ) do 
        local account = getAccountName ( getPlayerAccount ( player ) ) 
        local amount = math.random ( 100 ) 
        if isObjectInACLGroup ( "user." .. account, aclGetGroup ( "V.İ.P" ) ) then 
            givePlayerMoney ( player, amount ) 
            outputChatBox ( "*------------ V.İ.P BONUS ------------*", player, 142, 6, 0) 
            outputChatBox ( " #00ff00"..amount.." $ ", player, 255, 255, 255, true )                 
        end 
    end 
end 
  

Posted

İ need with setTimer

function VipPayDay(player) 
    if getPlayerAccount(player) then 
        local nameAccount = getAccountName(getPlayerAccount(player)) 
        local amount = 100 
        if isObjectInACLGroup ( "user." ..nameAccount, aclGetGroup ( "V.I.P" ) ) then 
            givePlayerMoney( player, amount ) 
            outputChatBox ( "*------------ V.I.P BONUS ------------*", player, 142, 6, 0) 
            outputChatBox ( " #00ff00"..amount.." $ ", player, 255, 255, 255) 
        end 
    end 
end 
  
addEventHandler("onResourceStart",root, 
    function () 
        for k, p in ipairs ( getElementsByType ( 'player' ) ) do 
            VipPayDay(p) 
        end 
    end 
    ) 

Posted
Try this:
function vipPayDay ( ) 
    for k, player in ipairs ( getElementsByType ( 'player' ) ) do 
        local account = getAccountName ( getPlayerAccount ( player ) ) 
        local amount = math.random ( 1, 100 ) 
        if isObjectInACLGroup ( "user." .. account, aclGetGroup ( "V.İ.P" ) ) then 
            givePlayerMoney ( player, amount ) 
            outputChatBox ( "*------------ V.İ.P BONUS ------------*", player, 142, 6, 0) 
            outputChatBox ( " #00ff00"..amount.." $ ", player, 255, 255, 255, true )                 
        end 
    end 
end 
  

...

Posted

Then do it by yourself. This is not a request forum. We are helping you, and you are making us do things. This forum ("Scripting") is for help not for requesting

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