public static void find_id(ConsoleSystem.Arg args) { uint num = args.GetUInt(0, 0); TextTable entityTable = Entity.GetEntityTable((Entity.EntityInfo info) => info.entityID == num); args.ReplyWith(entityTable.ToString()); }
public static void find_group(ConsoleSystem.Arg args) { uint filter = args.GetUInt(0, 0U); TextTable entityTable = Entity.GetEntityTable((Func <Entity.EntityInfo, bool>)(info => (int)info.groupID == (int)filter)); args.ReplyWith(((object)entityTable).ToString()); }
public static void entid(ConsoleSystem.Arg arg) { BaseEntity baseEntity = BaseNetworkable.serverEntities.Find(arg.GetUInt(1, 0U)) as BaseEntity; if (Object.op_Equality((Object)baseEntity, (Object)null) || baseEntity is BasePlayer) { return; } string str = arg.GetString(0, ""); if (Object.op_Inequality((Object)arg.Player(), (Object)null)) { Debug.Log((object)("[ENTCMD] " + arg.Player().displayName + "/" + (object)arg.Player().userID + " used *" + str + "* on ent: " + ((Object)baseEntity).get_name())); } if (!(str == "kill")) { if (!(str == "lock")) { if (!(str == "unlock")) { if (!(str == "debug")) { if (!(str == "undebug")) { if (str == "who") { arg.ReplyWith("Owner ID: " + (object)baseEntity.OwnerID); } else { arg.ReplyWith("Unknown command"); } } else { baseEntity.SetFlag(BaseEntity.Flags.Debugging, false, false, true); } } else { baseEntity.SetFlag(BaseEntity.Flags.Debugging, true, false, true); } } else { baseEntity.SetFlag(BaseEntity.Flags.Locked, false, false, true); } } else { baseEntity.SetFlag(BaseEntity.Flags.Locked, true, false, true); } } else { baseEntity.Kill(BaseNetworkable.DestroyMode.Gib); } }
public static void update(ConsoleSystem.Arg arg) { uint id = arg.GetUInt(0, 0U); string str = arg.GetString(1, ""); Item itemUid = arg.Player().inventory.FindItemUID(id); if (itemUid == null) { return; } itemUid.text = StringExtensions.Truncate(str, 1024, (string)null); itemUid.MarkDirty(); }
public static void find_radius(ConsoleSystem.Arg args) { BasePlayer player = args.Player(); if (Object.op_Equality((Object)player, (Object)null)) { return; } uint filter = args.GetUInt(0, 10U); TextTable entityTable = Entity.GetEntityTable((Func <Entity.EntityInfo, bool>)(info => (double)Vector3.Distance(((Component)info.entity).get_transform().get_position(), ((Component)player).get_transform().get_position()) <= (double)filter)); args.ReplyWith(((object)entityTable).ToString()); }
public static void update(ConsoleSystem.Arg arg) { uint num = arg.GetUInt(0, 0); string str = arg.GetString(1, ""); Item item = arg.Player().inventory.FindItemUID(num); if (item == null) { return; } item.text = str.Truncate(1024, null); item.MarkDirty(); }
public static void find_radius(ConsoleSystem.Arg args) { BasePlayer basePlayer = args.Player(); if (basePlayer == null) { return; } uint num = args.GetUInt(0, 10); TextTable entityTable = Entity.GetEntityTable((Entity.EntityInfo info) => Vector3.Distance(info.entity.transform.position, basePlayer.transform.position) <= (float)((float)num)); args.ReplyWith(entityTable.ToString()); }
public static void entid(ConsoleSystem.Arg arg) { BaseEntity baseEntity = BaseNetworkable.serverEntities.Find(arg.GetUInt(1, 0)) as BaseEntity; if (baseEntity == null) { return; } if (baseEntity is BasePlayer) { return; } string str = arg.GetString(0, ""); if (arg.Player() != null) { Debug.Log(string.Concat(new object[] { "[ENTCMD] ", arg.Player().displayName, "/", arg.Player().userID, " used *", str, "* on ent: ", baseEntity.name })); } if (str == "kill") { baseEntity.Kill(BaseNetworkable.DestroyMode.Gib); return; } if (str == "lock") { baseEntity.SetFlag(BaseEntity.Flags.Locked, true, false, true); return; } if (str == "unlock") { baseEntity.SetFlag(BaseEntity.Flags.Locked, false, false, true); return; } if (str == "debug") { baseEntity.SetFlag(BaseEntity.Flags.Debugging, true, false, true); return; } if (str == "undebug") { baseEntity.SetFlag(BaseEntity.Flags.Debugging, false, false, true); return; } if (str != "who") { arg.ReplyWith("Unknown command"); return; } arg.ReplyWith(string.Concat("Owner ID: ", baseEntity.OwnerID)); }
void NoteUpdateCommand(ConsoleSystem.Arg arg) { uint num = arg.GetUInt(0, 0); string str = arg.GetString(1, string.Empty); Item item = arg.Player().inventory.FindItemUID(num); if (item == null) { return; } item.text = str.Truncate(1024, null); item.MarkDirty(); NoteList.Add(new NoteInfo(arg.Player(), item.text, item.uid)); LogToConsole(arg.Player(), item.text, item.uid); }
public static void respawn_sleepingbag_remove(ConsoleSystem.Arg args) { BasePlayer basePlayer = args.Player(); if (!basePlayer) { return; } uint num = args.GetUInt(0, 0); if (num == 0) { args.ReplyWith("Missing sleeping bag ID"); return; } SleepingBag.DestroyBag(basePlayer, num); }
void OnServerCommand(ConsoleSystem.Arg args) { switch (args.cmd.FullName) { case "global.respawn": { RespawnType = RespawnTypeEnum.Default; break; } case "global.respawn_sleepingbag": { uint uInt = args.GetUInt(0, 0u); if (uInt == 0u) { RespawnType = RespawnTypeEnum.Default; return; } var bed = BaseNetworkable.serverEntities.Find(uInt); if (bed == null) { RespawnType = RespawnTypeEnum.Default; return; } if (!(bed is SleepingBag)) { RespawnType = RespawnTypeEnum.Default; return; } if (bed.ShortPrefabName == "sleepingbag_leather_deployed") { RespawnType = RespawnTypeEnum.SleepingBag; } else if (bed.ShortPrefabName == "bed_deployed") { RespawnType = RespawnTypeEnum.Bed; } else { RespawnType = RespawnTypeEnum.Default; } break; } } }
public static void respawn_sleepingbag_remove(ConsoleSystem.Arg args) { BasePlayer player = args.Player(); if (!Object.op_Implicit((Object)player)) { return; } uint sleepingBag = args.GetUInt(0, 0U); if (sleepingBag == 0U) { args.ReplyWith("Missing sleeping bag ID"); } else { SleepingBag.DestroyBag(player, sleepingBag); } }
void ConsoleCommandConfigSet(ConsoleSystem.Arg arg) { if (IsUInt(arg.GetString(2))) { Config[arg.GetString(0), arg.GetString(1)] = arg.GetUInt(2); } else if (arg.GetString(2) == "true" || arg.GetString(2) == "false") { Config[arg.GetString(0), arg.GetString(1)] = arg.GetBool(2); } else { Config[arg.GetString(0), arg.GetString(1)] = arg.GetString(2); } SaveConfig(); ConfigLoader(); }
public static void respawn_sleepingbag(ConsoleSystem.Arg args) { BasePlayer player = args.Player(); if (!Object.op_Implicit((Object)player) || !player.IsDead()) { return; } uint sleepingBag = args.GetUInt(0, 0U); if (sleepingBag == 0U) { args.ReplyWith("Missing sleeping bag ID"); } else { if (SleepingBag.SpawnPlayer(player, sleepingBag)) { return; } args.ReplyWith("Couldn't spawn in sleeping bag!"); } }
public static void respawn_sleepingbag(ConsoleSystem.Arg args) { BasePlayer basePlayer = args.Player(); if (!basePlayer) { return; } if (!basePlayer.IsDead()) { return; } uint num = args.GetUInt(0, 0); if (num == 0) { args.ReplyWith("Missing sleeping bag ID"); return; } if (!SleepingBag.SpawnPlayer(basePlayer, num)) { args.ReplyWith("Couldn't spawn in sleeping bag!"); } }