-
Notifications
You must be signed in to change notification settings - Fork 121
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
Admin name instead of "scriptadmin" in "ban" script function. #238
Comments
👍 |
i think the Plugin API Plugin_BanClient does that. adminname is also part of the baninfo_t struct. are we talking about the plugin functions, the server command or the gsc script interface? |
its about to run something like |
that will not work obviously, you are misusing a command for a script function. the admin is infered in that case from the caller. i.e. somebody writing $permban in chat to execute the command. what you should be using in this case is the respective script function called "ban" CoD4x_Server/src/scr_vm_functions.c Line 2093 in 1e9b93b
SV_AddBanForClient is used in that implementation, but that function seems to be designed for usage in commands, as it determines the banning admin by the invoker of the command. i believe we should replace SV_AddBanForClient by SV_AddBan at this point, and parse all the parameters (to fill baninfo_t) from the parameters given to the script function CoD4x_Server/src/scr_vm_functions.c Line 2111 in 1e9b93b
what do you think @T-Maxxx @IceNinjaman |
About plugin command to ban someone. All the contents of |
@D4edalus yep sure self exec is bullshit. just a stupid example of what Iam trying to achieve. So Iam looking for a solution of how to record this bans from caller admin, not from 'scriptadmin' for now I see couple of possible solutions:
|
actually, i think its perfectly fine that Plugin_BanClient is calling the plugin callback for banning a player. that way bans can be issued by any source (gsc scripts, other plugins, commands, etc) and still be recognized via the plugin callbacks to be persisted.
since void void SV_AddBanForClient(client_t* cl, int bantime, const char* banreason) parameters to the script function would then look as follows |
I meant we can ban player using script, chat and console (+rcon). Why you still want to add it to plugins too? |
for example the "warn" plugin is using it to ban a player when the number of warns exceed a certain amount. other plugins may use it to stay compatible to the command/script way of banning as i mentioned. e.g: the sourcebansplugin currently just checks the database and uses dropclient to get rid of players. these bans could as well be persisted through the plugin api function, and furthermore persisted by the respective plugin callback. if done so the commandline version of bans could be used to ban as well i think and persist bans via sourcebans. i hope that explanation was not too confusing :D the performance concern is in my opinion negligible. also: the plugin function is there already |
@volkv requested to add ability to log admin name if
ban
function has been invoked. I think it'll be enough to move actual ban functionality in seperate function and add script method calledban
so we can use something likelevel.admins[i] ban(level.players[j]);
and it'll loglevel.admins[i]
's name/guid/steamid/etc.The text was updated successfully, but these errors were encountered: