RE-EDIT: Oh my god, I'm completely
dumb. I put in the size of the vector as an element.
EDIT: Thanks to BHaType for solving a small problem + asherkin for explaining
m_vecMins and
m_vecMaxs.
Here's some code but I doubt anyone needs it now:
PHP Code:
void SpawnFirstAidKit(int entity)
{
if (!IsValidEntity(entity)) return;
float fPos[3];
float fAng[3];
GetEntPropVector(entity, Prop_Send, "m_vecOrigin", fPos, sizeof(fPos));
GetEntPropVector(entity, Prop_Send, "m_angRotation", fAng, sizeof(fAng));
int first_aid_kit = CreateEntityByName("weapon_first_aid_kit_spawn");
TeleportEntity(first_aid_kit, fPos, fAng, NULL_VECTOR);
DispatchKeyValue(first_aid_kit, "model", "models/w_models/weapons/w_eq_medkit.mdl");
DispatchKeyValue(first_aid_kit, "spawnflags", "3");
DispatchSpawn(first_aid_kit);
ActivateEntity(first_aid_kit);
}
void TestFunc(int entity)
{
float vecMins[3];
float vecMaxs[3];
float fPos[3];
float fAng[3];
GetEntPropVector(entity, Prop_Send, "m_vecOrigin", fPos, sizeof(fPos));
GetEntPropVector(entity, Prop_Send, "m_angRotation", fAng, sizeof(fAng));
int commentary_dummy = CreateEntityByName("commentary_dummy");
TeleportEntity(first_aid_kit, fPos, fAng, NULL_VECTOR);
DispatchKeyValue(commentary_dummy, "model", "models/survivors/survivor_gambler.mdl");
GetEntPropVector(commentary_dummy, Prop_Send, "m_vecMins", vecMins, sizeof(vecMins));
GetEntPropVector(commentary_dummy, Prop_Send, "m_vecMaxs", vecMaxs, sizeof(vecMaxs));
DispatchSpawn(commentary_dummy);
ActivateEntity(commentary_dummy);
}
__________________