Bnece 0 Posted November 22 Hy all! I created an AdminCommands class and it have a few commands for admins, on the Main class i defined the class but it not load the commans. I find solution https://wiki.gtanet.work/index.php?title=C.Register this but it not implemend yet. Forexample in AdminCommands class [Command("getpos")] public void GetPosition(Client player) { Vector3 PlayerPos = NAPI.Entity.GetEntityPosition(player); NAPI.Chat.SendChatMessageToPlayer(player, "X: " + PlayerPos.X + " Y: " + PlayerPos.Y + " Z: " + PlayerPos.Z); } and the Main class public class Main : Script { private static List<Vehicles> vehicle = new List<Vehicles>(); private static List<Players> players = new List<Players>(); private static AdminCommands admcmd = new AdminCommands(players, vehicle); [ServerEvent(Event.ResourceStart)] public void OnResourceStart() { NAPI.Util.ConsoleOutput("Loaded"); } Share this post Link to post Share on other sites
Xabi 143 Posted November 22 Just extend from Script class and you won't need to instantiate your command class. Share this post Link to post Share on other sites