adiq888 0 Posted November 26 (edited) Hi everyone I'd like to know how I can assign to a variable vehicles created by the NAPI.Vehicle.CreateVehicle function in c # public int[] Vehicle = new int[4]; [ServerEvent(Event.ResourceStart)] public void OnResourceStart() { NAPI.Util.ConsoleOutput("Twoj projekt Rage zostal pomyslnie zaladowany!"); Vehicle[0] = NAPI.Vehicle.CreateVehicle(-1346687836, new Vector3(-418.4451, 1211.138, 325.4577), 235.3172f, 1, 1); Vehicle[1] = NAPI.Vehicle.CreateVehicle(-1346687836, new Vector3(-419.3018, 1207.183, 325.4566), 235.3172f, 1, 1); Vehicle[2] = NAPI.Vehicle.CreateVehicle(-1346687836, new Vector3(-420.7397, 1202.853, 325.4572), 235.3172f, 1, 1); Vehicle[3] = NAPI.Vehicle.CreateVehicle(-1346687836, new Vector3(-421.3993, 1198.118, 325.4573), 235.3172f, 1, 1); } how to do it ? Edited November 26 by adiq888 Share this post Link to post Share on other sites
Smileey 64 Posted November 27 public Vehicle[] veh = new Vehicle[4]; [ServerEvent(Event.ResourceStart)] public void OnResourceStart() { NAPI.Util.ConsoleOutput("Twoj projekt Rage zostal pomyslnie zaladowany!"); veh[0] = NAPI.Vehicle.CreateVehicle(-1346687836, new Vector3(-418.4451, 1211.138, 325.4577), 235.3172f, 1, 1); veh[1] = NAPI.Vehicle.CreateVehicle(-1346687836, new Vector3(-419.3018, 1207.183, 325.4566), 235.3172f, 1, 1); veh[2] = NAPI.Vehicle.CreateVehicle(-1346687836, new Vector3(-420.7397, 1202.853, 325.4572), 235.3172f, 1, 1); veh[3] = NAPI.Vehicle.CreateVehicle(-1346687836, new Vector3(-421.3993, 1198.118, 325.4573), 235.3172f, 1, 1); } Share this post Link to post Share on other sites
adiq888 0 Posted Thursday at 05:39 PM [ServerEvent(Event.PlayerEnterVehicle)] void OnPlayerEnterVehicle(Client player, Vehicle vehicle, sbyte seatID) { if (vehicle == veh[0]) { NAPI.Chat.SendChatMessageToPlayer(player, "To jest pojazd kuriera!"); } } after executing this code the server will crash Share this post Link to post Share on other sites
Xabi 143 Posted Thursday at 09:21 PM 3 hours ago, adiq888 said: [ServerEvent(Event.PlayerEnterVehicle)] void OnPlayerEnterVehicle(Client player, Vehicle vehicle, sbyte seatID) { if (vehicle == veh[0]) { NAPI.Chat.SendChatMessageToPlayer(player, "To jest pojazd kuriera!"); } } after executing this code the server will crash And what's the exception? Share this post Link to post Share on other sites
adiq888 0 Posted Friday at 08:01 PM 22 hours ago, Xabi said: And what's the exception? I'm sorry but I don't understand you Share this post Link to post Share on other sites