public SaltyButton(SaltyMenu parent, string texture, float x, float y, float width, float height, float rotation, Action action)
 {
     Parent   = parent;
     Position = new Vector2(x, y);
     Size     = new Vector2(width, height);
     Texture  = texture;
     Rotation = rotation;
     Action   = action;
 }
 public SaltyButton(SaltyMenu parent, string caption, float x, float y, float width, float height, System.Drawing.Color colour, Action action)
 {
     Parent     = parent;
     Position   = new Vector2(x, y);
     Size       = new Vector2(width, height);
     Colour     = colour;
     ButtonText = new SaltyText(x, y - (height / 2), 0, 0, 0.2f, caption, 255, 255, 255, 255, false, true, 0, true);
     Action     = action;
 }
Esempio n. 3
0
        public override void Controls()
        {
            if (Team == 0)
            {
                return;
            }

            if (IsControlJustPressed(0, 23))
            {
                DropWeapon();
            }

            if (IsControlJustPressed(0, 244))      // M 244
            {
                if (Team == (int)Teams.Traitors)
                {
                    TTTMenu = TTTMenu == null ? new TTT_TraitorMenu(this, 0.5f, 0.8f, 0.3f, 0.15f, System.Drawing.Color.FromArgb(44, 62, 80), CloseTTTMenu, CanBuy) : null;
                }
                if (Team == (int)Teams.Detectives)
                {
                    TTTMenu = TTTMenu == null ? new TTT_DetectiveMenu(this, 0.5f, 0.8f, 0.3f, 0.15f, System.Drawing.Color.FromArgb(44, 62, 80), CloseTTTMenu, CanBuy) : null;
                }
            }

            if (IsControlJustPressed(0, 243))   // Tilde
            {
                if (CanDisguise)
                {
                    TriggerServerEvent("salty::netUpdatePlayerBool", "disguised");
                    isDisguised = !isDisguised;
                }
            }

            if (IsControlJustPressed(0, 212))     // Up arrow
            {
                if (CanTeleport)
                {
                    TeleportToSaved(3 * 1000);
                }
            }

            if (IsControlJustPressed(0, 121))   // Insert
            {
                if (CanTeleport)
                {
                    WriteChat("TTT", "Teleport position set.", 0, 0, 200);
                    SavedTeleport = Game.PlayerPed.Position;
                }
            }

            if (IsControlJustPressed(0, 38))      // E dead body
            {
                foreach (var body in DeadBodies)
                {
                    Vector3 myPos = Game.PlayerPed.Position;
                    float   dist  = GetDistanceBetweenCoords(myPos.X, myPos.Y, myPos.Z, body.Value.Position.X, body.Value.Position.Y, body.Value.Position.Z, true);
                    if (dist > 2)
                    {
                        continue;
                    }
                    if (body.Value.isDiscovered)
                    {
                        if (Team == (int)Teams.Detectives)
                        {
                            WriteChat("TTT", "Scanning DNA", 0, 0, 230);
                            GetHUD().DetectiveTracing = body.Value.KillerPed;
                        }
                    }
                    else
                    {
                        body.Value.View();
                        TriggerServerEvent("salty::netBodyDiscovered", body.Key);
                    }
                }
            }

            base.Controls();
        }
Esempio n. 4
0
 public void CloseTTTMenu()
 {
     TTTMenu = null;
 }