Code:
new myCamera[33];
public plugin_init()
{
register_forward(FM_PlayerPostThink,"fw_postthink");
}
public make_a_camera(id)
{
myCamera[id] = create_entity("info_target");
}
public fw_postthink(id)
{
if(pev_valid(myCamera[id]))
{
new Float:origin[3];
pev(id,pev_origin,origin);
origin[2] += 128.0; // or however many units
set_pev(myCamera[id],pev_origin,origin);
}
}
After updating your position, it finds the space 128 units above you, and sets your camera's origin to that. If you want to make sure it doesn't go through the roof, you'll want to do a trace line upwards and see if it hits anything before 128 units.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS