ZeroPointOne Posted August 22, 2023 Posted August 22, 2023 Here is my code: Commands.cs: using System; using System.Collections.Generic; using System.Text; using GTANetworkAPI; namespace Testing { class Commands : Script { [Command("veh", "/veh um Fahrzueg zu spawnen")] public void cmd_veh(Player player, string vehname, int color1, int color2) { uint vehash = NAPI.Util.GetHashKey(vehname); if (vehash <= 0) { player.SendChatMessage("~r~Ungültiger Spawnname"); return; } Vehicle veh = NAPI.Vehicle.CreateVehicle(vehash, player.Position, player.Heading, color1, color2); veh.NumberPlate = "Spawned"; veh.Locked = false; veh.EngineStatus = true; player.SetIntoVehicle(veh, (int)VehicleSeat.Driver); } } } Events.cs: using System; using System.Collections.Generic; using System.Text; using GTANetworkAPI; namespace Testing { class Events : Script { [ServerEvent(Event.PlayerConnected)] public void OnPlayerConnected(Player player) { player.SendChatMessage("Wilkommen auf dem Server!"); } [ServerEvent(Event.PlayerSpawn)] public void OnPlayerSpawn(Player player) { player.Health = 0; player.GiveWeapon(WeaponHash.Sniperrifle, 100); } } } there is no console error but it dont work Console: https://imgur.com/a/qnrll8a Please help
Kopra Posted August 22, 2023 Posted August 22, 2023 Did you compile and place .dll in proper folder? By console output I can see command and classes are not registered by script.
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