Storage.flush(): Difference between revisions
No edit summary |
MrPancakers2 (talk | contribs) No edit summary |
||
| Line 1: | Line 1: | ||
__NOTOC__ | |||
{{ClientsideJsFunction}} | |||
Flushes [[storage.data]]. It isn't neccessary to flush it after every change since it will be flushed on disconnect, but recommended. | 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 | <br />Data is saved in <path to RAGEMP>/client_resources/<server ip>/.storage | ||
{{JSContainer| | |||
==Syntax== | ==Syntax== | ||
< | |||
<pre> | |||
mp.storage.flush(); | |||
</pre> | |||
==Example== | ==Example== | ||
< | {{ClientsideCode| | ||
<pre> | |||
mp.storage.data.auth = { token: "abcd" }; | mp.storage.data.auth = { token: "abcd" }; | ||
mp.storage.flush(); | mp.storage.flush(); | ||
</ | </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
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
- Functions:
- Properties: