SHOW:
|
|
- or go back to the newest paste.
| 1 | -- For vehicle collision off -inspired Eliteprime, wizard, shaft and bugs's works -- | |
| 2 | ||
| 3 | --vehicle_dmgmodifier = 0.1 | |
| 4 | playerRunoverCounter = {}
| |
| 5 | playerIsHit = {}
| |
| 6 | ||
| 7 | function GetRequiredVersion() | |
| 8 | return 200 | |
| 9 | end | |
| 10 | ||
| 11 | ||
| 12 | function OnScriptLoad(processid, game, persistent) end | |
| 13 | ||
| 14 | function OnDamageLookup(receiving, causing, mapId, tagdata) | |
| 15 | if causing then | |
| 16 | local c_player = objectidtoplayer(causing) | |
| 17 | if c_player and isinvehicle(c_player) then | |
| 18 | local m_vehicleId = getplayervehicleid(c_player) | |
| 19 | if m_vehicleId then | |
| 20 | local m_vehicle = getobject(m_vehicleId) | |
| 21 | - | registertimer(10, "Alrdycrashed", c_player) |
| 21 | + | |
| 22 | if driver == causing then | |
| 23 | if not playerIsHit[c_player] then | |
| 24 | if not playerRunoverCounter[c_player] then playerRunoverCounter[c_player] = 0 end | |
| 25 | playerRunoverCounter[c_player] = playerRunoverCounter[c_player] + 1 | |
| 26 | local name = tostring(getname(c_player)) | |
| 27 | say("Player " .. name .. " has been ran over " .. tostring(playerRunoverCounter[c_player]) .. " times!")
| |
| 28 | if playerRunoverCounter[c_player] == 5 then | |
| 29 | say("Player " .. name .. " has been ran over 5 times and will now die!")
| |
| 30 | return true | |
| 31 | else | |
| 32 | playerIsHit[c_player] = true | |
| 33 | registertimer(1000, "Alrdycrashed", c_player) | |
| 34 | return false | |
| 35 | - | if count <= 5 then |
| 35 | + | end |
| 36 | - | return false |
| 36 | + | end |
| 37 | - | else |
| 37 | + | |
| 38 | - | return true |
| 38 | + | |
| 39 | end | |
| 40 | end | |
| 41 | end | |
| 42 | end | |
| 43 | ||
| 44 | function getplayervehicleid(player) | |
| 45 | local m_objectId = getplayerobjectid(player) | |
| 46 | if m_objectId then return readdword(getobject(m_objectId) + 0x11C) end | |
| 47 | end | |
| 48 | ||
| 49 | ||
| 50 | function Alrdycrashed(id, count, player) | |
| 51 | playerIsHit[player] = nil | |
| 52 | return false | |
| 53 | end |