MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / sm_WriteFileString

Function sm_WriteFileString

core/logic/smn_filesystem.cpp:1170–1184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1168}
1169
1170static cell_t sm_WriteFileString(IPluginContext *pContext, const cell_t *params)
1171{
1172 OpenHandle<FileObject> file(pContext, params[1], g_FileType);
1173 if (!file.Ok())
1174 return 0;
1175
1176 char *buffer;
1177 pContext->LocalToString(params[2], &buffer);
1178
1179 size_t len = strlen(buffer);
1180 if (params[3])
1181 len++;
1182
1183 return file->Write(buffer, len) >= len ? 1 : 0;
1184}
1185
1186static cell_t sm_AddGameLogHook(IPluginContext *pContext, const cell_t *params)
1187{

Callers

nothing calls this directly

Calls 2

OkMethod · 0.80
WriteMethod · 0.45

Tested by

no test coverage detected