-
-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Third attempt for cmd_targetex #515
base: master
Are you sure you want to change the base?
Conversation
This can probably just be in |
@rsKliPPy I made a new file because it includes engine.inc as well, I don't know if that's a big deal or not. It won't be only for CS. I didn't make the team names hardcoded, instead I added them in an enum list which can be filled with the team names for other games and it will work just fine. I don't know the names for the other games, so a list of them would be appreciated. I agree it's better if it was a native, but my C++ "skills" aren't too good, I even struggled doing it in Pawn and we can see that other people did too (the previous attempts). |
Merge branch 'master' of https://github.com/alliedmodders/amxmodx into cmd-targetex
I removed the [WIP] tag since I think it's pretty much good to go from coding perspective. I'll just need a list of all the team names used in AMXX games so I can add them in the file. static const Targetex_Teams[][TargetexTeams] =
{
{ "ct", "CT" },
{ "t", "TERRORIST" },
{ "spec", "SPECTATOR" }
} I did a bunch of testing and no problems were found. |
There isn't such a list, that's the thing. That's why I think the ability to target teams shouldn't be in the core. |
@rsKliPPy There won't be any problem if an invalid team name is used. It will simply print in the console that no players were found. It uses |
@OciXCrom for team filters I see two approaches:
|
I like the second suggestion the most and provided that no errors are produced when matching team names, it seems like the best solution which can stay in core. |
@WPMGPRoSToTeMa @rsKliPPy Right now it's working like this:
This way there's no errors or wrong matches. The group argument names don't collide with the team names. The only reason I don't like the second approach is because the patterns are longer and admins will need to write more text (e.g. What can also be done is to check the modname on first call and add the team names to the array according to the game (e.g. add |
@OciXCrom IIRC Half-Life has dynamic teams, so I think it's not possible to store teams for all the games. |
@WPMGPRoSToTeMa Weren't the teams in HL named RED and BLUE? If they can't be added we'll just ignore them, not a big deal. It's fine as long as they're working for CS and other games that have valid team names. We just need to dig out the list. I found this: "mp_teamlist: This defines the team names in HLDM depending of the models. Put nothing to allow all teams. List of valid team names: barney, gina, gman, gordon, helmet, hgrunt, recon, robo, scientist, zombie" |
Any news? |
First attempt was made by HamletEagle.
Second attempt is over here and looks abandoned - #368
So, here's the third attempt to add this stock into AMXX.
For those of you that don't know, the goal of this stock is to allow admins to use arguments such as @ALL, @ct, @t and so on with player targeting commands. Here's a list of all arguments that I made for the stock:
In addition, a team name can be passed into any argument that is supposed to target a group of players. For example, @alivect will target all alive players.
Another addition is the option to exclude yourself from the command by adding the "!" symbol right after the "@". For example, @!all will target everyone except the admin who used the command.
I decided to create a separate .inc file because it requires engine.inc. I'm not sure if the compiler will actually read any of the natives in engine.inc if
cmd_targetex
isn't used in the plugin, if not, we may move it in amxmisc.inc where the originalcmd_target
is.Let me know if there's something that can be optimized (there probably is) and if you have any ideas about adding additional arguments (@closest and @radius are ones I have in mind).
Here's an example usage for amx_slap: