[C#] MonoV2 Commands

Hey, how to use Commands with MonoV2, im writing this its not working

using System;
using System.Collections.Generic;
using CitizenFX.Core;
using CitizenFX.FiveM;
using CitizenFX.FiveM.Native;

namespace Basics.Client
    public class Commands : BaseScript
        public Commands()
            Natives.RegisterCommand("car", new Action<int, List<object>, string>(async (source, args, raw) =>
                await Delay(1);
            }), false);

This is the error:

Events no longer pass List<object> objects, they are now pure arrays object[] .

I assume that is the problem.

I have not yet worked with v2, but I read about it just yesterday. https://github.com/thorium-cfx/mono_v2_get_started/blob/main/Examples.md#extra-ways-to-unregister

1 Like

Thank you, it works now