top sniper Posted January 17, 2012 Share Posted January 17, 2012 whats the problem with this code function chat() givePlayerMoney (source,1000) end setTimer ( chat, 80000, 1) addEventHandler ( "onPlayerJoin", getRootElement(), chat ) Link to comment
FatalTerror Posted January 17, 2012 Share Posted January 17, 2012 The setTimer don't give the element source... Try that addEventHandler("onPlayerJoin", getRootElement(), function() setTimer(function(source) if source then givePlayerMoney(source, 1000) end end, 80000, 1, source) end) Edit: If you want give a cash for the player every 80000ms, you change the frequence value addEventHandler("onPlayerJoin", getRootElement(), function() setTimer(function(source) if source then givePlayerMoney(source, 1000) end end, 80000, 0, source) end) Link to comment
top sniper Posted January 17, 2012 Author Share Posted January 17, 2012 The setTimer don't give the element source...Try that addEventHandler("onPlayerJoin", getRootElement(), function() setTimer(function(source) if source then givePlayerMoney(source, 1000) end end, 80000, 1, source) end) Edit: If you want give a cash for the player every 80000ms, you change the frequence value addEventHandler("onPlayerJoin", getRootElement(), function() setTimer(function(source) if source then givePlayerMoney(source, 1000) end end, 80000, 0, source) end) thanks for helping me i will try it now 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