Beispiel #1
0
 public void returnVehicleModsCMD(IPlayer player, int modId)
 {
     if (player == null || !player.Exists || player.Vehicle == null)
     {
         return;
     }
     if (player.AdminLevel() <= 0)
     {
         HUDHandler.SendNotification(player, 4, 5000, "Keine Rechte."); return;
     }
     if (!player.Vehicle.Exists)
     {
         return;
     }
     //player.Vehicle.ModKit = 1;
     player.EmitLocked("returnVehicleMods", player.Vehicle, modId);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 0);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 1);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 2); //Hier schlagen
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 3);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 4);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 5);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 6);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 7);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 8);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 9);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 10);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 25);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 26);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 27);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 28);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 29);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 30);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 31);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 32);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 33);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 34);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 35);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 36);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 37);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 38);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 39);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 40);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 41);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 42);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 43);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 44);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 45);
     //player.EmitLocked("returnVehicleMods", player.Vehicle, 48);
 }
Beispiel #2
0
 public void ReviveCMD(IPlayer player)
 {
     if (player == null || !player.Exists)
     {
         return;
     }
     if (player.AdminLevel() <= 8)
     {
         HUDHandler.SendNotification(player, 4, 5000, "Keine Rechte."); return;
     }
     player.EmitLocked("Client:Ragdoll:SetPedToRagdoll", false, 2000);
     player.Health = 200;
     HUDHandler.SendNotification(player, 2, 5000, "Du hast dich wiederbelebt.");
 }
Beispiel #3
0
 public async Task BuyHouse(IPlayer player, int houseId)
 {
     try
     {
         if (player == null || houseId <= 0 || !player.Exists)
         {
             return;
         }
         int charId = User.GetPlayerOnline(player);
         if (charId <= 0)
         {
             return;
         }
         if (!ServerHouses.ExistHouse(houseId))
         {
             return;
         }
         if (ServerHouses.GetHouseOwner(houseId) > 0)
         {
             HUDHandler.SendNotification(player, 3, 5000, "Fehler: Dieses Haus gehört bereits jemanden."); return;
         }
         if (!CharactersBank.HasCharacterBankMainKonto(charId))
         {
             HUDHandler.SendNotification(player, 3, 5000, "Du hast noch kein Hauptkonto in der Bank festgelegt."); return;
         }
         int accNumber = CharactersBank.GetCharacterBankMainKonto(charId);
         if (accNumber <= 0)
         {
             return;
         }
         if (CharactersBank.GetBankAccountLockStatus(accNumber))
         {
             HUDHandler.SendNotification(player, 3, 5000, "Dein Bankkonto ist gesperrt."); return;
         }
         if (CharactersBank.GetBankAccountMoney(accNumber) < ServerHouses.GetHousePrice(houseId))
         {
             HUDHandler.SendNotification(player, 3, 5000, $"Soviel Geld hast du auf deinem Konto nicht ({ServerHouses.GetHousePrice(houseId)}$) - du hast {CharactersBank.GetBankAccountMoney(accNumber)}$"); return;
         }
         CharactersBank.SetBankAccountMoney(accNumber, CharactersBank.GetBankAccountMoney(accNumber) - ServerHouses.GetHousePrice(houseId));
         ServerBankPapers.CreateNewBankPaper(accNumber, DateTime.Now.ToString("d", CultureInfo.CreateSpecificCulture("de-DE")), DateTime.Now.ToString("t", CultureInfo.CreateSpecificCulture("de-DE")), "Ausgehende Überweisung", "Dynasty8", $"Hauskauf: {ServerHouses.GetHouseStreet(houseId)}", $"-{ServerHouses.GetHousePrice(houseId)}$", "Bankeinzug");
         ServerHouses.SetHouseOwner(houseId, charId);
         HUDHandler.SendNotification(player, 2, 5000, $"Sie haben sich das Haus mit der Adresse '{ServerHouses.GetHouseStreet(houseId)}' erfolgreich gekauft (Kosten: {ServerHouses.GetHousePrice(houseId)}$).");
     }
     catch (Exception e)
     {
         Alt.Log($"{e}");
     }
 }
Beispiel #4
0
 public void timeCMD(IPlayer player, int hour, int minute)
 {
     if (player.AdminLevel() <= 8)
     {
         HUDHandler.SendNotification(player, 4, 5000, "Keine Rechte."); return;
     }
     try
     {
         player.SetDateTime(DateTime.Now.Day, DateTime.Now.Month, DateTime.Now.Year, hour, minute, 0);
         player.EmitLocked("Client:Entity:setTime", hour, minute);
     }
     catch (Exception e)
     {
         Alt.Log($"{e}");
     }
 }
Beispiel #5
0
 public static void CMD_Unban(ClassicPlayer player, int accId)
 {
     try
     {
         if (player == null || !player.Exists || player.CharacterId <= 0 || accId <= 0 || player.AdminLevel() <= 3)
         {
             return;
         }
         User.SetPlayerBanned(accId, false, "");
         HUDHandler.SendNotification(player, 4, 5000, $"Spieler mit ID {accId} Erfolgreich entbannt.");
     }
     catch (Exception e)
     {
         Alt.Log($"{e}");
     }
 }
Beispiel #6
0
 public async Task EnterHouse(IPlayer player, int houseId)
 {
     try
     {
         if (player == null || houseId <= 0 || !player.Exists)
         {
             return;
         }
         int charId = (int)player.GetCharacterMetaId();
         if (charId <= 0)
         {
             return;
         }
         if (!ServerHouses.ExistHouse(houseId))
         {
             return;
         }
         if (!player.Position.IsInRange(ServerHouses.GetHouseEntrance(houseId), 2f))
         {
             return;
         }
         if (ServerHouses.GetHouseOwner(houseId) <= 0)
         {
             HUDHandler.SendNotification(player, 4, 5000, "Dieses Haus gehört Niemanden."); return;
         }
         if (ServerHouses.IsHouseLocked(houseId))
         {
             HUDHandler.SendNotification(player, 4, 5000, "Das Haus ist abgeschlossen."); return;
         }
         int interiorId = ServerHouses.GetHouseInteriorId(houseId);
         if (interiorId <= 0)
         {
             return;
         }
         Position targetPos = ServerHouses.GetInteriorExitPosition(interiorId);
         if (targetPos == new Position(0, 0, 0))
         {
             return;
         }
         player.Position  = targetPos;
         player.Dimension = 10000 + houseId;
     }
     catch (Exception e)
     {
         Alt.Log($"{e}");
     }
 }
Beispiel #7
0
 public async Task setRentState(IPlayer player, int houseId, string rentState)
 {
     try
     {
         if (player == null || !player.Exists || houseId <= 0)
         {
             return;
         }
         if (rentState != "true" && rentState != "false")
         {
             return;
         }
         int charId = (int)player.GetCharacterMetaId();
         if (charId <= 0)
         {
             return;
         }
         bool rentBool  = rentState == "true";
         int  dimension = player.Dimension;
         if (dimension <= 10000)
         {
             return;
         }
         int dhouseId = dimension - 10000;
         if (dhouseId <= 0 || dhouseId != houseId || !ServerHouses.ExistHouse(houseId))
         {
             return;
         }
         if (ServerHouses.GetHouseOwner(houseId) != charId)
         {
             HUDHandler.SendNotification(player, 4, 5000, "Fehler: Du bist nicht der Hausbesitzer."); return;
         }
         ServerHouses.SetHouseRentState(houseId, rentBool);
         if (rentBool)
         {
             HUDHandler.SendNotification(player, 2, 2500, $"Du hast den Mietstatus auf 'Mieter zulassen' gestellt."); return;
         }
         else
         {
             HUDHandler.SendNotification(player, 2, 2500, $"Du hast den Mietstatus auf 'Mieter nicht zulassen' gestellt."); return;
         }
     }
     catch (Exception e)
     {
         Alt.Log($"{e}");
     }
 }
Beispiel #8
0
 public async Task EnterHotel(IPlayer player, int hotelId, int apartmentId)
 {
     try
     {
         if (player == null || !player.Exists || hotelId <= 0 || apartmentId <= 0)
         {
             return;
         }
         int charId = User.GetPlayerOnline(player);
         if (charId <= 0)
         {
             return;
         }
         if (!ServerHotels.ExistHotelApartment(hotelId, apartmentId))
         {
             HUDHandler.SendNotification(player, 3, 5000, "Ein unerwarteter Fehler ist aufgetreten [HOTEL-001]."); return;
         }
         if (ServerHotels.GetApartmentOwner(hotelId, apartmentId) <= 0)
         {
             HUDHandler.SendNotification(player, 3, 5000, "Fehler: Dieses Zimmer ist nicht vermietet."); return;
         }
         var hotel = ServerHotels.ServerHotelsApartments_.FirstOrDefault(x => x.hotelId == hotelId && x.id == apartmentId);
         if (hotel == null)
         {
             return;
         }
         if (!player.Position.IsInRange(ServerHotels.GetHotelPosition(hotelId, apartmentId), 3f))
         {
             return;
         }
         if (hotel.isLocked)
         {
             HUDHandler.SendNotification(player, 3, 5000, "Fehler: Das Zimmer ist abgeschlossen."); return;
         }
         if (!ServerHouses.ExistInteriorId(hotel.interiorId))
         {
             return;
         }
         player.Position  = ServerHouses.GetInteriorExitPosition(hotel.interiorId);
         player.Dimension = 5000 + apartmentId;
     }
     catch (Exception e)
     {
         Alt.Log($"{e}");
     }
 }
Beispiel #9
0
 public async Task ClientEvent_deleteTattoo(ClassicPlayer player, int tattooId)
 {
     try
     {
         if (player == null || !player.Exists || player.CharacterId <= 0 || tattooId <= 0 || !CharactersTattoos.ExistAccountTattoo(player.CharacterId, tattooId))
         {
             return;
         }
         CharactersTattoos.RemoveAccountTattoo(player.CharacterId, tattooId);
         HUDHandler.SendNotification(player, 2, 1500, $"Du hast das Tattoo '{ServerTattoos.GetTattooName(tattooId)}' erfolgreich entfernen lassen.");
         player.updateTattoos();
     }
     catch (Exception e)
     {
         Console.WriteLine($"{e}");
     }
 }
Beispiel #10
0
 internal static void openStorage(IPlayer player)
 {
     try
     {
         if (player == null || !player.Exists)
         {
             return;
         }
         int charId = (int)player.GetCharacterMetaId();
         if (charId <= 0)
         {
             return;
         }
         int dimension = player.Dimension;
         if (dimension <= 10000)
         {
             return;
         }
         int houseId = dimension - 10000;
         if (houseId <= 0 || !ServerHouses.ExistHouse(houseId))
         {
             return;
         }
         if (!ServerHouses.HasHouseStorageUpgrade(houseId))
         {
             HUDHandler.SendNotification(player, 4, 5000, "Dieses Haus besitzt noch keinen ausgebauten Lagerplatz."); return;
         }
         int interiorId = ServerHouses.GetHouseInteriorId(houseId);
         if (interiorId <= 0)
         {
             return;
         }
         if (!player.Position.IsInRange(ServerHouses.GetInteriorStoragePosition(interiorId), 2f))
         {
             return;
         }
         var houseStorageContent = ServerHouses.GetServerHouseStorageItems(houseId);  //Haus Inventar
         var characterInvArray   = CharactersInventory.GetCharacterInventory(charId); //Spieler Inventar
         player.EmitLocked("Client:FactionStorage:openCEF", charId, houseId, "house", characterInvArray, houseStorageContent);
     }
     catch (Exception e)
     {
         Alt.Log($"{e}");
     }
 }
Beispiel #11
0
 public static async Task LockHotel(IPlayer player, int hotelId, int apartmentId)
 {
     try
     {
         if (player == null || !player.Exists || hotelId <= 0 || apartmentId <= 0)
         {
             return;
         }
         int charId = User.GetPlayerOnline(player);
         if (charId <= 0)
         {
             return;
         }
         if (!ServerHotels.ExistHotelApartment(hotelId, apartmentId))
         {
             HUDHandler.SendNotification(player, 3, 5000, "Ein unerwarteter Fehler ist aufgetreten [HOTEL-001]."); return;
         }
         if (!ServerHotels.HasCharacterAnApartment(charId))
         {
             HUDHandler.SendNotification(player, 3, 5000, $"Du besitzt hier kein Zimmer."); return;
         }
         if (ServerHotels.GetApartmentOwner(hotelId, apartmentId) != charId)
         {
             HUDHandler.SendNotification(player, 3, 5000, $"Du besitzt hier kein Zimmer."); return;
         }
         var hotel = ServerHotels.ServerHotelsApartments_.FirstOrDefault(x => x.hotelId == hotelId && x.id == apartmentId);
         if (hotel == null)
         {
             return;
         }
         if (hotel.isLocked)
         {
             HUDHandler.SendNotification(player, 2, 2500, $"Du hast dein Zimmer aufgeschlossen");
         }
         else
         {
             HUDHandler.SendNotification(player, 4, 2500, $"Du hast dein Zimmer abgeschlossen");
         }
         hotel.isLocked = !hotel.isLocked;
     }
     catch (Exception e)
     {
         Alt.Log($"{e}");
     }
 }
Beispiel #12
0
        public void AdutyCMD(IPlayer player)
        {
            if (player == null || !player.Exists)
            {
                return;
            }
            if (player.AdminLevel() <= 0)
            {
                HUDHandler.SendNotification(player, 4, 5000, "Keine Rechte."); return;
            }

            if (player.HasData("isAduty"))
            {
                player.DeleteData("isAduty");
                player.EmitLocked("Client:Admin:Invincible", false);
                Characters.SetCharacterCorrectClothes(player);
                HUDHandler.SendNotification(player, 4, 5000, $"Du befindest dich nun im nicht mehr im Aduty");
            }
            else
            {
                player.SetData("isAduty", true);
                if (!Characters.GetCharacterGender((int)player.GetCharacterMetaId()))
                {
                    //Männlich
                    player.EmitLocked("Client:SpawnArea:setCharClothes", 1, 135, 2);
                    player.EmitLocked("Client:SpawnArea:setCharClothes", 4, 114, 2);
                    player.EmitLocked("Client:SpawnArea:setCharClothes", 6, 78, 2);
                    player.EmitLocked("Client:SpawnArea:setCharClothes", 3, 3, 0);
                    player.EmitLocked("Client:SpawnArea:setCharClothes", 11, 287, 2);
                    player.EmitLocked("Client:SpawnArea:setCharClothes", 8, 1, 99);
                }
                else
                {
                    //Weiblich
                    player.EmitLocked("Client:SpawnArea:setCharClothes", 1, 135, 2);
                    player.EmitLocked("Client:SpawnArea:setCharClothes", 11, 300, 2);
                    player.EmitLocked("Client:SpawnArea:setCharClothes", 4, 121, 2);
                    player.EmitLocked("Client:SpawnArea:setCharClothes", 3, 8, 0);
                    player.EmitLocked("Client:SpawnArea:setCharClothes", 8, 1, 99);
                    player.EmitLocked("Client:SpawnArea:setCharClothes", 6, 82, 2);
                }
                player.EmitLocked("Client:Admin:Invincible", true);
                HUDHandler.SendNotification(player, 4, 5000, $"Du befindest dich nun im Aduty");
            }
        }
Beispiel #13
0
 public async Task StorageHotelItem(IPlayer player, int apartmentId, string itemName, int itemAmount, string fromContainer)
 {
     try
     {
         if (player == null || !player.Exists || apartmentId <= 0 || itemName == "" || itemName == "undefined" || itemAmount <= 0 || fromContainer == "none" || fromContainer == "")
         {
             return;
         }
         int cCharId = User.GetPlayerOnline(player);
         if (cCharId <= 0)
         {
             return;
         }
         if (player.HasPlayerHandcuffs() || player.HasPlayerRopeCuffs())
         {
             HUDHandler.SendNotification(player, 3, 5000, "Wie willst du das mit Handschellen/Fesseln machen?"); return;
         }
         if (!CharactersInventory.ExistCharacterItem(cCharId, itemName, fromContainer))
         {
             HUDHandler.SendNotification(player, 4, 5000, "Fehler: Diesen Gegenstand besitzt du nicht."); return;
         }
         if (CharactersInventory.GetCharacterItemAmount(cCharId, itemName, fromContainer) < itemAmount)
         {
             HUDHandler.SendNotification(player, 4, 5000, "Fehler: Du hast nicht genügend Gegenstände davon dabei."); return;
         }
         if (CharactersInventory.IsItemActive(player, itemName))
         {
             HUDHandler.SendNotification(player, 4, 5000, "Fehler: Ausgerüstete Gegenstände können nicht umgelagert werden."); return;
         }
         float itemWeight = ServerItems.GetItemWeight(itemName) * itemAmount;
         if (ServerHotels.GetHotelStorageItemWeight(apartmentId) >= 15f || (ServerHotels.GetHotelStorageItemWeight(apartmentId) + itemWeight) >= 15f)
         {
             HUDHandler.SendNotification(player, 3, 5000, "Fehler: Soviel passt in das Lager nicht rein (maximal 15kg Lagerplatz).");
             return;
         }
         CharactersInventory.RemoveCharacterItemAmount(cCharId, itemName, itemAmount, fromContainer);
         ServerHotels.AddServerHotelStorageItem(apartmentId, itemName, itemAmount);
         HUDHandler.SendNotification(player, 2, 5000, $"Der Gegenstand wurde erfolgreich eingelagert ({itemName} - {itemAmount}x).");
         //LoggingService.NewHotelLog(apartmentId, cCharId, 0, "storage", $"{Characters.GetCharacterName(charId)} ({charId}) hat den Gegenstand '{itemName} ({amount}x)' in seinen Spind gelegt."); //ToDo: Hotel Storage Log
     }
     catch (Exception e)
     {
         Alt.Log($"{e}");
     }
 }
Beispiel #14
0
        public async Task sendIdentityCardApplyForm(IPlayer player, string birthplace)
        {
            if (player == null || !player.Exists)
            {
                return;
            }
            int charId = User.GetPlayerOnline(player);

            if (charId == 0 || birthplace == "")
            {
                return;
            }
            Characters.SetCharacterBirthplace(charId, birthplace);
            Characters.setCharacterAccState(charId, 1);
            CharactersInventory.AddCharacterItem(charId, $"Ausweis {Characters.GetCharacterName(charId)}", 1, "inventory");
            HUDHandler.SendNotification(player, 2, 5000, "Du hast dir erfolgreich deinen Personalausweis beantragt.");
            HUDHandler.SendNotification(player, 1, 5000, "Erfolg freigeschaltet: Identifizierung");
        }
