Jump to content

What is the player's money element data


12p

Recommended Posts

  • Moderators

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 8)

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...