Jump to content

Race - Kills (Destruction Derby)


'LinKin

Recommended Posts

Hello,

I want to know how to add kill points to the players when they kill someone in DD.

More specificly, I need to know how to trigger something when a player is killed by another one.

It has something related to ColShape. But I don't really know.. I readed about how to create a colShape rectangle. I don't know if that is required.

EDIT:

Found this https://wiki.multitheftauto.com/wiki/On ... eCollision

But how to get the player who collisioned the source?

Link to comment
addEventHandler("onClientVehicleCollision", root, 
    function(hitElement) 
         if ( source == getPedOccupiedVehicle(localPlayer) and hitElement and getElementType(hitElement) == "vehicle") then 
             local hitPlayer = getVehicleOccupant(hitElement) -- Get the player that is driving the vehicle you hit 
         end 
    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...