Sign in to follow this  
SammyD86

Server C# and Client JS

Recommended Posts

Hey i have a question.

Can i use the server on C#  and Clientside on JS  without a C# on Clientside?

I want to trigger a Clientevent from Server with

Serverside C#

      [RemoteEvent("MyEventName")]
        public void MyEventName(Client player, object[] arguments)
        {
          
            player.SendChatMessage($"heyho");
        }


    [Command("hello")]
    public void SayHi(Client player)
    {
        NAPI.ClientEvent.TriggerClientEvent(player, "TEST");  
    }

and

CLientside JS

mp.events.add('TEST',(test)=>{
  mp.events.callRemote("MyEventName","huhu");
});

 

can someone help me?

Share this post


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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.