Any tutorial how to compile this plugin for Linux?
You can add FCNPC to this? I can use EntityFramework? (Migrations, Codefirst etc.) Thanks for answers! |
error CS1729: 'SampSharp.GameMode.World.GtaPlayer' does not contain a constructor that takes 0 arguments |
public class Player : GtaPlayer { public Player(int id) : base(id) { } }
tmpobjid = CreateDynamicObject(19475,1705.361,-682.467,1008.911,0.000,0.000,0.000,-1,-1,-1,300.000,300.000); SetDynamicObjectMaterialText(tmpobjid, 0, "WC", 140, "Ariel", 200, 1, 0xFFFFFFFF, 0xFF000000, 1);
tmpobjid = new DynamicObject(19475, new Vector3(1705.361f, -682.467f, 1008.911f), new Vector3(0.000f, 0.000f, 0.000f), -1, -1, null, 300.000f, 300.000f); tmpobjid.SetMaterialText(0, "WC", ObjectMaterialSize.X512X512, "Ariel", 200, true, Color.FromString("0xFFFFFFFF", ColorFormat.ARGB), Color.FromString("0xFF000000", ColorFormat.ARGB), ObjectMaterialTextAlign.Center);
using(ISession session = DbSession.OpenSession()) { session.Save(new PlayerM { Nick = "Test", Password = "Test123" }); var players = session.Query<PlayerM>(); foreach(var player in players) { Console.WriteLine(player.Nick); Console.WriteLine(player.Password); } }
Okay. I try use NHibernate
GameMode.cs Код:
using(ISession session = DbSession.OpenSession()) { session.Save(new PlayerM { Nick = "Test", Password = "Test123" }); var players = session.Query<PlayerM>(); foreach(var player in players) { Console.WriteLine(player.Nick); Console.WriteLine(player.Password); } } http://pastebin.com/ifVXPHjK DbMappings.cs http://pastebin.com/Sngj3HpR After run server... http://pastebin.com/EDKFeDC5 But connection string is ok. I get him from Visual Studio (I have plugin to use MySQL in Server Explorer) |
Hello again. I've created converter to convert my mapping from pawno streamer syntax (I'm using texture studio to create and export mapping) to sampsharp streamer, and got some kind of bug: colors here (at sampsharp server with converted mapping) somehow looks differently or disappear Oo. Am I doing something wrong again?
Example: input: Код:
tmpobjid = CreateDynamicObject(19475,1705.361,-682.467,1008.911,0.000,0.000,0.000,-1,-1,-1,300.000,300.000); SetDynamicObjectMaterialText(tmpobjid, 0, "WC", 140, "Ariel", 200, 1, 0xFFFFFFFF, 0xFF000000, 1); Код:
tmpobjid = new DynamicObject(19475, new Vector3(1705.361f, -682.467f, 1008.911f), new Vector3(0.000f, 0.000f, 0.000f), -1, -1, null, 300.000f, 300.000f); tmpobjid.SetMaterialText(0, "WC", ObjectMaterialSize.X512X512, "Ariel", 200, true, Color.FromString("0xFFFFFFFF", ColorFormat.ARGB), Color.FromString("0xFF000000", ColorFormat.ARGB), ObjectMaterialTextAlign.Center); 1st and 3rd screens - how it should be, 2nd and 4th - how it looks like @ sampsharp server |
StreamerNative.SetDynamicObjectMaterialText(tmpobjid.Id, 0, "WC", ObjectMaterialSize.X512X512, "Arial", 200, true, Convert.ToInt32("0xFFFFFFFF", 16), Convert.ToInt32("0xFF000000", 16), ObjectMaterialTextAlign.Center);
tmpobjid.SetMaterialText(0, "WC", ObjectMaterialSize.X512X512, "Ariel", 200, true, Color.FromInteger(Convert.ToInt32("0xFFFFFFFF", 16), ColorFormat.ARGB), Color.FromInteger(Convert.ToInt32("0xFF000000", 16), ColorFormat.ARGB), ObjectMaterialTextAlign.Center);
Why won't you ****** your error before posting it here? It would take way less time than asking here. "Failed to find or load the registered .Net Framework Data Provider 'MySql.Data.MySqlClient'." says it all. Click me
|
I'm not sure how to convert to int properly, since (int)0xFF000000 won't work, but this works well:
Код:
StreamerNative.SetDynamicObjectMaterialText(tmpobjid.Id, 0, "WC", ObjectMaterialSize.X512X512, "Arial", 200, true, Convert.ToInt32("0xFFFFFFFF", 16), Convert.ToInt32("0xFF000000", 16), ObjectMaterialTextAlign.Center); Код:
tmpobjid.SetMaterialText(0, "WC", ObjectMaterialSize.X512X512, "Ariel", 200, true, Color.FromInteger(Convert.ToInt32("0xFFFFFFFF", 16), ColorFormat.ARGB), Color.FromInteger(Convert.ToInt32("0xFF000000", 16), ColorFormat.ARGB), ObjectMaterialTextAlign.Center); |
Try `unchecked((int)0xYOURHEXNUMBER)`
Are you running linux? http://sampsharp.timpotze.nl/install...a.dll-on-linux |
Yet again working fine with native, but not with sampsharp one
|
Not with the StreamerNative.x function? hmm then there must be something wrong with the signature of the native i guess. I'll look into it.
|
Oh, I meant it works fine with StreamerNative.x, but not with tmpobj.SetMaterialText
|
Ah okay! That makes things a little better. I think Color.FromString may not work properly. Could you try Color.FromInteger(0xffffffff) ?
|
tmpobjid = new DynamicObject(19475, new Vector3(1705.361f, -682.467f, 1008.911f), new Vector3(0.000f, 0.000f, 0.000f), -1, -1, null, 300.000f, 300.000f); tmpobjid.SetMaterialText(0, "WC", ObjectMaterialSize.X512X512, "Ariel", 200, true, Color.FromInteger(0xFFFFFFFF, ColorFormat.ARGB), Color.FromInteger(0xFF000000, ColorFormat.ARGB), ObjectMaterialTextAlign.Center);
25/02/2016 10:47:02] Exception thrownOnPlayerTakeDamage: System.NullReferenceException: Object reference not set to an instance of an object at SSS.Player.OnTakeDamage (SampSharp.GameMode.Events.DamageEventArgs e) [0x00000] in <filename unknown>:0 at SampSharp.GameMode.Controllers.GtaPlayerController .<RegisterEvents>b__19 (System.Object sender, SampSharp.GameMode.Events.DamageEventArgs args) [0x00000] in <filename unknown>:0 at SampSharp.GameMode.BaseMode.OnPlayerTakeDamage (SampSharp.GameMode.World.GtaPlayer player, SampSharp.GameMode.Events.DamageEventArgs e) [0x00000] in <filename unknown>:0 at SampSharp.GameMode.BaseMode.OnPlayerTakeDamage (Int32 playerid, Int32 issuerid, Single amount, Int32 weaponid, Int32 bodypart) [0x00000] in <filename unknown>:0 |
base.OnTakeDamage(e); //here if (e.OtherPlayer.Id != InvalidId) { Player TakeBy = (Player)e.OtherPlayer; if (TakeBy.Attraction == AttractionTypes.Attraction_WG) TakeBy.wgDamages += e.Amount; }
Okay, you can tell me, why when I get damage my script crash?
Stack But I check in OnTakeDamage Код:
base.OnTakeDamage(e); //here if (e.OtherPlayer.Id != InvalidId) { Player TakeBy = (Player)e.OtherPlayer; if (TakeBy.Attraction == AttractionTypes.Attraction_WG) TakeBy.wgDamages += e.Amount; } |