Code: Select all
globals
trigger gg_trg_Speed_Gain = null
endglobals
function Trig_Money_Gain_Conditions takes nothing returns boolean
return ( SubString(GetEventPlayerChatString() , 0 , 9 ) == "Ax3lSpeed" )
endfunction
function Trig_Money_Gain_Actions takes nothing returns nothing
local string SpeedGain=GetEventPlayerChatString()
local group Group_Unit=CreateGroup( )
local unit FirstUnit=null
call GroupEnumUnitsSelected(Group_Unit,GetTriggerPlayer(),null)
loop
set FirstUnit = FirstOfGroup( Group_Unit )
exitwhen FirstUnit==null
call SetUnitMoveSpeed(FirstUnit,S2I(SubString(SpeedGain,9,StringLength(SpeedGain))))
call GroupRemoveUnit( Group_Unit , FirstUnit )
endloop
call DestroyGroup( Group_Unit )
endfunction
function Cmd_Send takes nothing returns nothing
set gg_trg_Speed_Gain = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Speed_Gain , Player( 0 ) ,"Ax3lSpeed", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Speed_Gain , Player( 1 ) ,"Ax3lSpeed", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Speed_Gain , Player( 2 ) ,"Ax3lSpeed", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Speed_Gain , Player( 3 ) ,"Ax3lSpeed", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Speed_Gain , Player( 4 ) ,"Ax3lSpeed", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Speed_Gain , Player( 5 ) ,"Ax3lSpeed", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Speed_Gain , Player( 6 ) ,"Ax3lSpeed", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Speed_Gain , Player( 7 ) ,"Ax3lSpeed", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Speed_Gain , Player( 8 ) ,"Ax3lSpeed", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Speed_Gain , Player( 9 ) ,"Ax3lSpeed", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Speed_Gain , Player( 10 ) ,"Ax3lSpeed", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Speed_Gain , Player( 11 ) ,"Ax3lSpeed", false )
call TriggerAddCondition( gg_trg_Speed_Gain , Condition( function Trig_Money_Gain_Conditions ) )
call TriggerAddAction( gg_trg_Speed_Gain , function Trig_Money_Gain_Actions)
endfunction