[Plugin] [DEV] .NET for SA:MP (VB.NET, C#)
#1

Project Dead
Reply
#2

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

How's the speeds compared to pawno?

Great job btw!
Reply
#4

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.
Reply
#5

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

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.
Reply
#7

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

I can't wait
Reply
#9

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

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

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.
Reply
#12

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.");
	}
}
Reply
#13

niceeeee
Reply
#14

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

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!
Reply
#16

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
Reply
#17

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 :]
Reply
#18

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

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.
Reply
#20

Can't wait to try it out.
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)