Back to TPG

TPG.CTF.OnCapture

S🏷️ Ctf

Part of TPG namespace

TPG.CTF.OnCapture(flag, carrier)
View on GitHub|gamemode/objectives/sv_ctf.lua:154-189
📋 Has LDoc👁️ 0 viewsUpdated 1 month ago

Description

Score a delivery: the carrier reached their own spawn with the flag. Drains TPG.Config.ctfCaptureTicketLoss from the enemy pool, multiplied by the objective overtime factor -- the same one the control-point drain uses, so a CTF round that has gone long ends in a couple of deliveries instead of eight. Then credits the carrier's round and lifetime capture counts, pays the economy reward if that mode is running, announces it, and sends the flag home. Called by the tpg_flag entity, not by the round loop. It runs the win check itself, because the drain happens between scoring steps.

Parameters

NameTypeDescription
flagEntityThe flag entity.
carrierPlayerWho delivered it.

Returns

No return values documented.

Examples

No examples available.

Used In

No usages found in the codebase.