this is a very good tutorial to help you with everything you need for cameras. if it's unclear tell me and I'll do my best to clarify
here, i took this right out of Blizzard's WarChasers map
Trigger:
- Disallow Mousewheel
- Events
- Time - Every 1.00 seconds of game time
- Conditions
- Actions
- Player Group - Pick every player in (All players) and do (Actions)
- Loop - Actions
- Camera - Set (Picked players)'s camera Distance to target to 1650.00 over 0.50 seconds
- Camera - Set (Picked players)'s camera Angle of attack to 304.00 over 0.50 seconds
- Camera - Set (Picked players)'s camera Roll to 0.00 over 0.50 seconds
- Camera - Set (Picked players)'s camera Rotation to 90.00 over 0.50 seconds
If you put that in, it makes it so the player cannot angle rotate or roll (mousewheel) their camera. the values are set to the default. just play around with them to what you want.
Then you have to do trigger that when a player types a command with a specific number, you change the value to get the camera far away.
EDIT: 200 posts
function Zoom_Conditions takes nothing returns boolean
return SubString(GetEventPlayerChatString(), 0, StringLength("-zoom ")) == "-zoom "
endfunction
function Zoom_Actions takes nothing returns nothing
local integer i = S2I(SubString(GetEventPlayerChatString(), 6, StringLength(GetEventPlayerChatString())))
if GetLocalPlayer() == GetTriggerPlayer() then
call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, i, 0 )
endif
endfunction
//===========================================================================
function InitTrig_zoom_test takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i = 0
loop
exitwhen i > 11
call TriggerRegisterPlayerChatEvent( t, Player(i), "-zoom ", false )
set i = i + 1
endloop
call TriggerAddCondition( t, Condition( function Zoom_Conditions ) )
call TriggerAddAction( t, function Zoom_Actions )
endfunction