Advertisement
Guest User

Untitled

a guest
Mar 1st, 2015
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. --Police Part---
  2. local theMarker;
  3. local theCar;
  4.  
  5.  
  6. function spawncar()
  7. theCar = createVehicle ( 411, 2453.8774414063, 2334.59765625, 10.8203125 )
  8. createBlipAttachedTo ( theCar, 42 )
  9. exports.QGpolice:alertPolice("Monney Car has been spawned at LV bank")
  10. end
  11. addEventHandler ( "onResourceStart", getRootElement(), spawncar )
  12.  
  13.  
  14. function Enter ( theVehicle, seat, jacked )
  15. local id = getElementModel ( theVehicle )
  16. if id == 411 and getTeamName( getPlayerTeam( source ) ) == "Police" then
  17. theMarker = createMarker ( 2470.0556640625,2335.4562988281, 9.5, "cylinder", 3, 255, 0, 0, 170 )
  18. blip = createBlipAttachedTo ( theMarker, 41 )
  19. exports.WSScommands:sendMessage("Deliever it.", 255, 255, 255, thePlayer)
  20. addEventHandler( "onMarkerHit", theMarker, MarkerHit )
  21. end
  22. end
  23. addEventHandler ( "onPlayerVehicleEnter", getRootElement(), Enter )
  24.  
  25.  
  26. function MarkerHit( hitElement, matchingDimension )
  27. if isElement(hitElement) then
  28. if getElementType(hitElement) == "player" then
  29. local veh = getPedOccupiedVehicle(hitElement)
  30. local id = getElementModel ( veh )
  31. if isPedInVehicle ( hitElement ) and getTeamName( getPlayerTeam( hitElement ) ) == "Police" and id == 411 then
  32. exports.WSScommands:giveMoney ( hitElement, 4000 )
  33. exports.WSScommands:sendMessage("Delievery done.", 255, 255, 255, hitElement)
  34. destroyElement( getPedOccupiedVehicle(hitElement) )
  35. destroyElement( theMarker )
  36. destroyElement(attachedElement)
  37. end
  38. end
  39. end
  40. end
  41.  
  42.  
  43. function blow ( thePlayer )
  44. if isPedInVehicle ( thePlayer ) then
  45. destroyElement(id)
  46. destroyElement(bank)
  47. outputChatBox("Failed", thePlayer)
  48. end
  49. end
  50. addEventHandler( "onVehicleExplode", getRootElement(), blow )
  51.  
  52.  
  53. addEventHandler( "onPlayerWasted", getRootElement( ),
  54. function()
  55. local veh = getPedOccupiedVehicle(source)
  56. local id = getElementModel ( veh )
  57. if isPedInVehicle ( source ) and getTeamName( getPlayerTeam( source ) ) == "Police" and id == 411 then
  58. destroyElement(veh)
  59. destroyElement(theMarker)
  60. end
  61. end
  62. )
  63.  
  64.  
  65.  
  66. function restartResource()
  67. if isElement(theMarker) then
  68. destroyElement(theMarker)
  69. theMarker = nil
  70. end;
  71. end
  72. setTimer(restartResource,10000,0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement