Re: SampSharp - Write gamemodes in .NET - NewbProgrammer - 09.10.2016
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:
Re: SampSharp - Write gamemodes in .NET -
Alcatrik - 09.10.2016
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)
Re: SampSharp - Write gamemodes in .NET - NewbProgrammer - 09.10.2016
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.
Re: SampSharp - Write gamemodes in .NET -
Alcatrik - 11.10.2016
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.
Re: SampSharp - Write gamemodes in .NET -
ikkentim - 12.10.2016
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)
Re: SampSharp - Write gamemodes in .NET -
Sasino97 - 13.10.2016
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.
Re: SampSharp - Write gamemodes in .NET -
LifeIsGood - 24.11.2016
Great plugin, thanks.
Re: SampSharp - Write gamemodes in .NET -
Kalashnecov - 03.01.2017
Nice plugin!
Re: SampSharp - Write gamemodes in .NET -
K0P - 07.01.2017
Oh Nice!
Now i can write code in C#
Re: SampSharp - Write gamemodes in .NET -
Jay_ - 09.01.2017
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).
Re: SampSharp - Write gamemodes in .NET -
ikkentim - 09.01.2017
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)
Re: SampSharp - Write gamemodes in .NET -
MrViolence101 - 17.04.2017
Quote:
Originally Posted by amirm3hdi
That language seems bad.
|
Are you serious? and you think pawno is better?
Re: SampSharp - Write gamemodes in .NET -
Jay_ - 18.04.2017
Quote:
Originally Posted by amirm3hdi
That language seems bad.
|
You couldn't even begin to compare C# with PAWN.
Re: SampSharp - Write gamemodes in .NET -
WooTFTW - 19.04.2017
Quote:
Originally Posted by amirm3hdi
That language seems bad.
|
funny guy
Re: SampSharp - Write gamemodes in .NET -
Battlezone - 19.04.2017
Lovely work by you, I'll be using this in my upcoming summer project
Re: SampSharp - Write gamemodes in .NET -
Jay_ - 21.04.2017
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!
Re: SampSharp - Write gamemodes in .NET -
MrViolence101 - 21.04.2017
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
Re: SampSharp - Write gamemodes in .NET -
amirm3hdi - 21.04.2017
Holy S***, by bad I meant, you could try Python or PHP.
Re: SampSharp - Write gamemodes in .NET -
amirm3hdi - 21.04.2017
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.
Re: SampSharp - Write gamemodes in .NET -
AwareWolf - 22.04.2017
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.