D
dArKzEr0
Guest
If I make a function and place it into the custom script section of the trigger editor, what's the proper syntax for calling it in the GUI in subsequent triggers?
-darkz
-darkz
Custom Script - call MyFunc()
function BJDebugMsg [B]takes string[/B] msg returns nothing
local integer i = 0
loop
call DisplayTimedTextToPlayer(Player(i),0,0,60,msg)
set i = i + 1
exitwhen i == bj_MAX_PLAYERS
endloop
endfunction
globals
trigger gg_trg_Whatever
unit udg_SpellUnit
endglobals
function PlayerIsPlaying takes player xyz returns boolean
if ( not GetBooleanAnd( ( GetPlayerController(xyz) == MAP_CONTROL_USER ), ( GetPlayerSlotState(xyz) == PLAYER_SLOT_STATE_PLAYING ) ) ) then
return false
endif
return true
endfunction
function PlayerIsPlaying takes player xyz returns boolean
return GetBooleanAnd( GetPlayerController(xyz) == MAP_CONTROL_USER, GetPlayerSlotState(xyz) == PLAYER_SLOT_STATE_PLAYING )
endfunction
function PlayerIsPlaying takes player xyz returns boolean
if ( not GetBooleanAnd( ( GetPlayerController(xyz) == MAP_CONTROL_USER ), ( GetPlayerSlotState(xyz) == PLAYER_SLOT_STATE_PLAYING ) ) ) then
return false
endif
return true
endfunction
function PlayerIsPlaying takes player xyz returns boolean
return GetPlayerController(xyz) == MAP_CONTROL_USER and GetPlayerSlotState(xyz) == PLAYER_SLOT_STATE_PLAYING
endfunction
Function Reference
function func_name
This expression is used to refer to a function. It returns a "pointer" to that function of type code that can be passed to functions that take parameters of code type (e.g., StartThread).
function ThisIsMyBoolean takes unit whichUnit, group whichGroup returns boolean
return (GetUnitState(whichUnit, UNIT_STATE_LIFE) > 0, IsUnitInGroup(whichUnit, whichGroup))
endfunction