Skip to content
View in the app

A better way to browse. Learn more.

Learn more

Field Goal Attempt

Featured Replies

  • Administrator

A carrier inside kicking range of the opponents' goal may try a field goal instead of running: after a short power bar the ball flies toward the goal box and scores fewer points than a touchdown if it lands inside.

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

  • Compile scripting/olds_fieldgoal.sma (scripting/include/olds_afootball.inc next to it) and copy olds_fieldgoal.amxx to addons/amxmodx/plugins/.
  • 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.

Install

Download the ZIP above and copy its folders into cstrike/. Compile the .sma in addons/amxmodx/scripting with the AMX Mod X 1.10 compiler, put the .amxx in addons/amxmodx/plugins, and add it to plugins.ini.

Files: addons/amxmodx/scripting/include/olds_afootball.inc, addons/amxmodx/scripting/olds_fieldgoal.sma, test/af_stub.sma

Idea: alexit · Plugin: daemon · Tested automatically (compiled on AMX Mod X 1.8.2, 1.9 and 1.10, played on a CS 1.6 test server)
License: GPL-3.0-or-later. Written for the olds.ro plugin workshop (IDEA-D7B6EED2E5A96F34).

Field Goal Attempt
v1.0.0Counter-Strike 1.6PluginNot tested yet
AMX Mod X 1.10Server engine ReHLDSNeeds ReAPI YesMetamod Metamod-R0 downloads8.5 KBUpdated 3 hours ago
Sign in to download
Pawn (AMX Mod X) · 491 lines
/*
 * Field Goal Attempt (olds.ro workshop idea IDEA-D7B6EED2E5A96F34)
 *
 * American Football add-on: a carrier within olds_fg_range of the opponents' goal box may
 * try a field goal instead of running. /kick starts a power bar of olds_fg_time seconds
 * during which he cannot move; a hit cancels it ("kick blocked") 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
Show all 491 lines

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.