NVM. did it differently using sourcepawn now.
Hm yea tried that but doesn't seem to work either.
PHP Code:
cell_t Native_GetWeaponShootPosition(IPluginContext *pContext, const cell_t *params)
{
static ICallWrapper *pWrapper = NULL;
if(!pWrapper)
{
REGISTER_NATIVE_ADDR("CBasePlayer::Weapon_ShootPosition",
PassInfo ret;\
ret.flags = PASSFLAG_BYVAL;\
ret.size = sizeof(Vector);\
ret.type = PassType_Basic;\
pWrapper = g_pBinTools->CreateCall(addr, CallConv_ThisCall, &ret, NULL, 0));
}
CBaseEntity *pEntity;
if(!(pEntity = GetCBaseEntity(params[1], true)))
{
return pContext->ThrowNativeError("Client index %d is invalid",params[1]);
}
cell_t *pPos;
pContext->LocalToPhysAddr(params[2], &pPos);
unsigned char vstk[sizeof(CBaseEntity *)];
unsigned char *vptr = vstk;
*(CBaseEntity **)vptr = pEntity;
//vptr +=sizeof(CBaseEntity *);
Vector pos;
pWrapper->Execute(vstk, &pos);
pPos[0] = sp_ftoc(pos.x);
pPos[1] = sp_ftoc(pos.y);
pPos[2] = sp_ftoc(pos.z);
return 1;
}