Пример #1
0
        public void LockCellCommand(Client player)
        {
            if (!FactionManager.IsPlayerAnOfficer(Player.PlayerData[player]))
            {
                Message.NotAuthorised(player); return;
            }

            int cellID = PDManager.GetClosestCellIDToPosition(player.position);

            if (cellID == -1)
            {
                Message.Syntax(player, "You are not close enough to any cell");  return;
            }

            PDManager.CellDoor cell = PDManager.Cells[cellID];
            bool isLocked           = PDManager.ToggleCellLock(ref cell);

            API.SendCloseMessage(player, 15.0f, "~#C2A2DA~", API.shared.getPlayerName(player) + " places a key inside the lock of the cell door and " + (isLocked ? "locks" : "unlocks") + " it.");
            Utils.SetEntityFacingVector(player, cell.position);
        }
Пример #2
0
        public void GivePlayerTicket(Client player, string target)
        {
            if (!FactionManager.IsPlayerAnOfficer(Player.PlayerData[player]))
            {
                Message.NotAuthorised(player); return;
            }

            Player trg = Player.GetPlayerData(target);

            if (trg != null)
            {
                if (player.position.DistanceTo(trg.Client.position) > 1.76)
                {
                    API.SendErrorNotification(player, "You are too far away from that player.", 5); return;
                }
                API.ShowInputPrompt(player, "OnTicketChargeReason", "Reason for ticket", "Please enter the reason for ticketing " + trg.Username.Roleplay() + ":", "Next", "Cancel");
                Player.PlayerData[player].PlayerInteractingWith = trg;
            }
            else
            {
                Message.PlayerNotConnected(player); return;
            }
        }
Пример #3
0
        public void FriskPlayer(Client player, string target = "")
        {
            if (!FactionManager.IsPlayerAnOfficer(Player.PlayerData[player]))
            {
                Message.NotAuthorised(player); return;
            }

            Player p   = Player.PlayerData[player];
            Player trg = target == "" ? player.GetClosestPlayer(1) : Player.GetPlayerData(target);

            //if (trg.Client == player) { API.SendErrorNotification(player, "You can't frisk yourself."); return; }
            if (trg != null)
            {
                if (player.position.DistanceTo(trg.Client.position) > 1.76)
                {
                    API.SendErrorNotification(player, "You are too far away from that player.", 5); return;
                }
                API.SendInfoNotification(player, string.Format("Awaiting {0}'s response to your request, please wait...", trg.Client.name), 8);
                API.ShowPopupPrompt(trg.Client, "OnPlayerFriskResponse", "Frisk Request", string.Format("{0} {1} wants to frisk you, do you accept?", p.Faction.Ranks[p.FactionRank].Title, p.Username.Roleplay()), "Accept", "Decline");
                p.PlayerInteractingWith   = trg;
                trg.PlayerInteractingWith = p;
                p.InEvent = PlayerEvent.AccessingInventory;
            }
        }