Advertisement
SjoerdPSV

Untitled

Aug 17th, 2014
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.78 KB | None | 0 0
  1. function destroyCar(theElement)
  2.     if (not isElement(theElement)) then return end
  3.     destroyElement(theElement)
  4.     if (getElementType(theElement) == "Vehicle") then
  5.         local driver = getVehicleOccupant(theElement, 0)
  6.         local owner = exports.GTIvehicles:getVehicleOwner(theElement)
  7.         if (owner) then
  8.             exports.GTIlogs:outputWebLog( "DESTROY: "..getPlayerName(client).." destroyed "..getPlayerName(owner).."'s car. ("..getVehicleName(theElement)..")")
  9.         elseif (driver) then
  10.             exports.GTIlogs:outputWebLog( "DESTROY: "..getPlayerName(client).." destroyed "..getPlayerName(driver).."'s car. ("..getVehicleName(theElement)..")")
  11.         end    
  12.     end    
  13. end
  14. addEvent("destroyCar", true)
  15. addEventHandler("destroyCar", root, destroyCar)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement