Events, commands & keys ​
Server events ​
server
Server-local (AddEventHandler), never sent over the network.
| Event | Arguments |
|---|---|
np_golf:holeCompleted |
roundId, cid, hole, strokes, par: fired for every player when the group finishes a hole |
np_golf:roundFinished |
roundId, results. results = { format, holes, board, money, players = { { cid, name, gross, adjusted, toPar, diff, hcpBefore, hcpAfter, retired } } }; money is the net bet result per cid |
np_golf:ace |
src, hole, roundId: a hole-in-one |
np_golf:betSettled |
bet: { round, kind = 'prop', template, winner, loser, stake } or { round, kind = 'spectator', market, selection, cid, stake, odds, won, payout } |
Practice rounds fire neither holeCompleted nor roundFinished; np_golf:ace fires on the range too. Every ace is
also announced to the whole server.
lua
-- Weazel News: announce every ace
AddEventHandler('np_golf:ace', function(src, hole, roundId)
TriggerEvent('my_news:breaking', ('%s aced hole %d at the Los Santos Golf Club!'):format(GetPlayerName(src), hole))
end)
State ​
| Key | Holds |
|---|---|
GlobalState.npGolfWind |
{ x, y, speed, dir, mph }, the current wind |
GlobalState.npGolfCourse |
Green slopes measured with /golfsurvey, per hole |
Commands ​
| Command | Who | What |
|---|---|---|
/golf |
Everyone | The clubhouse near the club (within 40 m), else the bets and odds screen |
/golfbag |
Everyone | The bag screen: gapping, ball, tracer colour, caddie duty |
/golfquit |
Everyone | Leave your round (a practice round just ends) |
/golfcaddie |
Hired caddies | The caddie view |
/golfwind |
np_golf.admin |
Roll new wind |
/golfend <round> |
np_golf.marshal |
End a round |
/golfsurvey <hole> |
np_golf.survey |
Measure a green |
Keys ​
All keys are RegisterKeyMappings: players rebind them in Settings → Key Bindings → FiveM.
| Key | Mapping | Action |
|---|---|---|
E |
npgolf_use |
At the pro shop desk: tee times · at your ball: address · at address: next club |
Q |
npgolf_prev |
Previous club |
Mouse wheel / Shift + wheel |
– | Shot shape / loft (at address) |
A / D (Shift = fine) |
– | Aim (at address) |
| Left mouse | +npgolf_swing |
3-click swing · putting: hold and release |
R |
npgolf_read |
Read the green (putter) |
G |
npgolf_gimme |
Ask for a gimme (match play) |
X |
npgolf_back |
Back off the ball · pick up (after double par) |
TAB |
+npgolf_card |
Scorecard (hold) · at address: hole flyover |
C |
npgolf_replay |
Replay the last shot |
B |
npgolf_bets |
Bets & odds (while playing or spectating) |
Esc |
– | Close a golf menu |