CityRP Documentation Repository

cityrp.vehicledamage

Vehicle contact damage rules.

Functions

Servercityrp.vehicledamage.scaleSlowContact(victim, damageInfo, vehicle) → booleanSource ☍

Replace contact damage below Minimum Run Over Speed, scaling from zero at rest up to Maximum Contact Damage. Replaced rather than scaled because a parked vehicle's physics resolving against a player reports impulses past a lethal value, so the incoming number says nothing about how hard they were hit.

Callers must skip run over handling when this returns true, and both damage hooks must call it: the EntityTakeDamage one bails out beforehand on build servers and for godmoded, knocked out or seated victims.

Parameters

  • victimPlayerThe player taking the damage.
  • damageInfoCTakeDamageInfoThe damage being dealt. Rewritten when the vehicle is too slow.
  • vehicleEntity?Vehicle behind the damage, saving a lookup when the caller has it.

Returns

  1. booleanWhether the damage was replaced with a slow contact value.

Fields

Servercityrp.vehicledamageSource ☍

Main table for vehicle contact damage rules.