Jump to content

ERROR: PublicKeyToken=null -> [ServerEvent(Event.PlayerConnected)]


Recommended Posts

Posted

Hello!

Help me pls :)

I write next code on C#:

using GTANetworkAPI;

namespace Test_RP
{
    public class Class1 : Script
    {
        [ServerEvent(Event.ResourceStart)]
        public void OnResourceStart()
        {
            NAPI.Util.ConsoleOutput("Script work!");
        }

        [ServerEvent(Event.PlayerConnected)]
        public void OnPlayerConnected(Client client)
        {
            NAPI.Util.ConsoleOutput($"Player, {client.Name} connected!");
        }
    }
}

After connecting to the server, an error appears: System.TypeLoadException: "Could not load type 'GTANetworkAPI.Client' from assembly 'Bootstrapper, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null'."

 

If running server without method "OnPlayerConnected" everything is OK.

 

BUT, somewhere 1 hour ago, everything worked and I didn't change anything! =(

 

Thank you all!

Posted

Bootstrapper, Version=1.1.0.0

Either you changed this one or it didn't work before, as Client doesn't exist on 1.1 version...

 

 

 

  • Like 1
Posted

  

20 минут назад, Xabi сказал:

Bootstrapper, Version=1.1.0.0

Either you changed this one or it didn't work before, as Client doesn't exist on 1.1 version...

 

 

 

 

Xabi, Why is it written that the method contains Client?

screenshot: https://ibb.co/3NSHTNV

What should I do?

 

 

Posted
14 минуты назад, Floriian сказал:

public void OnPlayerConnected(Player player)

 

Thanks you! WORK!

  • Xabi locked this topic
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...