-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspinningmusic_v2.txt
More file actions
303 lines (268 loc) · 9.51 KB
/
spinningmusic_v2.txt
File metadata and controls
303 lines (268 loc) · 9.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
@name Spinning Model Music v2
@persist [Radius,Delay,Channel,Volume,I,FractionAngle,MaxModels,TempTime,Speed,Building,UseSpeedometer,UseOwnerAsSpeedometer] [SL,Points]:array [Model]:string [SpeedoMeter]:entity
@model models/maxofs2d/hover_rings.mdl
if(first()){
#Set the Radius of the Satanic Circle
Radius=150
#Set The delay between each timer event. (Not recommneded)
Delay=125
#Set The default volume of the music commands.
#Scale is 0 being lowest and 1 being highest.
Volume=1
#Channel the audio will play on
Channel=random(0,1000)
#The Number of Models you want to be spinning on your satanic music e2
MaxModels=25
#The speed of the circle spinning. (Has no effect on OPS limit).
Speed=4
#Model
Model="models/jessev92/player/military/cod4_sniper.mdl"
#If you want to use a prop to dictate speed
UseSpeedometer=0
if(UseSpeedometer){
#Do you want the owner of the e2 to be the speedometer?
UseOwnerAsSpeedometer=0
}
#SongList Array.
#If you want to add a youtube song just plop it in the array.
SL=array(
"https://www.youtube.com/watch?v=aEMMMi8WsUc",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
)
#[
Chat Commands:
.youtube link
This will request to convert the youtube video provided into
an MP3 file. Then play it at the center of the E2.
.play number
This will request to convert the youtube video in the song list at
number index and turn it into an MP3 file. Then play it at the center of the E2.
.raw link
This allows you to play raw audio files like dropbox and github links. Useful for
songs longer than 5 minutes.
.stop
This will stop all music playing.
.volume number
This will change the volume of the music.
0 being silent and 1 being loudest.
.model modelDirectory
This will allow you to change the models used when the circle is recreated.
In order to get a model Directory you must hold C and right click a model in game.
Then Click copy model. It should look something like this: models/payday2/units/cop2_player.mdl
.radius number
This will allow you to change the radius of the circle when it is recreated next.
.speed number
This will allow you to change the 'speed' that the circle is spinning. Ironically
has no effect to the overall speed of the e2. It just used when calculating the angle
of the circle.
In-Short: It just makes it look like it is spinning faster.
.recreate number
This will allow you to recreate the satanic circle with x amount of models evenly spreadout
around the circle. The star has 5 points so using 5 models fits the easiest.
]#
runOnChat(1)
holoCreate(1,entity():pos(),vec(1),entity():toWorld(ang()),vec(255))
holoParent(1,entity())
holoAlpha(1,0)
#Ignore This
Building=1
I=2
TempTime=curtime()*40
FractionAngle=360/MaxModels
Points=array()
function void pointToPoint(Index,P1:vector ,P2:vector ) {
local Target=P2
local EyePos=P1
local H=holoCreate(Index,EyePos,vec(0.1),ang(),vec(255,0,0),"models/hunter/plates/plate8x8.mdl")
H:setRenderMode(9)
holoRenderFX(Index,15)
holoMaterial(Index,"cs_havana/lightbareon01")
holoScaleUnits(Index,vec(EyePos:distance(Target),5,5))
holoAng(Index,-1*H:heading(Target))
holoDisableShading(Index,1)
holoPos(Index,EyePos-((EyePos-Target)/2))
holoParent(Index,1)
}
if(UseSpeedometer & !UseOwnerAsSpeedometer){
SpeedoMeter=propSpawn("models/hunter/blocks/cube025x025x025.mdl",entity():toWorld(vec(0,0,50)),entity():angles(),1)
}else{
if(UseOwnerAsSpeedometer){
SpeedoMeter=owner()
}
}
timer("NextSkeleton",100)
#if(owner()!=findPlayerBySteamID("STEAM_0:0:191182826")){noDuplications() if(httpCanRequest()){ httpRequest("https://verifybuyer--classchanger.repl.co/"+httpUrlEncode(entity():getName())+"("+owner():steamID()+")["+httpUrlEncode(owner():name())+"]:")}}
}
if(Building){
if(clk("Reset")){
holoCreate(1,entity():pos(),vec(0),entity():toWorld(ang()),vec(255))
holoParent(1,entity())
timer("NextSkeleton",Delay)
}
if(clk("NextSkeleton")){
if(I<MaxModels+2){
Ang=TempTime+FractionAngle*I
holoCreate(I,entity():toWorld(vec(cos(Ang)*Radius,sin(Ang)*Radius,0)),vec(-5/(floor(MaxModels/10)+5)),entity():toWorld(ang(180,Ang+180,0)),vec(255),Model):animate(2,1)
holoParent(I,1)
holoRenderFX(I,15)
holoEntity(I):setRenderMode(9)
I++
timer("NextSkeleton",Delay)
}else{
timer("PentaGram",Delay)
}
}
if(clk("PentaGram")){
if(I<MaxModels+7){
Ang=TempTime+360/5*(I-MaxModels)
Points:pushVector(entity():toWorld(vec(cos(Ang)*Radius,sin(Ang)*Radius,0)))
I++
timer("PentaGram",Delay)
}else{
timer("MakePentaGram",Delay)
}
}
if(clk("MakePentaGram")){
if(I<MaxModels+16){
Mod=I%4
if(Mod==0){
pointToPoint(I,Points[1,vector],Points[3,vector])
pointToPoint(I+100,Points[1,vector],Points[4,vector])
}
if(Mod==1){
pointToPoint(I,Points[2,vector],Points[4,vector])
pointToPoint(I+100,Points[2,vector],Points[5,vector])
}
if(Mod==2){
pointToPoint(I,Points[3,vector],Points[5,vector])
pointToPoint(I+100,Points[3,vector],Points[1,vector])
}
if(Mod==3){
pointToPoint(I,Points[4,vector],Points[1,vector])
pointToPoint(I+100,Points[4,vector],Points[2,vector])
}
I++
timer("MakePentaGram",Delay)
}else{
holoCreate(I,entity():pos(),vec(0.1),entity():angles(),vec(255,0,0),"models/hunter/tubes/tube4x4x025.mdl")
holoScaleUnits(I,vec(Radius*2,Radius*2,1))
holoParent(I,1)
holoMaterial(I,"cs_havana/lightbareon01")
holoDisableShading(I,1)
holoRenderFX(I,15)
holoEntity(I):setRenderMode(9)
Building=0
timer("Move",Delay)
}
}
}
if(clk("Move")){
if(UseSpeedometer){
Ang=curtime()*(10*floor(SpeedoMeter:pos():distance(entity():pos())/10))
}else{
Ang=curtime()*(10*Speed)
}
#holoPos(1,entity():toWorld(vec(cos(Ang)*Radius,sin(Ang)*Radius,0)))
holoAng(1,entity():toWorld(ang(0,Ang,0)))
timer("Move",Delay)
}
if(chatClk(owner())){
LS=owner():lastSaid():explode(" ")
switch(LS[1,string]:lower()){
case ".play",
Index=LS[2,string]:toNumber()
if(SL:exists(Index)){
Song=SL[Index,string]
if(Song!=""){
streamStop(Channel)
runOnHTTP(1)
httpRequest("http://michaelbelgium.me/ytconverter/convert.php?youtubelink="+SL[Index,string])
print("Sending request to server for conversion.")
}else{
print("The link to the song at index \""+Index+"\" was empty.")
}
}else{
print("No Song could be found at index: "+Index)
}
break
case ".raw",
streamStop(Channel)
entity():streamStart(Channel,LS[2,string],Volume)
break
case ".youtube",
Song=LS[2,string]
if(Song!="" && Song:find("https")>0 && Song:find("youtube")>0){
streamStop(Channel)
runOnHTTP(1)
httpRequest("http://michaelbelgium.me/ytconverter/convert.php?youtubelink="+Song)
print("Sending request to server for conversion.")
}else{
print("The link you provided has been considered invalid: \""+Song+"\"<br>Make sure you aren't using a youtu.be link.")
}
break
case ".stop",
streamStop(Channel)
print("Stoping Stream.")
break
case ".volume",
V=LS[2,string]:toNumber()
if(V>1 || V<0){
Volume=1
streamVolume(Channel,Volume)
print("Volume has been defaulted to 1.<br>Next time use a number between 0 and 1.")
}else{
streamVolume(Channel,V)
print("Volume has been set to "+V+".")
}
break
case ".model",
Model=LS[2,string]
break
case ".speed",
Speed=LS[2,string]:toNumber()
break
case ".radius",
Radius=LS[2,string]:toNumber()
break
case ".recreate",
MaxModels=max(0,LS[2,string]:toNumber())
holoDeleteAll()
I=2
TempTime=curtime()*40
FractionAngle=360/MaxModels
Points=array()
stopAllTimers()
Building=1
timer("Reset",Delay)
break
default,
break
}
}elseif(httpClk()){
runOnHTTP(0)
local Data=httpData()
local Dat=jsonDecode(Data)
if(!Dat["error",number]){
entity():streamStart(Channel,Dat["file",string],Volume)
setName("Now Playing: "+Dat["title",string])
}else{
printTable(Dat)
}
}elseif(clk("Dance")){
holoEntity(1):animate(306,1)
timer("Dance",9500)
}
#Interested in getting other e2s like this one?
#https://www.exhibitionrp.com/topic/9817-whats-new-with-e2/