Jump to content

cash


Albinix

Recommended Posts

the timer don't work

local localPlayer = getLocalPlayer ( )
local playercash = getPlayerMoney ( localPlayer )
 
function addColumns()
  exports.scoreboard:scoreboardAddColumn("Points")
setTimer (addPoints,1000,0)
end
addEventHandler("onClientResourceStart",getResourceRootElement(),addColumns)
 
function addPoints()
setElementData(localPlayer,"Points",playercash)
end

Link to comment

Check "/debugscript 3" command and see if you get an error. I'm pretty sure you get an error saying something like "call to function scoreboardAddColumn failed". If you do get it, I can't help you since I've never managed to call exported functions, even gamemodes like "race" fail to call votemapanger functions so once race is complete, nothing happens.

Link to comment

The money don't shows in the scoreboard?

function onPlayerQuit ( )
     local playeraccount = getPlayerAccount ( source )
     if ( playeraccount ) then
           local playermoney = getPlayerMoney ( source )
           setAccountData ( playeraccount, "piraterpg.money", playermoney )
     end
end
 
local root = getRootElement()
addEventHandler("onPlayerLogin", root,
 function()
     local playeraccount = getPlayerAccount ( source )
     if ( playeraccount ) then
           local playermoney = getAccountData ( playeraccount, "piraterpg.money" )
           if ( playermoney ) then
                 setPlayerMoney ( source, playermoney )
           end
      end
 end
)
 
addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit )
 
local playercash = getPlayerMoney ( player )
 
function addColumns()
  exports.scoreboard:scoreboardAddColumn("Points")
  points ()
end
addEventHandler("onResourceStart",getRootElement(),addColumns)
 
function points ()
  setElementData ( player, "Points", playercash )
end

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