@@ -13,17 +13,17 @@ public void Execute(IRocketPlayer caller, string[] command)
13
13
var plugin = Plugin . Instance ;
14
14
var messageColor = plugin . MessageColor ;
15
15
var messageIcon = plugin . Configuration . Instance . MessageIcon ;
16
-
16
+
17
17
if ( command . Length < 1 )
18
18
{
19
19
Say ( caller , plugin . Translate ( "TpaCommand:WrongUsage" ) , messageColor , messageIcon ) ;
20
20
return ;
21
21
}
22
-
22
+
23
23
var player = ( UnturnedPlayer ) caller ;
24
-
24
+
25
25
var type = command [ 0 ] . ToLower ( ) ;
26
-
26
+
27
27
var teleportsManager = plugin . TeleportsManager ;
28
28
29
29
if ( type == "s" | type == "send" )
@@ -38,21 +38,31 @@ public void Execute(IRocketPlayer caller, string[] command)
38
38
39
39
if ( target == null )
40
40
{
41
- Say ( caller , plugin . Translate ( "TpaCommand:WrongUsage:NotFound" , command [ 1 ] ) , messageColor , messageIcon ) ;
41
+ Say ( caller , plugin . Translate ( "TpaCommand:WrongUsage:NotFound" , command [ 1 ] ) , messageColor ,
42
+ messageIcon ) ;
42
43
return ;
43
44
}
44
-
45
+
45
46
teleportsManager . Send ( player , target ) ;
46
47
}
47
48
else if ( type == "a" | type == "accept" )
48
49
teleportsManager . Accept ( player ) ;
49
50
else if ( type == "c" | type == "cancel" )
50
51
teleportsManager . Cancel ( player ) ;
51
- else if ( type == "l" | type == "list" )
52
+ else if ( type == "l" | type == "list" )
52
53
teleportsManager . List ( player ) ;
53
54
else
54
55
{
55
- Say ( caller , plugin . Translate ( "TpaCommand:WrongUsage" ) , messageColor , messageIcon ) ;
56
+ var target = UnturnedPlayer . FromName ( command [ 0 ] ) ;
57
+
58
+ if ( target == null )
59
+ {
60
+ Say ( caller , plugin . Translate ( "TpaCommand:WrongUsage:NotFound" , command [ 0 ] ) , messageColor ,
61
+ messageIcon ) ;
62
+ return ;
63
+ }
64
+
65
+ teleportsManager . Send ( player , target ) ;
56
66
}
57
67
}
58
68
@@ -66,8 +76,11 @@ private void Say(IRocketPlayer rocketPlayer, string message, Color messageColor,
66
76
public AllowedCaller AllowedCaller => AllowedCaller . Player ;
67
77
public string Name => "tpa" ;
68
78
public string Help => "Send, accept, deny and cancel teleport requests" ;
69
- public string Syntax => "<accept|send|cancel|list>" ;
70
- public List < string > Aliases => new List < string > ( ) ;
79
+ public string Syntax => "<playerName|accept|send|cancel|list>" ;
80
+ public List < string > Aliases => new List < string > ( )
81
+ {
82
+ "tpr"
83
+ } ;
71
84
public List < string > Permissions => new List < string > ( ) ;
72
85
}
73
86
}
0 commit comments