Giter Site home page Giter Site logo

kdxr / capture-flag Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joeszymkowiczfivem/js5m-ctf

0.0 0.0 0.0 92 KB

A Capture The Flag game for FiveM

License: GNU General Public License v3.0

JavaScript 0.47% Lua 78.67% TypeScript 9.62% CSS 5.52% HTML 1.61% Svelte 4.12%

capture-flag's Introduction

image

Description

This is a Capture The Flag game mode for FiveM, with custom flag props and customizable rulesets. Two teams fight to capture eachothers flag.

Basics

  • A player uses the command initctf to initiate a match. This person becomes the match admin. This notifies all players that a match is being setup.
  • The match admin selects a map to play on before players can join teams.
  • Once a map is selected, other players can join a team using the command ctfmenu.
  • When at least one player joins the match, the match admin can start the match.
  • Players can change teams before the match has begun. Match admins can change the map before the match has begun.

Rules

  • If your flag is taken, hunt down the flag carrier, and try to kill them and return your flag by touching it while it's dropped. This will return your flag back to your base.
  • If your teammate dies with the enemy flag, you can pickup the dropped flag.
  • You can only score a point by bringing the enemy flag back to your team's returned flag.
  • If you are carrying the flag, and exit the match area, the enemy flag will be returned to them.

Commands

initctf

This command will initiate the CTF match, and designate this person as the admin of the match.

ctfmenu

Once a ctf match is initiated and the match map has been chosen by the admin, players can:

  • Choose the team they would like to play for.
  • Remove from their chosen team.

Once the match has been created the admin can:

  • Choose the map the match is played on.
  • Start the match, given there are players.
  • End the match while the game is in progress.

Included maps/courses

Paleto Carnage

image

Redwood Rampage

image

Customized Rulesets/Config

Customizations of the rules and even the colors of the two team can be made within the config.

allowVehicles - Prevents players from entering vehicles if false.

maxScore - Sets the score limit to win the match.

autoRespawn - Automatically respawn at base on death

respawnTime - In seconds. delay before respawn, when you die, if autoRespawn

restrictedCreation - If true, restricts match creation to a list of user licenses.

showZoneBorder - This turns zones debug setting on. I could see why you want this on, but I personally think its stupid.

Dependencies

  • ox_lib
  • assets_ctfflags - These are the models specified in the existing game config. I guess you could technically use any other model in FiveM, you would just need to specify them in the game config.
  • qb-core/qbox/ESX - When autoRespawn is set to true, the script calls the revive event compatible with these frameworks. Compatibility can be expanded to other frameworks if someone wants to do a PR or send me the event names.

Preview

Kill opponent and return flag

Steal the enemy flag

Capture the flag and win

Init and CTF Menu

TODO

  • Better way of displaying course boundary
  • Warmup
  • Spectator options
  • Handling around players rejoining the game
  • Admin pausing the game
  • More maps
  • Powerups - temporary speed and health modifiers

capture-flag's People

Contributors

joeszymkowiczfivem avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.