Пример #1
0
        [Command("spectate")] //Spionieren
        public void SpectatePlayer(Client player, string target1)
        {
            if (!PlayerCommands.CheckAdminPermission(player, 1))
            {
                return;
            }

            Client target = PlayerCommands.FindPlayer(player, target1);

            if (target == null)
            {
                return;
            }

            if (target == player)
            {
                API.SendChatMessageToPlayer(player, "~r~Du kannst dich nicht selber beobachten!");

                return;
            }

            API.SetPlayerToSpectatePlayer(player, target);

            API.SendChatMessageToPlayer(player, string.Format("~b~Du beobachtest nun {0}.", target.Name));
        }
Пример #2
0
        [Command("sethealth", Alias = "health")] //Gesundheit setzen
        public void SetHealth(Client player, string target1, int health)
        {
            if (!PlayerCommands.CheckAdminPermission(player, 1))
            {
                return;
            }

            Client target = PlayerCommands.FindPlayer(player, target1);

            if (target == null)
            {
                return;
            }

            if (health < 0)
            {
                health = 0;
            }
            if (health > 100)
            {
                health = 100;
            }
            API.SetPlayerHealth(target, health);

            API.SendChatMessageToPlayer(target, String.Format("~b~Dein Leben wurde von {0} auf {1}% geändert.", player.Name, health));
            API.SendChatMessageToPlayer(player, String.Format("~b~Du hast das Leben von {0} auf {1}% geändert.", target.Name, health));
        }
Пример #3
0
        [Command("kill")] //Spieler töten
        public void Kill(Client player, string target1)
        {
            if (!PlayerCommands.CheckAdminPermission(player, 4))
            {
                return;
            }

            Client target = PlayerCommands.FindPlayer(player, target1);

            if (target == null)
            {
                return;
            }

            target.Kill();

            if (target == player)
            {
                API.SendChatMessageToPlayer(player, "~b~Du hast dich selbst getötet.");
            }
            else
            {
                API.SendChatMessageToPlayer(target, string.Format("~b~Du wurdest von {0} getötet.", player.Name));
                API.SendChatMessageToPlayer(player, string.Format("~b~Du hast {0} getötet.", target.Name));
            }
        }
Пример #4
0
        [Command("teleport", Alias = "tp", GreedyArg = true)] //Zum Spieler teleportieren
        public void Teleport(Client player, string target1)
        {
            if (!PlayerCommands.CheckAdminPermission(player, 1))
            {
                return;
            }

            Client target = PlayerCommands.FindPlayer(player, target1);

            if (target == null)
            {
                return;
            }

            if (target.IsInVehicle)
            {
                player.SetIntoVehicle(target.Vehicle, -2);
            }
            else
            {
                player.Position = target.Position;
            }

            player.SendChatMessage("~b~Du hast dich zu " + target.Name + " teleportiert");
        }
Пример #5
0
        [Command("ip", "~y~Benutzung: ~w~/ip [Spieler]")] //IP anzeigen
        public void IPAdresse(Client player, string target1)
        {
            if (!PlayerCommands.CheckAdminPermission(player, 4))
            {
                return;
            }

            Client target = PlayerCommands.FindPlayer(player, target1);

            if (target == null)
            {
                return;
            }


            API.SendChatMessageToPlayer(player, String.Format("~b~* IP Adresse von {0}: {1}", target.Name, API.GetPlayerAddress(target)));
        }
Пример #6
0
        [Command("kick")] //Spieler kicken
        public void Kick(Client player, string target1, string reason)
        {
            if (!PlayerCommands.CheckAdminPermission(player, 1))
            {
                return;
            }

            Client target = PlayerCommands.FindPlayer(player, target1);

            if (target == null)
            {
                return;
            }

            API.KickPlayer(target, reason);

            API.SendChatMessageToPlayer(player, "~r~Du hast {1} gekickt. (Grund: {2})");
        }
Пример #7
0
        [Command("setskin", Alias = "skin")] //Skin ändern
        public void Skin(Client player, string target1, PedHash skin)
        {
            if (!PlayerCommands.CheckAdminPermission(player, 1))
            {
                return;
            }

            Client target = PlayerCommands.FindPlayer(player, target1);

            if (target == null)
            {
                return;
            }

            API.SetPlayerSkin(target, skin);

            API.SendChatMessageToPlayer(target, string.Format("~b~Dein Skin wurde von {0} zu {1} geändert.", player.Name, skin));
            API.SendChatMessageToPlayer(player, string.Format("~b~Du hast den Skin von {0} zu {1} geändert.", target.Name, skin));
        }
Пример #8
0
        [Command("unspectate")] //Spionieren beenden
        public void Unspectate(Client player, string target1)
        {
            if (!PlayerCommands.CheckAdminPermission(player, 1))
            {
                return;
            }

            Client target = PlayerCommands.FindPlayer(player, target1);

            if (target == null)
            {
                return;
            }

            API.UnspectatePlayer(target);

            API.SendChatMessageToPlayer(target, string.Format("~b~{0} hat deinen Zuschauermodus deaktiviert.", player.Name));
            API.SendChatMessageToPlayer(player, string.Format("~b~Du hast {0}'s Zuschauermodus deaktiviert.", target.Name));
        }
Пример #9
0
        [Command("resetclothes")] //Kleidung zurücksetzen
        public void DefaultClothes(Client player, string target1)
        {
            if (!PlayerCommands.CheckAdminPermission(player, 2))
            {
                return;
            }

            Client target = PlayerCommands.FindPlayer(player, target1);

            if (target == null)
            {
                return;
            }

            API.SetPlayerDefaultClothes(target);

            API.SendChatMessageToPlayer(target, string.Format("~b~{0} hat deine Kleidung zurück gesetzt.", player.Name));
            API.SendChatMessageToPlayer(player, string.Format("~b~Du hast {0}'s Kleidung zurück gesetzt.", target.Name));
        }
Пример #10
0
        [Command("setaccessory", Alias = "accessory")] //Accessoir ändern
        public void SetAccessory(Client player, string target1, int slot, int drawable, int texture = 0)
        {
            if (!PlayerCommands.CheckAdminPermission(player, 2))
            {
                return;
            }

            Client target = PlayerCommands.FindPlayer(player, target1);

            if (target == null)
            {
                return;
            }

            API.SetPlayerAccessory(target, slot, drawable, texture);

            API.SendChatMessageToPlayer(target, string.Format("~b~{0} hat deine Accessoires geändert.", player.Name));
            API.SendChatMessageToPlayer(player, string.Format("~b~Du hast {0} seine Accessoires geändert.", target.Name));
        }
Пример #11
0
        [Command("giveweapon", Alias = "weapon")] //Waffe geben
        public void GiveWeapon(Client player, string target1, WeaponHash weapon, int ammo = 0, bool equip = false, bool loaded = false)
        {
            if (!PlayerCommands.CheckAdminPermission(player, 2))
            {
                return;
            }

            Client target = PlayerCommands.FindPlayer(player, target1);

            if (target == null)
            {
                return;
            }

            API.GivePlayerWeapon(target, weapon, ammo, equip, loaded);

            API.SendChatMessageToPlayer(target, string.Format("~b~Du hast von {0} ein(e) {1} mit {2} Munition erhalten.", player.Name, weapon, ammo));
            API.SendChatMessageToPlayer(player, string.Format("~b~Du hast {0} ein(e) {1} mit {2} Munition gegeben.", target.Name, weapon, ammo));
        }
Пример #12
0
        [Command("settint", Alias = "tint")] //Waffen Farbe ändern
        public void SetTint(Client player, string target1, WeaponHash weapon, WeaponTint tint)
        {
            if (!PlayerCommands.CheckAdminPermission(player, 2))
            {
                return;
            }

            Client target = PlayerCommands.FindPlayer(player, target1);

            if (target == null)
            {
                return;
            }

            API.SetPlayerWeaponTint(target, weapon, tint);

            API.SendChatMessageToPlayer(target, string.Format("~b~{0} hat die Färbung von {1} auf {2} geändert.", player.Name, weapon, tint));
            API.SendChatMessageToPlayer(player, string.Format("~b~Du hast {0}'s Färbung von {1} auf {2} geändert.", target.Name, weapon, tint));
        }
Пример #13
0
        [Command("setammo", Alias = "ammo")] //Munition geben
        public void SetAmmo(Client player, string target1, WeaponHash weapon, int ammo)
        {
            if (!PlayerCommands.CheckAdminPermission(player, 2))
            {
                return;
            }

            Client target = PlayerCommands.FindPlayer(player, target1);

            if (target == null)
            {
                return;
            }

            API.SetPlayerWeaponAmmo(target, weapon, ammo);

            API.SendChatMessageToPlayer(target, string.Format("~b~{0} hat die Munition von {1} auf {2} geändert.", player.Name, weapon, ammo));
            API.SendChatMessageToPlayer(player, string.Format("~b~Du hast {0}'s Munition von {1} auf {2} geändert.", target.Name, weapon, ammo));
        }
Пример #14
0
        [Command("giveweaponcomponent", Alias = "component")] //Waffen Komponente geben
        public void GiveWeaponComponent(Client player, string target1, WeaponHash weapon, WeaponComponent component)
        {
            if (!PlayerCommands.CheckAdminPermission(player, 2))
            {
                return;
            }

            Client target = PlayerCommands.FindPlayer(player, target1);

            if (target == null)
            {
                return;
            }

            API.GivePlayerWeaponComponent(target, weapon, component);

            API.SendChatMessageToPlayer(target, string.Format("~b~{0} hat dir ein(e) {1} für dein(e) {2} gegeben.", player.Name, component, weapon));
            API.SendChatMessageToPlayer(player, string.Format("~b~Du hast {0} ein(e) {1} für sein(e) {2} gegeben.", target.Name, component, weapon));
        }
Пример #15
0
        [Command("money", "~y~Benutzung: ~w~/money [Spieler] [Betrag]")] //Geld geben
        public void Money(Client player, string target1, int amount = 0)
        {
            if (!PlayerCommands.CheckAdminPermission(player, 4))
            {
                return;
            }

            Client target = PlayerCommands.FindPlayer(player, target1);

            if (target == null)
            {
                return;
            }

            double oldMoney = double.Parse(target.GetData("CashMoney").ToString());

            if (amount == 0)
            {
                API.SendChatMessageToPlayer(player, string.Format("~b~{0} hat ${1} in der Tasche.", target.Name, oldMoney));
                return;
            }

            double newMoney = 0;

            if (amount < 0)
            {
                newMoney = oldMoney - amount;
                if (newMoney < 0)
                {
                    newMoney = 0;
                }
            }
            else if (amount > 0)
            {
                newMoney = oldMoney + amount;
            }

            target.SetData("CashMoney", newMoney);
            target.TriggerEvent("update_money_display", target.GetData("CashMoney").ToString());

            player.SendChatMessage("~b~[System]~w~ Du hast " + target.Name + " " + amount + "$ gegeben");
        }
Пример #16
0
        [Command("godmode", Alias = "god")] //Gott Modus
        public void GodMode(Client player, string target1, bool enabled)
        {
            if (!PlayerCommands.CheckAdminPermission(player, 1))
            {
                return;
            }

            Client target = PlayerCommands.FindPlayer(player, target1);

            if (target == null)
            {
                return;
            }

            API.SetEntityInvincible(target.Handle, enabled);

            if (target == player)
            {
                if (enabled)
                {
                    API.SendChatMessageToPlayer(player, "~b~Dein Godmode wurde aktiviert.");
                }
                else
                {
                    API.SendChatMessageToPlayer(player, "~b~Dein Godmode wurde deaktiviert.");
                }

                return;
            }

            if (enabled)
            {
                API.SendChatMessageToPlayer(target, string.Format("~b~{0} hat deinen Godmode aktiviert.", player.Name));
                API.SendChatMessageToPlayer(player, string.Format("~b~Du hast {0}'s Godmode aktiviert.", target.Name));
            }
            else
            {
                API.SendChatMessageToPlayer(target, string.Format("~b~{0} hat deinen Godmode deaktiviert.", player.Name));
                API.SendChatMessageToPlayer(player, string.Format("~b~Du hast {0}'s Godmode deaktiviert.", target.Name));
            }
        }
Пример #17
0
        [Command("freeze", "~y~Benutzung: ~w~/freeze [Spieler] [Freezed]")] //Spieler einfrieren
        public void FreezePlayer(Client player, string target1, bool freeze)
        {
            if (!PlayerCommands.CheckAdminPermission(player, 1))
            {
                return;
            }

            Client target = PlayerCommands.FindPlayer(player, target1);

            if (target == null)
            {
                return;
            }

            API.SetEntityPositionFrozen(target.Handle, freeze);

            if (target == player)
            {
                if (freeze)
                {
                    API.SendChatMessageToPlayer(player, "~r~Du hast dich gefreezed.");
                }
                else
                {
                    API.SendChatMessageToPlayer(player, "~r~Du hast dich entfreezed.");
                }

                return;
            }

            if (freeze)
            {
                API.SendChatMessageToPlayer(target, string.Format("~b~Du wurdest von {0} gefreezed.", player.Name));
                API.SendChatMessageToPlayer(player, string.Format("~b~Du hast {0} gefreezed.", target.Name));
            }
            else
            {
                API.SendChatMessageToPlayer(target, string.Format("~b~Du wurdest von {0} entfreezed.", player.Name));
                API.SendChatMessageToPlayer(player, string.Format("~b~Du hast {0} entfreezed.", target.Name));
            }
        }
Пример #18
0
        [Command("warp", GreedyArg = true)] //Spieler zu sich teleportieren
        public void Warp(Client player, string target1)
        {
            if (!PlayerCommands.CheckAdminPermission(player, 1))
            {
                return;
            }

            Client target = PlayerCommands.FindPlayer(player, target1);

            if (target == null)
            {
                return;
            }

            if (player == target)
            {
                API.SendChatMessageToPlayer(player, "~r~Du kannst dich nicht selbst zu dir teleportieren!");
                return;
            }

            target.Position = player.Position;
            player.SendChatMessage("~b~Du hast " + target.Name + " zu dir teleportiert.");
        }