public static void CMD_getAccountIdByMail(ClassicPlayer player, string mail) { try { if (player == null || !player.Exists || player.CharacterId <= 0 || player.AdminLevel() <= 0) { return; } var accEntry = User.Player.ToList().FirstOrDefault(x => x.Email == mail); if (accEntry == null) { return; } player.SendChatMessage($"Spieler-ID der E-Mail {mail} lautet: {accEntry.playerid} - Spielername: {accEntry.playerName}"); } catch (Exception e) { Alt.Log($"{e}"); } }
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}"); } }
public async Task CharacterSelectedSpawnPlace(ClassicPlayer client, string spawnstr, string charcid) { if (client == null || !client.Exists || spawnstr == null || charcid == null) { return; } Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); int charid = Convert.ToInt32(charcid); if (charid <= 0) { return; } string charName = Characters.GetCharacterName(charid); await User.SetPlayerOnline(client, charid); //Online Feld = CharakterID client.CharacterId = charid; if (Characters.GetCharacterFirstJoin(charid) && Characters.GetCharacterFirstSpawnPlace(client, charid) == "unset") { Characters.SetCharacterFirstSpawnPlace(client, charid, spawnstr); CharactersInventory.AddCharacterItem(charid, "Bargeld", 10000, "inventory"); CharactersInventory.AddCharacterItem(charid, "Tasche", 1, "inventory"); Characters.SetCharacterBackpack(client, "Tasche"); CharactersInventory.AddCharacterItem(charid, "Sandwich", 3, "backpack"); //ToDo: Trinken hinzufuegen CharactersInventory.AddCharacterItem(charid, "Tablet", 1, "inventory"); CharactersInventory.AddCharacterItem(charid, "Smartphone", 1, "inventory"); switch (spawnstr) { case "lsairport": Characters.CreateCharacterLastPos(charid, Constants.Positions.SpawnPos_Airport, 0); break; case "beach": Characters.CreateCharacterLastPos(charid, Constants.Positions.SpawnPos_Beach, 0); break; case "sandyshores": Characters.CreateCharacterLastPos(charid, Constants.Positions.SpawnPos_SandyShores, 0); break; case "paletobay": Characters.CreateCharacterLastPos(charid, Constants.Positions.SpawnPos_PaletoBay, 0); break; case null: Characters.CreateCharacterLastPos(charid, Constants.Positions.SpawnPos_Airport, 0); break; } } if (Characters.GetCharacterGender(charid)) { client.Model = 0x9C9EFFD8; } else { client.Model = 0x705E61F2; } client.EmitLocked("Client:ServerBlips:LoadAllBlips", ServerBlips.GetAllServerBlips()); client.EmitLocked("Client:ServerMarkers:LoadAllMarkers", ServerBlips.GetAllServerMarkers()); client.EmitLocked("Client:SpawnArea:setCharSkin", Characters.GetCharacterSkin("facefeatures", charid), Characters.GetCharacterSkin("headblendsdata", charid), Characters.GetCharacterSkin("headoverlays", charid)); Position dbPos = Characters.GetCharacterLastPosition(charid); client.Position = dbPos; client.Spawn(dbPos, 0); client.Dimension = Characters.GetCharacterLastDimension(charid); client.Health = (ushort)(Characters.GetCharacterHealth(charid) + 100); client.Armor = (ushort)Characters.GetCharacterArmor(charid); HUDHandler.CreateHUDBrowser(client); //HUD erstellen WeatherHandler.SetRealTime(client); //Echtzeit setzen Characters.SetCharacterCorrectClothes(client); Characters.SetCharacterLastLogin(charid, DateTime.Now); Characters.SetCharacterCurrentFunkFrequence(charid, null); Alt.Log($"Eingeloggt {client.Name}"); Alt.Emit("PlayerLoggedIn", client); client.EmitLocked("SaltyChat_OnConnected"); if (Characters.IsCharacterUnconscious(charid)) { DeathHandler.openDeathscreen(client); } if (Characters.IsCharacterFastFarm(charid)) { var fastFarmTime = Characters.GetCharacterFastFarmTime(charid) * 60000; client.EmitLocked("Client:Inventory:PlayEffect", "DrugsMichaelAliensFight", fastFarmTime); HUDHandler.SendNotification(client, 2, 2000, $"Du bist durch dein Koks noch {fastFarmTime} Minuten effektiver."); } ServerAnimations.RequestAnimationMenuContent(client); if (Characters.IsCharacterPhoneEquipped(charid) && CharactersInventory.ExistCharacterItem(charid, "Smartphone", "inventory") && CharactersInventory.GetCharacterItemAmount(charid, "Smartphone", "inventory") > 0) { client.EmitLocked("Client:Smartphone:equipPhone", true, Characters.GetCharacterPhonenumber(charid), Characters.IsCharacterPhoneFlyModeEnabled(charid)); Characters.SetCharacterPhoneEquipped(charid, true); } else if (!Characters.IsCharacterPhoneEquipped(charid) || !CharactersInventory.ExistCharacterItem(charid, "Smartphone", "inventory") || CharactersInventory.GetCharacterItemAmount(charid, "Smartphone", "inventory") <= 0) { client.EmitLocked("Client:Smartphone:equipPhone", false, Characters.GetCharacterPhonenumber(charid), Characters.IsCharacterPhoneFlyModeEnabled(charid)); Characters.SetCharacterPhoneEquipped(charid, false); } SmartphoneHandler.RequestLSPDIntranet(client); await setCefStatus(client, false); AltAsync.Do(() => { client.SetStreamSyncedMetaData("sharedUsername", $"{charName} ({Characters.GetCharacterAccountId(charid)})"); client.SetSyncedMetaData("ADMINLEVEL", client.AdminLevel()); client.SetSyncedMetaData("PLAYER_SPAWNED", true); }); if (Characters.IsCharacterInJail(charid)) { HUDHandler.SendNotification(client, 1, 2500, $"Du befindest dich noch {Characters.GetCharacterJailTime(charid)} Minuten im Gefängnis.", 8000); client.Position = new Position(1691.4594f, 2565.7056f, 45.556763f); if (Characters.GetCharacterGender(charid) == false) { client.EmitLocked("Client:SpawnArea:setCharClothes", 11, 5, 0); client.EmitLocked("Client:SpawnArea:setCharClothes", 3, 5, 0); client.EmitLocked("Client:SpawnArea:setCharClothes", 4, 7, 15); client.EmitLocked("Client:SpawnArea:setCharClothes", 6, 7, 0); client.EmitLocked("Client:SpawnArea:setCharClothes", 8, 1, 88); } else { } } client.updateTattoos(); stopwatch.Stop(); if (stopwatch.Elapsed.Milliseconds > 30) { Alt.Log($"{charid} - CharacterSelectedSpawnPlace benötigte {stopwatch.Elapsed.Milliseconds}ms"); } await Task.Delay(5000); Model.ServerTattoos.GetAllTattoos(client); }