Electro88 Posted April 15, 2016 Posted April 15, 2016 (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 April 16, 2016 by Guest
aka Blue Posted April 15, 2016 Posted April 15, 2016 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
Electro88 Posted April 16, 2016 Author Posted April 16, 2016 İ 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 )
aka Blue Posted April 16, 2016 Posted April 16, 2016 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 ...
Anubhav Posted April 16, 2016 Posted April 16, 2016 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 See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
Electro88 Posted April 16, 2016 Author Posted April 16, 2016 ok i fix it thanks @Anubhav İ try it but i cant do it for fix :c
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