0 Üye ve 1 Ziyaretçi konuyu incelemekte.
local radyolar = {}local sx,sy = guiGetScreenSize() local pg,pu = 100,20 local x,y = (sx-pg)/2,10local radyoYazi,renderDurum,yaziY,yaziAlpha = "",false,0,255local sound,radyo = nil,0 -- başlangıçta sound ve radyo yok yapıyozlocal xml = xmlLoadFile ( "settings.xml" )local nodeColor,nodeFont,nodeStations = xmlFindChild ( xml, "color", 0 ), xmlFindChild ( xml, "font", 0 ),xmlFindChild ( xml, "stations", 0 ) local r,g,b = xmlNodeGetAttribute(nodeColor,"r"),xmlNodeGetAttribute(nodeColor,"g"),xmlNodeGetAttribute(nodeColor,"b")local font = xmlNodeGetValue(nodeFont)addEventHandler ( "onClientResourceStart", resourceRoot,function() showPlayerHudComponent ( "radio", false ) for i, v in ipairs (xmlNodeGetChildren (nodeStations)) do local node = xmlFindChild (nodeStations, "station",i) if node then local radioName = xmlNodeGetAttribute ( node, "name" ) local radioURL = xmlNodeGetAttribute ( node, "URL" ) table.insert(radyolar,{isim=radioName,url=radioURL}) end endend)addEventHandler ( "onClientResourceStop", resourceRoot,function() showPlayerHudComponent ( "radio", true )end)bindKey("radio_next", "down",function() if not getPedOccupiedVehicle(localPlayer) then return end radyo = radyo +1 if radyo > #radyolar-1 then radyo = 0 end radyoDegis(radyo)end)bindKey("radio_previous", "down",function() if not getPedOccupiedVehicle(localPlayer) then return end radyo = radyo-1 if radyo < 0 then radyo = #radyolar-1 end radyoDegis(radyo)end)function radyoDegis(radyo) setRadioChannel(0) if isElement(sound) then destroyElement(sound) end if radyo > 0 then -- eğer radyo varsa local isim,url = radyolar[radyo].isim,radyolar[radyo].url sound = playSound(url) radyoYaziOlustur(isim) else radyoYaziOlustur("Radyo Kapalı") endendfunction radyoYaziOlustur(yazi) radyoYazi = yazi showPlayerHudComponent ( "radio", false ) if isTimer(renderTimer) then killTimer(renderTimer) end yaziY,yaziAlpha = 0,255 if not renderDurum then removeEventHandler ( "onClientPreRender", root, render ) addEventHandler ( "onClientPreRender", root, render ) end renderTimer=setTimer(function() renderDurum = false end,5000,1) renderDurum = true kaybolmaTick = getTickCount()+200endfunction render() if renderDurum then dxDrawText(radyoYazi,2,yaziY+2,sx,(sy/1.2)+yaziY, tocolor( 0, 0, 0, yaziAlpha ), 1.6, font, "center", "bottom" ) dxDrawText(radyoYazi, 0, yaziY+2, sx,(sy/1.2)+yaziY, tocolor( r, g, b, yaziAlpha ), 1.6, font, "center", "bottom" ) yaziY = yaziY + sy * 0.0025 if ( getTickCount ( ) >= kaybolmaTick ) then yaziAlpha = yaziAlpha - 3 if ( yaziAlpha < 0 ) then renderDurum = false end end else removeEventHandler ( "onClientPreRender", root, render ) endendaddEventHandler ( "onClientPlayerVehicleEnter", getLocalPlayer (),function ( vehicle, seat ) radyoDegis(radyo) timerVehicle = setTimer(function(vehicle) if isPedInVehicle ( getLocalPlayer () ) == false or getPedOccupiedVehicle ( getLocalPlayer () ) ~= vehicle or getElementHealth ( getLocalPlayer () ) <= 0 then if isElement (sound ) then destroyElement (sound) end killTimer (timerVehicle) end end,50,0,vehicle )end)addEventHandler ( "onClientVehicleStartExit", getRootElement (),function ( player ) if player == getLocalPlayer () then if isElement(sound) then destroyElement(sound) end if isTimer (timerVehicle) then killTimer (timerVehicle) end endend)addEventHandler ( "onClientVehicleExit", getRootElement (),function ( player ) if player == getLocalPlayer () then if isElement(sound) then destroyElement(sound) end if isTimer (timerVehicle) then killTimer (timerVehicle) end endend)addEventHandler("onClientElementDestroy",getRootElement(), function () if getElementType(source) == "vehicle" and getPedOccupiedVehicle(getLocalPlayer()) == source then if isElement(sound) then destroyElement(sound) end if isTimer (timerVehicle) then killTimer (timerVehicle) end endend)
<settings> <color r="0" g="102" b="0"/><!-- Radio label color --> <font>default-bold</font><!-- Radio label font --> <stations><!-- Radio stations. To add one: <station name="[name here]" URL="[URL here]"/> --> <station name="Alem FM" URL="http://scturkmedya.radyotvonline.com/stream/80/"/> <station name="Ankara Havası" URL="http://37.247.98.8/stream/30/"/> <station name="Damar FM" URL="http://yayin.damarfm.com:8080/listen.pls"/> <station name="Park FM" URL="http://yayin.netradyom.com:8050/PARKFM"/> <station name="Banko" URL="http://yayin.netradyom.com:8050/RADYOBANKO"/> <station name="Megasite" URL="http://mega.netradyom.com:7900/listen.pls"/> <station name="Best FM" URL="http://46.20.7.125/listen.pls"/> <station name="Kral FM" URL="http://kralsc.radyotvonline.com/listen.pls"/> <station name="Kral Pop" URL="http://kralpopwmp.radyotvonline.com:80/;"/> <station name="Haber FM" URL="http://yayin.yayindakiler.com:4118/;"/> <station name="Efkarlı FM" URL="http://159.253.37.137:9814/;"/> <station name="Super FM" URL="http://provisioning.streamtheworld.com/pls/SUPER_FMAAC.pls"/> <station name="Slow Türk" URL="http://radyo.dogannet.tv/slowturk"/> <station name="Radyo Dejavu" URL="http://radyodejavu.canliyayinda.com:8054/"/> <station name="Joy Fm" URL="http://provisioning.streamtheworld.com/pls/JOY_FMAAC.pls"/> <station name="Joy Jazz" URL="http://provisioning.streamtheworld.com/pls/JOY_JAZZAAC.pls"/> <station name="Joy Türk" URL="http://provisioning.streamtheworld.com/pls/JOY_TURKAAC.pls"/> <station name="Joy Türk Akustik" URL="http://provisioning.streamtheworld.com/pls/JOYTURK_AKUSTIKAAC.pls"/> <station name="Joy Türk Rock" URL="http://provisioning.streamtheworld.com/pls/JOYTURK_ROCKAAC.pls"/> <station name="Metro FM" URL="http://provisioning.streamtheworld.com/pls/METRO_FMAAC.pls"/> <station name="Karadeniz FM" URL="http://46.20.7.100/stream/170/"/> <station name="My Donese" URL="http://provisioning.streamtheworld.com/pls/RADIO_MYDONOSEAAC.pls"/> <station name="DJ FM" URL="http://37.1.144.106:9001/;stream/1"/> <station name="Türkçe Rap" URL="http://95.173.188.166:9984/listen.pls"/> <station name="Number One Türk" URL="http://nmbshsource.mediatriple.net:7000/stream/28/"/> <station name="Fenomen FM" URL="http://fenomenclubbin.listenfenomen.com/fenomenclubbin/128/icecast.audio"/> <station name="Dance FM" URL="http://uk2.internet-radio.com:8024/listen.pls&t=.m3u"/> <station name="Radyo Kapalı" URL=""/> </stations></settings>
local radyolar = {}local sx,sy = guiGetScreenSize() local pg,pu = 100,20 local x,y = (sx-pg)/2,10local radyoYazi,renderDurum,yaziY,yaziAlpha = "",false,0,255local sound,radyo = nil,0 -- başlangıçta sound ve radyo yok yapıyozlocal xml = xmlLoadFile ( "settings.xml" )local nodeColor,nodeFont,nodeStations = xmlFindChild ( xml, "color", 0 ), xmlFindChild ( xml, "font", 0 ),xmlFindChild ( xml, "stations", 0 ) local r,g,b = xmlNodeGetAttribute(nodeColor,"r"),xmlNodeGetAttribute(nodeColor,"g"),xmlNodeGetAttribute(nodeColor,"b")local font = dxCreateFont( "fontum12.ttf", 20 )addEventHandler ( "onClientResourceStart", resourceRoot,function() showPlayerHudComponent ( "radio", false ) for i, v in ipairs (xmlNodeGetChildren (nodeStations)) do local node = xmlFindChild (nodeStations, "station",i) if node then local radioName = xmlNodeGetAttribute ( node, "name" ) local radioURL = xmlNodeGetAttribute ( node, "URL" ) table.insert(radyolar,{isim=radioName,url=radioURL}) end endend)addEventHandler ( "onClientResourceStop", resourceRoot,function() showPlayerHudComponent ( "radio", true )end)bindKey("radio_next", "down",function() if not getPedOccupiedVehicle(localPlayer) then return end radyo = radyo +1 if radyo > #radyolar-1 then radyo = 0 end radyoDegis(radyo)end)bindKey("radio_previous", "down",function() if not getPedOccupiedVehicle(localPlayer) then return end radyo = radyo-1 if radyo < 0 then radyo = #radyolar-1 end radyoDegis(radyo)end)function radyoDegis(radyo) setRadioChannel(0) if isElement(sound) then destroyElement(sound) end if radyo > 0 then -- eğer radyo varsa local isim,url = radyolar[radyo].isim,radyolar[radyo].url sound = playSound(url) radyoYaziOlustur(isim) else radyoYaziOlustur("Radyo Kapalı") endendfunction radyoYaziOlustur(yazi) radyoYazi = yazi showPlayerHudComponent ( "radio", false ) if isTimer(renderTimer) then killTimer(renderTimer) end yaziY,yaziAlpha = 0,255 if not renderDurum then removeEventHandler ( "onClientPreRender", root, render ) addEventHandler ( "onClientPreRender", root, render ) end renderTimer=setTimer(function() renderDurum = false end,5000,1) renderDurum = true kaybolmaTick = getTickCount()+200endfunction render() if renderDurum then dxDrawText(radyoYazi,2,yaziY+2,sx,(sy/1.2)+yaziY, tocolor( 0, 0, 0, yaziAlpha ), 1.6, font, "center", "bottom" ) dxDrawText(radyoYazi, 0, yaziY+2, sx,(sy/1.2)+yaziY, tocolor( r, g, b, yaziAlpha ), 1.6, font, "center", "bottom" ) yaziY = yaziY + sy * 0.0025 if ( getTickCount ( ) >= kaybolmaTick ) then yaziAlpha = yaziAlpha - 3 if ( yaziAlpha < 0 ) then renderDurum = false end end else removeEventHandler ( "onClientPreRender", root, render ) endendaddEventHandler ( "onClientPlayerVehicleEnter", getLocalPlayer (),function ( vehicle, seat ) radyoDegis(radyo) timerVehicle = setTimer(function(vehicle) if isPedInVehicle ( getLocalPlayer () ) == false or getPedOccupiedVehicle ( getLocalPlayer () ) ~= vehicle or getElementHealth ( getLocalPlayer () ) <= 0 then if isElement (sound ) then destroyElement (sound) end killTimer (timerVehicle) end end,50,0,vehicle )end)addEventHandler ( "onClientVehicleStartExit", getRootElement (),function ( player ) if player == getLocalPlayer () then if isElement(sound) then destroyElement(sound) end if isTimer (timerVehicle) then killTimer (timerVehicle) end endend)addEventHandler ( "onClientVehicleExit", getRootElement (),function ( player ) if player == getLocalPlayer () then if isElement(sound) then destroyElement(sound) end if isTimer (timerVehicle) then killTimer (timerVehicle) end endend)addEventHandler("onClientElementDestroy",getRootElement(), function () if getElementType(source) == "vehicle" and getPedOccupiedVehicle(getLocalPlayer()) == source then if isElement(sound) then destroyElement(sound) end if isTimer (timerVehicle) then killTimer (timerVehicle) end endend)
<file src="fontum12.ttf" />