View Single Post
bigborther
Member
Join Date: Feb 2014
Location: china
Old 02-12-2023 , 05:11   Re: Projectile Camera
Reply With Quote #15

fix view rotate issue. REF: https://forums.alliedmods.net/showpo...4&postcount=53

Code:
void setClientToProjectileiew(int client) {
    int ent = EntRefToEntIndex(observedEntRef[client]);
    static float ClientAngles[3];
    if(IsValidEntity(ent)){
        GetClientEyeAngles(client, ClientAngles);
        PrintToConsole(client, "ClientAngles[0]=%f, ClientAngles[1]=%f, ClientAngles[2]=%f",
        ClientAngles[0], ClientAngles[1], ClientAngles[2]);
        TeleportEntity(ent, NULL_VECTOR, ClientAngles, NULL_VECTOR);
        SetClientViewEntity(client, ent);
    } else {
        setClientToClientView(client);
    }
}
Attached Files
File Type: smx projectile-camera.smx (5.0 KB, 56 views)
File Type: sp Get Plugin or Get Source (projectile-camera.sp - 88 views - 2.9 KB)

Last edited by bigborther; 02-12-2023 at 05:11.
bigborther is offline