hi friends actually this is noy my camera system i found it in other web sites in vjass language, i need help can you also add trigger to set camera distance with mouse wheel too and max string to 2500 and min to 1650.
also please if it's posible write it in gui.
function gg_trg_CameraZoom_Conditions takes nothing returns boolean
local real r
local string s
if GetLocalPlayer() == GetTriggerPlayer() then
set s = SubString(GetEventPlayerChatString(), 6, StringLength(GetEventPlayerChatString()))
set r = S2R(s)
if s == "default" then
set r = 1650
endif
if s == "med" then
set r = 2075
endif
if s == "high" then
set r = 2500
endif
call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, r, 1.00)
call SetCameraField(CAMERA_FIELD_FARZ, 100000000.00, 1)
endif
return false
endfunction
//===========================================================================
function InitTrig_CameraZoom takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer i = 0
loop
exitwhen i == bj_MAX_PLAYERS
call TriggerRegisterPlayerChatEvent(trig, Player(i), "-zoom", false)
set i = i + 1
endloop
call TriggerAddCondition(trig, Condition(function gg_trg_CameraZoom_Conditions))
call SetTerrainFogExBJ( 0, 10000000.00, 1000000.00, 0.5, 100, 100, 100 )
endfunction
also please if it's posible write it in gui.
function gg_trg_CameraZoom_Conditions takes nothing returns boolean
local real r
local string s
if GetLocalPlayer() == GetTriggerPlayer() then
set s = SubString(GetEventPlayerChatString(), 6, StringLength(GetEventPlayerChatString()))
set r = S2R(s)
if s == "default" then
set r = 1650
endif
if s == "med" then
set r = 2075
endif
if s == "high" then
set r = 2500
endif
call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, r, 1.00)
call SetCameraField(CAMERA_FIELD_FARZ, 100000000.00, 1)
endif
return false
endfunction
//===========================================================================
function InitTrig_CameraZoom takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer i = 0
loop
exitwhen i == bj_MAX_PLAYERS
call TriggerRegisterPlayerChatEvent(trig, Player(i), "-zoom", false)
set i = i + 1
endloop
call TriggerAddCondition(trig, Condition(function gg_trg_CameraZoom_Conditions))
call SetTerrainFogExBJ( 0, 10000000.00, 1000000.00, 0.5, 100, 100, 100 )
endfunction
Last edited: