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

Function ReadStringTable

extensions/sdktools/vstringtable.cpp:127–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127static cell_t ReadStringTable(IPluginContext *pContext, const cell_t *params)
128{
129 TABLEID idx = static_cast<TABLEID>(params[1]);
130 INetworkStringTable *pTable = netstringtables->GetTable(idx);
131 int stringidx;
132 const char *value;
133 size_t numBytes;
134
135 if (!pTable)
136 {
137 return pContext->ThrowNativeError("Invalid string table index %d", idx);
138 }
139
140 stringidx = params[2];
141 value = pTable->GetString(stringidx);
142
143 if (!value)
144 {
145 return pContext->ThrowNativeError("Invalid string index specified for table (index %d) (table \"%s\")", stringidx, pTable->GetTableName());
146 }
147
148 pContext->StringToLocalUTF8(params[3], params[4], value, &numBytes);
149
150 return numBytes;
151}
152
153static cell_t GetStringTableDataLength(IPluginContext *pContext, const cell_t *params)
154{

Callers

nothing calls this directly

Calls 1

GetStringMethod · 0.45

Tested by

no test coverage detected