private void Start()
    {
        GameObject SpawnManager = GameObject.FindGameObjectWithTag("SpawnAnimals");

        SpawninAnim         = SpawnManager.GetComponent <SpawnAnimals>();
        SpawninAnim.enabled = false;
    }
Exemple #2
0
 public static void explode(Vector3 position, float range, int damage)
 {
     Collider[] colliderArray = Physics.OverlapSphere(position, range, RayMasks.ATTACKABLE);
     for (int i = 0; i < (int)colliderArray.Length; i++)
     {
         if (RayMasks.isVisible(position, colliderArray[i].transform.position + Vector3.up))
         {
             if (colliderArray[i].tag == "Player")
             {
                 if (ServerSettings.pvp)
                 {
                     colliderArray[i].GetComponent <Life>().damage(damage, "You were blown up by an explosion.", -2, "");
                     NetworkEffects.askEffect("Effects/flesh", colliderArray[i].transform.position + Vector3.up, Quaternion.identity, -1f);
                 }
             }
             else if (colliderArray[i].tag == "Enemy")
             {
                 if (ServerSettings.pvp)
                 {
                     GameObject owner = OwnerFinder.getOwner(colliderArray[i].gameObject);
                     owner.GetComponent <Life>().damage(damage, "You were blown up by an explosion.", -2, "");
                     NetworkEffects.askEffect("Effects/flesh", colliderArray[i].transform.position + Vector3.up, Quaternion.identity, -1f);
                 }
             }
             else if (colliderArray[i].tag == "Animal")
             {
                 GameObject gameObject = OwnerFinder.getOwner(colliderArray[i].gameObject);
                 gameObject.GetComponent <AI>().damage(damage);
                 NetworkEffects.askEffect("Effects/flesh", colliderArray[i].transform.position + Vector3.up, Quaternion.identity, -1f);
             }
             else if (colliderArray[i].tag == "Barricade")
             {
                 if (ServerSettings.pvp)
                 {
                     SpawnBarricades.damage(colliderArray[i].transform.parent.position, damage);
                 }
             }
             else if (colliderArray[i].tag == "Structure")
             {
                 if (ServerSettings.pvp)
                 {
                     // FIXME: explosion to structures?
                     //SpawnStructures.damage(colliderArray[i].transform.parent.position, damage);
                 }
             }
             else if (colliderArray[i].tag == "Vehicle" && ServerSettings.pvp)
             {
                 colliderArray[i].GetComponent <Vehicle>().damage(damage);
             }
         }
     }
     SpawnAnimals.attract(position + Vector3.up, 64f);
 }
Exemple #3
0
    // Start is called before the first frame update
    public void Start()
    {
        manager     = GameObject.Find("Game Manager");
        gameManager = manager.GetComponent <GameManager>();

        hunterSpawner = GameObject.Find("Hunter Spawner").GetComponent <SpawnHunters>();
        animalSpawner = GameObject.Find("Animal Spawner").GetComponent <SpawnAnimals>();

        player           = GameObject.FindWithTag("Player");
        playerController = player.GetComponent <PlayerController>();
        playerTransform  = player.transform;

        StartMinigame();
    }
Exemple #4
0
        private void RespawnNPC(NetworkCommandArgs args)
        {
            string text = String.Empty;

            try
            {
                SpawnAnimals.reset();
                text = "Successfully respawned all zombies & animals";
                byte[] serverbuffer = Encoding.UTF8.GetBytes(text);
                args.sender.SendBytes(serverbuffer);
            }
            catch
            {
                text = "Error occured while tried to Respawn all NPC";
                byte[] serverbuffer = Encoding.UTF8.GetBytes(text);
                args.sender.SendBytes(serverbuffer);
            }
        }
Exemple #5
0
 public void respawn()
 {
     SpawnAnimals.Respawn(base.gameObject);
 }
Exemple #6
0
 public void onReady()
 {
     SpawnAnimals.model = GameObject.Find(Application.loadedLevelName).transform.FindChild("animals").gameObject;
     SpawnAnimals.reset();
 }
Exemple #7
0
 public static void Respawn(GameObject npc)
 {
     Network.RemoveRPCs(npc.networkView.viewID);
     Network.Destroy(npc.networkView.viewID);
     SpawnAnimals.Spawn();
 }
Exemple #8
0
 public void attract()
 {
     SpawnAnimals.attract(base.transform.position + Vector3.up, 30f);
 }
Exemple #9
0
 private void ResetZombies(CommandArgs args)
 {
     SpawnAnimals.reset();
     NetworkChat.sendAlert(args.sender.name + " has respawned all zombies");
 }
Exemple #10
0
 public void drive(float turn, float thrust)
 {
     if (this.real)
     {
         this.frontLeft.steerAngle  = Mathf.Lerp(this.frontLeft.steerAngle, turn * (float)this.maxTurn, 4f * Time.deltaTime);
         this.frontRight.steerAngle = Mathf.Lerp(this.frontRight.steerAngle, turn * (float)this.maxTurn, 4f * Time.deltaTime);
         if (thrust != -1000f)
         {
             if (this.fuel <= 0 || this.health < 5)
             {
                 this.backLeft.motorTorque  = Mathf.Lerp(this.backLeft.motorTorque, 0f, 4f * Time.deltaTime);
                 this.backRight.motorTorque = Mathf.Lerp(this.backRight.motorTorque, 0f, 4f * Time.deltaTime);
             }
             else if (thrust > 0f)
             {
                 if (base.rigidbody.velocity.magnitude >= (float)this.maxSpeed)
                 {
                     this.backLeft.motorTorque  = Mathf.Lerp(this.backLeft.motorTorque, 0f, 4f * Time.deltaTime);
                     this.backRight.motorTorque = Mathf.Lerp(this.backRight.motorTorque, 0f, 4f * Time.deltaTime);
                 }
                 else
                 {
                     this.backLeft.motorTorque  = Mathf.Lerp(this.backLeft.motorTorque, thrust * (float)this.maxSpeed, 4f * Time.deltaTime);
                     this.backRight.motorTorque = Mathf.Lerp(this.backRight.motorTorque, thrust * (float)this.maxSpeed, 4f * Time.deltaTime);
                 }
             }
             else if (base.rigidbody.velocity.magnitude >= (float)(this.maxSpeed / 2))
             {
                 this.backLeft.motorTorque  = Mathf.Lerp(this.backLeft.motorTorque, 0f, 4f * Time.deltaTime);
                 this.backRight.motorTorque = Mathf.Lerp(this.backRight.motorTorque, 0f, 4f * Time.deltaTime);
             }
             else
             {
                 this.backLeft.motorTorque  = Mathf.Lerp(this.backLeft.motorTorque, thrust * (float)this.maxSpeed / 2f, 4f * Time.deltaTime);
                 this.backRight.motorTorque = Mathf.Lerp(this.backRight.motorTorque, thrust * (float)this.maxSpeed / 2f, 4f * Time.deltaTime);
             }
             this.backLeft.brakeTorque  = Mathf.Lerp(this.backLeft.brakeTorque, 2f, 4f * Time.deltaTime);
             this.backRight.brakeTorque = Mathf.Lerp(this.backRight.brakeTorque, 2f, 4f * Time.deltaTime);
         }
         else
         {
             this.backLeft.motorTorque  = Mathf.Lerp(this.backLeft.motorTorque, 0f, 4f * Time.deltaTime);
             this.backRight.motorTorque = Mathf.Lerp(this.backRight.motorTorque, 0f, 4f * Time.deltaTime);
             this.backLeft.brakeTorque  = Mathf.Lerp(this.backLeft.brakeTorque, 20f, 4f * Time.deltaTime);
             this.backRight.brakeTorque = Mathf.Lerp(this.backRight.brakeTorque, 20f, 4f * Time.deltaTime);
         }
         if (this.fuel > 0 && this.health >= 5 && Screen.lockCursor)
         {
             if (Input.GetMouseButtonDown(0) && (double)(Time.realtimeSinceStartup - this.lastHorn) > 0.25)
             {
                 this.lastHorn = Time.realtimeSinceStartup;
                 NetworkSounds.askSound("Sounds/Vehicles/horn", base.transform.position + (base.transform.right * 3f), 1f, 1.25f, 2f);
                 SpawnAnimals.attract(base.transform.position, 64f);
             }
             if (Input.GetMouseButtonDown(1))
             {
                 base.networkView.RPC("tellHeadlights", RPCMode.All, new object[] { !this.headlights });
                 NetworkSounds.askSound("Sounds/General/firemode", base.transform.position, 0.1f, UnityEngine.Random.Range(0.9f, 1.1f), 1f);
             }
             if (Input.GetKeyDown(InputSettings.otherKey) && base.transform.FindChild("siren") != null)
             {
                 base.networkView.RPC("tellSirens", RPCMode.All, new object[] { !this.sirens });
                 NetworkSounds.askSound("Sounds/General/firemode", base.transform.position, 0.1f, UnityEngine.Random.Range(0.9f, 1.1f), 1f);
             }
         }
         if (Mathf.Abs(this.lastSpeed) != (int)base.rigidbody.velocity.magnitude)
         {
             base.networkView.RPC("updateSpeed", RPCMode.All, new object[] { (thrust < 0f ? -(int)base.rigidbody.velocity.magnitude : (int)base.rigidbody.velocity.magnitude) });
         }
         this.steerer.localRotation = Quaternion.Euler(0f, -75f, Viewmodel.swayRoll);
         if (this.lastTurn != (int)Viewmodel.swayRoll)
         {
             base.networkView.RPC("updateTurn", RPCMode.All, new object[] { (int)Viewmodel.swayRoll });
         }
         if ((double)(Time.realtimeSinceStartup - this.lastTick) > 0.2)
         {
             this.lastTick = Time.realtimeSinceStartup;
             if ((base.transform.position - this.lastPosition).sqrMagnitude > 1f)
             {
                 this.lastPosition = this.position;
                 base.networkView.RPC("updatePosition", RPCMode.All, new object[] { base.transform.position, base.transform.rotation });
             }
         }
     }
 }
        public void checkForCommands()
        {
            if (getLastMessageText().StartsWith("/"))
            {
                UpdatePlayerList(true);

                String sender   = getLastMessagePlayerName();
                String commando = getLastMessageText();

                string groupString = getLastMessageGroup();

                lastUsedCommand = commando;

                if (loggingCommands)
                {
                    LogCommand(sender + ":" + commando);
                }


                //commands for non-admins

                if (commando.Equals("/online"))
                {
                    resetChat();
                    getNetworkChat().askChat("There are " + names.Count + " players online.", 2, getNetworkPlayerByPlayerName(sender));
                    return;
                }
                else if (commando.StartsWith("/time"))
                {
                    resetChat();
                    NetworkChat.sendAlert("Time: " + Sun.getTime());
                    return;
                }

                else if (commando.Equals("/sethome"))
                {
                    resetChat();
                    if (usePlayerHomes)
                    {
                        Vector3 location = NetworkUserList.getModelFromPlayer(getNetworkPlayerByPlayerName(sender)).transform.position;

                        setHome(getSteamIDByPlayerName(sender), location);


                        getNetworkChat().askChat("Home set.", 2, getNetworkPlayerByPlayerName(sender));
                    }
                    return;
                }



                else if (commando.Equals("/home"))
                {
                    resetChat();
                    if (usePlayerHomes)
                    {
                        //getNetworkChat().askChat("Teleporting home in 5 seconds...", 2, getNetworkPlayerByPlayerName(sender));
                        //Thread.Sleep(5000);
                        // what use has a delay if I cant check if the player moves while waiting ...
                        home(sender, getSteamIDByPlayerName(sender));
                        getNetworkChat().askChat("Teleported home. Don't move for 5 seconds if you don't wanna get kicked", 2, getNetworkPlayerByPlayerName(sender));
                    }
                    return;
                }

                if (isAdmin(sender) || (usingConsole && groupString.Equals(ConsolePassword)))
                {
                    if (!groupString.Equals(ConsolePassword) && requireCommandConfirmation && !commandconfirmed && commando.ToUpper().Equals("/" + confirmationString.ToUpper()))
                    {
                        resetChat();
                        commandconfirmed = true;

                        sendAdminTextToHost(tempCommand);
                        return;
                    }
                    if (!groupString.Equals(ConsolePassword) && requireCommandConfirmation && !commandconfirmed)
                    {
                        resetChat();
                        tempCommand        = commando;
                        tempSender         = sender;
                        confirmationString = RandomString(4);
                        Tell(getNetworkPlayerByPlayerName(sender), "Please confirm your command, type /" + confirmationString);
                        return;
                    }

                    /*if (getAdminLevel(sender) == -1 && sender != tempSender)
                     * {
                     *  getNetworkChat().askChat("An error occured! You appear to not have Admin Rights!", 2, getNetworkPlayerByPlayerName(sender));
                     *  return;
                     * }*/

                    //int permLvl = getAdminLevel(sender);
                    int permLvl = 4;
                    if (commando.StartsWith("/repeat") && permLvl >= 1)
                    {
                        resetChat();
                        NetworkChat.sendAlert(commando.Substring(8));
                    }



                    else if (commando.StartsWith("/ban") && permLvl >= 1)
                    {
                        resetChat();
                        String naam = commando.Substring(5);
                        if (naam.Length < 3)
                        {
                            naam        = names[Convert.ToInt32(naam)];
                            tempBanName = naam;
                            getNetworkChat().askChat("Reason for banning " + naam + " ?  /reason <reason> to ban", 2, getNetworkPlayerByPlayerName(sender));
                        }
                        else
                        {
                            tempBanName = naam;
                            getNetworkChat().askChat("Reason for banning " + naam + " ?  /reason <reason> to ban", 2, getNetworkPlayerByPlayerName(sender));
                        }
                    }
                    else if (commando.StartsWith("/kick") && permLvl >= 1)
                    {
                        resetChat();
                        String naam = commando.Substring(6);
                        if (naam.Length < 3)
                        {
                            naam = names[Convert.ToInt32(naam)];
                            getNetworkChat().askChat("Kick " + naam + " ?  /y to confirm", 2, getNetworkPlayerByPlayerName(sender));
                            tempKickName = naam;
                        }
                        else
                        {
                            playerName = naam;
                            KICK();
                        }
                    }
                    else if (commando.Equals("/y"))
                    { // kick
                        resetChat();
                        playerName = tempKickName;
                        KICK();
                    }

                    else if (commando.StartsWith("/reason") && permLvl >= 1)
                    {
                        resetChat();
                        reason   = commando.Substring(8);
                        playerID = getSteamIDByPlayerName(tempBanName);
                        if (!playerID.Equals(""))
                        {
                            playerName = tempBanName;
                            BAN();
                        }
                    }
                    else if (commando.StartsWith("/resetitems") && permLvl >= 2)
                    {
                        resetChat();
                        SpawnItems.reset();
                        NetworkChat.sendAlert(sender + " has respawned all items");
                    }
                    else if (commando.StartsWith("/repairvehicles") && permLvl >= 1)
                    {
                        resetChat();
                        Vehicle[] vehicles = UnityEngine.Object.FindObjectsOfType(typeof(Vehicle)) as Vehicle[];
                        foreach (Vehicle vehicle in vehicles)
                        {
                            vehicle.networkView.RPC("tellExploded", RPCMode.All, new object[] { false });
                            vehicle.networkView.RPC("tellWrecked", RPCMode.All, new object[] { false });

                            vehicle.heal(1000);
                        }
                        NetworkChat.sendAlert(sender + " has repaired " + vehicles.Length + " vehicles");
                    }
                    else if (commando.StartsWith("/refuelvehicles") && permLvl >= 1)
                    {
                        resetChat();
                        Vehicle[] vehicles = UnityEngine.Object.FindObjectsOfType(typeof(Vehicle)) as Vehicle[];
                        foreach (Vehicle vehicle in vehicles)
                        {
                            vehicle.fill(1000);
                        }
                        NetworkChat.sendAlert(sender + " has refueled " + vehicles.Length + " vehicles");
                    }
                    else if (commando.StartsWith("/sirens") && permLvl >= 1)
                    {
                        resetChat();
                        Vehicle[] vehicles = UnityEngine.Object.FindObjectsOfType(typeof(Vehicle)) as Vehicle[];
                        foreach (Vehicle vehicle in vehicles)
                        {
                            vehicle.networkView.RPC("tellSirens", RPCMode.All, new object[] { true });
                        }
                    }
                    else if (commando.Equals("/sirensoff") && permLvl >= 1)
                    {
                        resetChat();
                        Vehicle[] vehicles = UnityEngine.Object.FindObjectsOfType(typeof(Vehicle)) as Vehicle[];
                        foreach (Vehicle vehicle in vehicles)
                        {
                            vehicle.networkView.RPC("tellSirens", RPCMode.All, new object[] { false });
                        }
                    }

                    else if (commando.StartsWith("/resetzombies") && permLvl >= 2)
                    {
                        resetChat();
                        SpawnAnimals.reset();
                        NetworkChat.sendAlert(sender + " has respawned all zombies");
                    }
                    else if (commando.StartsWith("/killzombies") && permLvl >= 2)
                    {
                        resetChat();
                        Zombie[] Zombies = UnityEngine.Object.FindObjectsOfType(typeof(Zombie)) as Zombie[];
                        foreach (Zombie Zombie in Zombies)
                        {
                            Zombie.damage(500);
                        }
                        NetworkChat.sendAlert(sender + " has killed " + Zombies.Length + " zombies");
                    }
                    else if (commando.StartsWith("/reloadbans") && permLvl >= 3)
                    {
                        resetChat();
                        NetworkBans.load();
                    }
                    else if (commando.StartsWith("/setitemsdelay") && permLvl == 4)
                    {
                        resetChat();
                        String seconds = commando.Substring(15);
                        setItemResetIntervalInSeconds(Convert.ToInt32(seconds));
                    }
                    else if (commando.StartsWith("/setannouncedelay") && permLvl >= 3)
                    {
                        resetChat();
                        String seconds = commando.Substring(18);
                        setAnnounceIntervalInSeconds(Convert.ToInt32(seconds));
                    }
                    else if (commando.StartsWith("/reloadCommands") && permLvl >= 4)
                    {
                        resetChat();
                        reloadCommands();
                    }
                    else if (commando.StartsWith("/logmsg") && permLvl >= 4)
                    {
                        resetChat();
                        for (int i = 0; i < 80; i++)
                        {
                            Log(getNetworkChatFieldByNum(i));
                        }
                    }



                    else if (commando.StartsWith("/enablewhitelist") && permLvl >= 3)
                    {
                        resetChat();
                        usingWhitelist = true;
                        NetworkChat.sendAlert("Whitelist enabled.");
                    }
                    else if (commando.StartsWith("/disablewhitelist") && permLvl >= 3)
                    {
                        resetChat();
                        usingWhitelist = false;
                        NetworkChat.sendAlert("Whitelist disabled.");
                    }
                    else if (commando.StartsWith("/whitelist add") && permLvl >= 3)
                    {
                        resetChat();
                        String naam = commando.Substring(15);

                        System.IO.StreamWriter file = new StreamWriter("Unturned_Data/Managed/mods/AdminCommands/UnturnedWhitelist.txt", true);
                        file.WriteLine("");
                        file.WriteLine(naam);
                        file.Close();

                        reloadCommands();
                    }
                    else if (commando.StartsWith("/whitelist remove ") && permLvl >= 3)
                    {
                        resetChat();
                        String naam = commando.Substring(18);

                        string[] lines = System.IO.File.ReadAllLines(@"Unturned_Data/Managed/mods/AdminCommands/UnturnedWhitelist.txt");
                        File.Delete("Unturned_Data/Managed/mods/AdminCommands/UnturnedWhitelist.txt");

                        System.IO.StreamWriter file = new StreamWriter("Unturned_Data/Managed/mods/AdminCommands/UnturnedWhitelist.txt", true);


                        for (int i = 0; i < lines.Length; i++)
                        {
                            if (!lines[i].Equals(naam))
                            {
                                file.WriteLine(lines[i]);
                            }
                        }


                        file.Close();

                        reloadCommands();
                    }
                    else if (commando.StartsWith("/unban") && permLvl >= 1)
                    {
                        resetChat();
                        String name = commando.Substring(7);
                        unban(name);
                    }
                    else if (commando.StartsWith("/tpto ") && permLvl >= 1)
                    {
                        resetChat();

                        String     locString = commando.Substring(6);
                        Quaternion rotation  = NetworkUserList.getModelFromPlayer(getNetworkPlayerByPlayerName(sender)).transform.rotation;


                        float x = float.Parse(locString.Split(' ')[0]);
                        float y = float.Parse(locString.Split(' ')[1]);
                        float z = float.Parse(locString.Split(' ')[2]);

                        //NetworkChat.sendAlert(x + " , " + y + " , " + z);

                        NetworkUserList.getModelFromPlayer(getNetworkPlayerByPlayerName(sender)).GetComponent <Life>().networkView.RPC("tellStatePosition", RPCMode.All, new object[] { new Vector3(x, y, z), rotation });
                    }
                    else if (commando.StartsWith("/tptome") && permLvl >= 1)
                    {
                        resetChat();

                        String name = commando.Substring(8);
                        if (name.Length < 3)
                        {
                            name = names[Convert.ToInt32(name)];
                        }
                        //big ass line incoming
                        NetworkUserList.getModelFromPlayer(getNetworkPlayerByPlayerName(name)).transform.position = NetworkUserList.getModelFromPlayer(getNetworkPlayerByPlayerName(sender)).transform.position;
                        NetworkUserList.getModelFromPlayer(getNetworkPlayerByPlayerName(name)).GetComponent <Life>().networkView.RPC("tellStatePosition", RPCMode.All, new object[] { NetworkUserList.getModelFromPlayer(getNetworkPlayerByPlayerName(sender)).transform.position, NetworkUserList.getModelFromPlayer(getNetworkPlayerByPlayerName(sender)).transform.rotation });
                    }

                    else if (commando.Equals("/tpall") && permLvl >= 2)
                    {
                        resetChat();


                        Vector3    location = NetworkUserList.getModelFromPlayer(getNetworkPlayerByPlayerName(sender)).transform.position;
                        Quaternion rotation = NetworkUserList.getModelFromPlayer(getNetworkPlayerByPlayerName(sender)).transform.rotation;
                        foreach (String name in names)
                        {
                            //There's probably a shorter way to this teleport stuff but hey this works xD
                            NetworkUserList.getModelFromPlayer(getNetworkPlayerByPlayerName(name)).transform.position = location;
                            NetworkUserList.getModelFromPlayer(getNetworkPlayerByPlayerName(name)).GetComponent <Life>().networkView.RPC("tellStatePosition", RPCMode.All, new object[] { location, rotation });
                        }
                    }

                    else if (commando.StartsWith("/tp ") && permLvl >= 1)  //make sure this goes under /tptome
                    {
                        resetChat();

                        String name = commando.Substring(4);
                        if (name.Length < 3)
                        {
                            name = names[Convert.ToInt32(name)];
                        }

                        NetworkUserList.getModelFromPlayer(getNetworkPlayerByPlayerName(sender)).transform.position = NetworkUserList.getModelFromPlayer(getNetworkPlayerByPlayerName(name)).transform.position;
                        NetworkUserList.getModelFromPlayer(getNetworkPlayerByPlayerName(sender)).GetComponent <Life>().networkView.RPC("tellStatePosition", RPCMode.All, new object[] { NetworkUserList.getModelFromPlayer(getNetworkPlayerByPlayerName(name)).transform.position, NetworkUserList.getModelFromPlayer(getNetworkPlayerByPlayerName(name)).transform.rotation });
                    }



                    else if (commando.StartsWith("/kill") && permLvl >= 2)
                    {
                        resetChat();

                        //All of these things are buggy as f**k
                        String naam = commando.Substring(6);
                        // NetworkUserList.getModelFromPlayer(getNetworkPlayerByPlayerName(naam)).GetComponent<Life>().tellAllLife(10,0,0,0,true,true);
                        // NetworkUserList.getModelFromPlayer(getNetworkPlayerByPlayerName(naam)).GetComponent<Life>().tellDead(true, "You were shot in the face with a rocket launcher");
                        NetworkUserList.getModelFromPlayer(getNetworkPlayerByPlayerName(naam)).GetComponent <Life>().damage(500, "You were struck down by the Wrath of the Gods!!!");
                    }

                    else if (commando.Equals("/heal") && permLvl >= 1)
                    {
                        resetChat();
                        NetworkUserList.getModelFromPlayer(getNetworkPlayerByPlayerName(sender)).GetComponent <Life>().heal(100, true, true);
                    }

                    else if (commando.StartsWith("/heal") && permLvl >= 1)
                    {
                        resetChat();

                        String naam = commando.Substring(6);
                        NetworkUserList.getModelFromPlayer(getNetworkPlayerByPlayerName(naam)).GetComponent <Life>().heal(100, true, true);
                    }

                    else if (commando.StartsWith("/promote") && permLvl >= 4)
                    {
                        resetChat();

                        String naam = commando.Substring(9);

                        System.IO.StreamWriter file = new StreamWriter("Unturned_Data/Managed/mods/AdminCommands/UnturnedAdmins.txt", true);
                        file.WriteLine("");
                        file.WriteLine(naam + ":" + getSteamIDByPlayerName(naam) + ":1");
                        file.Close();
                        NetworkChat.sendAlert(naam + " was promoted to the role of Moderator. (Level 1 Admin)");

                        reloadCommands();
                    }
                    else if (commando.Equals("/commands") && permLvl >= 1)
                    {
                        resetChat();

                        String string1 = " /ban, /kick, /unban, /repeat, /reason, /repairvehicles, /refuelvehicles, /car";
                        String string2 = " /heal, /sirens, /sirensoff, /tp, /tpto <x> <y> <z>, /tptome, /home, /sethome";
                        String string3 = " /tpall, /kill, /resetZombies, /resetItems, /i, /killzombies, /kit ";
                        String string4 = " /enablewhitelist, /disablewhitelist, /whitelist add & remove, /setannouncedelay";
                        String string5 = " /setItemDelay <seconds>, /reloadCommands, /reloadBans /promote, /logmsg";

                        getNetworkChat().askChat(string1, 2, getNetworkPlayerByPlayerName(sender));
                        getNetworkChat().askChat(string2, 2, getNetworkPlayerByPlayerName(sender));
                        if (permLvl >= 2)
                        {
                            getNetworkChat().askChat(string3, 2, getNetworkPlayerByPlayerName(sender));
                        }
                        if (permLvl >= 3)
                        {
                            getNetworkChat().askChat(string4, 2, getNetworkPlayerByPlayerName(sender));
                        }
                        if (permLvl >= 4)
                        {
                            getNetworkChat().askChat(string5, 2, getNetworkPlayerByPlayerName(sender));
                        }
                    }
                    else if (commando.StartsWith("/car") && permLvl >= 1)
                    {
                        resetChat();

                        Vector3    location = NetworkUserList.getModelFromPlayer(getNetworkPlayerByPlayerName(sender)).transform.position;
                        Quaternion rotation = NetworkUserList.getModelFromPlayer(getNetworkPlayerByPlayerName(sender)).transform.rotation;


                        Vehicle[] mapVehicles = UnityEngine.Object.FindObjectsOfType(typeof(Vehicle)) as Vehicle[];

                        int     random        = UnityEngine.Random.Range(0, mapVehicles.Length);
                        Vehicle randomVehicle = mapVehicles[random];

                        Vector3 newPos = new Vector3(location[0] + 5, location[1] + 50, location[2]);

                        randomVehicle.updatePosition(newPos, rotation);
                        randomVehicle.transform.position = newPos;
                    }


                    else if (commando.StartsWith("/i ") && permLvl >= 2)
                    {
                        resetChat();

                        int itemid = Convert.ToInt32(commando.Split(' ')[1]);
                        int amount = 1;
                        if (commando.Split(' ').Length > 2)
                        {
                            amount = Convert.ToInt32(commando.Split(' ')[2]);
                        }

                        Vector3 location = NetworkUserList.getModelFromPlayer(getNetworkPlayerByPlayerName(sender)).transform.position;

                        for (int i = 0; i < amount; i++)
                        {
                            SpawnItems.spawnItem(itemid, 1, location);
                        }
                    }



                    else if (commando.Equals("/kit") && permLvl >= 2)
                    {
                        resetChat();

                        int[]   itemids  = new int[] { 0x7d4, 0x1b60, 0x2ee0, 0x232c, 0x2711, 0x2afb, 0x465e, 0x465e, 0x465e, 0x465e, 0x465e, 0x465e, 0x465e, 0xfb1, 0x1399, 11, 0x32c8, 0x32c8, 0x36c6, 0x36c6, 0x1f4f, 0x1f4d, 0xbba };
                        Vector3 location = NetworkUserList.getModelFromPlayer(getNetworkPlayerByPlayerName(sender)).transform.position;

                        foreach (int itemid in itemids)
                        {
                            SpawnItems.spawnItem(itemid, 1, location);
                        }
                    }
                } // end of isAdmin()

                else
                {
                    // KICK(sender, "Did you just kick yourself?");
                }



                commandconfirmed = false;
            }   // end of text.startswith("/")
        }//end checkForCommands()