FiveM Docs / Native Reference
API Set:
  • all
  • server
  • client
Language:
  • raw
  • lua
  • c#
  • js
Namespace: CFXAPI set: servereditImprove

FLUSH_RESOURCE_KVP

0xE27C97A0
// FlushResourceKvp
void FLUSH_RESOURCE_KVP();

Nonsynchronous operations will not wait for a disk/filesystem flush before returning from a write or delete call. They will be much faster than their synchronous counterparts (e.g., bulk operations), however, a system crash may lose the data to some recent operations.

This native ensures all _NO_SYNC operations are synchronized with the disk/filesystem.

Examples:

  • Lua
-- Bulk write many <key, value> pairs to the resource KVP.
local key = "bug_%d"
local value = "unintended_feature_%d"
for i=1,10000 do
	SetResourceKvpNoSync(key:format(i), value:format(i))
end

-- Ensure all data is synchronized to the filesystem
FlushResourceKvp()
Privacy
•
Cookie Policy
•
Cookie Settings
ENABLE_EDITOR_RUNTIME()
ENABLE_ENHANCED_HOST_SUPPORT(BOOL enabled)
END_FIND_KVP(int handle)
END_FIND_OBJECT(int findHandle)
END_FIND_PED(int findHandle)
END_FIND_PICKUP(int findHandle)
END_FIND_VEHICLE(int findHandle)
ENSURE_ENTITY_STATE_BAG(Entity entity)
ENTER_CURSOR_MODE()
EXECUTE_COMMAND(char* commandString)
EXPERIMENTAL_LOAD_CLONE_CREATE(char* data, int objectId, char* tree)
EXPERIMENTAL_LOAD_CLONE_SYNC(Entity entity, char* data)
EXPERIMENTAL_SAVE_CLONE_CREATE(Entity entity)
EXPERIMENTAL_SAVE_CLONE_SYNC(Entity entity)
FIND_FIRST_OBJECT(Entity* outEntity)
FIND_FIRST_PED(Entity* outEntity)
FIND_FIRST_PICKUP(Entity* outEntity)
FIND_FIRST_VEHICLE(Entity* outEntity)
FIND_KVP(int handle)
FIND_NEXT_OBJECT(int findHandle, Entity* outEntity)
FIND_NEXT_PED(int findHandle, Entity* outEntity)
FIND_NEXT_PICKUP(int findHandle, Entity* outEntity)
FIND_NEXT_VEHICLE(int findHandle, Entity* outEntity)
FLAG_SERVER_AS_PRIVATE(BOOL private_)
FLUSH_RESOURCE_KVP()
FORCE_SNOW_PASS(BOOL enabled)
FREEZE_ENTITY_POSITION(Entity entity, BOOL toggle)
GET_ACTIVE_PLAYERS()
GET_AIR_DRAG_MULTIPLIER_FOR_PLAYERS_VEHICLE(char* playerSrc)
GET_ALL_OBJECTS()
GET_ALL_PEDS()
GET_ALL_ROPES()
GET_ALL_VEHICLE_MODELS()
GET_ALL_VEHICLES()
GET_AMBIENT_PED_RANGE_MULTIPLIER()