Beispiel #15
0
        internal static void VehicleAutomaticParkFetch(object sender, ElapsedEventArgs e)
        {
            try
            {
                //foreach(IVehicle vehicle in Alt.Server.GetVehicles().ToList().Where(x => x.GetVehicleId() != 0))
                //{
                //    if (vehicle == null) return;
                //    using (var vehicleRef = new VehicleRef(vehicle))
                //    {
                //        if (!vehicleRef.Exists) return;
                //        lock (vehicle)
                //        {
                //            var dbVeh = ServerVehicles.ServerVehicles_.FirstOrDefault(v => v.id == (int)vehicle.GetVehicleId());
                //            if (dbVeh == null) continue;
                //            if (DateTime.Now.Subtract(Convert.ToDateTime(dbVeh.lastUsage)).TotalHours >= 3)
                //            {
                //                int garage = 0;
                //                if (dbVeh.garageId == 0) { garage = 10; }
                //                else { garage = dbVeh.garageId; }
                //                ServerVehicles.SetVehicleInGarage(vehicle, true, garage);
                //            }
                //        }
                //    }
                //}

                foreach (var hotelApartment in ServerHotels.ServerHotelsApartments_.Where(x => x.ownerId > 0))
                {
                    if (hotelApartment == null)
                    {
                        continue;
                    }
                    if (DateTime.Now.Subtract(Convert.ToDateTime(hotelApartment.lastRent)).TotalHours >= hotelApartment.maxRentHours)
                    {
                        int oldOwnerId = hotelApartment.ownerId;
                        ServerHotels.SetApartmentOwner(hotelApartment.hotelId, hotelApartment.id, 0);
                        foreach (IPlayer players in Alt.Server.GetPlayers().ToList().Where(x => x != null && x.Exists && User.GetPlayerOnline(x) == oldOwnerId))
                        {
                            HUDHandler.SendNotification(players, 1, 5000, "Deine Mietdauer im Hotel ist ausgelaufen, dein Zimmer wurde gekündigt");
                        }
                    }
                }
            }
            catch (Exception ex) { Alt.Log($"{ex}"); }
        }
Beispiel #16
0
 public async Task setRentPrice(IPlayer player, int houseId, int rentPrice)
 {
     try
     {
         if (player == null || !player.Exists || houseId <= 0 || rentPrice <= 0)
         {
             return;
         }
         int charId = (int)player.GetCharacterMetaId();
         if (charId <= 0)
         {
             return;
         }
         if (rentPrice > 1000)
         {
             HUDHandler.SendNotification(player, 4, 5000, "Fehler: Die Miete darf einen Wert von 1.000$ nicht überschreiten."); return;
         }
         int dimension = player.Dimension;
         if (dimension <= 10000)
         {
             return;
         }
         int dhouseId = dimension - 10000;
         if (dhouseId <= 0 || dhouseId != houseId || !ServerHouses.ExistHouse(houseId))
         {
             return;
         }
         if (ServerHouses.GetHouseOwner(houseId) != charId)
         {
             HUDHandler.SendNotification(player, 4, 5000, "Fehler: Du bist nicht der Hausbesitzer."); return;
         }
         ServerHouses.SetHouseRentPrice(houseId, rentPrice);
         HUDHandler.SendNotification(player, 2, 3000, $"Du hast den Mietpreis auf {rentPrice}$ festgelegt. Die Miete wird jede 7 Tage von Mietbeginn eines Mieters abgebucht.");
         if (!ServerHouses.HasHouseBankUpgrade(houseId))
         {
             HUDHandler.SendNotification(player, 3, 5000, "Dein Haus besitzt keinen Tresor. Mieteinnahmen werden erst gesammelt sofern dieser ausgebaut ist.");
         }
     }
     catch (Exception e)
     {
         Alt.Log($"{e}");
     }
 }
Beispiel #17
0
 public void wCMD(IPlayer player, WeaponModel wp)
 {
     if (player.AdminLevel() <= 8)
     {
         HUDHandler.SendNotification(player, 4, 5000, "Keine Rechte."); return;
     }
     try
     {
         if (player == null || !player.Exists)
         {
             return;
         }
         player.GiveWeapon(wp, 9999, true);
     }
     catch (Exception e)
     {
         Alt.Log($"{e}");
     }
 }
Beispiel #18
0
        public void heyCMD(IPlayer player, string model)
        {
            if (player == null || !player.Exists)
            {
                return;
            }
            if (player.AdminLevel() <= 1)
            {
                HUDHandler.SendNotification(player, 4, 5000, "Keine Rechte."); return;
            }
            if (player.Vehicle != null && player.Vehicle.Exists)
            {
                player.Vehicle.Remove();
            }
            IVehicle veh = Alt.CreateVehicle(model, player.Position, player.Rotation);

            veh.EngineOn  = true;
            veh.LockState = VehicleLockState.Unlocked;
        }
Beispiel #19
0
 public void TpPosCMD(IPlayer player, float X, float Y, float Z)
 {
     try
     {
         if (player == null || !player.Exists)
         {
             return;
         }
         if (player.AdminLevel() <= 2)
         {
             HUDHandler.SendNotification(player, 4, 5000, "Keine Rechte."); return;
         }
         player.Position = new Position(X, Y, Z);
     }
     catch (Exception e)
     {
         Alt.Log($"{e}");
     }
 }
