HustraDev Posted August 15, 2014 Share Posted August 15, 2014 Hey Guy's I have Problem in code i use to Give Money for player's in group every 1 hour But it does not work setTimer(function(tPlayer) if getElementData(tPlayer,'Group') == 'Army' then setPlayerMoney(tPlayer, 4000) --- money Army end end, 60000, 1, source) Link to comment
Anubhav Posted August 15, 2014 Share Posted August 15, 2014 (edited) setTimer(function() for k,tPlayer in ipairs(getElementsByType("player")) do if getElementData(tPlayer,'Group') == 'Army' then outputChatBox("Data: "..getElementData(tPlayer, 'Group')) givePlayerMoney(tPlayer, 4000) --- money Army end end end, 60000, 0) Edited August 15, 2014 by Guest Link to comment
#DRAGON!FIRE Posted August 15, 2014 Share Posted August 15, 2014 All Wrong .. : setTimer ( function ( ) for _,players in ipairs ( getElementsByType( "player" ) ) do if ( getElementData ( players, "Group" ) == "Army" ) then givePlayerMoney ( players, 4000 ) end end end, 60000, 0 ) Link to comment
Anubhav Posted August 15, 2014 Share Posted August 15, 2014 All Wrong .. : setTimer ( function ( ) for _,players in ipairs ( getElementsByType( "player" ) ) do if ( getElementData ( players, "Group" ) == "Army" ) then givePlayerMoney ( players, 4000 ) end end end, 60000, 0 ) There's nothing wrong in my code. If there is something wrong it will output it. I din't see givePlayerMoney function so :~. My code has nothing wrong .. Please try to improve english -.- Link to comment
#DRAGON!FIRE Posted August 15, 2014 Share Posted August 15, 2014 All Wrong .. : setTimer ( function ( ) for _,players in ipairs ( getElementsByType( "player" ) ) do if ( getElementData ( players, "Group" ) == "Army" ) then givePlayerMoney ( players, 4000 ) end end end, 60000, 0 ) There's nothing wrong in my code. If there is something wrong it will output it. I din't see givePlayerMoney function so :~. My code has nothing wrong .. Please try to improve english -.- oh Nice u must use .. givePlayerMoney ... not setPlayerMoney and he say : " every 1 hour" .. your code the timer is 1 just . Link to comment
Anubhav Posted August 15, 2014 Share Posted August 15, 2014 Fixed, thanks for telling me. Link to comment
#DRAGON!FIRE Posted August 15, 2014 Share Posted August 15, 2014 Fixed, thanks for telling me. np .. and why u put outputChatBox ? . Link to comment
TAPL Posted August 15, 2014 Share Posted August 15, 2014 One hour have 60 minutes each minute have 60 seconds, 60*60 = 3600 seconds in one hour not 60. Link to comment
#DRAGON!FIRE Posted August 15, 2014 Share Posted August 15, 2014 Just i fixed his code .. and if he want 1 hour : 3600000 Link to comment
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