CheiN Posted March 4, 2013 Posted March 4, 2013 exports.scoreboard:scoreboardAddColumn( "Top Times") function someoneReachedHunter(number, sort, model) if sort == "vehiclechange" and model == 425 then top = getElementData(source,"Top Times") or 0 setElementData(source,"Top Times",top+1) end end addEvent("onPlayerPickUpRacePickup",true) addEventHandler("onPlayerPickUpRacePickup",getRootElement(),someoneReachedHunter) function saverhere () local account = getPlayerAccount( source ) if ( account ) and not isGuestAccount ( account ) then local toptimes1 = getElementData ( source, "Top Times" ) if ( account ) then setAccountData ( account, "toptimes.top", toptimes1 ) end end end function loger ( account ) if ( account ) then local toptimes = getAccountData ( account, "toptimes.top" ) if ( toptimes ) then setElementData ( source, "toptimes.top", toptimes ) end end end addEventHandler ( "onPlayerQuit", getRootElement( ), saverhere ) addEventHandler ( "onPlayerLogin", getRootElement ( ), loger ) (i made this toptimes on scoreboard so im not stolling rights.) can some one help me or explain me why this is not working? My scripts: toptimes on scoreboard (server21) Screen on login(scren) Score on scoreboard (score)
Jaysds1 Posted March 4, 2013 Posted March 4, 2013 What's the problem? My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Danii Posted March 4, 2013 Posted March 4, 2013 Try: exports.scoreboard:scoreboardAddColumn( "Top Times") function someoneReachedHunter(number, sort, model) if sort == "vehiclechange" and model == 425 then top = getElementData(source,"Top Times") or 0 setElementData(source,"Top Times",top+1) end end addEvent("onPlayerPickUpRacePickup",true) addEventHandler("onPlayerPickUpRacePickup",getRootElement(),someoneReachedHunter) function saverhere () local account = getPlayerAccount( source ) if ( account and not isGuestAccount(account) ) then local toptimes1 = getElementData ( source, "Top Times" ) setAccountData ( account, "toptimes.top", toptimes1 ) end end function loger ( _,account ) if ( account ) then local toptimes = getAccountData ( account, "toptimes.top" ) if ( toptimes ) then setElementData ( source, "Top Times", toptimes ) end end end addEventHandler ( "onPlayerQuit", getRootElement( ), saverhere ) addEventHandler ( "onPlayerLogin", getRootElement ( ), loger )
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