How to use OnItemSelect += (sender, item, index) => twice?
-
so i am trying to make a modmenu but i can only use a "if" statement for on thing
vehicleoptions.OnItemSelect += (sender, item, index) =>
{ if (item == adder) { Vehicle car = World.CreateVehicle("ADDER", Game.Player.Character.Position); Game.Player.Character.SetIntoVehicle(car, VehicleSeat.Driver); }
but if i want to use it with a other item while this enabled i will get an error:
A local or parameter named 'index' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter
it also says the exact same about sender and item does anyone know how to fix this?
i also tried the "else" and end method but dind't work