Esempio n. 1
0
        public async Task openTuningMenu(IPlayer player, IVehicle vehicle)
        {
            try
            {
                if (player == null || !player.Exists || vehicle == null || !vehicle.Exists)
                {
                    return;
                }
                int charId = (int)player.GetCharacterMetaId();
                int vehId  = (int)vehicle.GetVehicleId();
                if (charId <= 0 || vehId <= 0)
                {
                    return;
                }
                vehicle.ModKit = 1;
                string tuningItems = "Primärfarbe:100;Sekundärfarbe:200;Pearl-Effekt:250;Neonröhren:300";
                if (ServerVehicles.ReturnMaxVehicleMods(vehicle, 0) != 0)
                {
                    tuningItems += ";Spoiler:0";
                }
                if (ServerVehicles.ReturnMaxVehicleMods(vehicle, 1) != 0)
                {
                    tuningItems += ";Frontstoßstange:1";
                }
                if (ServerVehicles.ReturnMaxVehicleMods(vehicle, 2) != 0)
                {
                    tuningItems += ";Heckstoßstange:2";
                }
                if (ServerVehicles.ReturnMaxVehicleMods(vehicle, 3) != 0)
                {
                    tuningItems += ";Seitenverkleidung:3";
                }
                if (ServerVehicles.ReturnMaxVehicleMods(vehicle, 4) != 0)
                {
                    tuningItems += ";Auspuff:4";
                }
                if (ServerVehicles.ReturnMaxVehicleMods(vehicle, 5) != 0)
                {
                    tuningItems += ";Überrollkäfig:5";
                }
                if (ServerVehicles.ReturnMaxVehicleMods(vehicle, 6) != 0)
                {
                    tuningItems += ";Kühlergrill:6";
                }
                if (ServerVehicles.ReturnMaxVehicleMods(vehicle, 7) != 0)
                {
                    tuningItems += ";Motorhaube:7";
                }
                if (ServerVehicles.ReturnMaxVehicleMods(vehicle, 8) != 0)
                {
                    tuningItems += ";Linker Kotflügel:8";
                }
                if (ServerVehicles.ReturnMaxVehicleMods(vehicle, 9) != 0)
                {
                    tuningItems += ";Rechter Kotflügel:9";
                }
                if (ServerVehicles.ReturnMaxVehicleMods(vehicle, 10) != 0)
                {
                    tuningItems += ";Dach:10";
                }
                if (ServerVehicles.ReturnMaxTuningWheels(11) != 0)
                {
                    tuningItems += ";Motor:11";
                }
                if (ServerVehicles.ReturnMaxTuningWheels(12) != 0)
                {
                    tuningItems += ";Bremsen:12";
                }
                if (ServerVehicles.ReturnMaxTuningWheels(13) != 0)
                {
                    tuningItems += ";Getriebe:13";
                }
                if (ServerVehicles.ReturnMaxTuningWheels(14) != 0)
                {
                    tuningItems += ";Hupe:14";
                }
                if (ServerVehicles.ReturnMaxTuningWheels(15) != 0)
                {
                    tuningItems += ";Federung:15";
                }
                if (ServerVehicles.ReturnMaxTuningWheels(22) != 0)
                {
                    tuningItems += ";Xenon:22";
                }
                tuningItems += ";Scheinwerferfarbe:280";
                //ToDo: Reifentyp
                //if (ServerVehicles.ReturnMaxTuningWheels(131) != 0) { tuningItems += ";Reifen Typ:131"; }

                int wheelT = vehicle.WheelType;
                if (wheelT == 255 || wheelT == 0)
                {
                    wheelT = 0;
                }

                if (ServerVehicles.ReturnMaxTuningWheels(Convert.ToInt32(23 + "" + wheelT)) != 0)
                {
                    tuningItems += ";Reifen:23";
                }
                if (ServerVehicles.ReturnMaxTuningWheels(132) != 0)
                {
                    tuningItems += ";Reifen Farbe:132";
                }
                if (ServerVehicles.ReturnMaxVehicleMods(vehicle, 25) != 0)
                {
                    tuningItems += ";Nummernschild Rahmen:25";
                }
                if (ServerVehicles.ReturnMaxVehicleMods(vehicle, 27) != 0)
                {
                    tuningItems += ";Innenpolster:27";
                }
                if (ServerVehicles.ReturnMaxVehicleMods(vehicle, 28) != 0)
                {
                    tuningItems += ";Wackelkopf:28";
                }
                if (ServerVehicles.ReturnMaxVehicleMods(vehicle, 30) != 0)
                {
                    tuningItems += ";Tacho Design:30";
                }
                if (ServerVehicles.ReturnMaxVehicleMods(vehicle, 33) != 0)
                {
                    tuningItems += ";Lenkrad:33";
                }
                if (ServerVehicles.ReturnMaxVehicleMods(vehicle, 34) != 0)
                {
                    tuningItems += ";Schaltknüppel:34";
                }
                if (ServerVehicles.ReturnMaxVehicleMods(vehicle, 35) != 0)
                {
                    tuningItems += ";Tafel:35";
                }
                if (ServerVehicles.ReturnMaxVehicleMods(vehicle, 40) != 0)
                {
                    tuningItems += ";Luftfilter:40";
                }
                if (ServerVehicles.ReturnMaxTuningWheels(46) != 0)
                {
                    tuningItems += ";Fenstertönung:46";
                }
                if (ServerVehicles.ReturnMaxVehicleMods(vehicle, 48) != 0)
                {
                    tuningItems += ";Vinyls:48";
                }

                player.EmitLocked("Client:Tuning:openTuningMenu", vehicle, tuningItems);
            }
            catch (Exception e)
            {
                Alt.Log($"{e}");
            }
        }