--ez az alap filelocal iDriftScore = 0;local iMaxScore = 0;local iScore = 0;local iMyCombo = 1;local fCustomFontScale = 2;local bJustFinished = false;addEventHandler( \"onClientMapStarting\", root,function( tMapInfo )iMaxScore = 0;iDriftScore = 0;iMyCombo = 0;txtBestScore: text( \"Best Score: 0\" );for i, v in pairs( tMapInfo ) do outputDebugString( tostring( i ) .. \" : \" .. tostring( v ) );endend); addEventHandler( \"onClientResourceStart\", resourceRoot,function( )dxSetTestMode( \"none\" ); txtCombo = dxText: create( \"x2\", screenSize[ 1 ] - 100, screenSize[ 2 ] / 2 , false, \"default-bold\", 5 );txtCombo: type( \"shadow\", 4 );txtCombo: visible( false );txtComboTitle = dxText: create( \"COMBO\", screenSize[ 1 ] * 0.9, screenSize[ 2 ] / 2 - 60, false, \"default-bold\", 3 );txtComboTitle: type( \"shadow\", 3 );txtComboTitle: visible( false );txtScoreTitle = dxText: create( \"DRIFT\", screenSize[ 1 ] / 2, screenSize[ 2 ] / 5.6, false, \"default-bold\", 3 );txtScoreTitle: type( \"shadow\", 3 );txtScoreTitle: visible( false );txtScore = dxText: create( \"\", screenSize[ 1 ] / 2, screenSize[ 2 ] / 4, false, \"default-bold\", 3 );txtScore: visible( false );txtScore: type( \"shadow\", 3 );txtBestScore = dxText: create( \"Best Score: 0\", screenSize[ 1 ] * 0.8, 20, false, \"arial\", 2 );txtBestScore: type( \"shadow\", 2 );ftDigitalism = dxCreateFont( \"digitalism.ttf\", 20, true );if ftDigitalism then txtCombo: font( ftDigitalism ); txtCombo: scale( fCustomFontScale ); txtComboTitle: font( ftDigitalism ); txtComboTitle: scale( fCustomFontScale*.7 ); txtScore: font( ftDigitalism ); txtScore: scale( fCustomFontScale ); txtScoreTitle: font( ftDigitalism ); txtScoreTitle: scale( fCustomFontScale ); txtBestScore: font( ftDigitalism ); txtBestScore: scale( fCustomFontScale/2 );endend)addEventHandler( \"onClientVehicleStartDrift\", root,function( )addEventHandler( \"onClientVehicleDrift\", root, drift );if not bJustFinished then txtScore: text( \"0\" ); txtScore: visible( true ); txtScoreTitle: visible( true ); local r,g,b,a = txtScore: color( ); txtScore: color( r, g, b, 255 );endend)addEventHandler( \"onClientVehicleEndDrift\", root,function( )removeEventHandler( \"onClientVehicleDrift\", root, drift );iLastScore = iDriftScore * iMyCombo;txtCombo: visible( false );txtComboTitle: visible( false );txtScore: text( tostring( iLastScore ) );Animation.createAndPlay( txtScore, Animation.presets.dxTextMove( screenSize[ 1 ] / 2, screenSize[ 2 ] / 4, 100, false, screenSize[ 1 ] * .3, screenSize[ 2 ] / 4 ));--Animation.createAndPlay( txtScore, Animation.presets.dxTextFadeIn( 100 ) );Animation.createAndPlay( txtScoreTitle, Animation.presets.dxTextMove( screenSize[ 1 ] / 2, screenSize[ 2 ] / 5.6, 100, false, screenSize[ 1 ] * .7, screenSize[ 2 ] / 5.6 ));--Animation.createAndPlay( txtScoreTitle, Animation.presets.dxTextFadeIn( 300 ) );if iLastScore > iMaxScore then txtBestScore: text( \"Pénz(drift score): \" .. tostring( iLastScore ) ); iMaxScore = iLastScore;endbJustFinished = true;setTimer( changeFinishedState, 2000, 1 );setTimer( centreScore, 100, 1 );iDriftScore = 0;iMyCombo = 1;end)addEventHandler( \"onClientVehicleDriftCombo\", root, function( iCombo )txtCombo: text( \"x\"..tostring( iCombo ) );txtCombo: visible( true );txtComboTitle: visible( true );playSoundFrontEnd( 43 );Animation.createAndPlay( txtCombo, Animation.presets.dxTextMoveResize( screenSize[ 1 ] * 0.9, screenSize[ 2 ] / 2 - 10, ftDigitalism and fCustomFontScale*.75 or 5, 300, false, -- time, loop, screenSize[ 1 ] * 0.9, screenSize[ 2 ] / 2 - 10, ftDigitalism and fCustomFontScale*3 or 15 ) );Animation.createAndPlay( txtCombo, Animation.presets.dxTextFadeIn( 300 ) );iMyCombo = iCombo;end); function drift( fAngle, fSpeed, sSide, iDriftTime )local iNewScore = math.ceil( iDriftScore + (fAngle/25) * (fSpeed/15) );if not bJustFinished thentxtScore: text( tostring( iNewScore ) );txtScore: visible( true );txtScoreTitle: visible( true );local r,g,b = txtScore: color( );txtScore: color( r, g, b, 255 );endiDriftScore = iNewScore;endfunction centreScore( )txtScore: position( screenSize[ 1 ] / 2, screenSize[ 2 ] / 4, false )txtScoreTitle: position( screenSize[ 1 ] / 2, screenSize[ 2 ] / 5.6, false );endfunction changeFinishedState( )bJustFinished = false;if iDriftScore == 0 thentxtScore: visible( false );txtScoreTitle: visible( false );elsetxtScore: text( tostring( iDriftScore ) );endend
function onPlayerQuit( )local playeraccount = getPlayerAccount(source)local ertek = iMaxScore --getPlayerMoney ( source )setAccountData(playeraccount, \"driftscore\", ertek) endfunction onPlayerLogin(_, playeraccount)local ertek = getAccountData(playeraccount, \"driftscore\")--setPlayerMoney(source, ertek )setElementData ( source, iMaxScore, \"driftscore\")endaddEventHandler(\"onPlayerLogin\",getRootElement(),onPlayerLogin)addEventHandler(\"onPlayerQuit\",getRootElement(),onPlayerQuit)
local iDriftScore = 0;local iMaxScore = 0;local iScore = 0;local iMyCombo = 1;local fCustomFontScale = 2;local bJustFinished = false;function onPlayerLogin()iMaxScore = getAccountData ( source, \"driftscore\" )endaddEventHandler(\"onPlayerLogin\",getRootElement(),onPlayerLogin)addEventHandler( \"onClientMapStarting\", root,function( tMapInfo )iMaxScore = 0;iDriftScore = 0;iMyCombo = 0;txtBestScore: text( \"Pénz(drift score): 0\" );for i, v in pairs( tMapInfo ) do outputDebugString( tostring( i ) .. \" : \" .. tostring( v ) );endend); addEventHandler( \"onClientResourceStart\", resourceRoot,function( )dxSetTestMode( \"none\" ); txtCombo = dxText: create( \"x2\", screenSize[ 1 ] - 100, screenSize[ 2 ] / 2 , false, \"default-bold\", 5 );txtCombo: type( \"shadow\", 4 );txtCombo: visible( false );txtComboTitle = dxText: create( \"COMBO\", screenSize[ 1 ] * 0.9, screenSize[ 2 ] / 2 - 60, false, \"default-bold\", 3 );txtComboTitle: type( \"shadow\", 3 );txtComboTitle: visible( false );txtScoreTitle = dxText: create( \"DRIFT\", screenSize[ 1 ] / 2, screenSize[ 2 ] / 5.6, false, \"default-bold\", 3 );txtScoreTitle: type( \"shadow\", 3 );txtScoreTitle: visible( false );txtScore = dxText: create( \"\", screenSize[ 1 ] / 2, screenSize[ 2 ] / 4, false, \"default-bold\", 3 );txtScore: visible( false );txtScore: type( \"shadow\", 3 );txtBestScore = dxText: create( \"Pénz(drift score): 0\", screenSize[ 1 ] * 0.8, 20, false, \"arial\", 2 );txtBestScore: type( \"shadow\", 2 );ftDigitalism = dxCreateFont( \"digitalism.ttf\", 20, true );if ftDigitalism then txtCombo: font( ftDigitalism ); txtCombo: scale( fCustomFontScale ); txtComboTitle: font( ftDigitalism ); txtComboTitle: scale( fCustomFontScale*.7 ); txtScore: font( ftDigitalism ); txtScore: scale( fCustomFontScale ); txtScoreTitle: font( ftDigitalism ); txtScoreTitle: scale( fCustomFontScale ); txtBestScore: font( ftDigitalism ); txtBestScore: scale( fCustomFontScale/2 );endend)addEventHandler( \"onClientVehicleStartDrift\", root,function( )addEventHandler( \"onClientVehicleDrift\", root, drift );if not bJustFinished then txtScore: text( \"0\" ); txtScore: visible( true ); txtScoreTitle: visible( true ); local r,g,b,a = txtScore: color( ); txtScore: color( r, g, b, 255 );endend)addEventHandler( \"onClientVehicleEndDrift\", root,function( )removeEventHandler( \"onClientVehicleDrift\", root, drift );iLastScore = iDriftScore * iMyCombo;txtCombo: visible( false );txtComboTitle: visible( false );txtScore: text( tostring( iLastScore ) );Animation.createAndPlay( txtScore, Animation.presets.dxTextMove( screenSize[ 1 ] / 2, screenSize[ 2 ] / 4, 100, false, screenSize[ 1 ] * .3, screenSize[ 2 ] / 4 ));--Animation.createAndPlay( txtScore, Animation.presets.dxTextFadeIn( 100 ) );Animation.createAndPlay( txtScoreTitle, Animation.presets.dxTextMove( screenSize[ 1 ] / 2, screenSize[ 2 ] / 5.6, 100, false, screenSize[ 1 ] * .7, screenSize[ 2 ] / 5.6 ));--Animation.createAndPlay( txtScoreTitle, Animation.presets.dxTextFadeIn( 300 ) );if iLastScore > iMaxScore then txtBestScore: text( \"Pénz(drift score): \" .. tostring( iLastScore ) ); iMaxScore = iLastScore;endbJustFinished = true;setTimer( changeFinishedState, 2000, 1 );setTimer( centreScore, 100, 1 );iDriftScore = 0;iMyCombo = 1;setElementData (source, \"driftscore\", iMaxScore)end)addEventHandler( \"onClientVehicleDriftCombo\", root, function( iCombo )txtCombo: text( \"x\"..tostring( iCombo ) );txtCombo: visible( true );txtComboTitle: visible( true );playSoundFrontEnd( 43 );Animation.createAndPlay( txtCombo, Animation.presets.dxTextMoveResize( screenSize[ 1 ] * 0.9, screenSize[ 2 ] / 2 - 10, ftDigitalism and fCustomFontScale*.75 or 5, 300, false, -- time, loop, screenSize[ 1 ] * 0.9, screenSize[ 2 ] / 2 - 10, ftDigitalism and fCustomFontScale*3 or 15 ) );Animation.createAndPlay( txtCombo, Animation.presets.dxTextFadeIn( 300 ) );iMyCombo = iCombo;end); function drift( fAngle, fSpeed, sSide, iDriftTime )local iNewScore = math.ceil( iDriftScore + (fAngle/25) * (fSpeed/15) );if not bJustFinished thentxtScore: text( tostring( iNewScore ) );txtScore: visible( true );txtScoreTitle: visible( true );local r,g,b = txtScore: color( );txtScore: color( r, g, b, 255 );endiDriftScore = iNewScore;endfunction centreScore( )txtScore: position( screenSize[ 1 ] / 2, screenSize[ 2 ] / 4, false )txtScoreTitle: position( screenSize[ 1 ] / 2, screenSize[ 2 ] / 5.6, false );endfunction changeFinishedState( )bJustFinished = false;if iDriftScore == 0 thentxtScore: visible( false );txtScoreTitle: visible( false );elsetxtScore: text( tostring( iDriftScore ) );endend
function onPlayerQuit( )local playeraccount = getPlayerAccount(source)local ertek = iMaxScore --getPlayerMoney ( source )setAccountData(playeraccount, \"driftscore\", ertek) endfunction onPlayerLogin(_, playeraccount)local ertek = getAccountData(playeraccount, \"driftscore\")--setPlayerMoney(source, ertek )getElementData(source,\"driftscore\")setElementData ( source, \"driftscore\", iMaxScore)endaddEventHandler(\"onPlayerLogin\",getRootElement(),onPlayerLogin)addEventHandler(\"onPlayerQuit\",getRootElement(),onPlayerQuit)