66
77namespace Zamirathe_HomeCommand
88{
9- public class CommandHome : Command
9+ public class CommandHome : IRocketCommand
1010 {
11- public CommandHome ( )
11+ public bool RunFromConsole
1212 {
13- this . commandName = "home" ;
14- this . commandHelp = "Teleports you to your bed if you have one." ;
15- this . commandInfo = this . commandName + " - " + this . commandHelp ;
13+ get
14+ {
15+ return false ;
16+ }
1617 }
17-
18- protected override void execute ( SteamPlayerID playerid , string bed )
18+ public string Name
19+ {
20+ get
21+ {
22+ return "home" ;
23+ }
24+ }
25+ public string Help
26+ {
27+ get
28+ {
29+ return "Teleports you to your bed if you have one." ;
30+ }
31+ }
32+ public void Execute ( CSteamID playerid , string bed )
1933 {
20- if ( ! RocketCommand . IsPlayer ( playerid ) ) return ;
21- SteamPlayer player = PlayerTool . getSteamPlayer ( playerid . CSteamID ) ;
22- HomePlayer homeplayer = player . Player . transform . GetComponent < HomePlayer > ( ) ;
23- object [ ] cont = HomeCommand . CheckConfig ( player , homeplayer ) ;
34+ Player player = PlayerTool . getPlayer ( playerid ) ;
35+ HomePlayer homeplayer = player . transform . GetComponent < HomePlayer > ( ) ;
36+ object [ ] cont = HomeCommand . CheckConfig ( player , playerid , homeplayer ) ;
2437 if ( ! ( bool ) cont [ 0 ] ) return ;
2538 // A bed was found, so let's run a few checks.
2639 if ( HomeCommand . Instance . Configuration . TeleportWait )
@@ -29,12 +42,12 @@ protected override void execute(SteamPlayerID playerid, string bed)
2942 if ( HomeCommand . Instance . Configuration . MovementRestriction )
3043 {
3144 // Admin wants them not to move either. So let's send the appropriate msg and start the timer.
32- RocketChatManager . Say ( player . SteamPlayerID . CSteamID , String . Format ( HomeCommand . Instance . Configuration . FoundBedWaitNoMoveMsg , player . Player . name , HomeCommand . Instance . Configuration . TeleportWaitTime ) ) ;
45+ RocketChatManager . Say ( playerid , String . Format ( HomeCommand . Instance . Configuration . FoundBedWaitNoMoveMsg , player . name , HomeCommand . Instance . Configuration . TeleportWaitTime ) ) ;
3346 }
3447 else
3548 {
3649 // Admin just wants them to wait but they can move.
37- RocketChatManager . Say ( player . SteamPlayerID . CSteamID , String . Format ( HomeCommand . Instance . Configuration . FoundBedNowWaitMsg , player . Player . name , HomeCommand . Instance . Configuration . TeleportWaitTime ) ) ;
50+ RocketChatManager . Say ( playerid , String . Format ( HomeCommand . Instance . Configuration . FoundBedNowWaitMsg , player . name , HomeCommand . Instance . Configuration . TeleportWaitTime ) ) ;
3851 }
3952 }
4053 homeplayer . GoHome ( ( Vector3 ) cont [ 1 ] , ( byte ) cont [ 2 ] , player ) ;
0 commit comments