-
Notifications
You must be signed in to change notification settings - Fork 3
/
Satellite_CAM.txt
128 lines (101 loc) · 2.92 KB
/
Satellite_CAM.txt
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
@name Satellite CAM
@inputs Cam:wirelink
@outputs Active FLIR
@persist Find:array [E O TE ECT]:entity Vec:vector Up
@persist Target Duck Speed Down Mode
@persist W S M1 M2
runOnTick(1)
if(first())
{
function vector angle:toVector() {return vec(1,0,0):rotate(This)}
function init() {
E = entity()
O = owner()
Target=1
Vec=O:toWorld(vec(0,0,100))
Active = 0
FLIR = 0
Mode = 0
Find = array()
}
init()
ECT = E:isConstrainedTo()
if(ECT:type():lower():find("camera"))
{
Cam = ECT:wirelink()
}
}
Duck=O:keyDuck()
W=O:keyForward()
A=O:keyLeft()
S=O:keyBack()
D=O:keyRight()
Space=O:keyJump()
Shift=O:keySprint()
Up=Duck & W
Down=Duck & S
M1=O:keyAttack1()
M2=O:keyAttack2()
R=O:keyReload()
Alt=O:keyWalk()
Eye=O:eyeAngles()
if(M1&$M1&M2){Active=!Active}
if(M1 & $M1 & !M2) {FLIR=!FLIR}
Mode+=Active&((Up & $Up & (Mode!=2)) - (Down & $Down & (Mode!=0)))
if($Mode) {print("Mode: "+Mode)}
Cam:entity():createWire(entity(),"FLIR","FLIR")
Cam:entity():createWire(entity(),"Activated","Active")
Cam["FLIR",number]=FLIR
if(!Active){holoDelete(1)}
if(!Mode)
{
rangerDefaultZero(1)
Ranger=rangerOffset(10000000,Vec,Eye:toVector())
#Num=round(Ranger:distance())
Speed=10 + Shift*30 - Alt*5
Vec+=vec(W - S,A - D,0):rotate(Eye)*Speed
Vec+=vec(0,0,Space)*Speed/2
Cam["Activated",number]=Active
Cam["Angle",angle]=Eye
Cam["Position",vector]=Vec
holoAlpha(1,Ranger:entity():isValid()*255)
holoPos(1,Ranger:entity():pos())
holoAng(1,Ranger:entity():angles())
holoModel(1,Ranger:entity():model())
#holoEntity(1):setModel(Ranger:entity():model())
if(R) {Vec=O:toWorld(vec(0,0,100))}
}
if(Mode){
TE=Find[Target,entity]
if(!Active)
{
findIncludeEntities(players())
Find:clear()
} elseif(Active) {
findByClass("player")
findExcludePlayer(O)
Find=findToArray()
if(Find:count()){
if (Target&$Target) {
print("Name: "+TE:name())
print("HP: "+TE:health())
print("Armor: "+TE:armor())
}
if(Mode==1){
rangerFilter(TE)
rangerFilter(TE:vehicle())
Round=rangerOffset(120,TE:boxCenterW(),-Eye:toVector())
Vec=TE:boxCenterW() - Eye:toVector()*(Round:distance() - 20)
Cam["Position",vector]=TE:boxCenterW() - Eye:toVector()*(Round:distance() - 20)
Cam["Angle",angle]=Eye
} elseif(Mode==2){
Vec=TE:attachmentPos("eyes") + TE:eye()*1.3
Cam["Position",vector]=TE:attachmentPos("eyes") + TE:eye()*1.3
Cam["Angle",angle]=(TE:aimPos() - Vec):toAngle()
}
Target+=Active&((W & $W & !Duck & Target!=Find:count()) - (S & $S & Target!=1))
holoAlpha(1,0)
}
}
}
if(duped()) {reset()}