native SetStructString(Handle:struct, const String:member[], String:value[]);
| 320 | |
| 321 | //native SetStructString(Handle:struct, const String:member[], String:value[]); |
| 322 | static cell_t SetStructString(IPluginContext *pContext, const cell_t *params) |
| 323 | { |
| 324 | Handle_t hndl = static_cast<Handle_t>(params[1]); |
| 325 | HandleError err; |
| 326 | HandleSecurity sec; |
| 327 | |
| 328 | sec.pOwner = NULL; |
| 329 | sec.pIdentity = myself->GetIdentity(); |
| 330 | |
| 331 | StructHandle *pHandle; |
| 332 | if ((err = g_pHandleSys->ReadHandle(hndl, g_StructHandle, &sec, (void **)&pHandle)) |
| 333 | != HandleError_None) |
| 334 | { |
| 335 | return pContext->ThrowNativeError("Invalid struct handle %x (error %d)", hndl, err); |
| 336 | } |
| 337 | |
| 338 | char *member; |
| 339 | pContext->LocalToString(params[2], &member); |
| 340 | |
| 341 | char *string; |
| 342 | pContext->LocalToString(params[3], &string); |
| 343 | |
| 344 | if (!pHandle->SetString(member, string)) |
| 345 | { |
| 346 | return pContext->ThrowNativeError("Invalid member, or incorrect data type"); |
| 347 | } |
| 348 | |
| 349 | return 1; |
| 350 | } |
| 351 | |
| 352 | //native GetStructEnt(Handle:struct, const String:member[], &ent); |
| 353 | static cell_t GetStructEnt(IPluginContext *pContext, const cell_t *params) |
nothing calls this directly
no test coverage detected