addonsVersion 1.0.0: First release.
README.txtVersion 1.0.0: First release.
Field Goal Attempt 1.0.0 (olds.ro)
==================================
American Football add-on. A carrier within olds_fg_range of the opponents' goal
box may try a field goal instead of running:
- say /kick starts a power bar of olds_fg_time seconds; he cannot move
while it runs;
- a hit during the bar cancels it ("Kick blocked by ...") and he keeps the
ball;
- when the bar is full the ball flies on an arc toward the point he aims at,
with up to olds_fg_spread degrees of random error;
- if it enters the goal box the kicking team scores olds_fg_points (3, fewer
than a touchdown) and play restarts as after a touchdown; otherwise the
ball stays loose.
Requirements
- AMX Mod X 1.10.0.5490 or newer, with ReAPI (ReGameDLL_CS)
- the American Football core (library "olds_afootball"); without it the
plugin loads and stays idle
Install
1. Compile scripting/olds_fieldgoal.sma (scripting/include/olds_afootball.inc
next to it) and copy olds_fieldgoal.amxx to addons/amxmodx/plugins/.
2. Copy data/lang/olds_fieldgoal.txt to addons/amxmodx/data/lang/. The
folder addons/amxmodx/configs/olds_fieldgoal/ is made on first run.
No downloads: stock progress bar, chat text and the stock
sound/buttons/bell1.wav on a good kick.
Settings (addons/amxmodx/configs/plugins/olds_fieldgoal.cfg, made on first run)
olds_fg_range 1200 greatest distance from the carrier to the box centre
olds_fg_points 3 points of a field goal
olds_fg_time 2.0 seconds of the power bar
olds_fg_spread 6 greatest random error in degrees (up/down and sideways)
Players
say /kick try a field goal (ball carrier, within range). Out of range the
reply says how many units closer he must be.
Goal boxes (ADMIN_CFG)
olds_fg_setbox <t|ct>
first use: corner 1 where you stand; second use at the opposite corner:
corner 2, and the box is saved
olds_fg_setbox <t|ct> x1 y1 z1 x2 y2 z2
the box from coordinates (works from the server console)
The box of a team is the goal that team defends. Boxes are kept in
configs/olds_fieldgoal/<map>.ini, one "<t|ct> x1 y1 z1 x2 y2 z2" line each.
What the core provides (include/olds_afootball.inc)
olds_af_get_carrier(), olds_af_drop_ball(), olds_af_add_score(team, points,
reason) (adds the points and restarts play as after a touchdown) and the
forward olds_af_ball_pickup (pick-ups are refused while the kick flies).
How it works
- Movement is frozen through the max speed (RG_CBasePlayer_ResetMaxSpeed);
RG_CBasePlayer_TakeDamage (post) cancels the bar on any damage; death,
disconnect and a round restart cancel it too.
- The aim (with the random error) is traced to the point it hits; the ball
gets MOVETYPE_TOSS and the velocity of an arc that reaches that point after
a flight time based on the distance (0.6 - 2.5 s).
- A 0.05 s check follows the ball: once it is inside the box the kick is
good; once it lands (or after the flight time + 2 s) outside, no good.