Skip to content
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

[Feature Request] Add optional "reason" parameter to kick / ban API #53

Open
Martin-H2 opened this issue Jul 13, 2017 · 0 comments
Open

Comments

@Martin-H2
Copy link

Martin-H2 commented Jul 13, 2017

g_AdminControl.BanPlayer(p, minutes, reason);
g_AdminControl.KickPlayer(p, reason);

As for now, coders need to do very dirty workarounds like:

  if(iMinutes > 0)
    g_EngineFuncs.ServerCommand("kick #"+string(g_EngineFuncs.GetPlayerUserId(pTarget.edict()))+" \""+sReason+" (ban duration: "+string(iMinutes)+")\"\n");
  else
    g_EngineFuncs.ServerCommand("kick #"+string(g_EngineFuncs.GetPlayerUserId(pTarget.edict()))+" \""+sReason+" (ban duration: permanent)\"\n");
  g_EngineFuncs.ServerCommand("wait\n");
  if(!bBanIp)
    g_EngineFuncs.ServerCommand("banid "+string(iMinutes)+" "+sId+"\n");
  if(bBanIp)
    g_EngineFuncs.ServerCommand("addip "+string(iMinutes)+" "+sIp+"\n");
  g_EngineFuncs.ServerCommand("wait\n");
  if(!bBanIp)
    g_EngineFuncs.ServerCommand("writeid\n");
  if(bBanIp)
    g_EngineFuncs.ServerCommand("writeip\n");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant