Coder Social home page Coder Social logo

splewis / csgo-retakes Goto Github PK

View Code? Open in Web Editor NEW
333.0 41.0 115.0 432 KB

CS:GO Sourcemod plugin for a site-retake gamemode

License: GNU General Public License v3.0

SourcePawn 100.00%
csgo sourcemod counter-strike counter-strike-global-offensive

csgo-retakes's Introduction

csgo-retakes

Build status GitHub Downloads Discord Chat

This is a CS:GO Sourcemod plugin that creates a competitive-minded gamemode called retakes. The idea is that the T players spawn in a bombsite with the bomb, while the CT spawn on rotation routes and try to retake the site and defuse the bomb.

Status: Maintained. Not actively developed.

For plugin developers

My goal is to keep the base retakes plugin as simple as possible. See retakes.inc for how to extend the plugin.

Here are some examples of what could be done using those natives:

  • different weapon allocation policies (by default, everyone gets an AK/M4, armor/helmet, and a kit)
  • change how players get put into teams by changing their "round points", the team ratios, or by changing who is in the waiting queue if the game is full
  • change how the bombsite is chosen each round (by default one is randomly picked each round)

Download

Stable releases are in the GitHub Releases section.

You may download the latest development build if you wish. If you report any bugs from these, make sure to include the build number (when typing sm plugins list into the server console, the build number will be displayed with the plugin version).

Installation

Requirements

Only Sourcemod 1.9 or later is supported.

Instructions

Download the archive and extract the files to the game server. From the download, you should have installed the following (to the csgo directory):

  • addons/sourcemod/plugins/retakes.smx
  • addons/sourcemod/translations
  • cfg/sourcemod/retakes

Configuration

The file cfg/sourcemod/retakes/retakes.cfg will be autogenerated when the plugin is first run and you can tweak it if you wish.

You may also tweak the values in cfg/sourcemod/retakes/retakes_game.cfg, which is executed by the plugin each map start.

Here are a few important cvars that are in cfg/sourcemod/retakes/retakes.cfg:

  • sm_retakes_maxplayers: maximum number of players allowed in the game at once
  • sm_retakes_ratio_constant: what percentage of players go on the T team

You can enable optional addon plugins for more features, read the Addon Plugins section for more information.

Building

The build process is managed by my smbuilder project. You can still compile retakes.sp without it in the normal fashion, however.

To compile, you will need:

You should make sure you have a relatively recent version of smlib - some changes were made to accommodate sourcemod 1.7 changes. The plugin is currently compiled against sourcemod 1.7.1.

Creating and Editing Spawns

Edit mode can be launched by using the sm_edit command (!edit in chat), which requires the map-change admin flag. Doing this brings up the edit menu which makes it easy to modify spawns.

Here is how to operate the spawn editor via commands:

  • use sm_edit to launch into edit mode, this makes more spawn-editing commands avaliable (you shouldn't do this on a live, public server). Example: !edit in chat on a map whose spawns you want to edit
  • use sm_new to create a new spawn. Example: !new ct a in chat will create a new CT spawn for bombsite A where you are standing.
  • use sm_show to show the spawns for a site. Example: !show a in chat will show all spawns for bombsite A.
  • use sm_delete to delete the nearest spawn. Example: !deletespawn in chat.
  • use sm_goto to go to a spawn. Spawns are indexed from 0 upwards. Example: !goto 10 to go to spawn 10.
  • use sm_iteratespawns to fake sm_goto commands every few seconds to visit every spawn in the map.
  • use sm_deletemapspawns to delete all spawns for the current map

Note: the plugin automatically saves the changed spawns on map ends to a file in addons/sourcemod/configs/retakes.

Addon plugins

The following plugins are optional and disabled by default. To enable them move them up from the addons/sourcemod/plugins/disabled directory to addons/sourcemod/plugins.

retakes_sitepicker

This plugin adds a simple admin command sm_site to let an admin pick between bombsites being used. For example, then can type: "!site a" or "!site any".

retakes_standardallocator

This plugin provides a simple sm_guns (!guns in chat) command that lets users choose between regular and silenced M4's and whether they want to ever recieve an AWP. It also randomly gives out a small amount of grenades.

retakes_pistolallocator

This plugin is an alternative to retakes_standardallocator (meaning: you shouldn't use both of these plugins, just one!) that makes every round a pistol round and lets players choose which pistol they have.

Contribution and Suggestions

First, check the issue tracker to ask questions or make a suggestion. If you have a suggestion you can mark it as an enhancement.

Style/gameplay design choices that don't have to made here, should not be made here. Spawns can be edited by anyone running a server. How weapons are given can be set by the natives and forwards provided. Please don't submit requests to change these, since everyone will want something different.

Guidelines

  • Create a fork on github, clone that, then create a branch to work on git checkout -b mybranchname
  • Follow the code-style already used as much as you can
  • Submit a pull request when you're happy with the new feature/enhancement/bugfix
  • Favor readability and correctness over all else
  • For a moderately advanced feature, it may be simpler to write it as a plugin that uses the retakes natives from retakes.inc
  • Keep it simple, stupid

Discord Chat

A Discord channel is available for general discussion.

csgo-retakes's People

Contributors

atakanb avatar aur3m avatar borzaka avatar brutalcskakan avatar chriswoodle avatar crashzk avatar dying-ducks avatar etojuice avatar fohdeesha avatar headline avatar johto avatar joinedsenses avatar jusmejtr avatar lidbetter avatar marvinlehmann avatar melkor217 avatar mikejoliva avatar mominon avatar moritzloewenstein avatar naathysz avatar natanel-shitrit avatar nicobuu avatar ravagecs avatar royz-iwnl avatar s-hirvonen avatar shaneajm avatar splewis avatar technoblazed avatar walliski avatar wasyady avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

csgo-retakes's Issues

how to handle afk players?

if i turn on mp_autokick will that also kick people who are in queue spectators? is it possible to setup that if you are afk for x time it moves you to spectator and someone in queue gets your spot?

Create a simple weapon allocator plugin

By default the plugin gives ak/m4's and no nades.

I'd like to have a lightweight plugin that uses the Retakes_SetPlayerInfo native inside the Retakes_OnWeaponsAllocated forward that does some smarter things.

Ideally, it could also have pistol rounds and would have some configuration values. (e.g. several cvars or a keyvalue file defining what players can have, probabilities they have them, etc.)

Game is currently full with 9 players

When a 10th player is spectating and wants to join the game it says "game is currently full with 9 players" and is a 5v4, any way to change it so it's a 5v5 instead ?
Thanks

Getting kicked too fast.

I'm a noob with coding and these plugins.
But is there a way to disable the inactivity kick or increase the time?
Since my friend gets disconnected instantly when he connects.

Thanks for the reply! :)

More weapons?

I've seen multiple servers with a retake plugin that has more weapons. (http://forum.pbfortress.com/)
I'm curious if they themselves modified the Retakes plugin to have different weapons?
(I'm not a plugin maker nor can I code. I have a basic understanding how CSGO Servers work)

Because in these servers it's possible to have SMG's, Shotguns, Auto-Snipers, All Pistols and even AK's on CT.
I'm fairly curious about this, since I run a server with your plugin. My friends and I have played 100s of hours on the PBfortress servers and with your plugin on my current server.

It gets boring really fast with only M4's and AK's. :/

Thanks for the response in advance! :)

Damage Print

How can i use your Damageprint plugin in retakes mod.
It says need required pugsetup plugin.

!scramble command - enhancement

Hello!

Would love to see a command that made it possible for admins to scramble the teams.
Something like !scramble, and the next round got mixed.

Love your plugin, keep it up!
-spot

Grenades can't be picked up

The distributed grenades fall to the ground and cannot be picked up in any way.
I've replaced all files and it still happens every round. Are there some plugin variable or sourcemod options I should check?

Enable/disable mod

Can you include a enable/disable option for this mod so we can install it on war servers?

Thanks!

Fix de_dust2 spawns

A CT spawns in CT spawn and gets almost insta-killed by someone's spawning on A-slope

Message Dont Show Up at times and this error is thrown into console

L 02/18/2015 - 15:41:24: [SM] Native "PrintToChat" reported: Client 3 is not in game
L 02/18/2015 - 15:41:24: [SM] Displaying call stack trace for plugin "retakes.smx":
L 02/18/2015 - 15:41:24: [SM] [0] Line 68, ./scripting/retakes/natives.sp::Native_RetakeMessageToAll()
L 02/18/2015 - 15:41:24: [SM] Native "Retakes_MessageToAll" reported: Error encountered while processing a dynamic native
L 02/18/2015 - 15:41:24: [SM] Displaying call stack trace for plugin "retakes.smx":
L 02/18/2015 - 15:41:24: [SM] [0] Line 703, ./scripting/retakes.sp::TerroristsWon()
L 02/18/2015 - 15:41:24: [SM] [1] Line 519, ./scripting/retakes.sp::Event_RoundEnd()

[bug] Multi bomber

First time i noticed it,
2 terrorists spawn with the bomb and both can try to plant.

Add more weapon options?

Would you be open to a PR maybe adding galil and famas to weapon options, for AK and M4 options?

HookEvent player_team EventHookMode_Pre

I installed your plugin. I joined the server and when I choose a team the server crashed.
In the debug file I found this:

Program terminated with signal 11, Segmentation fault.
#0  0x00000000 in ?? ()
#0  0x00000000 in ?? ()
#1  0xef962839 in Sample::Hook_FireEvent(IGameEvent*, bool) () from /.../csgo/addons/sourcemod/war1/extensions/connect_log_fix.ext.2.csgo.so
#2  0xefaf8790 in __SourceHook_FHCls_IGameEventManager2FireEvent0::Func(IGameEvent*, bool) () from /..../csgo/addons/sourcemod/bin/sourcemod.2.csgo.so
#3  0xffeb2898 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

So the problem is from connect_log_fix extension. And I also found this post: https://forums.alliedmods.net/showpost.php?p=2278839&postcount=46 .
After a little research in that thread I found this post https://forums.alliedmods.net/showthread.php?p=2203209#post2203209 that explains what is happening.
That extension, which is very useful, hooks onto 'FireEvent' and check all the events in search of "player_connect" to set the IP address. I think that this hook is PreHook.
Because in your plugin, you block the player_team event, it causes the server crash.

Until you will find a solution for this, I return Plugin_Continue on that hook and see a lots of team changes :D.

Where is retakes.smx?

I can't find it anywhere and I don't know how to initiate the plug in! Can anyone help, I learned everything I know about running a server and using a plug in so I'm fairly lost...

Auto update for plugins.

As SM1.7 is out could you add auto update to all the retake plugins. So if you change something it will be pushed out to servers.

Also it would help if there was an option for updating the spawn files. Some people might not want them to auto update but others [like me] would like them to be updated. =)

