Jump to content

What is the player's money element data


12p

Recommended Posts

Posted

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'

Posted

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.

  • Moderators
Posted

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)

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...