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.

Common does not exist in current context.

Featured Replies

So, I'm trying to use the Vector3Extension API but when I try to assign it to spawn within a min and a max it says that Common does not exist in its current context (near the bottom of the code). How do I fix this? Thank you!

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Rage;
using Rage.Native;
using LSPD_First_Response.Mod.API;
using LSPD_First_Response.Mod.Callouts;
using LSPD_First_Response.Engine.Scripting.Entities;

namespace ToastyCallouts.Callouts
{
    public static class Vector3Extension
    {
        public static Vector3 Around(this Vector3 start, float radius)
        {
            // Random direction.
            Vector3 direction = Vector3Extension.RandomXY();
            Vector3 around = start + (direction * radius);
            return around;
        }

        public static float DistanceTo(this Vector3 start, Vector3 end)
        {
            return (end - start).Length();
        }

        public static Vector3 RandomXY()
        {
            Random random = new Random(Environment.TickCount);

            Vector3 vector3 = new Vector3();
            vector3.X = (float)(random.NextDouble() - 0.5);
            vector3.Y = (float)(random.NextDouble() - 0.5);
            vector3.Z = 0.0f;
            vector3.Normalize();
            return vector3;
        }
    }

    [CalloutInfo("GrandTheftAuto", CalloutProbability.VeryHigh)]

    public class GrandTheftAuto : Callout
    {
        public EVehicleBlockingTrafficState state;
        public LHandle Pursuit;
        public Vector3 SpawnPoint;
        public Blip myBlip;
        public Ped mySuspect;
        public Vehicle myVehicle;
        static Vector3 NewSpawn;

        static Vector3
            GetRandomSpawnPoint(int pMin, int pMax, Vector3 target)
        {
            return
                World.GetNextPositionOnStreet(target.Around(Common.gRandom.Next(pMin, pMax)));
        }

 

  • Author
19 minutes ago, khorio said:

is Common placed in the same directory? and what type of class did you assign to Common?

In the same directory as.. ? It's in the Callouts class.

One second I may have it..

Thanks for your help btw

Edited by ToastinYou

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.