here you go.. untested, but i guess you should be able to get it working..
/*
plc = local player controller ptr
behind_view = guess what :p
FMax() = uscript func 'UObject_execFMax_Parms'
Max() = uscript func 'UObject_execMax_Parms'
Min() = uscript func 'UObject_execMin_Parms'
*/
int KeyEvent(DWORD key, DWORD action, float Value) {
static float cam_dist = 0;
if (action == 0x01) {
if (key == 0xEC) {
if (behind_view) {
cam_dist = FMax((cam_dist + 1.00), 2.00);
plc.CameraDist = cam_dist;
} else {
plc.DesiredFOV = Max(plc.FovAngle - 15, 3);
};
} else if (key == 0xED)
if (behind_view) {
cam_dist = FMax((cam_dist - 1.00), 2.00);
plc.CameraDist = cam_dist;
} else {
plc.DesiredFOV = Min(plc.FovAngle + 15, plc.DefaultFOV);
};
};
};
return 0;/* or call original keyevent*/
};
NetzTeil: you forgot half of the code :p