Advertisement
artemx32

123123123

Dec 7th, 2015
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 16.87 KB | None | 0 0
  1. @name swoofer v2
  2. @persist [NeonColor Ve CachePos1 CachePos2 CachePos3]:vector [Words]:array [O E]:entity Stations:table [V NAME]:string [Ray PRay]:ranger [Angle CA1 CA2 CA3 RANT]:angle [RotVAL RotAxle MMODE_ RotMode ColorSwitch CS Physics NLight CurTimeLock VCE SoundPause ColorScheme NC Id]:normal
  3. @model models/sprops/geometry/sphere_12.mdl
  4.  
  5.     E = entity(),O = owner()
  6.     interval(25),runOnChat(1)
  7.    
  8.     if(first() | dupefinished())
  9.     {
  10.            
  11.     ColorSwitch = 1 # start neon
  12.     VCE         = 1 # other param
  13.     Physics     = 1 # physics force
  14.     NLight      = 1 # light
  15.     ColorScheme = 1 # color scheme at startup
  16.     RotMode     = 1 # to ply
  17.     RotAxle     = 1
  18.    
  19.     E:setAlpha(0),E:setMass(200), E:setTrails(13,8,0.4,"effects/beam001_white",vec(225),125),E:setPhysProp("metal",800)
  20.  
  21.     Stations = table(
  22.         array("http://dubstep-light.info:8000/dubsteplight.mp3" , "Dubstep Light"),
  23.         array("http://pub1.di.fm/di_clubdubstep" , "Club Dubstep"),
  24.         array("http://cs3-1v4.vk.me/p14/b7a41674db3c05.mp3" , "unknown"),
  25.         array("http://online-kissfm.tavrmedia.ua/KissFM_digital" , "KissFM Digital"),
  26.         array("http://online-kissfm.tavrmedia.ua/KissFM" , "KissFM"),
  27.         array("http://online-kissfm.tavrmedia.ua/KissFM_trance" , "KissFM Trance"),
  28.         array("http://online-kissfm.tavrmedia.ua/KissFM_deep" , "KissFM Deep"),
  29.         array("http://noisefm.ru:8000/play_96" , "NoiseFM"),
  30.         array("http://pub6.di.fm/di_dubstep" , "Dubstep radio"),
  31.         array("http://uk1.internet-radio.com:15634/listen.pls" , "DUBTHugz"),
  32.         array("http://streaming.radionomy.com/R1Dubstep", "R1 Dubstep"),
  33.         array("http://pub2.di.fm/di_chillstep", "[Dl] ChillStep"),
  34.         array("http://listen.radiogora.ru:8000/etc320", "Et Cetera")
  35.         )
  36.    
  37.     #Stations["CUSTOM", array] = array("http://dl.zaycev.net/125192/820603/nyusha_-_chudo_(zaycev.net).mp3", "Custom") ## nyusha
  38.     #Stations["CUSTOM", array] = array("http://dl.zaycev.net/44341/3095364/fort_minor_-_kenji_minus_(zaycev.net).mp3", "Custom") ## kenji
  39.     Stations["CUSTOM", array] = array("http://dl.zaycev.net/93874/323816/sound_system_-_dreamscape_(zaycev.net).mp3", "Custom")
  40.    
  41.     ########################################]FUNCTIONS[############################################## [[
  42.    
  43.     function void notice()
  44.     {
  45.    
  46.     print("Welcome!")
  47.     print("To start player print '#play' and number of station. ")
  48.     print("To get stations print '#list' ")
  49.     print("To stop radio print '#stop' ")
  50.    
  51.     }
  52.    
  53.    
  54.         function void v_ISUAL()
  55.     {
  56.     holoPos(4,E:toWorld(vec(-4.9+random(-0.05,-0.1),0,0)))    
  57.     }
  58.    
  59.         function follow()
  60.     {
  61.  
  62.          
  63.         rangerFilter(players())
  64.         Ray = rangerOffset(80,E:pos(),vec(0,0,-1))
  65.    
  66.         Angle = (vec(E:pos():x(),E:pos():y(),E:pos():z()) - vec(O:pos():x(),O:pos():y(),O:boxCenterW():z() + O:height() - 40)):toAngle()
  67.        
  68.         if(RotMode){
  69.        
  70.             Ve = E:toLocal(rotationVector(quat(Angle)/quat(E))+E:pos())
  71.        
  72.         }else{
  73.        
  74.             RotVAL = (RotVAL+pi()^2 )
  75.        
  76.             if(RotVAL > 360){ RotAxle++, RotVAL = 0 }
  77.             if(RotAxle > 3){RotAxle = 1}
  78.        
  79.             RANT[RotAxle] = RotVAL
  80.  
  81.             Ve = E:toLocal(rotationVector(quat(RANT)/quat(E))+E:pos())
  82.  
  83.             print(4,"" + RANT + "\n" + RotAxle + "\n" + $RotVAL)
  84.        
  85.         }
  86.        
  87.         E:applyTorque((150*Ve - 22*E:angVelVector())*E:inertia()/2)
  88.    
  89.             if(toUnit("m",E:pos():distance(O:pos())) > 1.7 & RotMode){E:applyForce(E:forward()*-abs(toUnit("m",E:pos():distance(O:pos()))*(E:mass()*0.75)) )}
  90.             else{
  91.         E:applyForce(vec(-E:vel()[1]*14,-E:vel()[2]*14,0))  
  92.             }
  93.         if(toUnit("m",E:pos():distance(O:pos())) < 1.2){E:applyForce(E:forward()*225 )}
  94.        
  95.         E:applyForce((vec(0,0,Ray:pos()[3]+55) - vec(0,0,E:pos()[3]))*200-E:vel()[3]*8)
  96.         E:applyForce(E:right() * -E:velL()[2]*-5)
  97.  
  98.         if(toUnit("m",E:pos():distance(O:pos())) < 1.7 & changed(O:health())&O:getDamage()&O:getDamageType() == "crush")
  99.         {
  100.         local A = (100 - O:health()), print(4,""+ (  (O:pos() - E:pos()) == O:getDamagePos() ) )
  101.        
  102.         E:soundPlay(15,1,"buttons/bell1.wav"),printColor(vec(0,155,155),"(INet) ",vec(255,55,55),"damaged ",vec(0,0,200),"You ", vec(220,55,55),"on "+A+" HP. Resetting to 100"),timer("HPRESTORE",500)
  103.         }
  104.    
  105.     }
  106.    
  107.         function colorSwitch()
  108.     {
  109.         NC = (NC+0.2) % 360
  110.         if(ColorScheme){NeonColor = hsv2rgb(NC,1,0.9) * ColorSwitch}
  111.         if(ColorScheme == 2){NeonColor = vec(0,128,128) * ColorSwitch}
  112.         if(ColorScheme == 3){NeonColor = vec(0,0,255) * ColorSwitch}
  113.         if(ColorScheme == 4){NeonColor = vec(0,255,0) * ColorSwitch}
  114.         if(ColorScheme == 5){NeonColor = vec(255,0,0) * ColorSwitch}
  115.         if(ColorScheme == 6){NeonColor = vec(0,255,255) * ColorSwitch}
  116.         if(ColorScheme == 7){NeonColor = vec(255) * ColorSwitch}
  117.         holoColor(3,NeonColor)
  118.         holoColor(5,NeonColor)
  119.         holoColor(7,NeonColor)
  120.         holoColor(8,NeonColor)
  121.         holoColor(12,NeonColor)
  122.         holoColor(14,NeonColor)
  123.         holoColor(15,NeonColor)
  124.         holoColor(16,NeonColor)
  125.         holoColor(17,NeonColor)
  126.         holoColor(22,NeonColor)
  127.         holoColor(23,NeonColor)
  128.         holoColor(24,NeonColor)
  129.         holoColor(25,NeonColor)
  130.         holoColor(26,NeonColor)
  131.  
  132.             if(NLight>0)
  133.         {
  134.             #ifdef entity:dLightColor(vector)
  135.         E:dLightColor(NeonColor)
  136.         holoEntity(7):dLightColor(NeonColor)
  137.             #endif
  138.             #ifdef entity:fLightColor(vector)
  139.         E:fLightColor(NeonColor)
  140.             #endif
  141.    
  142.         }
  143.      
  144.     }
  145.    
  146.         function void sub_color(Vec:vector)
  147.     {
  148.         holoColor(6,Vec),holoMaterial(6, "phoenix_storms/pro_gear_top2")
  149.         holoColor(1,Vec),holoMaterial(1, "phoenix_storms/pro_gear_top2")
  150.         holoColor(2,Vec),holoMaterial(2, "phoenix_storms/pro_gear_top2")
  151.         holoColor(18,Vec),holoMaterial(18, "phoenix_storms/pro_gear_top2")
  152.         holoColor(19,Vec),holoMaterial(19, "phoenix_storms/pro_gear_top2")
  153.         holoColor(20,Vec),holoMaterial(20, "phoenix_storms/pro_gear_top2")
  154.         holoColor(21,Vec),holoMaterial(21, "phoenix_storms/pro_gear_top2")
  155.  
  156.     }
  157.  
  158.         function void playMP3first(Id:number, Stations:array, Number)
  159.     {
  160.         soundURLdelete(""+Id)
  161.         soundURLload(""+Id,Stations[Number, string],1,0,E)
  162.         E:soundPlay(14,1.25,"buttons/lightswitch2.wav")
  163.     }
  164.         function void playMP3button(Id:number, URL:string)
  165.     {
  166.         soundURLdelete(""+Id)
  167.         soundURLload(""+Id,URL,1,0,E)
  168.         E:soundPlay(14,1.25,"buttons/lightswitch2.wav")
  169.     }
  170.         function void stopSound(Id:number)
  171.     {
  172.         soundURLdelete(""+Id)
  173.         E:soundPlay(14,1.25,"buttons/lightswitch2.wav")
  174.     }
  175.  
  176.         function listR()
  177.     {
  178.      
  179.         local Value = Stations:count()
  180.    
  181.         for(I = 1, Value){
  182.    
  183.             printColor(vec( 0,0,255 ), Stations[I, array][2, string])
  184.        
  185.         }
  186.     }
  187.  
  188.         function void soundMP3Pause(Id:number)
  189.     {
  190.         soundURLpause(""+Id)
  191.         E:soundPlay(14,1.25,"buttons/lightswitch2.wav")
  192.     }
  193.  
  194.         function void soundMP3Unpause(Id:number)
  195.     {
  196.         soundURLplay(""+Id)
  197.         E:soundPlay(14,1.25,"buttons/lightswitch2.wav")
  198.     }
  199.    
  200.         function void soundMP3Volume(Vol:number)
  201.     {
  202.         soundURLvolume("1", Vol/100)
  203.     }
  204.  
  205.         function void entity:hsetMod(String:string)
  206.     {
  207.     #ifdef entity:setModel( string )
  208.         This:setModel( String )
  209.     #else
  210.         holoModel(holoIndex( This ), String )
  211.     #endif
  212.     }
  213.  
  214.         if(NLight>0)
  215.     {
  216.     #ifdef entity:setdLight(vector,number,number)
  217.         E:setdLight(vec(),3,200)
  218.     #endif  
  219.     #ifdef entity:setfLight(vector,vector,angle,string,number,number,number)
  220.         E:setfLight(E:pos(),vec(255,0,0),E:toWorld(ang(180,0,0)),"effects/flashlight/soft",80,455,100)
  221.     #endif
  222.     }else{E:dLightRemove(),E:fLightRemove()}
  223.  
  224.         function chat_ops(W:array)
  225.     {
  226.    
  227.     local Words = W
  228.     local Fi = Words[1, string]
  229.     local Se = Words[2, string]
  230.     local Key = Se:toNumber()
  231.     local Count = Stations:count()
  232.    
  233.         if( chatClk( O ) )
  234.         {
  235.          
  236.             if(Fi == "#play" & Se){      hideChat( 1 )
  237.            
  238.             if(Key > Count | Key == 0 & Words[2, string] != "custom"){
  239.             printColor(vec(0,150,150),"Abort! Invalid station number! ",vec(0,200,200),"\n" + "Use this: 1 - " + Count)        
  240.             }else{
  241.             playMP3button(1, Stations[Key, array][1,string]),setName(NAME + "\n" + "Now playing: " + Stations[Key, array][2, string]) , printColor(vec(0,255,255),"Now plays: "+Stations[Key, array][2,string]  )
  242.             }
  243.            
  244.             if(Se == "custom"){      hideChat( 1 )
  245.             playMP3button(1, Stations["CUSTOM", array][1,string]),setName(NAME + "\n" + "Now playing: " + Stations["CUSTOM", array][2, string])                
  246.             printColor(vec(0,0,255),"Custom song" )
  247.             }
  248.             }
  249.            
  250.             if(Fi == "#stop"){      hideChat( 1 )
  251.             stopSound(1)
  252.             printColor(vec(0,255,255),"Stop playing")
  253.             hideChat(1)
  254.             }
  255.            
  256.             if(Fi == "#help") {      hideChat( 1 ),  notice()  }
  257.                
  258.             if(Fi == "#list"){      hideChat( 1 )
  259.             printColor(vec(0,255,255),"Count of stations: " + Stations:count() )
  260.             for(I_ = 1, Count){
  261.             printColor(vec(200-I_*6),"" + I_ + "  - " + Stations[I_, array][1,string] + "       [ " + Stations[I_,array][2,string] + "  ] " )
  262.             }  
  263.              
  264.             }
  265.             if(Fi == "#vol" & Se){      hideChat( 1 )
  266.             local Volume = clamp(Se:toNumber(),0,100)
  267.             soundMP3Volume(Volume)
  268.             }
  269.            
  270.             if(Fi == "#content"){    hideChat( 1 )
  271.              
  272.                 printColor(vec(0,0,255), "Radio stations: " + ( Stations:count() - 1 ) )
  273.                
  274.                 timer("Spisok", 2000)
  275.            
  276.             }
  277.            
  278.             if(Fi == "#rot"){    hideChat( 1 )
  279.              
  280.                 RotMode = !RotMode
  281.                
  282.                 if(RotMode){ printColor(vec(0,255,255), "RotMode changed to target owner") }
  283.                 if(!RotMode){ printColor(vec(0,255,255), "RotMode changed to club style") }
  284.                
  285.             }
  286.            
  287.             if(chatClk(O) & Words[1, string] == "#color"){      hideChat( 1 )
  288.             if(Words[2, string]){
  289.             local Col = Se:toNumber()
  290.             ColorScheme = Col    
  291.             }else{ ColorSwitch=!ColorSwitch }
  292.             }
  293.            
  294.         }
  295.        
  296.     }
  297.             ################################################################################################### ]]
  298.  
  299.               holoCreate(1, E:toWorld(vec(0,0,0.2)),vec(1,1,0.96),E:toWorld(ang())):hsetMod("models/holograms/hq_hdome_thin.mdl"),holoClip(1,vec(-4.7,0,0),vec(1,0,0),0),holoClipEnabled(1,1)
  300.               holoCreate(2, E:toWorld(vec(0,0,-0.2)),vec(1,1,0.96),E:toWorld(ang(180,0,0))):hsetMod("models/holograms/hq_hdome_thin.mdl"),holoClip(2,vec(4.7,0,0),vec(-1,0,0),0),holoClipEnabled(2,1)
  301.               holoCreate(3, E:toWorld(vec(-4.75,0,0)),vec(0.64,0.64,0.7),E:toWorld(ang(90,0,0))):hsetMod("models/holograms/hq_hdome_thin.mdl"),holoMaterial(3,"lights/white")
  302.               holoCreate(4, E:toWorld(vec(-4,0,0)),vec(0.65,0.65,-0.2),E:toWorld(ang(90,0,0))):hsetMod("models/holograms/hq_sphere.mdl"),holoMaterial(4,"sprops/textures/sprops_rubber"),holoColor(4,vec(122)),holoClip(4,vec(0,0,0.35),vec(0,0,1),0),holoClipEnabled(4,1)
  303.               holoCreate(5, E:toWorld(vec(0,0,0)),vec(0.97,0.97,0.1),E:toWorld(ang(0,-18,0))):hsetMod("models/holograms/hq_tube_thin.mdl"),holoClip(5,vec(-3,0,0),vec(1,0,0),0),holoClipEnabled(5,1),holoMaterial(5,"lights/white")
  304.               holoCreate(6, E:toWorld(vec(-2.5,0,0)),vec(0.253),E:toWorld(ang(90,0,0))):hsetMod("models/holograms/hq_rcylinder.mdl"),holoParent(6,4),holoClip(6,vec(0,0,-1.45),vec(0,0,1),0),holoClipEnabled(6,1)
  305.               holoCreate(7, E:toWorld(vec(-3.09,0,0)),vec(0.075,0.075,0.03),E:toWorld(ang(90,0,0))):hsetMod("models/holograms/hq_sphere.mdl"),holoParent(7,4),holoMaterial(7,"lights/white")
  306.               #holoCreate(9, E:toWorld(vec(0,0,0)),vec(1),E:toWorld(ang(90,0,0))):hsetMod("models/holograms/hq_sphere.mdl"),holoClip(9,vec(0,0,-4.7),vec(0,0,-1),0),holoClipEnabled(9,1),holoParent(9,E),holoMaterial(9,"phoenix_storms/metalfence004a"),holoColor(9,vec4(180,180,180,80))
  307.               holoCreate(11, E:toWorld(vec(-3.06,0,0)),vec(0.14),E:toWorld(ang(90,0,0))):hsetMod("models/holograms/hq_rcylinder_thin.mdl"),holoParent(11,4),holoMaterial(11,"models/shiny")
  308.               holoCreate(12, E:toWorld(vec(-3.6,0,0)),vec(0.23,0.23,0.05),E:toWorld(ang(90,0,0))):hsetMod("models/holograms/hq_tube_thick.mdl"),holoParent(12,4),holoMaterial(12,"lights/white")
  309.               holoCreate(13, E:toWorld(vec(-4,0,0)),vec(0.15,0.15,0.005),E:toWorld(ang(90,0,0))):hsetMod("models/holograms/hq_rcylinder_thin.mdl"),holoParent(13,4),holoMaterial(13,"phoenix_storms/dome_side")
  310.               holoCreate(14, E:toWorld(vec(-4,0.5,0)),vec(0.025),E:toWorld(ang(0,90,0))):hsetMod("models/sprops/misc/alphanum/alphanum_a.mdl"),holoParent(14,4),holoMaterial(14,"lights/white")
  311.               holoCreate(15, E:toWorld(vec(-4,-0.5,0)),vec(0.025),E:toWorld(ang(0,90,0))):hsetMod("models/sprops/misc/alphanum/alphanum_m.mdl"),holoParent(15,4),holoMaterial(15,"lights/white")
  312.               holoCreate(16, E:toWorld(vec(-4,0.17,0)),vec(0.025),E:toWorld(ang(0,90,0))):hsetMod("models/sprops/misc/alphanum/alphanum_3.mdl"),holoParent(16,4),holoMaterial(16,"lights/white")
  313.               holoCreate(17, E:toWorld(vec(-4,-0.17,0)),vec(0.025),E:toWorld(ang(0,90,0))):hsetMod("models/sprops/misc/alphanum/alphanum_2.mdl"),holoParent(17,4),holoMaterial(17,"lights/white")
  314.               holoCreate(18, E:toWorld(vec(-4.8,2.78,-0.2)),vec(0.02,0.005,0.15),E:toWorld(ang(0,-15,90))):hsetMod("models/holograms/prism.mdl"),holoParent(18,1),holoClip(18,vec(0,0,0.47),vec(0,0,-1),0),holoClipEnabled(18,1)
  315.               holoCreate(19, E:toWorld(vec(-4.8,2.78,0.2)),vec(0.02,0.005,0.15),E:toWorld(ang(0,-15,90))):hsetMod("models/holograms/prism.mdl"),holoParent(19,1),holoClip(19,vec(0,0,0.47),vec(0,0,-1),0),holoClipEnabled(19,1)
  316.               holoCreate(20, E:toWorld(vec(-4.8,-2.78,-0.2)),vec(0.02,0.005,0.15),E:toWorld(ang(0,15,-90))):hsetMod("models/holograms/prism.mdl"),holoParent(20,1),holoClip(20,vec(0,0,0.47),vec(0,0,-1),0),holoClipEnabled(20,1)
  317.               holoCreate(21, E:toWorld(vec(-4.8,-2.78,0.2)),vec(0.02,0.005,0.15),E:toWorld(ang(0,15,-90))):hsetMod("models/holograms/prism.mdl"),holoParent(21,1),holoClip(21,vec(0,0,0.47),vec(0,0,-1),0),holoClipEnabled(21,1)
  318.               holoCreate(22, E:toWorld(vec(-4.8,2.78,-0.2)),vec(0.02,0.005,0.15),E:toWorld(ang(0,-15,90))):hsetMod("models/holograms/prism.mdl"),holoParent(22,1),holoMaterial(22,"lights/white"),holoClip(22,vec(0,0,0.47),vec(0,0,1),0),holoClipEnabled(22,1)
  319.               holoCreate(23, E:toWorld(vec(-4.8,2.78,0.2)),vec(0.02,0.005,0.15),E:toWorld(ang(0,-15,90))):hsetMod("models/holograms/prism.mdl"),holoParent(23,1),holoMaterial(23,"lights/white"),holoClip(23,vec(0,0,0.47),vec(0,0,1),0),holoClipEnabled(23,1)
  320.               holoCreate(24, E:toWorld(vec(-4.8,-2.78,-0.2)),vec(0.02,0.005,0.15),E:toWorld(ang(0,15,-90))):hsetMod("models/holograms/prism.mdl"),holoParent(24,1),holoMaterial(24,"lights/white"),holoClip(24,vec(0,0,0.47),vec(0,0,1),0),holoClipEnabled(24,1)
  321.               holoCreate(25, E:toWorld(vec(-4.8,-2.78,0.2)),vec(0.02,0.005,0.15),E:toWorld(ang(0,15,-90))):hsetMod("models/holograms/prism.mdl"),holoParent(25,1),holoMaterial(25,"lights/white"),holoClip(25,vec(0,0,0.47),vec(0,0,1),0),holoClipEnabled(25,1)
  322.               holoCreate(26, E:toWorld(vec(0,0,0)),vec(0.97,0.97,0.1),E:toWorld(ang(0,18,0))):hsetMod("models/holograms/hq_tube_thin.mdl"),holoClip(26,vec(-3,0,0),vec(1,0,0),0),holoClipEnabled(26,1),holoMaterial(26,"lights/white"),holoParent(26,1)
  323.  
  324.         for(I = 1,5){holoParent(I, E)}
  325.        
  326.         sub_color(vec(255))
  327.         V = "0.820n"
  328.        
  329.         NAME = "Difficult radio by artem32" + "\n" + "version: " + V + "\n"
  330.         setName(NAME)
  331.             if(Physics>0){timer("physics_update",10)}
  332.        
  333.     }
  334.    
  335.     Words = O:lastSaid():lower():explode(" ")
  336.        
  337.     chat_ops(Words)
  338.     v_ISUAL()
  339.     colorSwitch()
  340.    
  341.     if(clk("physics_update")){follow(),timer("physics_update",10)}
  342.     if(clk("Spisok")){listR()}
  343.     if(changed(clk("HPRESTORE"))&clk("HPRESTORE")){O:setHealth(100),E:soundPlay(16,1,"buttons/blip2.wav")}
  344.     if(changed(ColorSwitch)){E:soundPlay(4,0.5,"buttons/button24.wav"),soundPitch(4,90+ColorSwitch*20),timer("VCE",500),VCE = 0},if(clk("VCE")){VCE = 1}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement