Code: Select all
Event( "Custom", "TestCam" )
{
SpawnCamera()
}
Function SpawnCamera( )
{
$xpos = $gPlayerWorldX + 100
$ypos = $gPlayerWorldY + 1000
$hCamEntity = EntityCreate( $gPlayerID, "LOCAL", "TRACK" )
EntitySetPosition( $hCamEntity, $xpos, $ypos, 0 )
EntitySetValue( $hCamEntity, "ZOffset", 800 )
EntitySetValue( $hCamEntity, "IsCamera", 1 )
EntitySetValue( $hCamEntity, "FaceTarget", 1 )
EntitySetValue( $hCamEntity, "AutoExpire", 5 )
EntitySetValue( $hCamEntity, "Target", $gPlayerID )
EntityAddToWorld( $hCamEntity )
}