SA-MP and C#
#1

Hello guys,
i have a little question:

Is there any possibility to extend sa-mp with C#, or
to write gamemodes with it? There must be a way to let the server communicate with c#-compiled
files, or not?

It would be great, if you can extend sa-mp with C# or if you had a library which contains all
script functions that you can use in pawn scripts.
In any way, you should can load the assembly and get the entry point (the gamemode-initialisation)
and then run the rest of it.

is this possible? i mean, itґs difficult to use native c++ and C#, of course, but it must work anyhow.
i mean, sa-mp is good enough to do something like this.

C# is much easier than c++. So many newbies can extend it faster as with c++,
and the possibilities if you can use C# to extend it will be much bigger, as well you can use MySQL databases,
network comunication and so on, all based on .Net Framework.


So say it: Is it possible? I hope you say yes. If it is, i will help on it, if some people develop it (only C# programming) as much as i can.

Greetings
TBR
Reply
#2

Nope, as far as I know you can't write .dll plugins for SA:MP via C#

It's difficult in the beginning but once you got the basic you'll play with it.
Reply
#3

Thatґs worse ...
You can use C++ dllґs with .Net. If you can write a library or program, which
converts the data from C# into C++ or reverse, it may work to make a gamemode on this way.

anyhow there must be a way to do it. iґm sure it can work.
If i could write c++ it would be much easier to try it...
Reply
#4

Server owners that run their servers on linux would have to use mono in order to use plugins in C#(or any .net language), which they wouldn't have to do with C++, cause C++ compiles natively on both linux, and windows, which is less of a hassle overall.
Reply
#5

Maybe there is a way.
The only question is, if itґs possible with making a plugin for sa-mp.

I found this information on the web. So C++ and C# could communicate very easy.
http://stackoverflow.com/questions/5...-c-application

So, if you send strings in form as a command (like "saveXML("user1", "password1")) you can do it.
All you need is the function to invoke methods.


I think itґs worth a try. And i will try it

EDIT: Here is the best information off all. So you wouldnґt need any named pipe. The solution is: Bridges.
But this is something for the developer team ... (http://www.codeproject.com/KB/dotnet/bridge.aspx)
Reply
#6

You can use C# (or any other language) if you convert the SDK.
Reply
#7

I believe dugi or Popz attempted to make a C# game-mode a while ago.
Reply
#8

That sounds interesting
I donґt want to script a gamemode with pawn. If itґs possible with C#
i will do it.
Reply
#9

Quote:
Originally Posted by TheBlackRazer
Посмотреть сообщение
That sounds interesting
I donґt want to script a gamemode with pawn. If itґs possible with C#
i will do it.
Yea I did once using sockets. It works quite well, but my socket was being laggy for some reason so I gave up. It's possible though.


Popz
Reply
#10

It's possible using libmono: http://www.mono-project.com/Embedding_Mono
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)