I doubt that will work as there is no trigger (not on the globals that is) so I don't know how you are planning to make the string event...
I didnt test but here is what I took from JJ's CP (all credit goes to him)
globals
Code:
trigger trg_hp=CreateTrigger()
endglobals
Code:
function addHP takes nothing returns nothing
local integer Sethp=S2I(SubString(GetEventPlayerChatString(),7,12))/50
local group g2g=CreateGroup()
local unit u2u
local integer Nowhp=0
call GroupEnumUnitsSelected(g2g,GetTriggerPlayer(),null)
loop
set u2u=FirstOfGroup(g2g)
exitwhen u2u==null
if SubString(GetEventPlayerChatString(),0,7)=="-addhp "then
if Sethp>200then
set Sethp=200
endif
call UnitAddAbility(u2u,'AInv')
loop
exitwhen Nowhp>=Sethp
set Nowhp=Nowhp+1
call UnitAddItemToSlotById(u2u,'manh',6)
endloop
endif
call GroupRemoveUnit(g2g,u2u)
endloop
call DestroyGroup(g2g)
endfunction
function main
Code:
local integer zzz=0
loop
exitwhen zzz>11
call TriggerRegisterPlayerChatEvent(trg_hp,Player(zzz),"-addhp ",false)
set zzz=zzz+1
endloop
call TriggerAddAction(trg_hp,function addHP)
Tell me how it goes.