What is Rage Multiplayer?

Rage Multiplayer is a multiplayer client for Grand Theft Auto V. Rage multiplayer uses various native functions to create a seamless multiplayer experience for Grand Theft Auto V. Although it is not endorsed by Rockstar games in any way, you still must buy the game in order to play Rage Multiplayer.


Getting Started

To setup a project visit the Rage Wiki and setup for C#. These tutorials will be primarily focusing on the C# aspect of the server. You can visit the wiki here.


Programming

In the last post we learned about variables for GetData, SetData, and HasData.
Server events for Rage.Mp are basically constantly looping to check if a player achieves a certain action.

For instance here are a few of the events we can call:

  • OnChatMessage
  • OnPlayerConnected
  • OnPlayerDamage
  • OnPlayerDeath
  • OnPlayerSpawn
  • and plenty more...

Each of these events have very specific attributes that need to be executed along with them.
For instance if we look at the OnPlayerSpawn event you will see that it requires the attribute of client.

So how do we use these events? Well we create a class file with the script class inheritance attached to it.

We'll be using OnPlayerSpawn for this part of the script.

public class MyCustomResource : Script
{
    [ServerEvent(Event.PlayerSpawn)]
    public void EventOnPlayerSpawn(Client client) 
    {
        // Logic goes here...
    }
}

So what can we do with the PlayerSpawn event. Well we can create a greeter and give them full armor when they spawn! We can even teleport them to specific locations if we want to.

Our logic for setting armor is very straight forward.

client.Armor = 100;

Our logic to greet them is a little more complicated. We need to make sure that they only receive the message the first time they join the server. We can use those data variables from the previous post to help us with that.

if (!client.HasData("Greeted"))
{
     client.SetData("Greeted", true);
     client.SendChatMessage($"Hello {client.Name} welcome to the server!");
}

The basic idea is... when the player joins the server and they don't have the 'Greeted' variable we can assign it as a way to know if they've already been greeted. We can then send the message and then the next time they respawn from death or reconnect to the server it will either re-greet them or it won't greet them at all!

Maybe we should send the client to the hospital when they join the server too! We can do that by setting the client's position.

client.Position = new Vector3(360, -585, 28);

Working with Server Events, Commands, and Data is extremely easy to do. It's making the functioning product that is the difficult part. Stay tuned for the next post!