Bnece Posted November 22, 2019 Posted November 22, 2019 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"); }
Xabi Posted November 22, 2019 Posted November 22, 2019 Just extend from Script class and you won't need to instantiate your command class.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now