Jump to content
RAGE Multiplayer Community

System.Reflection.TargetParameterCountException


Recommended Posts

Hello,

 

I started to make a carsystem on my server but the PlayerEnterVehicle Event does not work. I Created the Event as you can see below. Sometimes I get an error and sometimes nothing happens.

Thats the error:

System.Reflection.TargetParameterCountException
  HResult=0x8002000E
  Message=Parameter count mismatch.
  Source=System.Private.CoreLib
  StackTrace:
   at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at GTANetworkInternals.EventHandler.Parse(Event _event, Object[] arguments)

 

Thats my event method:

using System;
using System.Collections.Generic;
using System.Text;
using GTANetworkAPI;

namespace GermanSelfmadeReallife.Events
{
    class OnPlayerEnterVehicleEvent : Script
    {
        [ServerEvent(Event.PlayerEnterVehicle)]
        public void OnPlayerEnterVehicle(Client player, Vehicle vehicle, sbyte seatID)
        {
            NAPI.Util.ConsoleOutput(player.Name.ToString());
        }
    }
}

 

The parameters are correct at least according to the doku.

https://wiki.gtanet.work/index.php?title=OnPlayerEnterVehicle

 

Can anyone help me with this?

Edited by Smile325
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...