0 Üye ve 1 Ziyaretçi konuyu incelemekte.
-- Server-sidelocal function seslikorna ( thePlayer, key, keyState ) local theVehicle = getPedOccupiedVehicle ( thePlayer ) if ( not theVehicle ) then return end if ( getElementModel ( theVehicle ) == 579 ) or ( getElementModel( theVehicle ) == 507 ) or ( getElementModel( theVehicle ) == 560 ) then -- Hangi araçlarda çalmasını istiyorsan buraya or .... şeklinde ekle. triggerClientEvent ( "AracKorna", root, ( keyState == "down" and true or false ), theVehicle ) endendaddEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, player in ipairs ( getElementsByType ( "player" ) ) do bindKey ( player, "H", "down", seslikorna ) bindKey ( player, "H", "up", seslikorna ) end end ) addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, "H", "down", seslikorna ) bindKey ( source, "H", "up", seslikorna ) end)
-- Client-sideaddEvent ( "AracKorna", true )addEventHandler ( "AracKorna", root, function ( state, theVehicle ) if isElement ( AracKornaSesi ) and ( state ) then if isTimer(decrease) then killTimer(decrease) end destroyElement(AracKornaSesi) end if not ( state ) then decrease = setTimer(function() local time, final = getTimerDetails(decrease) if isElement(AracKornaSesi) then if final ~= 1 then local volume = getSoundVolume(AracKornaSesi); setSoundVolume(AracKornaSesi, volume-1); else destroyElement(AracKornaSesi) end end end, 300, 1) end --stopSound ( AracKornaSesi ) if ( state ) then local x, y, z = getElementPosition ( theVehicle ) AracKornaSesi = playSound3D ( 'sesler.mp3', x, y, z ) setSoundVolume ( AracKornaSesi, 5.0 ) setSoundMaxDistance ( AracKornaSesi, 100 ) attachElements ( AracKornaSesi, theVehicle ) end end)