- Joined
- Mar 20, 2014
- Messages
- 67
It gives me an error, is it because I can't add the parameter to the function when I'm adding it as an action? If I can't then what do I do?
- Zach
- Zach
JASS:
function PlayerExceedsMax takes integer p returns nothing
call SetPlayerStateBJ( Player(p), PLAYER_STATE_RESOURCE_GOLD, udg_MaxGold )
call SetPlayerStateBJ( Player(p), PLAYER_STATE_RESOURCE_LUMBER, udg_MaxLumber )
endfunction
//===========================================================================
function InitTrig_Player_Exceeds_Max takes nothing returns nothing
local integer i = 0
local integer stop = GetPlayers()
local integer p
set gg_trg_Player_Exceeds_Max = CreateTrigger( )
loop
call TriggerRegisterPlayerStateEvent( gg_trg_Player_Exceeds_Max, Player(i), PLAYER_STATE_RESOURCE_GOLD, GREATER_THAN_OR_EQUAL, udg_MaxGold[i])
call TriggerRegisterPlayerStateEvent( gg_trg_Player_Exceeds_Max, Player(i), PLAYER_STATE_RESOURCE_LUMBER, GREATER_THAN_OR_EQUAL, udg_MaxLumber[i] )
set i = i + 1
exitwhen i >= stop
endloop
set p = GetConvertedPlayerId(GetTriggerPlayer())
call TriggerAddAction( gg_trg_Player_Exceeds_Max, function PlayerExceedsMax(p) )
endfunction
Last edited by a moderator: