CBaseEntity::Create(char const* class_name, Vector const& origin, QAngle const& angle, CBaseEntity*);
call Create() function = crashes
Code:
Handle Config;
Handle hCreate;
public void OnPluginStart(){
Config = LoadGameConfigFile("test");
StartPrepSDKCall(SDKCall_Entity);
//window sig: \x55\x8B\xEC\x56\x6A\xFF\xFF\x75\x08\xE8\x2A\x2A\x2A\x2A\x8B\xF0\x83\xC4\x08\x85\xF6\x75\x2A\x56
//linux and mac sig: _ZN11CBaseEntity6CreateEPKcRK6VectorRK6QAnglePS_
PrepSDKCall_SetFromConf(Config, SDKConf_Signature, "CBaseEntity::Create");
PrepSDKCall_AddParameter(SDKType_String, SDKPass_Pointer);
PrepSDKCall_AddParameter(SDKType_Vector, SDKPass_ByValue);
PrepSDKCall_AddParameter(SDKType_QAngle, SDKPass_ByValue);
PrepSDKCall_AddParameter(SDKType_CBaseEntity, SDKPass_Pointer);
hCreate= EndPrepSDKCall();
CloseHandle(Config);
RegConsoleCmd("sm_test", test);
}
public Action test(int client, int args){
float origin[3];
float angle[3];
GetClientAbsOrigin(client, origin);
angle[0] = GetEntPropFloat(client, Prop_Send, "m_angEyeAngles[0]");
angle[1] = GetEntPropFloat(client, Prop_Send, "m_angEyeAngles[1]");
SDKCall(hCreate, "item_currencypack_medium", origin, angle, client); //---crashes---
return Plugin_Handled;
}