Beispiel #20
0
        public async Task finishBarber(IPlayer player, string headoverlaysarray)
        {
            if (player == null || !player.Exists)
            {
                return;
            }
            int charId = User.GetPlayerOnline(player);

            if (charId == 0 || headoverlaysarray == "")
            {
                return;
            }
            if (!CharactersInventory.ExistCharacterItem(charId, "Bargeld", "inventory") || CharactersInventory.GetCharacterItemAmount(charId, "Bargeld", "inventory") < 50)
            {
                HUDHandler.SendNotification(player, 3, 5000, $"Du hast nicht genug Bargeld dabei (50$)."); SetCorrectCharacterSkin(player);  return;
            }
            CharactersInventory.RemoveCharacterItemAmount(charId, "Bargeld", 50, "inventory");
            Characters.SetCharacterHeadOverlays(charId, headoverlaysarray);
        }
Beispiel #21
0
 public async Task RemoveRenter(IPlayer player, int houseId, int renterId)
 {
     try
     {
         if (player == null || !player.Exists || houseId <= 0 || renterId <= 0)
         {
             return;
         }
         int charId = (int)player.GetCharacterMetaId();
         if (charId <= 0)
         {
             return;
         }
         int dimension = player.Dimension;
         if (dimension <= 10000)
         {
             return;
         }
         int dhouseId = dimension - 10000;
         if (dhouseId <= 0 || dhouseId != houseId || !ServerHouses.ExistHouse(houseId))
         {
             return;
         }
         if (ServerHouses.GetHouseOwner(houseId) != charId)
         {
             HUDHandler.SendNotification(player, 4, 5000, "Fehler: Du bist nicht der Hausbesitzer."); return;
         }
         if (!ServerHouses.IsCharacterRentedInAnyHouse(renterId) || !ServerHouses.IsCharacterRentedInHouse(renterId, houseId))
         {
             HUDHandler.SendNotification(player, 4, 5000, "Fehler: Dieser Spieler ist nicht in deinem Haus eingemietet."); return;
         }
         ServerHouses.RemoveServerHouseRenter(houseId, renterId);
         HUDHandler.SendNotification(player, 2, 2000, $"Du hast den Mieter {Characters.GetCharacterName(renterId)} erfolgreich gekündigt.");
         foreach (var renterPlayer in Alt.Server.GetPlayers().ToList().Where(x => x != null && x.Exists && x.GetCharacterMetaId() == (ulong)renterId))
         {
             HUDHandler.SendNotification(renterPlayer, 3, 2000, $"Dein Mietvertrag in dem Haus '{ServerHouses.GetHouseStreet(houseId)}' wurde gekündigt."); break;
         }
     }
     catch (Exception e)
     {
         Alt.Log($"{e}");
     }
 }
Beispiel #22
0
 public void GetHereCMD(IPlayer player, int targetId)
 {
     if (player.AdminLevel() <= 1)
     {
         HUDHandler.SendNotification(player, 4, 5000, "Keine Rechte."); return;
     }
     try
     {
         if (player == null || !player.Exists)
         {
             return;
         }
         if (targetId <= 0 || targetId.ToString().Length <= 0)
         {
             player.SendChatMessage("Benutzung: /gethere charId");
             return;
         }
         string targetCharName = Characters.GetCharacterName(targetId);
         if (targetCharName.Length <= 0)
         {
             HUDHandler.SendNotification(player, 3, 5000, $"Warnung: Die angegebene Character-ID wurde nicht gefunden ({targetId}).");
             return;
         }
         if (!Characters.ExistCharacterName(targetCharName))
         {
             HUDHandler.SendNotification(player, 3, 5000, $"Warnung: Der angegebene Charaktername wurde nicht gefunden ({targetCharName} - ID: {targetId}).");
             return;
         }
         var targetPlayer = Alt.Server.GetPlayers().FirstOrDefault(x => x != null && x.Exists && x.GetCharacterMetaId() == (ulong)targetId);
         if (targetPlayer == null || !targetPlayer.Exists)
         {
             HUDHandler.SendNotification(player, 4, 5000, "Fehler: Spieler ist nicht online."); return;
         }
         HUDHandler.SendNotification(targetPlayer, 1, 5000, $"{Characters.GetCharacterName((int)player.GetCharacterMetaId())} hat dich zu Ihm teleportiert.");
         HUDHandler.SendNotification(player, 2, 5000, $"Du hast den Spieler {Characters.GetCharacterName((int)targetPlayer.GetCharacterMetaId())} zu dir teleportiert.");
         targetPlayer.Position = player.Position + new Position(0, 0, 1);
     }
     catch (Exception e)
     {
         Alt.Log($"{e}");
     }
 }
Beispiel #23
0
 public static void cmd_BAn(IPlayer player, int accId)
 {
     try
     {
         if (player == null || !player.Exists || accId <= 0 || player.AdminLevel() <= 2)
         {
             return;
         }
         User.SetPlayerBanned(accId, true, $"Gebannt von {Characters.GetCharacterName(User.GetPlayerOnline(player))}");
         var targetP = Alt.Server.GetPlayers().ToList().FirstOrDefault(x => x != null && x.Exists && User.GetPlayerAccountId(x) == accId);
         if (targetP != null)
         {
             targetP.Kick("");
         }
         HUDHandler.SendNotification(player, 4, 5000, $"Spieler mit ID {accId} Erfolgreich gebannt.");
     }
     catch (Exception e)
     {
         Alt.Log($"{e}");
     }
 }
Beispiel #24
0
 public static void CMD_parkVehicleById(IPlayer player, int vehId)
 {
     try
     {
         if (player == null || !player.Exists || player.AdminLevel() <= 8 || vehId <= 0)
         {
             return;
         }
         var vehicle = Alt.Server.GetVehicles().ToList().FirstOrDefault(x => x != null && x.Exists && x.HasVehicleId() && (int)x.GetVehicleId() == vehId);
         if (vehicle == null)
         {
             return;
         }
         ServerVehicles.SetVehicleInGarage(vehicle, true, 25);
         HUDHandler.SendNotification(player, 4, 5000, $"Fahrzeug {vehId} in Garage 1(Pillbox) eingeparkt");
     }
     catch (Exception e)
     {
         Alt.Log($"{e}");
     }
 }
Beispiel #25
0
 public static void CMD_parkVehicle(IPlayer player, string plate)
 {
     try
     {
         if (player == null || !player.Exists || player.AdminLevel() <= 1 || string.IsNullOrWhiteSpace(plate))
         {
             return;
         }
         var vehicle = Alt.Server.GetVehicles().ToList().FirstOrDefault(x => x != null && x.Exists && x.HasVehicleId() && (int)x.GetVehicleId() > 0 && x.NumberplateText.ToLower() == plate.ToLower());
         if (vehicle == null)
         {
             return;
         }
         ServerVehicles.SetVehicleInGarage(vehicle, true, 25);
         HUDHandler.SendNotification(player, 4, 5000, $"Fahrzeug mit dem Kennzeichen {plate} in Garage 1 (Pillbox) eingeparkt");
     }
     catch (Exception e)
     {
         Alt.Log($"{e}");
     }
 }
Beispiel #26
0
 public static void cmd_KICK(IPlayer player, int charId)
 {
     try
     {
         if (player == null || !player.Exists || charId <= 0 || player.AdminLevel() <= 1)
         {
             return;
         }
         var targetP = Alt.Server.GetPlayers().ToList().FirstOrDefault(x => x != null && x.Exists && User.GetPlayerOnline(x) == charId);
         if (targetP == null)
         {
             return;
         }
         targetP.Kick("");
         HUDHandler.SendNotification(player, 4, 5000, $"Spieler mit Char-ID {charId} Erfolgreich gekickt.");
     }
     catch (Exception e)
     {
         Alt.Log($"{e}");
     }
 }
Beispiel #27
0
        public async Task DeleteLSPDIntranetWanted(ClassicPlayer player, int dbId, int selectedCharId)
        {
            try
            {
                if (player == null || !player.Exists || player.CharacterId <= 0 || dbId <= 0 || !CharactersWanteds.ExistWantedEntry(dbId) || !ServerFactions.IsCharacterInAnyFaction(player.CharacterId) || !ServerFactions.IsCharacterInFactionDuty(player.CharacterId) || (ServerFactions.GetCharacterFactionId(player.CharacterId) != 2 && ServerFactions.GetCharacterFactionId(player.CharacterId) != 12))
                {
                    return;
                }
                CharactersWanteds.RemoveWantedEntry(dbId);
                requestLSPDIntranetPersonWanteds(player, selectedCharId);

                foreach (ClassicPlayer policeMember in Alt.Server.GetPlayers().ToList().Where(x => x != null && x.Exists && ((ClassicPlayer)x).CharacterId > 0 && ServerFactions.IsCharacterInAnyFaction(((ClassicPlayer)x).CharacterId) && (ServerFactions.GetCharacterFactionId(((ClassicPlayer)x).CharacterId) == 2 || ServerFactions.GetCharacterFactionId(((ClassicPlayer)x).CharacterId) == 12)))
                {
                    HUDHandler.SendNotification(policeMember, 1, 3000, $"{Characters.GetCharacterName(player.CharacterId)} hat die Akte von {Characters.GetCharacterName(selectedCharId)} bearbeitet.");
                }
            }
            catch (Exception e)
            {
                Alt.Log($"{e}");
            }
        }
Beispiel #28
0
 public async Task WithdrawMoney(IPlayer player, int houseId, int money)
 {
     try
     {
         if (player == null || !player.Exists || houseId <= 0 || money <= 0)
         {
             return;
         }
         int charId = (int)player.GetCharacterMetaId();
         if (charId <= 0)
         {
             return;
         }
         int dimension = player.Dimension;
         if (dimension <= 10000)
         {
             return;
         }
         int dhouseId = dimension - 10000;
         if (dhouseId <= 0 || dhouseId != houseId || !ServerHouses.ExistHouse(houseId))
         {
             return;
         }
         if (ServerHouses.GetHouseOwner(houseId) != charId)
         {
             HUDHandler.SendNotification(player, 4, 5000, "Fehler: Du bist nicht der Hausbesitzer."); return;
         }
         if (ServerHouses.GetHouseBankMoney(houseId) < money)
         {
             HUDHandler.SendNotification(player, 4, 5000, $"Fehler: Soviel Geld ist nicht im Tresor (Aktueller Stand: {ServerHouses.GetHouseBankMoney(houseId)}$)."); return;
         }
         ServerHouses.SetHouseBankMoney(houseId, ServerHouses.GetHouseBankMoney(houseId) - money);
         CharactersInventory.AddCharacterItem(charId, "Bargeld", money, "inventory");
         HUDHandler.SendNotification(player, 2, 2500, $"Du hast erfolgreich {money}$ aus dem Tresor entnommen.");
     }
     catch (Exception e)
     {
         Alt.Log($"{e}");
     }
 }
Beispiel #29
0
        internal static void OpenLicensingCEF(IPlayer player)
        {
            try
            {
                if (player == null || !player.Exists)
                {
                    return;
                }
                int charId = User.GetPlayerOnline(player);
                if (charId <= 0)
                {
                    return;
                }
                if (!player.Position.IsInRange(Constants.Positions.VehicleLicensing_Position, 3f))
                {
                    HUDHandler.SendNotification(player, 4, 5000, "Fehler: Du hast dich zu weit entfernt."); return;
                }

                var vehicleList = Alt.Server.GetVehicles().Where(x => x.GetVehicleId() > 0 && x.Position.IsInRange(Constants.Positions.VehicleLicensing_VehPosition, 10f) && ServerVehicles.GetVehicleOwner(x) == charId).Select(x => new
                {
                    vehId    = x.GetVehicleId(),
                    ownerId  = ServerVehicles.GetVehicleOwner(x),
                    vehName  = ServerVehicles.GetVehicleNameOnHash(x.Model),
                    vehPlate = x.NumberplateText,
                }).ToList();

                if (vehicleList.Count <= 0)
                {
                    HUDHandler.SendNotification(player, 3, 5000, "Keines deiner Fahrzeuge steht hinter dem Rathaus (an der roten Fahrzeugmarkierung)."); return;
                }
                player.EmitLocked("Client:VehicleLicensing:openCEF", JsonConvert.SerializeObject(vehicleList));
                Alt.Log($"{JsonConvert.SerializeObject(vehicleList)}");
            }
            catch (Exception e)
            {
                Alt.Log($"{e}");
            }
        }
Beispiel #30
0
 public async Task SellHouse(IPlayer player, int houseId)
 {
     try
     {
         if (player == null || !player.Exists || houseId <= 0)
         {
             return;
         }
         int charId = (int)player.GetCharacterMetaId();
         if (charId <= 0)
         {
             return;
         }
         if (!ServerHouses.ExistHouse(houseId) || ServerHouses.GetHouseOwner(houseId) != charId)
         {
             HUDHandler.SendNotification(player, 4, 3500, "Fehler: Dieses Haus gehört nicht dir."); return;
         }
         if (!CharactersBank.HasCharacterBankMainKonto(charId))
         {
             HUDHandler.SendNotification(player, 3, 2500, "Du besitzt kein Haupt-Bankkonto"); return;
         }
         int accNumber  = CharactersBank.GetCharacterBankMainKonto(charId);
         int housePrice = ServerHouses.GetHousePrice(houseId) / 2;
         if (!CharactersBank.ExistBankAccountNumber(accNumber))
         {
             return;
         }
         ServerHouses.SetHouseLocked(houseId, true);
         ServerHouses.SetHouseOwner(houseId, 0);
         CharactersBank.SetBankAccountMoney(accNumber, CharactersBank.GetBankAccountMoney(accNumber) + housePrice);
         HUDHandler.SendNotification(player, 2, 2500, $"Haus erfolgreich für {housePrice}$ (50% Kaufpreis) verkauft.");
         ServerBankPapers.CreateNewBankPaper(accNumber, DateTime.Now.ToString("d", CultureInfo.CreateSpecificCulture("de-DE")), DateTime.Now.ToString("t", CultureInfo.CreateSpecificCulture("de-DE")), "Eingehende Überweisung", "Immobilienmakler", $"Hausverkauf: {ServerHouses.GetHouseStreet(houseId)}", $"+{housePrice}$", "Online-Banking");
     }
     catch (Exception e)
     {
         Alt.Log($"{e}");
     }
 }