Jump to content

Vehicle Ramming


Benevolence

Recommended Posts

Okay so everyone hates that on Zombie servers when you ram the zombies, most of the times due to lag (i think) or slow speed, it just stops the car and damages it with doing little or no damage to zombies. How could I create a script that makes it so if you hit a zombie while in a moving vehicle in the direction that you are going, it makes the zombie fall (you run him over) and die? Also, if a vehicle is on top of a zombie, it instantly kills the zombie. So if a car falls from out of nowhere onto a zombie, instead of it falling on top then rolling aside of the zombie. Which would be realistic, you ram someone, full speed or not in real life and they will fall under the car.

I mean look at this, lol vehicles on a zombie server = crap. I'm creating a zombie GM and I want to make it good and sort of realistic.

ramf.png

Like that monster isn't heavy enough to crush them. :redhotevil:

Link to comment

-- client side:

addEventHandler ( "onClientPedDamage", getRootElement(), 
function (attacker) 
    if not attacker then return end 
    if ( getElementType(source) == "ped" and getElementType(attacker) == "vehicle" ) then 
          triggerServerEvent("killZombie",localPlayer,source) 
    end 
end) 

-- server side:

addEvent("killZombie",true) 
addEventHandler ( "killZombie", getRootElement (), 
function ( zombie ) 
   if zombie and source then 
            killPed ( zombie, source ) 
    end 
end) 

Edited by Guest
Link to comment
Okay, resent.

Ignition don't post useless posts like saying "cough see posts" and "xxx is my rolemodel". That's what people call SPAM and it's absolutely not related to the topic. Also remove the image from your signature :> You stole it from AeroXbird LMFAO

Tank, also do an if check to see if attacker exists (if not attacker then return end)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...