Esempio n. 1
0
        /// <summary>
        /// Prints a message in Mafia Message Box
        /// </summary>
        /// <param name="text">Message text</param>
        /// <param name="color">Text color</param>
        /// <returns>True if the function is successful</returns>
        public bool Message(string text, OakColor color)
        {
            int ret = int.Parse(Oakwood.CallFunction("oak_hud_message", new object[] { player.ID, text + "\0", text.Length + 1, color.ConvertToInt32() })[1].ToString());

            if (ret == -1)
            {
                return(false);
            }

            return(true);
        }
Esempio n. 2
0
        /// <summary>
        /// Starts a countdown
        /// </summary>
        /// <param name="countdown">Countdown length in seconds</param>
        /// <param name="duration">Countdown duration</param>
        /// <param name="color">Countdown color</param>
        /// <returns>True if the function is successful</returns>
        public bool Countdown(int countdown, int duration, OakColor color)
        {
            int ret = int.Parse(Oakwood.CallFunction("oak_hud_countdown", new object[] { player.ID, countdown, duration, color.ConvertToInt32() })[1].ToString());

            if (ret == -1)
            {
                return(false);
            }

            return(true);
        }
Esempio n. 3
0
        /// <summary>
        /// Starts a countdown
        /// </summary>
        /// <param name="text">Announce text</param>
        /// <param name="duration">Announce duration</param>
        /// <returns>True if the function is successful</returns>
        public bool Announce(string text, float duration)
        {
            int ret = int.Parse(Oakwood.CallFunction("oak_hud_announce", new object[] { player.ID, text + "\0", text.Length + 1, duration })[1].ToString());

            if (ret == -1)
            {
                return(false);
            }

            return(true);
        }
Esempio n. 4
0
        internal static bool Clear(OakwoodPlayer player)
        {
            int ret = int.Parse(Oakwood.CallFunction("oak_chat_clear", new object[] { player.ID })[0].ToString());

            if (ret == 0)
            {
                return(true);
            }

            return(false);
        }
Esempio n. 5
0
        /// <summary>
        /// Fades a screen into color
        /// </summary>
        /// <param name="type">Fade type</param>
        /// <param name="duration">Fade duration</param>
        /// <param name="color">Fade color</param>
        /// <returns>True if the function is successful</returns>
        public bool Fade(OakwoodFade type, int duration, OakColor color)
        {
            int ret = int.Parse(Oakwood.CallFunction("oak_hud_fadeout", new object[] { player.ID, (int)type, duration, color.ConvertToInt32() })[1].ToString());

            if (ret == -1)
            {
                return(false);
            }

            return(true);
        }
Esempio n. 6
0
        internal static bool SetKillbox(float height)
        {
            int ret = int.Parse(Oakwood.CallFunction("oak_killbox_set", new object[] { height })[1].ToString());

            if (ret == 0)
            {
                return(true);
            }

            return(false);
        }
Esempio n. 7
0
        internal static bool SendAll(string message)
        {
            int ret = int.Parse(Oakwood.CallFunction("oak_chat_broadcast", new object[] { message + "\0", message.Length + 1 })[0].ToString());

            if (ret == 0)
            {
                return(true);
            }

            return(false);
        }
Esempio n. 8
0
        internal static bool Send(OakwoodPlayer player, string message)
        {
            int ret = int.Parse(Oakwood.CallFunction("oak_chat_send", new object[] { player.ID, message + "\0", message.Length + 1 })[0].ToString());

            if (ret == 0)
            {
                return(true);
            }

            return(false);
        }
Esempio n. 9
0
        /// <summary>
        /// Un-Targets a player's camera
        /// </summary>
        /// <returns>True if the function is successful</returns>
        public bool Untarget()
        {
            int ret = int.Parse(Oakwood.CallFunction("oak_camera_target_unset", new object[] { player.ID })[1].ToString());

            if (ret == 0)
            {
                return(true);
            }

            return(false);
        }
Esempio n. 10
0
        /// <summary>
        /// Targets player's camera to vehicle
        /// </summary>
        /// <param name="spectatedVehicle">Vehicle to target</param>
        /// <returns>True if the function is successful</returns>
        public bool TargetVehicle(OakwoodVehicle spectatedVehicle)
        {
            int ret = int.Parse(Oakwood.CallFunction("oak_camera_target_vehicle", new object[] { player.ID, spectatedVehicle.ID })[1].ToString());

            if (ret == 0)
            {
                return(true);
            }

            return(false);
        }
Esempio n. 11
0
        /// <summary>
        /// Targets player's camera to another player
        /// </summary>
        /// <param name="spectatedPlayer">Player to target</param>
        /// <returns>True if the function is successful</returns>
        public bool TargetPlayer(OakwoodPlayer spectatedPlayer)
        {
            int ret = int.Parse(Oakwood.CallFunction("oak_camera_target_player", new object[] { player.ID, spectatedPlayer.ID })[1].ToString());

            if (ret == 0)
            {
                return(true);
            }

            return(false);
        }
Esempio n. 12
0
        /// <summary>
        /// Sets camera position
        /// </summary>
        /// <param name="position">Camera position</param>
        /// <param name="direction">Camera direction</param>
        /// <returns>True if the function is successful</returns>
        public bool Set(OakVec3 position, OakVec3 direction)
        {
            int ret = int.Parse(Oakwood.CallFunction("oak_camera_set", new object[] { player.ID, new float[] { position.x, position.y, position.z }, new float[] { direction.x, direction.y, direction.z } })[1].ToString());

            if (ret == 0)
            {
                return(true);
            }

            return(false);
        }
Esempio n. 13
0
        internal static bool Log(string message)
        {
            string msg = message + "\n\0";
            int    ret = int.Parse(Oakwood.CallFunction("oak_logn", new object[] { msg, message.Length + 2 })[1].ToString());

            if (ret == 0)
            {
                return(true);
            }

            return(false);
        }
Esempio n. 14
0
        internal static float GetKillbox()
        {
            float killbox = float.Parse(Oakwood.CallFunction("oak_killbox_get", null)[1].ToString());

            return(killbox);
        }