Esempio n. 1
0
        void OnTick(object sender, EventArgs e)
        {
            if (VCOFunctions.IsVCOLoaded())
            {
                if (!blipsCreated)
                {
                    while (xmlReader.Read())
                    {
                        if (xmlReader.NodeType == XmlNodeType.Element && xmlReader.Name == "Blip")
                        {
                            string name;
                            float  x, y, z;
                            int    spriteID;
                            int    colourID;
                            bool   shortRange;

                            // Read the name from the XML file
                            xmlReader.ReadToDescendant("Name");
                            xmlReader.Read();
                            name = xmlReader.Value;

                            // Read the position from the XML file
                            xmlReader.ReadToFollowing("X");
                            xmlReader.Read();
                            float.TryParse(xmlReader.Value, out x);

                            xmlReader.ReadToFollowing("Y");
                            xmlReader.Read();
                            float.TryParse(xmlReader.Value, out y);

                            xmlReader.ReadToFollowing("Z");
                            xmlReader.Read();
                            float.TryParse(xmlReader.Value, out z);

                            // Read the sprite id from the XML file
                            xmlReader.ReadToFollowing("SpriteID");
                            xmlReader.Read();
                            Int32.TryParse(xmlReader.Value, out spriteID);

                            // Read the colour id from the XML file
                            xmlReader.ReadToFollowing("ColourID");
                            xmlReader.Read();
                            Int32.TryParse(xmlReader.Value, out colourID);

                            // Read the short range value from the XML file
                            xmlReader.ReadToFollowing("ShortRange");
                            xmlReader.Read();
                            bool.TryParse(xmlReader.Value, out shortRange);

                            VCOFunctions.UI.CreateBlip(new Vector3(x, y, z), name, spriteID, shortRange, colourID, gangHideoutBlips); // This is our custom function for creating blips, I recommend you use this for cleaner code :
                        }
                    }

                    blipsCreated = !blipsCreated;
                }
            }
        }
Esempio n. 2
0
 void OnTick(object sender, EventArgs e)
 {
     if (VCOFunctions.IsVCOLoaded())
     {
         if (Function.Call <bool>(Hash.IS_ENTITY_IN_AREA, Game.Player, vcoArea1.X, vcoArea1.Y, vcoArea1.Z, vcoArea2.X, vcoArea2.Y, vcoArea2.Z))
         {
             Function.Call(Hash.SET_DEEP_OCEAN_SCALER, modifiedWaterHeight);
         }
         else
         {
             Function.Call(Hash.RESET_DEEP_OCEAN_SCALER);
         }
     }
 }
Esempio n. 3
0
        void OnTick(object sender, EventArgs e)
        {
            if (VCOFunctions.IsVCOLoaded())
            {
                if (!hasCreatedBlips)
                {
                    while (xmlReader.Read()) // Reading loop (I honestly don't really know what this does, pretty sure it loops through the elements)
                    {
                        if (xmlReader.NodeType == XmlNodeType.Element && xmlReader.Name == "Blip")
                        {
                            string name;
                            float x, y, z;
                            int spriteID;
                            int colourID;
                            bool shortRange;

                            // Read the name from the XML file
                            xmlReader.ReadToDescendant("Name");
                            xmlReader.Read();
                            name = xmlReader.Value;

                            // Read the position from the XML file
                            xmlReader.ReadToFollowing("X");
                            xmlReader.Read();
                            float.TryParse(xmlReader.Value, out x);

                            xmlReader.ReadToFollowing("Y");
                            xmlReader.Read();
                            float.TryParse(xmlReader.Value, out y);

                            xmlReader.ReadToFollowing("Z");
                            xmlReader.Read();
                            float.TryParse(xmlReader.Value, out z);

                            // Read the sprite id from the XML file
                            xmlReader.ReadToFollowing("SpriteID");
                            xmlReader.Read();
                            Int32.TryParse(xmlReader.Value, out spriteID);

                            // Read the colour id from the XML file
                            xmlReader.ReadToFollowing("ColourID");
                            xmlReader.Read();
                            Int32.TryParse(xmlReader.Value, out colourID);

                            // Read the short range value from the XML file
                            xmlReader.ReadToFollowing("ShortRange");
                            xmlReader.Read();
                            bool.TryParse(xmlReader.Value, out shortRange);

                            VCOFunctions.UI.CreateBlip(new Vector3(x, y, z), name, spriteID, shortRange, colourID, vcoMapBlips); // This is our custom function for creating blips, I recommend you use this for cleaner code :
                        }
                    }

                    xmlReader.Close();

                    hasCreatedBlips = !hasCreatedBlips; // Reverses a boolean so it's = opposite
                    hasRemovedBlips = !hasRemovedBlips;
                }
            }
            else
            {
                if (!hasRemovedBlips)
                {
                    foreach (Blip b in vcoMapBlips) // Loops through the list of blips, b is the result of each blip
                    {
                        b.Delete(); // This removes every blip in list
                    }
                    vcoMapBlips.Clear(); // Clears our list so it's empty again

                    hasRemovedBlips = !hasRemovedBlips; // Reverses a boolean so it's = opposite
                    hasCreatedBlips = !hasCreatedBlips;
                }
            }
        }