Jump to content

[Help] DD Addon


BieHDC

Recommended Posts

Posted

Hello,

i wanna make something that detects which player(vehicle) has hit the other player(vehicle).

So if the one hit the other and the hitted got killed within 10 sec the other recives something.

I dont want you to make me this script!

I wanna know what would be the best Functions and Events to use.

I thought about attaching a colsphere to the vehicle and on hit to check.

And would be serverside or clientside better.

(i think serverside :P )

thx if you can help me a bit, if not then not

Posted

thx man i know i have seen such event in past but couldnt find it anymore :P

and maybe you can give me a little example of my idea^

(already have read the examples in wiki, but they not matching mine and i am a beginner scripter so pls :) )

Posted
function hit (collide) 
  
 if collide and getElementType(collide)=="vehicle"  then  --check if is a vehicle , or  hitted an object from the map 
  
        if ( source == getPedOccupiedVehicle(getLocalPlayer()) ) then  -- check if you hitted somebody  
  
              setTimer(check_if_is_alive,10000,1,collide) -- timmer to 10s 
        end 
 end 
end 
 addEventHandler("onClientVehicleCollision", root, hit) 
  
function check_if_is_alive(car) 
  
if  car and getVehicleOccupant(car) and  getElementData(getVehicleOccupant(car),"state") ~= "dead" then  
  
  -- the hitted player is still alive  
  
    return 
  
else 
  
  
 -- the hitted player is dead so you do here your stuff's 
  
end 
  
end 
  

Posted

hmmm doesnt work like i want to (no scripting error)

i need it for a special thing, so i will try use getDistanceBetweenPoints3D and onVehicleDamage

:)

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...