SA-MP Forums Archive
[Plugin] [DEV] .NET for SA:MP (VB.NET, C#) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Plugin Development (https://sampforum.blast.hk/forumdisplay.php?fid=18)
+--- Thread: [Plugin] [DEV] .NET for SA:MP (VB.NET, C#) (/showthread.php?tid=204969)

Pages: 1 2 3 4


Project Dead - jaymac407 - 30.12.2010

Project Dead


Re: [DEV] .NET for SA:MP - Maikel - 30.12.2010

Hell yea, this is what I were waiting for! Great! Sadly enough I must wait some time longer.


Re: [DEV] .NET for SA:MP (VB.NET, C#) - [L3th4l] - 30.12.2010

How's the speeds compared to pawno?

Great job btw!


Re: [DEV] .NET for SA:MP (VB.NET, C#) - jaymac407 - 30.12.2010

Quote:
Originally Posted by [L3th4l]
Посмотреть сообщение
How's the speeds compared to pawno?

Great job btw!
I haven't run any formal tests, but I'm assuming it will be a tad slower.
Although it does use JIT to compile the .NET code, I'm guessing the .NET/Mono runtime will be lagging it somewhat.
I'll try and post some basic tests later.


Re: [DEV] .NET for SA:MP (VB.NET, C#) - Souvlaki - 30.12.2010

This is sick :P. Can't wait for the ALPHA release.


Re: [DEV] .NET for SA:MP (VB.NET, C#) - Yagoda - 31.12.2010

This is very good !
The example in for VB.NET right?
Can you please make an example for C# because i know C# and i want to see how its going to work.



Re: [DEV] .NET for SA:MP (VB.NET, C#) - Bumbis - 31.12.2010

Excellent and perfect. I like C# it will be interesting to try this. Thanks!!


Re: [DEV] .NET for SA:MP (VB.NET, C#) - Aleks7 - 31.12.2010

I can't wait


Re: [DEV] .NET for SA:MP (VB.NET, C#) - Hiddos - 31.12.2010

This might be a nice opportunity for me to learn more about other programming languages, I'm sure to try this out!


Re: [DEV] .NET for SA:MP (VB.NET, C#) - JernejL - 31.12.2010

PLEASE at least don't dumb down users with vb.net's brainfuck syntax and make examples in c#-only.


Re: [DEV] .NET for SA:MP (VB.NET, C#) - sooky - 31.12.2010

Yes, I don't know what's "basic" about Visual Basic. It manages to confuse me so bad, I don't even want to know it. C#, in the other hand, is much easier to pick up in my opinion.


Re: [DEV] .NET for SA:MP (VB.NET, C#) - jaymac407 - 31.12.2010

The exact same example, in C#:
Code:
public class Script
{
	public static void OnGameModeInit()
	{
		SAMP.Util.Log("Creating Objects...");
		SAMP.World.CreateObject(19286, 16.20947266, 261.96289062, 12.74184227, 0.0, 0.0, 0.0);
		SAMP.Util.Log("Creating Classes...");
		SAMP.Server.AddPlayerClass(26, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0,
		0);
		SAMP.Server.AddPlayerClass(26, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0,
		0);
		SAMP.Util.Log("Creating Vehicles...");
		SAMP.Natives.CreateVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60);
		SAMP.Util.Log(".NET Gamemode Loaded!");
	}
	public static void OnPlayerConnect(int playerID)
	{
		SAMP.Player player = SAMP.Player.getPlayer(playerID);
		player.SetPos(144, 265, 11);
		player.SetCameraLookAt(14, 265, 11);
		player.SetCameraPos(158.0326, 24.4021, 33.2211);
		player.SendMessage(255, "{FF0000} Welcome to the server!");
		player.variables.Add("Money", 5000);
	}
	public static void OnPlayerDisconnect(int playerID)
	{
		return;
	}
	public static void OnPlayerDeath(int playerID, int killerID, int reason)
	{
		return;
	}
	public static int OnPlayerCommandText(int playerID, string command)
	{
		SAMP.Player player = SAMP.Player.getPlayer(playerID);
		command = command.Remove(0, 1);
		//remove /
		string[] SeperatedCommand = command.Split(" ");
		//split by space
		if (SeperatedCommand[0] == "help") {
			player.SendMessage(255, "{FF0000} No help available.");
			return 1;
		} else if (SeperatedCommand[0] == "money") {
			player.SendMessage(255, "{FF0000} Money: $" + player.variables("Money"));
			return 1;
		} else if (SeperatedCommand[0] == "dialog") {
			SAMP.Dialog myDialog = new SAMP.Dialog();
			myDialog.playerID = player.ID;
			myDialog.caption = "Cookies";
			myDialog.info = "Do you like cookies?";
			myDialog.style = 0;
			myDialog.button1 = "Yes";
			myDialog.button2 = "No";
			myDialog.response += Script.HandleTech;
			myDialog.show();
			return 1;
		} else if (SeperatedCommand[0] == "o") {
			SAMP.Natives.SendClientMessageToAll(255, "{C0C0C0} [OOC] " + player.Name + ": " + command.Remove(0, 2));
			return 1;
		} else {
			return 0;
		}
	}
	public static void HandleTech(object sender, bool response, int listitem, string textinput)
	{
		SAMP.Player player = SAMP.Player.getPlayer(((SAMP.Dialog)sender).playerID);
		if (response) {
			player.SendMessage(255, "{C0C0C0} [COOKIES] Me too!");
		} else {
			player.SendMessage(255, "{C0C0C0} [COOKIES] Really? Sucks.");
		}
	}
	public static void OnPlayerRequestClass(int playerID, int classID)
	{
		SAMP.Player player = SAMP.Player.getPlayer(playerID);
		switch (classID) {
			case 0:
				player.SetPos(14, 2665, 11);
				player.SetCameraLookAt(144, 25, 11);
				player.SetCameraPos(158.0326, 24.4021, 33.2211);
				break;
			case 1:
				player.SetPos(28, 26, 11);
				player.SetCameraPos(21.3079, 27.7612, 34.8534);
				player.SetCameraLookAt(28, 26, 11);
				break;
		}
	}
	public static int OnPlayerRequestSpawn(int playerID)
	{
		SAMP.Player player = SAMP.Player.getPlayer(playerID);
		return 1;
	}
	public static void OnPlayerSpawn(int playerID)
	{
		SAMP.Player player = SAMP.Player.getPlayer(playerID);
		SAMP.Util.Log("Player '" + player.Name + "' spawned.");
	}
}



Re: [DEV] .NET for SA:MP (VB.NET, C#) - [Ask]Terminator - 31.12.2010

niceeeee


Re: [DEV] .NET for SA:MP (VB.NET, C#) - hencz - 31.12.2010

This is the coolest thing in sa-mp I've ever seen


Re: [DEV] .NET for SA:MP (VB.NET, C#) - jaymac407 - 31.12.2010

I'm aiming for a 100% class based system. Basically, you shouldn't HAVE to use any of the natives at all, but you can if you want. e.g, see:


P.S. Happy new year, everyone!


Re: [DEV] .NET for SA:MP (VB.NET, C#) - frannic - 31.12.2010

Quote:
Originally Posted by JernejL
View Post
PLEASE at least don't dumb down users with vb.net's brainfuck syntax and make examples in c#-only.
What the hell is wrong with vb?
If you want to use C# then do so.
Everybody picks the language he or she knows best.
That's the beauty of .NET


Re: [DEV] .NET for SA:MP (VB.NET, C#) - Momo5000 - 01.01.2011

Jaymac i would like to help you script that net plugin. (if u want)

Im good in VB (2 year's of programming experience including C/Pawn)

So if u need some help let it know me :]


Re: [DEV] .NET for SA:MP (VB.NET, C#) - psoftware - 01.01.2011

I'm very happy. Now it will be easy for me with vb.net!!!!


Re: [DEV] .NET for SA:MP (VB.NET, C#) - Maikel - 01.01.2011

Quote:
Originally Posted by JernejL
View Post
PLEASE at least don't dumb down users with vb.net's brainfuck syntax and make examples in c#-only.
The syntax off VB.NET is nothing wrong, it's handy and clear.


Re: [DEV] .NET for SA:MP (VB.NET, C#) - VIRUXE - 01.01.2011

Can't wait to try it out.