diff --git a/sourcepawn/vm/sp_vm.c b/sourcepawn/vm/sp_vm.c index 2c6685300..b9651fb4c 100644 --- a/sourcepawn/vm/sp_vm.c +++ b/sourcepawn/vm/sp_vm.c @@ -1,4 +1,5 @@ #include +#include #include #include "sp_vm.h" @@ -105,3 +106,19 @@ int SP_HeapRelease(sp_context_t *ctx, cell_t local_addr) return SP_ERR_NONE; } + +int SP_FindNativeByName(sp_context_t *ctx, const char *name, uint32_t *index) +{ + uint32_t i; + + for (i = 0; i < ctx->plugin->info->natives_num; i++) + { + if (!strcmp(name, ctx->natives[i].name)) + { + if (index) + *index = i; + return SP_ERR_NONE; + } + } + return SP_ERR_NOT_FOUND; +} \ No newline at end of file