public void PlayerSubmit(string playerName) { if (!Config.Instance.EnableConflict || Core.NexusDetected) { Context.Respond("Conflict is not enabled"); return; } if (string.IsNullOrEmpty(playerName)) { Context.Respond("Command requires the player name or tag you wish to challenge"); } var playerId = Utilities.IdentityUtility.GetPlayerId(playerName); if (playerId == 0) { Context.Respond("This command can only be used ingame"); return; } ConflictPairModule.RequestSubmit(playerId, Context.Player.SteamUserId); }
public void FactionSubmit(string factionNameOrTag) { if (!Config.Instance.EnableConflict || Core.NexusDetected) { Context.Respond("Conflict is not enabled"); return; } if (string.IsNullOrEmpty(factionNameOrTag)) { Context.Respond("Command requires the faction name or tag you wish to challenge"); } var playerId = Context.Player.IdentityId; if (playerId == 0) { Context.Respond("This command can only be used ingame"); return; } var playerFaction = MySession.Static.Factions.GetPlayerFaction(Context.Player.IdentityId); var subjectId = Utilities.IdentityUtility.GetFactionId(factionNameOrTag); if (subjectId == 0 || playerFaction == null || (!playerFaction.IsLeader(playerId) && !playerFaction.IsFounder(playerId))) { Context.Respond("Faction error. This command requires you to be the founder or leader of your faction and a valid faction name or tag to issue challenge"); return; } if (MySession.Static.Factions.IsNpcFaction(subjectId)) { Context.Respond("Command cannot be used with NPC faction"); return; } ConflictPairModule.RequestSubmit(playerFaction.FactionId, subjectId, ConflictPairModule.ConflictType.Faction, Context.Player.SteamUserId); }