Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Ped Shoots Me Before Start Of Code

Featured Replies

Hey! I'm new to coding and need some help on this one. I coded it for the bed to shoot me after the dialogue but it doesn't seem to work? Any ideas? Here's my code. 

 

 

Spoiler

  public override bool OnCalloutAccepted()
        {
            Game.SetRelationshipBetweenRelationshipGroups("Suspect", "PLAYER", Relationship.Hate);
            Functions.PlayScannerAudio("RESPOND_CODE_3");
            
            Suspect = new Ped(Spawnpoint, heading);
            Suspect.IsPersistent = true;
            Suspect.BlockPermanentEvents = true;
            Suspect.Inventory.GiveNewWeapon("WEAPON_PISTOL", -1, true);

            SuspectBlip = Suspect.AttachBlip();
            SuspectBlip.Color = System.Drawing.Color.DarkGreen;
            SuspectBlip.IsRouteEnabled = true;

            if (Suspect.IsMale)
                maleFemale = "dude";
            else
                maleFemale = "mam";

            counter = 0;


            return base.OnCalloutAccepted();
        }
        public override void Process()
        {
            base.Process();

            if (Game.LocalPlayer.Character.DistanceTo(Suspect) <= 10f)
            {
                Game.DisplayHelp("~w~Press ~r~'Y' ~w~to talk to the suspect", false);

                if (Game.IsKeyDown(System.Windows.Forms.Keys.Y))

                    counter++;
                {
                         }
            }

            if (counter == 1)

                Game.DisplaySubtitle("~b~Officer: ~w~Hey " + maleFemale + ", I got called for a welfare check is everything ok here?");

            if (counter == 2)

                Game.DisplaySubtitle("~b~Suspect: ~w~Get the fuck out of here you ain't supposed to be here.");

            if (counter == 3)

                Game.DisplaySubtitle("~b~Officer: ~w~You need to chill the fuck out  " + maleFemale + ", Where is the lady?");

            if (counter >= 4)

                Game.DisplaySubtitle("~b~Suspect: ~w~Find out yourself.");

            Suspect.Tasks.FightAgainst(Game.LocalPlayer.Character);

            if (Suspect != null && Suspect.IsValid() && (Suspect.IsDead || Suspect.IsCuffed))
            {
                End();
            }; }

 

I own a YouTube channel called Radcat367. Go check it out!

  • Management Team

The call to FightAgainst is not in any if statement, meaning it will run the first time Process is executed and then every subsequent tick. Try moving it together with the counter >= 4 check.

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

  • Author

Little bit confused mind dropping a example?

I own a YouTube channel called Radcat367. Go check it out!

  • Management Team
if (counter >= 4)
    Game.DisplaySubtitle("~b~Suspect: ~w~Find out yourself.");
Suspect.Tasks.FightAgainst(Game.LocalPlayer.Character); // This should also be in the if clause, otherwise it gets executed every tick.

 

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.