• Shooting players in their vehicles
    3 replies, posted
I was wondering if there was a way to be able to shoot players in their vehicles. I've tried an addon before for this, and it lacked support for the driver being able to take damage. (Only damaged the passengers)
You can add a callback function to FireBullets to send damage to the vehicle owner
[QUOTE=Texas_on_duty;50888330]I was wondering if there was a way to be able to shoot players in their vehicles. I've tried an addon before for this, and it lacked support for the driver being able to take damage. (Only damaged the passengers)[/QUOTE] I've run into this problem myself, ent:TakeDamage() doesn't appear to work on people driving a prop_vehicle_jeep despite working on seats edit: found a workaround, here's the code: [code] concommand.Add( "testcardamage", function( ply, cmd, args ) if !ply:InVehicle() or !ply:IsSuperAdmin() then return end local car = ply:GetVehicle() if !car:IsValid() or car:GetClass() != "prop_vehicle_jeep" then return end local d = DamageInfo() d:SetDamage( 25 ) d:SetAttacker( ply ) d:SetDamageType( 16 ) ply:TakeDamageInfo( d ) end ) [/code]
Oh sorry, I meant shooting people in their tdm, sgm, and lw cars.
Sorry, you need to Log In to post a reply to this thread.