Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.05 KB | None | 0 0
  1. addEventHandler("onResourceStart", resourceRoot,
  2. function ( )
  3.     backupBeacon = false
  4. end
  5. )
  6.  
  7. --
  8.    
  9. function showBeacon ( thePlayer, commandName )
  10.         if exports.players:isLoggedIn( thePlayer ) then
  11.                 local pdMember = getElementsByType("player")
  12.                 local inPD, factionID, factionName, factionTag = exports.factions:isPlayerInFactionType( pdMember, 1 )
  13.                 if inPD and factionTag then
  14.                         if not backupBeacon then
  15.                                 local playerx, playery, playerz = getElementPosition( thePlayer )
  16.                                 backupBlip = createBlip( playerx, playery, playerz, 0, 3, 255, 0, 0, 255, 0 , 99999.0, pdMember)
  17.                                 outputChatBox("A unit is in need of assistance, respond ASAP!", pdMember, 255, 150, 0)
  18.                                 attachElements ( backupBlip, thePlayer)
  19.                                 backupBeacon = true
  20.                             else
  21.                                 destroyElement( backupBlip )
  22.                                 backupBeacon = false
  23.                                 outputChatBox("The unit no longer requires assistance.", pdMember, 255, 150, 0)
  24.                         end
  25.                 end
  26.         end
  27. end
  28. addCommandHandler("backup", showBeacon)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement