Entity not being created
Hey
I am trying to create an entity on the floor where a player dies (with a custom model) and detect whether someone touches it. I have the following code: PHP Code:
Regards, SpirT. |
Re: Entity not being created
Your code looks ok.
I think is missing a debug to detect what is touching the entity, probably with that info you can understand what is happening Otherwise, try waiting for a frame (or create a timer to test) before spawning the entity. Maybe it is touching the death player itself (even with the IsPlayerAlive(client)) Also doesn't make much sense comparing the model in the OnTouchEntity check |
Re: Entity not being created
Quote:
With the timer do you mean creating it before deleting it? |
Re: Entity not being created
by Timer I mean hooking "SDKHook(coin, SDKHook_StartTouch, OnTouchEntity);" inside the timer.
|
Re: Entity not being created
Quote:
Something like this........ |
Re: Entity not being created
Put a delay in between player death and creating it, im guessing its hitting the dead player. Try a RequestFrame delay if that doesn't work then use a timer at 0.1 sec...that should work, if it does not then go to 0.2 etc. Or just do what Andi67 suggests.
|
Re: Entity not being created
...depends, do custom model have physic model, so touch would activate ?
You can look from Hammer map editor, via model browser, check "render collision model" you should see red wireframes. Or from Model Viewer, check physics model. What I remember. *edit Try different model ? ex: "models\weapons\w_eq_smokegrenade_dropped.mdl " |
Re: Entity not being created
Quote:
I'll give a try to andi67 source. |
Re: Entity not being created
Andi67's code worked perfectly, I changed also the timer from 1.0 to 0.5 and it works great! I just have another question. With these settings, the model spawns @ player death position, but I'd like it to fall to the floor, like if we would spawn any weapon in the air. Is that possible? (CS:GO)
|
Re: Entity not being created
Change prop_dynamic to prop_physics.....
|
All times are GMT -4. The time now is 17:47. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.