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(target, fPosition)
fPosition[2]+=10
new String:sModel[64]
sModel = "models/Hat/model.mdl"
new iModel = CreateEntityByName("prop_dynamic_override");
TeleportEntity(iModel, fPosition, NULL_VECTOR, NULL_VECTOR);
DispatchKeyValue(iModel, "model", "models/Hat/model.mdl");
DispatchSpawn(iModel);
AcceptEntityInput(iModel, "SetParent", target, target, 0);
AcceptEntityInput(iModel, "TurnOn", target, target, 0);