Esempio n. 1
0
            /// <summary>
            /// Calls the specified native script function and ignores its return value.
            /// </summary>
            /// <param name="hash">The hashed name of the script function.</param>
            /// <param name="arguments">A list of input and output arguments to pass to the native script function.</param>
            public static void Call(Hash hash, params InputArgument[] arguments)
            {
                var task = new NativeTask();

                task.Hash      = (ulong)hash;
                task.Arguments = arguments;

                ScriptDomain.CurrentDomain.ExecuteTask(task);
            }
 internal static unsafe T Call <T>(ulong hash, params InputArgument[] arguments)
 {
     NativeTask modopt(IsConst) task = new NativeTask
     {
         _hash      = hash,
         _arguments = arguments
     };
     ScriptDomain.CurrentDomain.ExecuteTask(task);
     return((T)GTA.Native.ObjectFromNative(typeof(T), task._result));
 }
Esempio n. 3
0
            /// <summary>
            /// Calls the specified native script function and returns its return value.
            /// </summary>
            /// <param name="hash">The hashed name of the native script function.</param>
            /// <param name="arguments">A list of input and output arguments to pass to the native script function.</param>
            /// <returns>The return value of the native</returns>
            public static T Call <T>(Hash hash, params InputArgument[] arguments)
            {
                var task = new NativeTask();

                task.Hash      = (ulong)hash;
                task.Arguments = arguments;

                ScriptDomain.CurrentDomain.ExecuteTask(task);

                unsafe { return((T)(ObjectFromNative(typeof(T), task.Result))); }
            }