Looks like you forgot to get the pWarpper pointer. that is the first thing I noticed, try this:
PHP Code:
static cell_t Native_IsPlayer(IPluginContext* pContext, const cell_t* params)
{
CBaseEntity* pEntity = GetCBaseEntity(params[1], false);
if (!pEntity)
{
return pContext->ThrowNativeError("Entity index %d is invalid", params[1]);
}
static ICallWrapper* pWrapper = nullptr;
if (!pWrapper)
{
REGISTER_NATIVE_OFFSET("CBaseEntity::IsPlayer",
PassInfo retInfo;
retInfo.flags = PASSFLAG_BYVAL; \
retInfo.size = sizeof(bool); \
retInfo.type = PassType_Basic; \
pWrapper = g_pBinTools->CreateVCall(offset, 0, 0, &retInfo, nullptr, 0));
}
if( !pWrapper )
{
return pContext->ThrowNativeError("Failed to get ICallWarpper pointer");
}
//ArgBuffer<CBaseEntity*> vstk(pEntity);
unsigned char vstk[sizeof(CBaseEntity*)];
unsigned char* vptr = vstk;
*(CBaseEntity**)vptr = pEntity;
bool bResult;
pWrapper->Execute(vstk, &bResult);
return (bResult == true) ? 1 : 0;
}
EDIT: Ah, one more thing. don't forget to free it, I think using a List or a Vector to store the pointer and free it on extension unload is a good idea.