Storage.flush(): Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Flushes [[storage.data]]. It isn't neccessary to flush it after every change since it will be flushed on disconnect, but recommended. Data is saved in <path to RAGEMP>/client_resources/<server ip>.storage
__NOTOC__
{{ClientsideJsFunction}}
Flushes [[storage.data]]. It isn't neccessary to flush it after every change since it will be flushed on disconnect, but recommended.  
<br />Data is saved in <path to RAGEMP>/client_resources/<server ip>/.storage
 
{{JSContainer|
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">storage.flush();</syntaxhighlight>
 
<pre>
mp.storage.flush();
</pre>
 
==Example==
==Example==
<syntaxhighlight lang="javascript">
{{ClientsideCode|
<pre>
mp.storage.data.auth = { token: "abcd" };
mp.storage.data.auth = { token: "abcd" };
mp.storage.flush();
mp.storage.flush();
</syntaxhighlight>
</pre>
}}
}}


==See also==
==See also==
{{Storage_definition_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:Client-side Function]]

Latest revision as of 01:21, 25 April 2021

Client-Side
Function

 JavaScript



Flushes storage.data. It isn't neccessary to flush it after every change since it will be flushed on disconnect, but recommended.
Data is saved in <path to RAGEMP>/client_resources/<server ip>/.storage

JavaScript Syntax

Syntax

mp.storage.flush();

Example

Client-Side
mp.storage.data.auth = { token: "abcd" };
mp.storage.flush();


See also