Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Police Part---
- local theMarker;
- local theCar;
- function spawncar()
- theCar = createVehicle ( 411, 2453.8774414063, 2334.59765625, 10.8203125 )
- createBlipAttachedTo ( theCar, 42 )
- exports.QGpolice:alertPolice("Monney Car has been spawned at LV bank")
- end
- addEventHandler ( "onResourceStart", getRootElement(), spawncar )
- function Enter ( theVehicle, seat, jacked )
- local id = getElementModel ( theVehicle )
- if id == 411 and getTeamName( getPlayerTeam( source ) ) == "Police" then
- theMarker = createMarker ( 2470.0556640625,2335.4562988281, 9.5, "cylinder", 3, 255, 0, 0, 170 )
- blip = createBlipAttachedTo ( theMarker, 41 )
- exports.WSScommands:sendMessage("Deliever it.", 255, 255, 255, thePlayer)
- addEventHandler( "onMarkerHit", theMarker, MarkerHit )
- end
- end
- addEventHandler ( "onPlayerVehicleEnter", getRootElement(), Enter )
- function MarkerHit( hitElement, matchingDimension )
- if isElement(hitElement) then
- if getElementType(hitElement) == "player" then
- local veh = getPedOccupiedVehicle(hitElement)
- local id = getElementModel ( veh )
- if isPedInVehicle ( hitElement ) and getTeamName( getPlayerTeam( hitElement ) ) == "Police" and id == 411 then
- exports.WSScommands:giveMoney ( hitElement, 4000 )
- exports.WSScommands:sendMessage("Delievery done.", 255, 255, 255, hitElement)
- destroyElement( getPedOccupiedVehicle(hitElement) )
- destroyElement( theMarker )
- destroyElement(attachedElement)
- end
- end
- end
- end
- function blow ( thePlayer )
- if isPedInVehicle ( thePlayer ) then
- destroyElement(id)
- destroyElement(bank)
- outputChatBox("Failed", thePlayer)
- end
- end
- addEventHandler( "onVehicleExplode", getRootElement(), blow )
- addEventHandler( "onPlayerWasted", getRootElement( ),
- function()
- local veh = getPedOccupiedVehicle(source)
- local id = getElementModel ( veh )
- if isPedInVehicle ( source ) and getTeamName( getPlayerTeam( source ) ) == "Police" and id == 411 then
- destroyElement(veh)
- destroyElement(theMarker)
- end
- end
- )
- function restartResource()
- if isElement(theMarker) then
- destroyElement(theMarker)
- theMarker = nil
- end;
- end
- setTimer(restartResource,10000,0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement