Explanation:
There are two clients in the server, one named gene, the other one "Ene ~special characters~".
An admin issues "sm_slay Ene" and gets following error message: More than one client matched the given pattern.
What this hack will do is: Use GetCmdArg(0, ...); to get the command name "sm_slay".
Use GetCmdArgString(...); to get the arguments supplied to the command.
Use GetLastProcessTargetString(...); (which was implemented in this commit) to retrieve the arguments that were passed to the last ProcessTargetString call.
It will then pass this data to the DynamicTargeting plugin through its AmbiguousMenu native.
The plugin will open up a menu on the client and list all targets which match the pattern that was supplied to ProcessTargetString.
If the client selects a menu entry, FakeClientCommand will be used to re-execute the command with the correct target.
* Stop EntRefToEntIndex returning garbage if a bad parameter is passed
Seen multiple bad usage of this function that works only because whatever was passed in was returned as it wasnt an entity reference.
This code should have worked and would be expected to have returned something invalid but instead the the input was returned which allowed the code to work when really it is bad code.
See for one such case https://discordapp.com/channels/335290997317697536/335290997317697536/736518488314871868
* Update documentation of EntRefToEntIndex
Added the error text saying what shall be returned when a invalid parameter is passed.
* Validate entity index instead of just returning INVALID_EHANDLE_INDEX
Not sure if it needs this much validation but this just mirrors how IsValidEntity works, so the entity index returned should be valid else INVALID_EHANDLE_INDEX is returned.
* EntRefToEntIndex improve doc comments to better represent functionality
---------
Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
* Add void prototype to NativeCall typeset
`void` prototype can be used for simple natives which don't return any value.
This is done to silence compiler warnings 209 (`function has explicit 'int' tag but does not return a value`) and 242 (`function "NativeCallback" should return an explicit value`).
* Make MenuHandler into typeset and add void prototype
This can be used for basic menu handlers that don't return modified item styles and don't redraw menu items.
* Update basetriggers.sp for Dystopia compatibility
Dystopia has a built-in command called nextmap which breaks due to the Sourcemod nextmap command. This modification is intended to restore Dystopia compatibility.
* Update basetriggers.sp
* Update basetriggers.sp
* Update basetriggers.sp
* Update basetriggers.sp
This brings in a few breaking changes.
One, INVALID_FUNCTION is now 0 instead of -1. This is long overdue.
Plugins should transparently work except in two cases:
1. Third-party extensions that have a hardcoded test for -1 will no
longer work. A new API has been provided for this,
GetFunctionByIdOrNull.
2. If a plugin "framework" uses INVALID_FUNCTION anywhere in its
exported API, then all plugins using that framework need to be
recompiled together, so they agree on the value of
INVALID_FUNCTION.
Hopefully the damage here is minimal. The core plugin version has been
bumped to 7 to try and limit conflicts.
Second, braceless functions are no longer supported. There wasn't really
any way around this and it's better to bite the bullet now. This affects
source compatibility, but not binary compatibility.
Third, the "using" keyword is no longer implemented. SourceMod now has a
Handle methodmap again. Plugins compiled against this new methodmap will
require a "Handle.~Handle" native, which 1.12 now provides.
* Ignore chat triggers for interactive ban reason
If the admin types a chat trigger for a command while BaseBans is
waiting for them to type a ban reason, don't treat that message as the
ban reason.
This fixes a problem where the admin decides to cancel their ban with
"!abortban", "/abortban" etc, but ends up accidentally banning the
player with the ban reason "!abortban" (or by attempting to access any
other command via a chat trigger before typing the ban reason).
* Optimize
Check if we're actually waiting for chat reason before calling the native
* Add more functions to ArrayStack
* Make formatting consistent with other functions
* Don't remove the element for TopArray
* Replace 4 with sizeof(cell_t)
* Update SDKCall return information
This adds the information that if the return value is a string then SDKCall will return the number of bytes written.
* Update description
* Add info if the string is null
The current ``KvSavePosition`` definition does not reflect the behaviour seen in [core/smn_keyvalues.cpp#L973-L981](404e96ad45/core/smn_keyvalues.cpp (L973-L981)). This can cause problems if some procedure on sp expects ``KvSavePosition`` to always add one node to the stack, no matter if there is no higher node.
Co-authored-by: peace-maker <peace-maker@wcfan.de>
* Remove obsolete slapslay.phrases.txt
That plugin isn't in the stock arsenal since forever.
* Remove "Dead Player Rename" phrase
Unused since #313
* Remove nominations phrases from rockthevote
Those phrases were moved to their own nominations.phrases.txt
* Remove "Next Map" phrase from nextmap.phrases.txt
It was moved to basetriggers.phrases.txt
* Remove unused phrases from common.phrases.txt
Only "Slapped Player" was moved to funvotes.phrases.txt
* Delete empty phrase files
* Fix workflow python version selection
3.10 would select Python 3.1 and fail
* Deduplicate "Please select a map" phrase
Only keep it in the plugin.basecommands.txt file and remove it from the basevotes.phrases.txt.
Both plugins using the phrase load the basecommands phrases.
* Allow manual triggering of translations action
* Actually use the nextmap phrases
They were never referenced in the plugin. The "ago" phrase doesn't work the way it is and needs more rethinking.
Support L4D(2) Friendly Fire In Basetriggers.sp #1522
- Games have cvar mp_friendlyfire min. and max. bounds set to 1
- Removing mp_friendlyfire lower bound and set to 0, cvar have no purpose on friendly fire damage.
- FF works from z_difficulty and each difficult level have FF damage ration cvars:
survivor_friendly_fire_factor_easy
survivor_friendly_fire_factor_normal
survivor_friendly_fire_factor_hard
survivor_friendly_fire_factor_expert
Update added PRINT_TO_ things from previous update.
Co-authored-by: Bacardi <>
* Build SDKTools for hl2sdk-mock
* Fix loading of extensions using advanced naming scheme for hl2sdk-mock
* Fix error on missing sv_visiblemaxplayers convar
* Build SDKHooks for hl2sdk-mock
* Fix x86_64 SourcePawn VM filename
* SDKHooks: Ignore missing IEntityListeners list in hl2sdk-mock