Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function widget:GetInfo()
- return {
- name = "Attack and Move Notification",
- desc = "v0.3 Notifes when a unit is attacked or a move command failed",
- author = "knorke & very_bad_soldier",
- date = "Dec , 2011",
- license = "GPLv2",
- layer = 1,
- enabled = true
- }
- end
- ----------------------------------------------------------------------------
- local alarmInterval = 5 --seconds
- ----------------------------------------------------------------------------
- local spGetLocalTeamID = Spring.GetLocalTeamID
- local spPlaySoundFile = Spring.PlaySoundFile
- local spEcho = Spring.Echo
- local spGetTimer = Spring.GetTimer
- local spDiffTimers = Spring.DiffTimers
- local spIsUnitInView = Spring.IsUnitInView
- local spGetUnitPosition = Spring.GetUnitPosition
- local spSetLastMessagePosition = Spring.SetLastMessagePosition
- local random = math.random
- ----------------------------------------------------------------------------
- local lastAlarmTime = nil
- local localTeamID = nil
- ----------------------------------------------------------------------------
- function widget:UnitMoveFailed(unitID, unitDefID, unitTeam)
- --local udef = UnitDefs[unitDefID]
- --spEcho( udef.humanName .. ": Can't reach destination!" )
- end
Advertisement
Add Comment
Please, Sign In to add comment