View Single Post
scorpius2k1
Senior Member
Join Date: Feb 2016
Old 05-13-2020 , 11:44   Re: SetEntPropEnt "m_hOwnerEntity" Changes Collision Group & Weapon Interaction
Reply With Quote #4

Quote:
Originally Posted by Bacardi View Post
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(clientfSpawnLocation);
        
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(iEntfSpawnLocationNULL_VECTORNULL_VECTOR);

        
DataPack dp;
        
CreateDataTimer(0.1tSetPropOwnerdp);
        
dp.WriteCell(client);
        
dp.WriteCell(iEnt);
    }
}

public 
Action tSetPropOwner(Handle timerHandle 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(iEntProp_Data"m_hOwnerEntity"client);
    }
}

public 
void OnPropTakeDamage(const char [] outputint callerint activatorfloat delay) {
    
PrintToChatAll("Prop Damaged!");

__________________
{__ PIRATES COVE __} ● HIGH-KILL Community | Stats ●
Half-Life 2: Deathmatch
66.151.244.149:27016 => CONNECT
scorpius2k1 is offline