# Arm Wrestling

> Arm wrestle any player at a table or a barrel, with stamina, bets, a rated ranking and tournaments.

- URL: https://xexstudio.com/scripts/arm-wrestling
- Resource name: `xex_armwrestling`
- Category: Gameplay
- Price: Free
- Frameworks: ESX, QBCore, Qbox
- Source: Open source (no escrow)
- Repository: https://github.com/JGCdev/xex_armwrestling
- Version: 1.0.1
- Measured resmon: 0.00 ms idle · 0.06 ms in a match
- Requires: ox_lib, oxmysql, OneSync
- Delivery: instant, through Cfx.re Keymaster
- Documentation: https://xexstudio.com/docs/arm-wrestling
- Video: https://www.youtube.com/watch?v=N-SGIvXqrBI

## Highlights
- Stamina turns it into a match of timing, not a tapping contest
- Rated ranking with divisions, monthly seasons, a hall of fame and tournaments for 4, 8 or 16 players
- The server counts the pushes, moves the arm, picks the winner and pays the bet

Walk up to a table or a barrel, challenge the player in front of you and push. Every push costs stamina, so the player who keeps a steady rhythm and saves the burst for the right moment wins, not the one who taps fastest. Put money on it if you both agree.

Every ranked match moves a rating. Players climb through the divisions, the best of each month go to the hall of fame, and admins can run a tournament at the table with a bracket and a pot.

The server runs the match: it limits how fast each player can push, applies stamina, moves the arm, decides the winner and pays the bet. A modified client can't win a match it didn't play. Free and open source under the MIT license.

## Features
- Works on the arm wrestling tables and wooden barrels already on the map (ox_target or qb-target), plus tables you place in the config with a map blip
- [E] at the placed tables when there is no target resource
- Challenge a player standing at the table, who accepts or declines
- Stamina for both players, shown on screen. A steady rhythm keeps full power; a burst wins ground and leaves you weak
- Optional bets with in-game money. The winner takes both stakes; draws and cancelled matches are refunded
- Rating that moves after every ranked match, with bronze, silver, gold and diamond divisions and a champion
- Monthly seasons. The top 3 of each season go to the hall of fame
- The season's top 5 painted on a wall next to the table
- Players near a match watch it live, with both names, the arm and the stamina bars
- Single elimination tournaments seeded by rating, with entry fees, a pot, a live bracket and walkovers
- Short matches and repeated matches between the same two players don't move the ranking
- Hooks and events to connect a gym skill, a battle pass or analytics
- English and Spanish

## Changelog
### 1.0.1
- Placed tables no longer end up half buried when you arrive before the ground has loaded
### 1.0.0
- First public release, free and open source (MIT)
- Matches on map props and placed tables, with challenges and optional bets
- Stamina, match HUD and result card
- Rated ranking with divisions, monthly seasons and a hall of fame
- Wall ranking board, spectators and tournaments
- Hooks and events, ESX, QBCore and Qbox, English and Spanish

## FAQ
### Can I change the code?
Yes. It is open source under the MIT license, the whole resource, no escrow. The code is on GitHub at github.com/JGCdev/xex_armwrestling.
### Does it need a target resource?
Only to use the tables and barrels that are already on the map. Tables you place in the config also work with [E].
### Can I turn off the bets or the ranking?
Yes. Set Config.Bets.enabled or Config.Ranking.enabled to false.
### Does a stronger character push harder?
Not by default. Return a multiplier from Config.Hooks.power to connect your own gym or skills resource.
### Who can host a tournament?
Admins by default. Set Config.Tournaments.host to 'everyone' to let any player host one.
### Can players farm the ranking with a friend?
The same two players get at most three ranked matches per hour by default, and matches under four seconds are never ranked.
