Jump to content

Slipe - C# for MTA


NanoBob

Recommended Posts

A new version of the core has been released!

Async RPCs
A new feature called "Async RPCs" has been implemented. This allows you to return a value over an RPC, and use `async / await` in order to use it, so you will no longer need to bounce RPCs back and forth to get a value from the server to the client or vice versa.

Example:
Server:

RpcManager.Instance.RegisterAsyncRPC<SingleCastRpc<string>, EmptyRpc>("Async.RequestMapName", (player, request) =>
{
    return new SingleCastRpc<string>(GameServer.Announcement.MapName);
});



Client:

Task.Run(async () =>
{
    string name = (await RpcManager.Instance.TriggerAsyncRpc<SingleCastRpc<string>>("Async.RequestMapName", new EmptyRpc())).Value;
    ChatBox.WriteLine($"Map name: {name}");
});


 

Updating
In order to update an existing project use `slipe update-core`

  • Like 1
Link to comment

your create  new MTA with all the codes , thank you


 

using System;
namespace Vehicle {
        public void createVehicle(VehicleModel model, Vector3 position)
    
        }
        createVehicle(311,111,222,12);
}


To Lua

local system = {}
system.Vehicle=function()
createVehicle(311,111,222,12);
end
system.Vehicle()

 

Link to comment
  • 9 months later...
  • 11 months later...

Fascinating approach! Converting C# to Lua is a genius idea and craftsmanship. Looking forward to more. I wonder, which language is easier to teach to newcomers... C# or Lua? Development is a lot about models and converting those to code... A true OOP language like C# is ideal for that. Thank you!

Link to comment

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...