<?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=Player%3A%3AsetAsCop</id>
	<title>Player::setAsCop - История изменений</title>
	<link rel="self" type="application/atom+xml" href="https://rage.grandroleplay.ru/index.php?action=history&amp;feed=atom&amp;title=Player%3A%3AsetAsCop"/>
	<link rel="alternate" type="text/html" href="https://rage.grandroleplay.ru/index.php?title=Player::setAsCop&amp;action=history"/>
	<updated>2026-07-24T21:14:44Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://rage.grandroleplay.ru/index.php?title=Player::setAsCop&amp;diff=12072&amp;oldid=prev</id>
		<title>imported&gt;JerryChen: /* Example */</title>
		<link rel="alternate" type="text/html" href="https://rage.grandroleplay.ru/index.php?title=Player::setAsCop&amp;diff=12072&amp;oldid=prev"/>
		<updated>2020-02-12T21:08:57Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Example&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Turns the desired ped into a cop. If you use this on the player ped, you will become almost invisible to cops dispatched for you. You will also report your own crimes, get a generic cop voice, get a cop-vision-cone on the radar, and you will be unable to shoot at other cops. SWAT and Army will still shoot at you. Toggling ped as &amp;#039;false&amp;#039; has no effect; you must change p0&amp;#039;s ped model to disable the effect.&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;player.setAsCop(toggle);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Required Arguments ===&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;toggle:&amp;#039;&amp;#039;&amp;#039; Boolean&lt;br /&gt;
===Return value===&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Undefined&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
mp.events.add({&lt;br /&gt;
    &amp;quot;entityStreamIn&amp;quot; : (entity) =&amp;gt; {&lt;br /&gt;
	if(entity.type === &amp;#039;player&amp;#039;) // check if it&amp;#039;s a player or not&lt;br /&gt;
	{&lt;br /&gt;
        	const isOnDuty = entity.getVariable(&amp;#039;isOnDuty&amp;#039;); // setVariable when player on duty, handle it on server-side&lt;br /&gt;
	        if(isOnDuty) entity.setAsCop(true); // if this player on duty, set this player as a cop&lt;br /&gt;
	}&lt;br /&gt;
},&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Player_function_c}}&lt;br /&gt;
[[Category:Clientside API]]&lt;br /&gt;
[[Category:TODO: Example]]&lt;/div&gt;</summary>
		<author><name>imported&gt;JerryChen</name></author>
	</entry>
</feed>