- Timestamp:
- Aug 26, 2014, 4:41:47 PM (10 years ago)
- Location:
- binary-improvements/7dtd-server-fixes/src/CustomCommands
- Files:
-
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/CustomCommands/Kill.cs
r117 r130 2 2 using System.Collections.Generic; 3 3 4 public class Kill : ConsoleCommand 4 namespace AllocsFixes.CustomCommands 5 5 { 6 public Kill (ConsoleSdtd cons) : base(cons)6 public class Kill : ConsoleCommand 7 7 { 8 } 8 public Kill (ConsoleSdtd cons) : base(cons) 9 { 10 } 9 11 10 public override string Description ()11 {12 return "kill a given player (entity id or name)";13 }12 public override string Description () 13 { 14 return "kill a given player (entity id or name)"; 15 } 14 16 15 public override string[] Names ()16 {17 return new string[] { "kill", string.Empty };18 }17 public override string[] Names () 18 { 19 return new string[] { "kill", string.Empty }; 20 } 19 21 20 public override void Run (string[] _params) 21 { 22 try { 23 if (_params.Length != 1) { 24 m_Console.SendResult ("Usage: kill <playername|entityid>"); 25 return; 22 public override void Run (string[] _params) 23 { 24 try { 25 if (_params.Length != 1) { 26 m_Console.SendResult ("Usage: kill <playername|entityid>"); 27 return; 28 } 29 30 ClientInfo ci = CommonMappingFunctions.GetClientInfoFromNameOrID (_params [0], false); 31 32 if (ci == null) { 33 m_Console.SendResult ("Playername or entity id not found."); 34 return; 35 } 36 37 EntityPlayer p = CommonMappingFunctions.GetEntityPlayer (ci); 38 p.DamageEntity (new DamageSource (EnumDamageSourceType.Bullet), 9999); 39 m_Console.SendResult ("Killed player " + _params [0]); 40 } catch (Exception e) { 41 Log.Out ("Error in Kill.Run: " + e); 26 42 } 27 28 ClientInfo ci = CommonMappingFunctions.GetClientInfoFromNameOrID (_params [0], false);29 30 if (ci == null) {31 m_Console.SendResult ("Playername or entity id not found.");32 return;33 }34 35 EntityPlayer p = CommonMappingFunctions.GetEntityPlayer (ci);36 p.DamageEntity(new DamageSource(EnumDamageSourceType.Bullet), 9999);37 m_Console.SendResult ("Killed player " + _params [0]);38 } catch (Exception e) {39 Log.Out ("Error in Kill.Run: " + e);40 43 } 41 44 } 42 45 } 43
Note:
See TracChangeset
for help on using the changeset viewer.