Quote:
Originally Posted by Bacardi
Try set properties, after entity spawn.
CreateTimer with 0.0 seconds.
|
Great idea, I was hopeful and had not tried that but no luck, still have the issue unfortunately.
PHP Code:
stock void SpawnEntityAtPlayer(int client) {
int iEnt = CreateEntityByName("prop_physics_override");
if(IsValidEntity(iEnt)) {
float fSpawnLocation[3];
GetClientAbsOrigin(client, fSpawnLocation);
fSpawnLocation[0] += 64.0;
fSpawnLocation[1] += 64.0;
DispatchKeyValue(iEnt, "model", "models/props_citizen_tech/guillotine001a_wheel01.mdl");
DispatchKeyValue(iEnt, "targetname", sEntName);
DispatchSpawn(iEnt);
TeleportEntity(iEnt, fSpawnLocation, NULL_VECTOR, NULL_VECTOR);
DataPack dp;
CreateDataTimer(0.1, tSetPropOwner, dp);
dp.WriteCell(client);
dp.WriteCell(iEnt);
}
}
public Action tSetPropOwner(Handle timer, Handle dp) {
ResetPack(dp);
int client = ReadPackCell(dp);
int iEnt = ReadPackCell(dp);
if(IsValidEntity(iEnt)) {
// ???
// FOR SOME REASON, THIS MODIFIES COLLISION GROUP WITH PLAYER
// AND INTERACTION HITSCAN-BASED WEAPONS
SetEntPropEnt(iEnt, Prop_Data, "m_hOwnerEntity", client);
}
}
public void OnPropTakeDamage(const char [] output, int caller, int activator, float delay) {
PrintToChatAll("Prop Damaged!");
}
__________________