Weapons and damage
dlmp.give_weapon
Parameters
playerPlayerweaponintegerammointegerset_current(optional)boolean
Returns ok boolean|nil, err string|nil
dlmp.take_weapon
Same as Player:take_weapon.
Parameters
playerPlayerweaponinteger
Returns ok boolean|nil, err string|nil
dlmp.set_ammo
Parameters
playerPlayerweaponintegerammointegerclip(optional)integer
Returns ok boolean|nil, err string|nil
dlmp.clear_weapons
Same as Player:clear_weapons.
Parameters
playerPlayer
Returns ok boolean|nil, err string|nil
dlmp.set_armed_weapon
Same as Player:set_armed_weapon.
Parameters
playerPlayerweaponinteger
Returns ok boolean|nil, err string|nil
dlmp.set_weapon_skill
Same as Player:set_weapon_skill.
Parameters
playerPlayerskillintegervalueinteger
Returns ok boolean|nil, err string|nil
dlmp.set_driveby_interval
Sets a weapon's drive-by fire interval: the time in milliseconds between two shots fired from a vehicle (30..5000), for the driver and passengers on every client. nil restores the default, the weapon's on-foot fire rate at the shooter's skill level. Drive-by weapons are 22..33; a driver can fire only 28, 29 and 32. The setting is server-wide and persists after the resource stops.
Parameters
weaponintegermsinteger|nil
Returns ok boolean|nil, err string|nil
dlmp.driveby_interval
Returns the drive-by fire interval the gamemode set for a weapon, in milliseconds, or nil if the weapon uses its on-foot rate or has no drive-by.
Parameters
weaponinteger
Returns integer|nil
dlmp.set_weapon_property
Sets one property of a hitscan weapon (22..34, 38) at a skill tier on every client; nil restores the game's default. skill is "poor", "std" (default) or "pro"; only 22..32 have the poor and pro tiers. A player fires a weapon at the tier reached by the player's skill with that weapon. Properties and ranges: damage 0 .. 1000 (integer, per hit), range 1 .. 350 (m), accuracy 0.01 .. 100, clip 1 .. 1000 (integer), fire_loop_start / fire_loop_end 0 .. 5 and fire_time 0 .. 2 (seconds: the fire animation's loop and the moment the shot is fired; the loop sets the fire rate), the same three for crouched fire (crouch_fire_loop_start, crouch_fire_loop_end, crouch_fire_time), and move_speed 0 .. 2 (walking speed while aiming; 1 is the game's default for most weapons, about 2 m/s). Flags take a boolean: move_and_aim (keeps the weapon raised while walking and aiming), move_and_fire (allows firing while walking), heavy (disables sprinting and jumping; can be set only at "std", the tier the game reads, and applies to every tier). A loop must start before it ends, checked against the values currently in force, so set a later end before a later start. The server validates shots against the new range and fire rate. The setting is server-wide and persists after the resource stops.
Parameters
weaponintegerskill"poor"|"std"|"pro"|nilpropertystringvaluenumber|boolean|nil
Returns ok boolean|nil, err string|nil
dlmp.weapon_property
Returns one property of a hitscan weapon at a skill tier (see dlmp.set_weapon_property): the value the gamemode set, or the game's default if none was set.
Parameters
weaponintegerskill"poor"|"std"|"pro"|nilpropertystring
Returns value number|boolean|nil, err string|nil
dlmp.set_damage_multiplier
Scales the damage every player takes from one damage class (1 = the game's default, 0 = no damage, up to 10); nil restores the default. A class is the damage type a hit is dealt with, not the weapon that caused it: fists and melee weapons 0..15, the parachute 46, fire 37 (molotov, flamethrower, burning), spraycan 41, extinguisher 42, explosion 51 (grenade, satchel, rocket, vehicle blast, tank cannon, dlmp.create_explosion) and the Predator's guns 52. Firearm bullets use damage in dlmp.set_weapon_property instead, and a firearm's butt keeps the game's default. The victim's game scales each hit before it lands, from any source, including the player's own grenades and fire in the world; at 0 the hit does not land at all (no flinch, no knockdown). Deaths the server applies on its own, such as the occupants of a blown-up vehicle or a stealth kill, are not affected. The setting is server-wide and persists after the resource stops.
Parameters
weaponintegermultipliernumber|nil
Returns ok boolean|nil, err string|nil
dlmp.damage_multiplier
Returns the damage multiplier of a damage class (see dlmp.set_damage_multiplier), or nil for a weapon without one.
Parameters
weaponinteger
Returns number|nil
dlmp.set_weapon_allowed
Allows or disallows a weapon (1..46, except 19..21) for every player; all weapons are allowed by default. Disallowing a weapon removes it from every player who holds it. A disallowed weapon cannot be given, and the server drops every shot, throw and hit that uses it. The setting is server-wide and persists after the resource stops.
Parameters
weaponintegerallowedboolean
Returns ok boolean|nil, err string|nil
dlmp.is_weapon_allowed
Returns whether a weapon is allowed (see dlmp.set_weapon_allowed).
Parameters
weaponinteger
Returns boolean
ExplosionSpec
An explosion of one of the game's types: 0 grenade, 1 molotov, 2 rocket, 3 weak rocket, 4 car, 5 quick car, 6 boat, 7 aircraft, 8 mine, 9 object, 10 tank shell, 11 small, 12 tiny.
The point must lie within the world: |x|, |y| <= 6000, -200 <= z <= 4000.
Fields
xnumberynumberznumbertypeinteger— 0..12.creator(optional)Player— Player credited with the damage it deals; must be a spawned player in the explosion's world.virtual_world(optional)integer— Defaults to the creator's world, or 0 without a creator.interior(optional)integer— Defaults to the creator's interior, or 0 without a creator.
dlmp.create_explosion
Creates an explosion for every spawned player in its world. Each client's game creates it natively, so it damages players and vehicles there like a native explosion; damage, fire and destroyed vehicles are credited to creator if set.
Parameters
specExplosionSpec
Returns ok boolean|nil, err string|nil
dlmp.detonate_satchels
Detonates the satchel charges player has thrown, on every client, as the detonator would. Fails if the player has none placed; its satchels are removed without a blast when it dies or leaves its virtual world or interior. The player keeps the detonator.
Parameters
playerPlayer
Returns ok boolean|nil, err string|nil
FireSpec
The point must lie within the world: |x|, |y| <= 6000, -200 <= z <= 4000.
Fields
xnumberynumberznumbersize(optional)number— 1..3, default 1.8. Larger values give bigger flames that burn longer (about 5 s, plus 7 s for each step above 1).creator(optional)Player— Player credited with the damage it deals; must be a spawned player in the fire's world.virtual_world(optional)integer— Defaults to the creator's world, or 0 without a creator.interior(optional)integer— Defaults to the creator's interior, or 0 without a creator.
ExtinguishSpec
The point must lie within the world: |x|, |y| <= 6000, -200 <= z <= 4000.
Fields
xnumberynumberznumberradius(optional)number— Meters, above 0 and at most 100; default 1.virtual_world(optional)integer— Defaults to 0.interior(optional)integer— Defaults to 0.
dlmp.create_fire
Starts a fire for every spawned player in its world. Each client's game starts and burns it natively (it does not spread), so it burns players there like a native fire; damage is credited to creator if set. Its duration may differ slightly between players.
Parameters
specFireSpec
Returns ok boolean|nil, err string|nil
dlmp.extinguish_fire
Puts out the fires within radius of the point for every spawned player in that world; a burning player keeps burning (dlmp.set_on_fire).
Parameters
specExtinguishSpec
Returns ok boolean|nil, err string|nil