Server Player Slot Swap

Where is the portion of the code dealing with how you swap players when the server is at full capacity? I do not like the current iteration as I'm always the one screwed with the swap. It feels like you are picking the swap based on an alphabetized list of names.

Disconnected after 15 seconds

Hi, is there any logic in the plugin that kicks users after 15 seconds as I am experiencing this

Thanks

Nojustice

Silencer

Hey! Some players pointed out that you cant have M4 silencer without using the retakes_standardallocator.

Like in our situation, we wanted to have a server without AWP and nades but then we also lose the silencer. My suggestion would be that the M4 menu would be implemented in the main plugin. :)

New gun

โ€“ Added a new secondary weapon, the R8 Revolver, which occupies the Desert Eagle loadout slot.

Helmet w/BatMen weaponallocater

Can't seem to figure out how to remove helmets in the pistol rounds, and then get helmets on the weapon rounds, is there any possibility that you can create a cvar for it? ๐Ÿ‘

Idea: Slaylosers

This is an idea, not an issue. Some players complains about other players "Saving" and run "outside" the map so they dont die. Even as Terrorist sometimes.

So I was wondering if a slaylosers option could be made for this? I tried finding such a plugin in the forums and google but didnt find a working one for CSGO. It would be nice with a build-in feature with a cvar ofc. :)

https://forums.alliedmods.net/showthread.php?t=133756&page=6
Crashing server.

HUD showing that YOU got the bomb

For some reason(drunk or tired reasons) I totally missed that I had the bomb on De_dust2, which made me jump down to CT-spawn and then the timer was over. This could probably be an issue with people that's a little bit too "frag-horny" and doesn't check if hes got the bomb or not.

[Suggestion] Pistol rounds

As far as i can see there's no way enabling pistol rounds, would be nice to have like round 1-3 be pistol rounds or 1-2 pistol 3 smg, to simulate the matchmaking experience.

Add decoys

Is there any way to add decoys to available grenades?

I tried something like: but did not work

static void SetNades(char nades[NADE_STRING_LENGTH]) {
int rand = GetRandomInt(0, 4);
switch(rand) {
case 0: nades = "";
case 1: nades = "s";
case 2: nades = "f";
case 3: nades = "h";
case 4: nades = "d";
}
}

Turning "retakes" into "takes"

If I wanted to have a "take"mode (i.e. T's trying to attack a certain bomb site guarded by CT's) could I just have a disabled folder with the alternative spawn points and then just swap them out and change the round timer.

Guns?

I get m4a4 instead m4a1_silencer?

How to fix this?

retakes_pistolallocator.smx

Hello, at my servers a lot of insults about armor with any non default pistol. I've change code a bit.
It will be nice if you're add it at the next relese, like default option or with cvar.
if (choice == 0 || choice == 1 || choice == 2) {
kevlar = 100;
}
else {
kevlar = 0;
}

PrintHintTextToAll

Hi.. How can I put this information on center of monitor ? as you had in the previous version ..
Regards..

No chat message on first round

So, the chatmessage saying what bombsite the retake should be on didn't show up on the first round after the warmup. Haven't checked if it's a common issue or something that happens sometimes yet.

Map problems

de_nuke
The bomb has time to go down the vent and plant on B when its A site (12 sec)

de_cbble
CT get stuck on one of the spawns for B site

de_dust2
T can pick some CT off with AWP at their spawnpositions near the normal CT spawn/mid gate

I fixed these problems on my servers but they seem to been overritten? How do I turn off the auto update for spawn files? :S

void SetNades for ct and t

Would it be possible that you edit the function void SetNades that you can give ct and t different nade sets like a extra incgrenade for ct but not for t. Would be cool.

Sry for my bad english. Also can pay for a private change if you dont want to set this public.

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.