Raised This Month: $ Target: $400
 0% 

[TF2] Entity not getting parented


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Boonie
Member
Join Date: Aug 2015
Old 09-08-2015 , 07:56   [TF2] Entity not getting parented
Reply With Quote #1

I know I'm making an eay mistake, but I cannot get this to parent to my object. Any ideas?

Code:
char classname[32];
int ent = GetEventInt(hEvent, "index");
GetEdictClassname(ent, classname, sizeof(classname));
if (StrEqual(classname, "obj_teleporter")) {
    
    int entity = CreateEntityByName("func_nobuild");
    if (entity != -1) {
        DispatchKeyValue(entity, "AllowTeleporters", "0");
        DispatchSpawn(entity);
        
        AcceptEntityInput(entity, "SetParent", ent, entity);
        AcceptEntityInput(entity, "SetParentAttachment", ent, entity);
        
        ActivateEntity(entity);
        == snip ==
    }
}

Last edited by Boonie; 09-08-2015 at 07:57.
Boonie is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 09-08-2015 , 09:46   Re: [TF2] Entity not getting parented
Reply With Quote #2

Take a look at this thread:
https://forums.alliedmods.net/showthread.php?t=146554
And use some of examples provided above in your code
You should get more or less reason why it didn't work
__________________
...
Oshizu is offline
Boonie
Member
Join Date: Aug 2015
Old 09-08-2015 , 23:59   Re: [TF2] Entity not getting parented
Reply With Quote #3

Well now I feel stupid. I got it working, thanks!
Boonie is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:31.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode