Advertisement
Guest User

Untitled

a guest
May 29th, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. ScriptName RDE_DetonationScript extends ObjectReference Const
  2.  
  3. Keyword Property pRemoteExplosive Auto Const ; Add this Keyword to objects which you wish to be triggered by the detonator
  4. float Property WorkingRadius Auto Const ; Set the unit radius within which to find explosived to detonate
  5.  
  6. Function OnEquipped(Actor akActor)
  7. If (akActor == Game.GetPlayer())
  8. RegisterForAnimationEvent(akActor, "WeaponFire")
  9. EndIf
  10. EndFunction
  11.  
  12. Function OnUnequipped(Actor akActor)
  13. If (akActor == Game.GetPlayer())
  14. UnregisterForAnimationEvent(akActor, "WeaponFire")
  15. EndIf
  16. EndFunction
  17.  
  18. Event OnAnimationEvent(ObjectReference akSource, string asEventName)
  19. ObjectReference[] RemoteExplosiveList = akSource.FindAllReferencesWithKeyword(pRemoteExplosive, WorkingRadius)
  20. int i = RemoteExplosiveList.length-1
  21. While (i <= 0)
  22. RemoteExplosiveList[i].DamageObject(100)
  23. EndWhile
  24. EndEvent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement