Spawning a prop_physics and making it follow a player.
I am currently in the process of making a command that spawns a custom model prop_physics above a players head and stays with them when they move. I have written all the foundations for the plugin, and now I just need to spawn the prop.
I am assuming I will need to use CreateEntityByName("prop_physics")(or prop_physics_multiplayer) but that's about as far as I have gotten. So basically what I need is: A way to spawn a prop_physics (or prop_physics_multiplayer) with a custom model A way to make this prop follow the player. Any help would be wonderful, thank you Allied Modders community. Also, look for this command in the next release of FuncommandsX. Spazman0. |
Re: Spawning a prop_physics and parenting it to a player.
There should be a signature for CBaseSomething(Entity?)::SetParent somewhere.. I've seen it before.
You might have to do a bit of research. |
Re: Spawning a prop_physics and parenting it to a player.
|
Re: Spawning a prop_physics and parenting it to a player.
Ok, so reading that article Kigen sent, I might be better off going with prop_physics_multiplayer. Still doesn't solve the issue of how to spawn it and make it follow the player. Any help?
|
Re: Spawning a prop_physics and making it follow a player.
Read the text I put above my link. I'm saying you CANNOT parent prop_physics.
Look at other props to see if one matches what your trying to do. http://developer.valvesoftware.com/w...Types_Overview |
Re: Spawning a prop_physics and making it follow a player.
I read the whole article, and couldn't see anywhere that it can't be parented. Unless you are saying this from your own experience, in which case I apologize.
For the moment I am doing away with the parenting and just trying to spawn it. However, when I run the command my server pops up with a message saying: 292/ - prop_physics: UTIL_SetModel: not precached: models/Hat/model.mdl This is the code I use to spawn the prop and give it the hat model: PHP Code:
I am assuming that I have to somehow "precache" the model with the server? If so, how would I go about doing this? I sv_pure is set to 0, just incase you were wondering. |
Re: Spawning a prop_physics and making it follow a player.
Code:
native PrecacheModel(const String:model[], bool:preload=false); Try prop_dynamic, since that can be parented. http://developer.valvesoftware.com/wiki/Prop_dynamic |
Re: Spawning a prop_physics and making it follow a player.
Actually you should use prop_dynamic_override, if I remember my experimentation correctly. I was trying to do exactly this. I gave up in the end - it always ended up obstructing the player's field of view, even if it looked like it shouldn't.
|
Re: Spawning a prop_physics and making it follow a player.
EDIT: Got it to work.
Now, I have it spawning as a prop_dynamic_override. How would I go about parenting it to the player? (assuming the player is defined by "target") At the moment this is my entire spawn code (Edited chundo's Achievement trophy code) PHP Code:
|
Re: Spawning a prop_physics and making it follow a player.
Sorry to bump, but I wasn't sure people realised I have edited the last post with more details and a new request.
|
All times are GMT -4. The time now is 09:09. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.