native SetStructInt(Handle:struct, const String:member[], value);
| 129 | |
| 130 | //native SetStructInt(Handle:struct, const String:member[], value); |
| 131 | static cell_t SetStructInt(IPluginContext *pContext, const cell_t *params) |
| 132 | { |
| 133 | Handle_t hndl = static_cast<Handle_t>(params[1]); |
| 134 | HandleError err; |
| 135 | HandleSecurity sec; |
| 136 | |
| 137 | sec.pOwner = NULL; |
| 138 | sec.pIdentity = myself->GetIdentity(); |
| 139 | |
| 140 | StructHandle *pHandle; |
| 141 | if ((err = handlesys->ReadHandle(hndl, g_StructHandle, &sec, (void **)&pHandle)) |
| 142 | != HandleError_None) |
| 143 | { |
| 144 | return pContext->ThrowNativeError("Invalid struct handle %x (error %d)", hndl, err); |
| 145 | } |
| 146 | |
| 147 | char *member; |
| 148 | pContext->LocalToString(params[2], &member); |
| 149 | |
| 150 | if (!pHandle->SetInt(member, params[3])) |
| 151 | { |
| 152 | return pContext->ThrowNativeError("Invalid member, or incorrect data type"); |
| 153 | } |
| 154 | |
| 155 | return 1; |
| 156 | } |
| 157 | |
| 158 | //native GetStructFloat(Handle:struct, const String:member[], &Float:value); |
| 159 | static cell_t GetStructFloat(IPluginContext *pContext, const cell_t *params) |
nothing calls this directly
no test coverage detected