Guest User

VehiCollOff

a guest
Jan 22nd, 2014
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.96 KB | None | 0 0
  1. -- For vehicle collision off -inspired Eliteprime, wizard, shaft and bugs's works --
  2.  
  3. --vehicle_dmgmodifier = 0.1
  4.  
  5. function GetRequiredVersion()
  6.     return 200
  7. end
  8.  
  9.  
  10. function OnScriptLoad(processid, game, persistent) end
  11.  
  12. function OnDamageLookup(receiving, causing, mapId, tagdata)
  13.     if causing then
  14.         local c_player = objectidtoplayer(causing)
  15.         if c_player and isinvehicle(c_player) then
  16.             local m_vehicleId = getplayervehicleid(c_player)
  17.             if m_vehicleId then
  18.                 local m_vehicle = getobject(m_vehicleId)
  19.                 local driver = readdword(m_vehicle + 0x324)
  20.                 if driver == causing then
  21.                     registertimer(10, "Alrdycrashed", c_player)
  22.                 end
  23.             end
  24.         end
  25.     end
  26. end
  27.  
  28. function getplayervehicleid(player)
  29.     local m_objectId = getplayerobjectid(player)
  30.     if m_objectId then return readdword(getobject(m_objectId) + 0x11C) end
  31. end
  32.  
  33.  
  34. function Alrdycrashed(id, count, player)
  35.     if count <= 5 then
  36.         return false
  37.     else
  38.         return true
  39.     end
  40. end
Advertisement
Add Comment
Please, Sign In to add comment