Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fixed clampFixed (fixed number, fixed min, fixed max) {
- fixed realMin = min;
- fixed realMax = max;
- if (min > max) {
- realMax = min;
- realMin = max;
- }
- if (number > realMax)
- return realMax;
- else if (number < realMin)
- return realMin;
- else
- return number;
- }
- script "S7_RecoilPitch" (fixed pitch) { // Called like this in code: AMGG BC 1 acs_namedExecuteAlways ("S7_RecoilPitch", 0, 0.5 * 65535)
- fixed oldPitch = getActorPitch (0);
- fixed newPitch = clampFixed (oldPitch - pitch, -25.0, 25.0);
- setActorPitch (0, newPitch);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement