Guest User

Untitled

a guest
Dec 18th, 2011
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. function widget:GetInfo()
  2. return {
  3. name = "Attack and Move Notification",
  4. desc = "v0.3 Notifes when a unit is attacked or a move command failed",
  5. author = "knorke & very_bad_soldier",
  6. date = "Dec , 2011",
  7. license = "GPLv2",
  8. layer = 1,
  9. enabled = true
  10. }
  11. end
  12. ----------------------------------------------------------------------------
  13. local alarmInterval = 5 --seconds
  14. ----------------------------------------------------------------------------
  15. local spGetLocalTeamID = Spring.GetLocalTeamID
  16. local spPlaySoundFile = Spring.PlaySoundFile
  17. local spEcho = Spring.Echo
  18. local spGetTimer = Spring.GetTimer
  19. local spDiffTimers = Spring.DiffTimers
  20. local spIsUnitInView = Spring.IsUnitInView
  21. local spGetUnitPosition = Spring.GetUnitPosition
  22. local spSetLastMessagePosition = Spring.SetLastMessagePosition
  23. local random = math.random
  24. ----------------------------------------------------------------------------
  25. local lastAlarmTime = nil
  26. local localTeamID = nil
  27. ----------------------------------------------------------------------------
  28.  
  29. function widget:UnitMoveFailed(unitID, unitDefID, unitTeam)
  30. --local udef = UnitDefs[unitDefID]
  31. --spEcho( udef.humanName .. ": Can't reach destination!" )
  32. end
Advertisement
Add Comment
Please, Sign In to add comment