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.

Native Checkpoint question

Featured Replies

Callout cs:
------------
private Vector3 CheckPointV3;
public static int CheckPointHandle { get; private set; }


CheckPointHandle = Common.CreateCheckpoint(45, CheckPointV3, CheckPointV3, 5f, Color.LightBlue);

Common.cs:
------------
public static int Handle { get; private set; }


public static int CreateCheckpoint(int CheckpointType ,Vector3 position, Vector3 directTo, float radius, Color color)
        {
            Handle = Rage.Native.NativeFunction.Natives.CREATE_CHECKPOINT(            
               (int)CheckpointType,
               position.X,
               position.Y,
               position.Z,
               directTo.X,
               directTo.Y,
               directTo.Z,
               radius,
               color.R,
               color.G,
               color.B,
               color.A,
               0); 
            return Handle;
        }
[26/05/2016 04:42:38.068] LSPD First Response: 
[26/05/2016 04:42:38.068] LSPD First Response: ==============================
[26/05/2016 04:42:38.068] LSPD First Response: UNHANDLED EXCEPTION DURING GAME FIBER TICK
[26/05/2016 04:42:38.068] LSPD First Response: ------------------------------
[26/05/2016 04:42:38.069] LSPD First Response: Origin: Game fiber "<UNNAMED THREAD>".
[26/05/2016 04:42:38.069] LSPD First Response: ------------------------------
[26/05/2016 04:42:38.069] LSPD First Response: Exception type: System.Reflection.AmbiguousMatchException
[26/05/2016 04:42:38.069] LSPD First Response: Exception message: Ambiguous match found.
[26/05/2016 04:42:38.070] LSPD First Response: ------------------------------
[26/05/2016 04:42:38.070] LSPD First Response: Inner exceptions:
[26/05/2016 04:42:38.070] LSPD First Response: ------------------------------
[26/05/2016 04:42:38.070] LSPD First Response: Stack trace:
[26/05/2016 04:42:38.071] LSPD First Response: at System.DefaultBinder.SelectMethod(BindingFlags bindingAttr, MethodBase[] match, Type[] types, ParameterModifier[] modifiers)
[26/05/2016 04:42:38.071] at System.RuntimeType.GetMethodImpl(String name, BindingFlags bindingAttr, Binder binder, CallingConventions callConv, Type[] types, ParameterModifier[] modifiers)
[26/05/2016 04:42:38.071] at System.Type.GetMethod(String name, BindingFlags bindingAttr, Binder binder, Type[] types, ParameterModifier[] modifiers)
[26/05/2016 04:42:38.071] at Rage.Native.DynamicNativeFunction.TryInvokeMember(InvokeMemberBinder binder, Object[] args, Object& result)
[26/05/2016 04:42:38.071] at CallSite.Target(Closure , CallSite , Object , Int32 , Single , Single , Single , Single , Single , Single , Single , Byte , Byte , Byte , Byte , Int32 )
[26/05/2016 04:42:38.072] at CallSite.Target(Closure , CallSite , Object , Int32 , Single , Single , Single , Single , Single , Single , Single , Byte , Byte , Byte , Byte , Int32 )
[26/05/2016 04:42:38.072] at LSPDFR_Khallouts.Callouts.Common.CreateCheckpoint(Int32 CheckpointType, Vector3 position, Vector3 directTo, Single radius, Color color) in E:\_GTADEV\LSPDFR Khallouts\LSPDFR Khallouts\Callouts\Common.cs:line 288
[26/05/2016 04:42:38.072] at LSPDFR_Khallouts.Callouts.Terrorist__Activity.<runoperation>b__76_0() in E:\_GTADEV\LSPDFR Khallouts\LSPDFR Khallouts\Callouts\Terrorist_Activity.cs:line 384
[26/05/2016 04:42:38.072] at Rage.GameFiber.Main()
[26/05/2016 04:42:38.073] LSPD First Response: ==============================
[26/05/2016 04:42:38.073] LSPD First Response: 

 

Is there something inherently wrong with this call?

NativeFunction.Natives.CREATE_CHECKPOINT

You need to use pascal case names when calling native functions using the dynamic "Natives" property.

Rage.Native.NativeFunction.Natives.CreateCheckpoint
  • Author
2 hours ago, ainesophaur said:

NativeFunction.Natives.CREATE_CHECKPOINT

You need to use pascal case names when calling native functions using the dynamic "Natives" property.


Rage.Native.NativeFunction.Natives.CreateCheckpoint

Same error sadly

 

You also need to set the return type if you want to get the handler. Without setting a return type of <unit> the native is going to return as a void function

NativeFunction.Natives.CreateCheckpoint<uint>(0, position.X, position.Y, position.Z, 0f, 0f, 0f, 5f, 255, 0, 0, 1000, 0);

Here's a constructor of my Checkpoint class used in Transportation:

public Checkpoint(Vector3 Position, float Radius, System.Drawing.Color Color)
        {
            _fRadius = Radius;
            _vPosition = Position;

            handle = Rage.Native.NativeFunction.CallByName<uint>(
                        "CREATE_CHECKPOINT", 5, //5 is a type ID, check natives documentation @ http://www.dev-c.com/nativedb/
                        Position.X, Position.Y, Position.Z - 7.0f,
                        Position.X, Position.Y, Position.Z,
                        Radius, (int)Color.R, (int)Color.G, (int)Color.B,
                        100, 0);

            _bExists = true;
        }

 

 

5 hours ago, ainesophaur said:

NativeFunction.Natives.CREATE_CHECKPOINT

You need to use pascal case names when calling native functions using the dynamic "Natives" property.


Rage.Native.NativeFunction.Natives.CreateCheckpoint

No, you don't have to use pascal case, if the provided name contains an underscore it will be treated as a complete native name and it will ignore casing. The only thing needed is to set the return type.
In the case of the OP the return type as uint won't work because his Handle property is an int, he either changes the return type to int or the Handle to uint.

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...

Similar Content

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.