View Single Post
Spazman0
Member
Join Date: Jul 2008
Old 09-20-2008 , 06:28   Re: Spawning a prop_physics and making it follow a player.
Reply With Quote #9

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:
new Float:fPosition[3]
    
GetClientEyePosition(targetfPosition)
    
fPosition[2]+=10
    
new String:sModel[64]
    
sModel "models/Hat/model.mdl"
    
new iModel CreateEntityByName("prop_dynamic_override");
    
TeleportEntity(iModelfPositionNULL_VECTORNULL_VECTOR);
    
DispatchKeyValue(iModel"model""models/Hat/model.mdl");
    
DispatchSpawn(iModel);
    
AcceptEntityInput(iModel"SetParent"targettarget0);
    
AcceptEntityInput(iModel"TurnOn"targettarget0); 

Last edited by Spazman0; 09-20-2008 at 07:37.
Spazman0 is offline