25.06.2017, 10:26
This encoding also I'm a little clumsy. If you have training videos more quickly I can learn.
I'm waiting for your help @AwareWolf
I'm waiting for your help @AwareWolf
Код:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Diagnostics; using SampSharp.GameMode; // Contains BaseMode class using SampSharp.GameMode.Controllers; // Contains ControllerCollection class using SampSharp.GameMode.API.NativeObjects; using SampSharp.GameMode.World; using SampSharp.GameMode.SAMP; using SampSharp.GameMode.Definitions; namespace MyGamemode { public class GameMode : BaseMode { #region Overrides of BaseMode protected override void OnInitialized(EventArgs e) { Console.WriteLine("\n----------------------------------"); Console.WriteLine(" C# Mode"); Console.WriteLine("----------------------------------\n"); SetGameModeText("C Test Mode"); base.OnInitialized(e); } protected override void LoadControllers(ControllerCollection controllers) { base.LoadControllers(controllers); } public override void SetGameModeText(string text) { base.SetGameModeText(text); } protected override void OnPlayerConnected(SampSharp.GameMode.World.BasePlayer player, EventArgs e) { player.SendClientMessage(0xD33257FF, "[{0}] Welcome {1}({2})", DateTime.Now, player.Name, player.Id); player.GiveMoney(500); base.OnPlayerConnected(player, e); } protected override void OnPlayerDisconnected(SampSharp.GameMode.World.BasePlayer player, SampSharp.GameMode.Events.DisconnectEventArgs e) { base.OnPlayerDisconnected(player, e); } protected override void OnPlayerCommandText(SampSharp.GameMode.World.BasePlayer player, SampSharp.GameMode.Events.CommandTextEventArgs e) { base.OnPlayerCommandText(player, e); } #endregion } } class AnyClass { [Command("helloworld")] private static void HelloWorldCommand(BasePlayer sender, int times) { for (var i = 0; i < times; i++) sender.SendClientMessage("Hello, world!"); } }
Код:
[Command("helloworld")] <--- Error