Storage.flush(): Difference between revisions
No edit summary |
MrPancakers2 (talk | contribs) No edit summary |
||
| (7 intermediate revisions by 4 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. | __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== | ||
< | |||
<pre> | |||
mp.storage.flush(); | |||
</pre> | |||
==Example== | ==Example== | ||
< | {{ClientsideCode| | ||
mp.storage.data.auth = { | <pre> | ||
mp.storage.flush(); | mp.storage.data.auth = { token: "abcd" }; | ||
</ | 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: