NanoBob

Slipe - C# for MTA

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`

Share this post


Link to post

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()

 

Share this post


Link to post

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.