<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://g1r-mp.com/wiki/index.php?action=history&amp;feed=atom&amp;title=OnClientCameraReset</id>
	<title>OnClientCameraReset - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://g1r-mp.com/wiki/index.php?action=history&amp;feed=atom&amp;title=OnClientCameraReset"/>
	<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=OnClientCameraReset&amp;action=history"/>
	<updated>2026-09-19T06:22:41Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://g1r-mp.com/wiki/index.php?title=OnClientCameraReset&amp;diff=808&amp;oldid=prev</id>
		<title>QCherry: Document scripted camera API and events available from G1R:MP 0.1.3</title>
		<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=OnClientCameraReset&amp;diff=808&amp;oldid=prev"/>
		<updated>2026-09-08T23:51:03Z</updated>

		<summary type="html">&lt;p&gt;Document scripted camera API and events available from G1R:MP 0.1.3&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= onClientCameraReset =&lt;br /&gt;
&amp;lt;div style=&amp;quot;background:#fff5f5; border:1px solid #d13b3b; border-left:5px solid #d13b3b; color:#111111; padding:0.85rem 1rem; margin:0.75rem 0 1rem;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#111111; font-weight:bold; letter-spacing:0.04em;&amp;quot;&amp;gt;AVAILABLE FROM UPDATE 0.1.3&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#111111; margin-top:0.25rem;&amp;quot;&amp;gt;This event is available in G1R:MP 0.1.3 and later. The contract below includes the compatibility guarantees introduced in that update.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notifies an affected client resource that its camera ownership, cached state or pending requests have been forcibly invalidated.&lt;br /&gt;
&lt;br /&gt;
== Availability ==&lt;br /&gt;
This event is available in &amp;#039;&amp;#039;&amp;#039;client-side&amp;#039;&amp;#039;&amp;#039; scripts.&lt;br /&gt;
&lt;br /&gt;
== Callback signature ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onClientCameraReset(string errorText, string stateJson)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Name !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;errorText&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; || Reason for the forced reset or invalidation, such as a connection/world/local-character change.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;stateJson&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; || Optional JSON snapshot. It can be empty, notably on IPC disconnect; do not assume it is valid JSON or a ready camera state.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
Cancel your own pending cinematic state when camera ownership is lost.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; line&amp;gt;&lt;br /&gt;
local pendingMove&lt;br /&gt;
local cinematicTimer&lt;br /&gt;
addEventHandler(&amp;quot;onClientCameraReset&amp;quot;, resourceRoot, function(errorText, stateJson)&lt;br /&gt;
    pendingMove = nil&lt;br /&gt;
    if cinematicTimer then&lt;br /&gt;
        killTimer(cinematicTimer)&lt;br /&gt;
        cinematicTimer = nil&lt;br /&gt;
    end&lt;br /&gt;
    outputDebugString(&amp;quot;Camera control ended: &amp;quot; .. tostring(errorText))&lt;br /&gt;
    -- Do not immediately reacquire: wait until the world/spawn is ready again.&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Built-in local client event delivered to resourceRoot; it is not a remotely triggerable server callback. Native forced cleanup targets the camera owner; IPC disconnect notifies all affected resources with cached state or pending requests, including query-only resources.&lt;br /&gt;
* Resource ownership, pending requests and cached snapshots are invalidated before this callback. Do not continue an old path from an old requestId.&lt;br /&gt;
* The event covers forced native lifecycle cleanup and IPC connection invalidation. A disconnect notification does not guarantee a newly rendered restored view at that instant.&lt;br /&gt;
* An explicit resetCameraPos command is acknowledged by [[onClientCameraCommandResult]] with phase reset; do not wait for this forced-reset event to complete an ordinary reset.&lt;br /&gt;
* World readiness and spawn completion must be re-established before requesting a new camera sequence. See [[Scripted camera]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua Events]]&lt;br /&gt;
[[Category:Client Events]]&lt;/div&gt;</summary>
		<author><name>QCherry</name></author>
	</entry>
</feed>