[Plugin] SampSharp - Write gamemodes in .NET

Quote:
Originally Posted by Sasino97
Посмотреть сообщение
Hello, is it possible to export a SampSharp project as a filterscript/plugin?
It works as a Plugin (sampgdk) and you can use it along with an existing gamemode running.
Just note that in the gamemode if you return 0 (or 1 with OnPlayerCommandText/OnRconCommand) with a "callback" it won't be sent to the Plugin.
If you use the Streamer wrapper and the Streamer plugin at the same time, Streamer will work just fine.

Visual Studio and Xamarin Studio (Mono-Develop) scans the code and turns auto-complete into documentation. Just type "SampSharp" then after you type the "." it will display the libraries, for BasePlayer you will find that in "SampSharp.GameMode.World" if you type "." you will see other overrides you can use such as "Actor" "BaseVehicle" "GangZone", etc.


Helps with seeing what the "Event" overrides contain:
Reply

Quote:
Originally Posted by Sasino97
Посмотреть сообщение
Hello, is it possible to export a SampSharp project as a filterscript/plugin?

EDIT:

Also, why can't it find the GtaPlayer class?
This code won't compile:
Код:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using SampSharp.GameMode.World;

namespace Sasinosoft.Roleplay
{
    class Player : GtaPlayer
    {
        
    }
}
EDIT 2:
Solved
The class was "BasePlayer" not "GtaPlayer"...
Please can you update the API documentation and the tutorials, because some other newbies like me could get the same problems...
I think you are using the prerelease (which has BasePlayer) rather than the stable version (which I think is GtaPlayer)
Reply

Quote:
Originally Posted by Alcatrik
Посмотреть сообщение
I think you are using the prerelease (which has BasePlayer) rather than the stable version (which I think is GtaPlayer)
I have the most updated and it's BasePlayer.
Reply

Quote:
Originally Posted by NewbProgrammer
Посмотреть сообщение
I have the most updated and it's BasePlayer.
I think that's the prerelease in that case. I had to manually build 0.7 and drop the plugin in - if any of you have issues with it saying it's loaded but OnInitialized not actually being called or it doing anything, this may be your issue.

Also having just read a thread about a new command process that shaves a couple of milliseconds off processing time - if you are at the point where you need to worry about milliseconds then you have a lot more to gain by moving to something like S# where you can parallelize your processes.
Reply

Late to the party, but just confirming what Alcatrik said.

0.7 is quite an overhaul, which also contains a few renames, such as GtaPlayer > BasePlayer, GtaVehicle > BaseVehicle, etc. 0.7 is currently in alpha as it still needs more testing. When it's stable enough it will be fully released. When that time comes, I'll wipe the 0.6 documentation off of the wiki (I'll also be looking into versioning the docs to prevent confusion in the future)
Reply

Lol how stupid of me
Yes I'm using the 0.7 prerelease, but I was reading the 0.6 docs. Anyway your work is awesome, this is a great project, and I think I will make my next big gamemode fully in C# thanks to you. I love object oriented languages.
Reply

Great plugin, thanks.
Reply

Nice plugin!
Reply

Oh Nice!
Now i can write code in C#
Reply

Forgive me if I've missed this elsewhere.

Has anyone experienced any problems with the plugin failing to load? Are there any additional prerequisites other than the ones listed in the documentation (mono)?

I'm seeing the following error:



SA-MP doesn't output very detailed logs, so I'm a a bit of a loss.

I'm using the latest version of the SA-MP server, and have also tried using both the pre-release version of this plugin (0.7.6133.31753-alpha) and the stable version (0.6.2).
Reply

I think someone mentioned this to me, he's currently using an older verison. Could you try using version 0.7.6119.35177-alpha instead?

iirc it has something to do with loading some configuration for the debugger


(I really need to find some time to iron out these bugs)
Reply

Quote:
Originally Posted by amirm3hdi
Посмотреть сообщение
That language seems bad.
Are you serious? and you think pawno is better?
Reply

Quote:
Originally Posted by amirm3hdi
Посмотреть сообщение
That language seems bad.
You couldn't even begin to compare C# with PAWN.
Reply

Quote:
Originally Posted by amirm3hdi
Посмотреть сообщение
That language seems bad.
funny guy
Reply

Lovely work by you, I'll be using this in my upcoming summer project
Reply

I'm considering putting together a proposal for a community project for a SA-MP server with a gamemode coded in C# using vNext of this library (which supports .Net Core). Following the most up to date and best practices, we could put together a fairly decent project. Open source on GitHub, a decent branching strategy with pull requests and code reviews, following a decent agile methodology, fully integrated with a CI environment with automated deployments to a development and staging environment (and eventually production), good coding practices - SOLID, DRY, unit testing etc. and a decent testing strategy which requires a tester to sign off functionality before it's completed.

Just wondering before I present my idea if there are many experienced C# developers in this community that would be willing to get involved? (Preferably older than 15 )

We'd need some testers too!
Reply

Quote:
Originally Posted by Jay_
Посмотреть сообщение
I'm considering putting together a proposal for a community project for a SA-MP server with a gamemode coded in C# using vNext of this library (which supports .Net Core). Following the most up to date and best practices, we could put together a fairly decent project. Open source on GitHub, a decent branching strategy with pull requests and code reviews, following a decent agile methodology, fully integrated with a CI environment with automated deployments to a development and staging environment (and eventually production), good coding practices - SOLID, DRY, unit testing etc. and a decent testing strategy which requires a tester to sign off functionality before it's completed.

Just wondering before I present my idea if there are many experienced C# developers in this community that would be willing to get involved? (Preferably older than 15 )

We'd need some testers too!
Seems like a fantastic idea
Reply

Holy S***, by bad I meant, you could try Python or PHP.
Reply

I use C# a lot for programming in Unity 3D, but the way it is used in the examples, seems awful compared to other languages. like TypeScript, PHP or Python.
Reply

Quote:
Originally Posted by amirm3hdi
Посмотреть сообщение
I use C# a lot for programming in Unity 3D, but the way it is used in the examples, seems awful compared to other languages. like TypeScript, PHP or Python.
I want a list of the features TypeScript, PHP, and Python has that C# doesn't to support that asinine comment. I'll wait.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)