BieHDC Posted August 26, 2013 Share Posted August 26, 2013 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 ) thx if you can help me a bit, if not then not Link to comment
bandi94 Posted August 26, 2013 Share Posted August 26, 2013 Well you can made it on client side faster / easyer using . OnClientVehicleCollision Link to comment
BieHDC Posted August 26, 2013 Author Share Posted August 26, 2013 thx man i know i have seen such event in past but couldnt find it anymore 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 ) Link to comment
bandi94 Posted August 26, 2013 Share Posted August 26, 2013 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 Link to comment
BieHDC Posted August 27, 2013 Author Share Posted August 27, 2013 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 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now