4135 {
4137 {
4140 Car car;
4141 Boat boat;
4142 Motorbike motorbike;
4143 float damage;
4144 vector impulse;
4145
4146
4147 if (Car.CastTo(car, transport))
4148 {
4149 float carSpeed = car.GetSpeedometerAbsolute();
4150 if (carSpeed > 2.0)
4151 {
4153 ProcessDirectDamage(DT_CUSTOM, transport, "", "TransportHit", "0 0 0", damage);
4154 }
4155 else
4157
4158
4160 {
4162 impulse[1] = 40 * 1.5;
4164 }
4165 }
4166 else if (Motorbike.CastTo(motorbike, transport))
4167 {
4168 float motorbikeSpeed = motorbike.GetSpeedometerAbsolute();
4169 if (motorbikeSpeed > 2.0)
4170 {
4172 ProcessDirectDamage(DT_CUSTOM, transport, "", "TransportHit", "0 0 0", damage);
4173 }
4174 else
4176
4177
4179 {
4181 impulse[1] = 5.0;
4183 }
4184 }
4185 else if (Boat.CastTo(boat, transport))
4186 {
4187 Human player = Human.Cast(this);
4189 {
4191 return;
4192 }
4193
4195 {
4197 ProcessDirectDamage(DT_CUSTOM, transport, "", "TransportHit", "0 0 0", damage);
4198 }
4199 else
4201 }
4202 else
4203 {
4204
4206 {
4208 ProcessDirectDamage(DT_CUSTOM, transport, "", "TransportHit", "0 0 0", damage);
4209 }
4210 else
4211 {
4213 }
4214
4215
4217 {
4219 impulse[1] = 40 * 1.5;
4221 }
4222 }
4223 }
4224 }
bool IsDamageDestroyed(ActionTarget target)
bool m_TransportHitRegistered
vector m_TransportHitVelocity
proto native IEntity PhysicsGetLinkedEntity()
entity we are linked to (not valid when IEntity.GetParent() returns some entity)
proto native vector GetVelocity(notnull IEntity ent)
Returns linear velocity.
proto void dBodyApplyImpulse(notnull IEntity body, vector impulse)
Applies impuls on a rigidbody (origin)