<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>https://rage.grandroleplay.ru/index.php?action=history&amp;feed=atom&amp;title=Events%3A%3AcallRemoteProc</id>
	<title>Events::callRemoteProc - История изменений</title>
	<link rel="self" type="application/atom+xml" href="https://rage.grandroleplay.ru/index.php?action=history&amp;feed=atom&amp;title=Events%3A%3AcallRemoteProc"/>
	<link rel="alternate" type="text/html" href="https://rage.grandroleplay.ru/index.php?title=Events::callRemoteProc&amp;action=history"/>
	<updated>2026-07-24T20:26:02Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://rage.grandroleplay.ru/index.php?title=Events::callRemoteProc&amp;diff=1090&amp;oldid=prev</id>
		<title>imported&gt;Xabi в 08:16, 26 декабря 2022</title>
		<link rel="alternate" type="text/html" href="https://rage.grandroleplay.ru/index.php?title=Events::callRemoteProc&amp;diff=1090&amp;oldid=prev"/>
		<updated>2022-12-26T08:16:04Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This function calls a previously registered event on the server using [[Events::addProc]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;{{ClientsideCsJsFunction}}&lt;br /&gt;
&lt;br /&gt;
{{CSharpContainer|&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Task&amp;lt;object&amp;gt; RAGE.Events.CallRemote(string procName, params object[] args);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{JSContainer|&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mp.events.callRemoteProc(String eventName [, ...args])&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
In this example, we will send an RPC request from the client to the server in which we will transmit the number 1. We will wait for the response and process it.&lt;br /&gt;
On the server, if number is 1, return true, otherwise false.&lt;br /&gt;
P.S. Note that await can only be used in an async function.&lt;br /&gt;
&lt;br /&gt;
{{ClientsideCode|&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
const number = 1;&lt;br /&gt;
const response = await mp.events.callRemoteProc(&amp;quot;testEvent&amp;quot;, number);&lt;br /&gt;
if (response.result === true) mp.console.logInfo(&amp;quot;Result is true&amp;quot;, true, true);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{ServersideCode|&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//player object is always the first param and it&amp;#039;s the player who requested this RPC&lt;br /&gt;
mp.events.addProc(&amp;quot;testEvent&amp;quot;, (player, number) =&amp;gt; {&lt;br /&gt;
    return {&lt;br /&gt;
        result: number === 1 ? true : false&lt;br /&gt;
    };&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Event_functions}}&lt;/div&gt;</summary>
		<author><name>imported&gt;Xabi</name></author>
	</entry>
</feed>