22using Exiled . API . Features ;
33using PlayerRoles ;
44using System ;
5+ using TestingDummies . SpawningHandler ;
56
67namespace TestingDummies . Commands ;
78
@@ -14,33 +15,38 @@ public class SpawnDummy : ICommand
1415 public string Description => "Spawns a dummy for development or testing purposes, it has 0 logic" ;
1516
1617 public bool Execute ( ArraySegment < string > arguments , ICommandSender sender , out string response )
17- {
18+ {
1819 if ( arguments . Count != 3 )
1920 {
20- response = "Incorrect arguments. Usage: spawndummy [name] [role] [playerID] OR [playerNickname]" ;
21+ response = "Incorrect arguments. Usage: spawndummy [name] [role] ( [playerID] or [playerNickname]) " ;
2122 return false ;
2223 }
24+
2325 string name = arguments . At ( 0 ) ;
2426 string roleString = arguments . At ( 1 ) ;
2527 Player player = Player . Get ( arguments . At ( 2 ) ) ;
28+
2629 if ( ! Enum . TryParse ( roleString , out RoleTypeId role ) )
2730 {
2831 response = $ "Invalid role: { roleString } ";
2932 return false ;
3033 }
34+
3135 if ( player == null )
3236 {
3337 response = $ "Invalid player with the specified ID or Nickname: { arguments . At ( 2 ) } ";
3438 return false ;
3539 }
40+
3641 if ( ! Extensions . HasDummyPermissions ( player ) )
3742 {
38- response = "You do not have the needed permissions to run this command! Needed perms : devdummies" ;
43+ response = "You do not have the needed permissions to run this command! Needed perms: devdummies" ;
3944 return false ;
4045 }
41- Plugin . Instance . spawning . SpawnDummy ( name , role , player ) ;
46+
47+ Spawn . SpawnDummy ( name , role , player ) ;
48+
4249 response = $ "Spawned dummy with name '{ name } ', role '{ role } ', for player '{ player . Nickname } '";
4350 return true ;
4451 }
45-
4652}
0 commit comments