Very nice work done here ! Was looking for this !
Trying to figure out how to use the wrapper.
Your example works fine on my side. Iād like now to create a script wich registers a server event wich then shows a notification when called by another script.
I canā't do it like that, right ?
RegisterServerEvent("CSharpEventTest2");
AddEventHandler("CSharpEventTest2", new Action<string>((message) =>
{
string output = "Blablabla.";
Screen.ShowNotification(output);
}));
TriggerEvent("CSharpEventTest2", "Example Argument");
What should I do ?
Thanks
ShowNotification is a client script function, you need to register a client event on the client, add the handler on the client, and you could then call TriggerClientEvent in the wrapper.
Iāll look into it. Itās my first time dealing with server/client interactions. Thank you !
Hi,
As thereās no any guide on how to work on server C# script, I tried to use it with FXServer but I get an error on the clr.System.Reflection on the server.lua (calling a nil value).
Any idea ?
Thanks
itās the same as the client, why does there need to be a guide?
I guess Iām just lost. How do you register a Server event then?
Hey !
Since the latest update of server (FXServer). Can i use the Server Wrapper or the FXServer is the only solution to code the server in c# ?
Thanks.
FXServer comes with official support for C# server scripts, the wrapper was only intended to be a temporary solution for CitizenMP for those interested in using C# for things you couldnāt do using Lua (at least not easily).
Ok thanks, but how can i import asselbly like this: EmbeddedAssembly.Load("ServerSide.MySql.Data.dll", "MySql.Data.dll");
In the new FXServer ?
@CoMaNdO Idea ?