-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSend_Owner.txt
75 lines (75 loc) · 2.06 KB
/
Send_Owner.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
@name Send Stuff
@persist LastEnt:entity
@outputs [Target,Buyer]:entity PosB:vector AngB:angle
if(first()){
runOnChat(1)
function entity searchForPlayer(Person:string){
local P= findPlayerByName(Person)
if (!(P:isPlayer())){
P=findPlayerBySteamID(Person)
if (!(P:isPlayer())){
P=findPlayerBySteamID64(Person)
if (!(P:isPlayer())){
print("Invalid Player")
}
}
}
return P
}
}
if(chatClk(owner())){
local LS=lastSaid():explode(" ")
if(LS[1,string]=="flyto"){
local P=searchForPlayer(LS[2,string])
if(P:isValid()){
if(->Target>0 && ->AngB>0 && ->PosB>0){
PosB=P:pos()
AngB=P:angles()
Target=owner()
LastEnt=owner()
Buyer=P
timer("Reset",10000)
}else{
print("Not Wired Correctly")
}
}
}elseif(LS[1,string]=="home"){
E=LastEnt
local P=entity()
if(E:isValid() && P:isValid()){
if(->Target>0 && ->AngB>0 && ->PosB>0){
PosB=P:pos()
AngB=P:angles()
Target=owner()
timer("Reset",10000)
}else{
print("Not Wired Correctly")
}
}else{
if(!E:isValid()){
print("Aim Entity Invalid")
}
}
}elseif(LS[1,string]=="send"){
local E=owner():aimEntity()
local P=searchForPlayer(LS[2,string])
if(E:isValid() && P:isValid()){
if(->Target>0 && ->AngB>0 && ->PosB>0){
PosB=P:pos()
AngB=P:angles()
Target=E
LastEnt=E
timer("Reset",10000)
}else{
print("Not Wired Correctly")
}
}else{
if(!E:isValid()){
print("Aim Entity Invalid")
}
}
}
}
if(clk("Reset")){
Target=noentity()
}