ViPeR124 Posted January 23, 2014 Posted January 23, 2014 Hey guys it's me again with a new problem. I want to give every player after 10 minutes 700$. So i used a timer(Server-side): setTimer( giveCash, 600000, 0) the giveCash function(Server-side): function giveCash( playerSource, cmdtext, amount ) amount = money + 700 givePlayerMoney ( playerSource, tonumber(amount) ) end Now when i am joining the server the console shows up the error: Bad argument @ 'givePlayerMoney' But when i use a command Handler it works perfectly... Someone knows what my problem is?
Alexs Posted January 23, 2014 Posted January 23, 2014 amount = 700 setTimer( function() for k, i in ipairs( getElementsByType( 'player' ) ) do givePlayerMoney( i, amount ) end end, 600000, 0 ) Try that.
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