Hello, moving straight to the issue:
Typing -cam <camera> should set global camera value to <camera> and it certainly does, but after typing -cam fix the debug message appears.
What do I misunderstand?
Typing -cam <camera> should set global camera value to <camera> and it certainly does, but after typing -cam fix the debug message appears.
What do I misunderstand?
JASS:
globals
player cameraPlayer
real camera = 0
endglobals
function Camera_t takes nothing returns boolean
set cameraPlayer = GetTriggerPlayer()
set camera = S2R(SubString(GetEventPlayerChatString(),5,9))
call CameraSet()
return true
endfunction
function Camera_typ takes nothing returns boolean
if camera == 0 then
call BJDebugMsg("Cam = 0!")
endif
return true
endfunction
//===========================================================================
function InitTrig_Camera takes nothing returns nothing
local trigger t = CreateTrigger( )
local trigger typ = CreateTrigger( )
local integer index = 0
loop
call TriggerRegisterPlayerChatEvent(t,Player(index),"-cam ",false)
call TriggerRegisterPlayerChatEvent(typ, Player(index),"-cam fix",true)
set index = index + 1
exitwhen index == bj_MAX_PLAYER_SLOTS
endloop
call TriggerAddCondition( t, Condition(function Camera_t) )
call TriggerAddCondition( typ, Condition(function Camera_typ) )
set typ = null
set t = null
endfunction