12p Posted February 28, 2011 Share Posted February 28, 2011 By logic, if there is a "ping" element data, then it should exist a "money" element data. Does it exist, and what's the name of it? I tried with "money" and "cash" but both doesn't work... It is for my "dxscoreboard" 'modification' Link to comment
Castillo Posted March 1, 2011 Share Posted March 1, 2011 I don't think it exist an element data for that o_O, but you could do it by yourself easily Link to comment
12p Posted March 1, 2011 Author Share Posted March 1, 2011 There is no such event like onPlayerMoneyChange, I don't have any idea of how to do that Of course I could do it by setTimer or using onClientRender but it wouldn't be ok and may use too much CPU. Link to comment
Moderators Citizen Posted March 1, 2011 Moderators Share Posted March 1, 2011 Hi The Kid, Of course I could do it by setTimer lol I thought that at the begining but I have another idea: (All in ServerSide: ) Replace all givePlayerMoney by giveMoney in your GM and put this function in your code: function giveMoney( thePlayer, money ) if amount and money then givePlayerMoney( thePlayer, money ) triggerEvent( "onPlayerMoneyChange", getRootElement (), thePlayer, money ) end end And put this at the top of your GM: addEvent("onPlayerMoneyChange", true ) Then you can use addEventHandler( "onPlayerMoneyChange", getRootElement(), yourFunction ) for every functions you want Exemple: function yourFunction( thePlayer, money ) -- executed each time the server uses the giveMoney function end addEventHandler( "onPlayerMoneyChange", getRootElement(), yourFunction ) I think that it is what you want Link to comment
Moderators Citizen Posted March 1, 2011 Moderators Share Posted March 1, 2011 No problem 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