Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name swoofer v2
- @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
- @model models/sprops/geometry/sphere_12.mdl
- E = entity(),O = owner()
- interval(25),runOnChat(1)
- if(first() | dupefinished())
- {
- ColorSwitch = 1 # start neon
- VCE = 1 # other param
- Physics = 1 # physics force
- NLight = 1 # light
- ColorScheme = 1 # color scheme at startup
- RotMode = 1 # to ply
- RotAxle = 1
- E:setAlpha(0),E:setMass(200), E:setTrails(13,8,0.4,"effects/beam001_white",vec(225),125),E:setPhysProp("metal",800)
- Stations = table(
- array("http://dubstep-light.info:8000/dubsteplight.mp3" , "Dubstep Light"),
- array("http://pub1.di.fm/di_clubdubstep" , "Club Dubstep"),
- array("http://cs3-1v4.vk.me/p14/b7a41674db3c05.mp3" , "unknown"),
- array("http://online-kissfm.tavrmedia.ua/KissFM_digital" , "KissFM Digital"),
- array("http://online-kissfm.tavrmedia.ua/KissFM" , "KissFM"),
- array("http://online-kissfm.tavrmedia.ua/KissFM_trance" , "KissFM Trance"),
- array("http://online-kissfm.tavrmedia.ua/KissFM_deep" , "KissFM Deep"),
- array("http://noisefm.ru:8000/play_96" , "NoiseFM"),
- array("http://pub6.di.fm/di_dubstep" , "Dubstep radio"),
- array("http://uk1.internet-radio.com:15634/listen.pls" , "DUBTHugz"),
- array("http://streaming.radionomy.com/R1Dubstep", "R1 Dubstep"),
- array("http://pub2.di.fm/di_chillstep", "[Dl] ChillStep"),
- array("http://listen.radiogora.ru:8000/etc320", "Et Cetera")
- )
- #Stations["CUSTOM", array] = array("http://dl.zaycev.net/125192/820603/nyusha_-_chudo_(zaycev.net).mp3", "Custom") ## nyusha
- #Stations["CUSTOM", array] = array("http://dl.zaycev.net/44341/3095364/fort_minor_-_kenji_minus_(zaycev.net).mp3", "Custom") ## kenji
- Stations["CUSTOM", array] = array("http://dl.zaycev.net/93874/323816/sound_system_-_dreamscape_(zaycev.net).mp3", "Custom")
- ########################################]FUNCTIONS[############################################## [[
- function void notice()
- {
- print("Welcome!")
- print("To start player print '#play' and number of station. ")
- print("To get stations print '#list' ")
- print("To stop radio print '#stop' ")
- }
- function void v_ISUAL()
- {
- holoPos(4,E:toWorld(vec(-4.9+random(-0.05,-0.1),0,0)))
- }
- function follow()
- {
- rangerFilter(players())
- Ray = rangerOffset(80,E:pos(),vec(0,0,-1))
- 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()
- if(RotMode){
- Ve = E:toLocal(rotationVector(quat(Angle)/quat(E))+E:pos())
- }else{
- RotVAL = (RotVAL+pi()^2 )
- if(RotVAL > 360){ RotAxle++, RotVAL = 0 }
- if(RotAxle > 3){RotAxle = 1}
- RANT[RotAxle] = RotVAL
- Ve = E:toLocal(rotationVector(quat(RANT)/quat(E))+E:pos())
- print(4,"" + RANT + "\n" + RotAxle + "\n" + $RotVAL)
- }
- E:applyTorque((150*Ve - 22*E:angVelVector())*E:inertia()/2)
- 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)) )}
- else{
- E:applyForce(vec(-E:vel()[1]*14,-E:vel()[2]*14,0))
- }
- if(toUnit("m",E:pos():distance(O:pos())) < 1.2){E:applyForce(E:forward()*225 )}
- E:applyForce((vec(0,0,Ray:pos()[3]+55) - vec(0,0,E:pos()[3]))*200-E:vel()[3]*8)
- E:applyForce(E:right() * -E:velL()[2]*-5)
- if(toUnit("m",E:pos():distance(O:pos())) < 1.7 & changed(O:health())&O:getDamage()&O:getDamageType() == "crush")
- {
- local A = (100 - O:health()), print(4,""+ ( (O:pos() - E:pos()) == O:getDamagePos() ) )
- 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)
- }
- }
- function colorSwitch()
- {
- NC = (NC+0.2) % 360
- if(ColorScheme){NeonColor = hsv2rgb(NC,1,0.9) * ColorSwitch}
- if(ColorScheme == 2){NeonColor = vec(0,128,128) * ColorSwitch}
- if(ColorScheme == 3){NeonColor = vec(0,0,255) * ColorSwitch}
- if(ColorScheme == 4){NeonColor = vec(0,255,0) * ColorSwitch}
- if(ColorScheme == 5){NeonColor = vec(255,0,0) * ColorSwitch}
- if(ColorScheme == 6){NeonColor = vec(0,255,255) * ColorSwitch}
- if(ColorScheme == 7){NeonColor = vec(255) * ColorSwitch}
- holoColor(3,NeonColor)
- holoColor(5,NeonColor)
- holoColor(7,NeonColor)
- holoColor(8,NeonColor)
- holoColor(12,NeonColor)
- holoColor(14,NeonColor)
- holoColor(15,NeonColor)
- holoColor(16,NeonColor)
- holoColor(17,NeonColor)
- holoColor(22,NeonColor)
- holoColor(23,NeonColor)
- holoColor(24,NeonColor)
- holoColor(25,NeonColor)
- holoColor(26,NeonColor)
- if(NLight>0)
- {
- #ifdef entity:dLightColor(vector)
- E:dLightColor(NeonColor)
- holoEntity(7):dLightColor(NeonColor)
- #endif
- #ifdef entity:fLightColor(vector)
- E:fLightColor(NeonColor)
- #endif
- }
- }
- function void sub_color(Vec:vector)
- {
- holoColor(6,Vec),holoMaterial(6, "phoenix_storms/pro_gear_top2")
- holoColor(1,Vec),holoMaterial(1, "phoenix_storms/pro_gear_top2")
- holoColor(2,Vec),holoMaterial(2, "phoenix_storms/pro_gear_top2")
- holoColor(18,Vec),holoMaterial(18, "phoenix_storms/pro_gear_top2")
- holoColor(19,Vec),holoMaterial(19, "phoenix_storms/pro_gear_top2")
- holoColor(20,Vec),holoMaterial(20, "phoenix_storms/pro_gear_top2")
- holoColor(21,Vec),holoMaterial(21, "phoenix_storms/pro_gear_top2")
- }
- function void playMP3first(Id:number, Stations:array, Number)
- {
- soundURLdelete(""+Id)
- soundURLload(""+Id,Stations[Number, string],1,0,E)
- E:soundPlay(14,1.25,"buttons/lightswitch2.wav")
- }
- function void playMP3button(Id:number, URL:string)
- {
- soundURLdelete(""+Id)
- soundURLload(""+Id,URL,1,0,E)
- E:soundPlay(14,1.25,"buttons/lightswitch2.wav")
- }
- function void stopSound(Id:number)
- {
- soundURLdelete(""+Id)
- E:soundPlay(14,1.25,"buttons/lightswitch2.wav")
- }
- function listR()
- {
- local Value = Stations:count()
- for(I = 1, Value){
- printColor(vec( 0,0,255 ), Stations[I, array][2, string])
- }
- }
- function void soundMP3Pause(Id:number)
- {
- soundURLpause(""+Id)
- E:soundPlay(14,1.25,"buttons/lightswitch2.wav")
- }
- function void soundMP3Unpause(Id:number)
- {
- soundURLplay(""+Id)
- E:soundPlay(14,1.25,"buttons/lightswitch2.wav")
- }
- function void soundMP3Volume(Vol:number)
- {
- soundURLvolume("1", Vol/100)
- }
- function void entity:hsetMod(String:string)
- {
- #ifdef entity:setModel( string )
- This:setModel( String )
- #else
- holoModel(holoIndex( This ), String )
- #endif
- }
- if(NLight>0)
- {
- #ifdef entity:setdLight(vector,number,number)
- E:setdLight(vec(),3,200)
- #endif
- #ifdef entity:setfLight(vector,vector,angle,string,number,number,number)
- E:setfLight(E:pos(),vec(255,0,0),E:toWorld(ang(180,0,0)),"effects/flashlight/soft",80,455,100)
- #endif
- }else{E:dLightRemove(),E:fLightRemove()}
- function chat_ops(W:array)
- {
- local Words = W
- local Fi = Words[1, string]
- local Se = Words[2, string]
- local Key = Se:toNumber()
- local Count = Stations:count()
- if( chatClk( O ) )
- {
- if(Fi == "#play" & Se){ hideChat( 1 )
- if(Key > Count | Key == 0 & Words[2, string] != "custom"){
- printColor(vec(0,150,150),"Abort! Invalid station number! ",vec(0,200,200),"\n" + "Use this: 1 - " + Count)
- }else{
- 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] )
- }
- if(Se == "custom"){ hideChat( 1 )
- playMP3button(1, Stations["CUSTOM", array][1,string]),setName(NAME + "\n" + "Now playing: " + Stations["CUSTOM", array][2, string])
- printColor(vec(0,0,255),"Custom song" )
- }
- }
- if(Fi == "#stop"){ hideChat( 1 )
- stopSound(1)
- printColor(vec(0,255,255),"Stop playing")
- hideChat(1)
- }
- if(Fi == "#help") { hideChat( 1 ), notice() }
- if(Fi == "#list"){ hideChat( 1 )
- printColor(vec(0,255,255),"Count of stations: " + Stations:count() )
- for(I_ = 1, Count){
- printColor(vec(200-I_*6),"" + I_ + " - " + Stations[I_, array][1,string] + " [ " + Stations[I_,array][2,string] + " ] " )
- }
- }
- if(Fi == "#vol" & Se){ hideChat( 1 )
- local Volume = clamp(Se:toNumber(),0,100)
- soundMP3Volume(Volume)
- }
- if(Fi == "#content"){ hideChat( 1 )
- printColor(vec(0,0,255), "Radio stations: " + ( Stations:count() - 1 ) )
- timer("Spisok", 2000)
- }
- if(Fi == "#rot"){ hideChat( 1 )
- RotMode = !RotMode
- if(RotMode){ printColor(vec(0,255,255), "RotMode changed to target owner") }
- if(!RotMode){ printColor(vec(0,255,255), "RotMode changed to club style") }
- }
- if(chatClk(O) & Words[1, string] == "#color"){ hideChat( 1 )
- if(Words[2, string]){
- local Col = Se:toNumber()
- ColorScheme = Col
- }else{ ColorSwitch=!ColorSwitch }
- }
- }
- }
- ################################################################################################### ]]
- 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)
- 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)
- 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")
- 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)
- 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")
- 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)
- 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")
- #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))
- 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")
- 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")
- 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")
- 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")
- 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")
- 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")
- 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")
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- for(I = 1,5){holoParent(I, E)}
- sub_color(vec(255))
- V = "0.820n"
- NAME = "Difficult radio by artem32" + "\n" + "version: " + V + "\n"
- setName(NAME)
- if(Physics>0){timer("physics_update",10)}
- }
- Words = O:lastSaid():lower():explode(" ")
- chat_ops(Words)
- v_ISUAL()
- colorSwitch()
- if(clk("physics_update")){follow(),timer("physics_update",10)}
- if(clk("Spisok")){listR()}
- if(changed(clk("HPRESTORE"))&clk("HPRESTORE")){O:setHealth(100),E:soundPlay(16,1,"buttons/blip2.wav")}
- 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