Albinix Posted May 25, 2010 Posted May 25, 2010 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
50p Posted May 25, 2010 Posted May 25, 2010 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. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
karlis Posted May 25, 2010 Posted May 25, 2010 Btw the money wont refresh, u have to check count every time the timer is called [WIP]GTA IV style hud+custom blips + blip text + circular radar areas
Albinix Posted May 27, 2010 Author Posted May 27, 2010 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
karlis Posted May 28, 2010 Posted May 28, 2010 you need exports.scoreboard:addScoreBoardColummn() and setElementData() to show it in scoreboard [WIP]GTA IV style hud+custom blips + blip text + circular radar areas
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