Jump to content
RAGE Multiplayer Community

C# client-side event problem


Mariusz
 Share

Recommended Posts

Hi.

I want to get something because I dont know have I set up everything right. I have to say I have no idea why it is not compiling. I feel stupid already (I spent few hours on it). I know how to do it in js client side, but no result in c# client side. What am I missing ? Can I get event based little bite of code that is working for c# client-side that I could experiment with ? Hopeless here. Thanks.

using System;
using RAGE;

namespace RageMpRoleplayClient
{
    public class MainClient
    {
		Events.OnPlayerJoin += OnPlayerJoin;
		public void OnPlayerJoin(RAGE.Elements.Player player)
		{
   			RAGE.Chat.Output($"Player {player.Name} has joined");
		}
	}
}

 

Link to comment
Share on other sites

Found working example.

using System;
using System.Collections.Generic;
using System.Text;
using RAGE;
using RAGE.Ui;


namespace RageMpRoleplayClient
{
    public class TickEvent:RAGE.Events.Script
    {
        public TickEvent()
        {
            RAGE.Events.Tick = Tick;
        }

        private void Tick(List<RAGE.Events.TickNametagData> nametags)
        {
            RAGE.Chat.Show(true);
            RAGE.Chat.Output("Working");
        }
    }
}

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...