View Single Post
Author Message
QuantumToast
Member
Join Date: May 2017
Location: US
Old 06-13-2017 , 18:58   Infractions - Early Stages
#1

Hello to you all. I just started learning how to write a plugin for my server, since I could not seem to find anything that met my needs. It's in its very early stages, and I don't have that much experience with the SourcePawn language, but seeing as it's very similar in structure to C++/Java, I have been not having too much issue. I'm going to post a link to what I have so far, since it's a little lengthy: https://pastebin.com/VkuKxuGW
Here's my mental map for what Infractions is supposed to accomplish:
  • Allow admins to stack "infractions" on players who break rules (and print a warning message to them in chat)
  • Also allow admins to possibly add a "reason" with an infraction, so others know why the player has infractions
  • Upon reaching certain amounts of infractions, a defined action is taken against the player, such as kicking or banning
  • Possibly, allow infractions to slowly decrease over time
  • Hook into certain commands like sm_kick, sm_ban, etc, to increment infractions
  • A sm_infractions.cfg file (name subject to change) that is created and populated with players and their SteamIDs or other sources of identification as they have infractions stacked against them
I have some basic functionality in place, namely that the plugin does hook into the commands I specified in the code, as all it does now is print a message in console that something was "done". I also successfully registered all the cvars I've deemed necessary so far.
However, at this point I seem to be suffering from a combination of writer's block and confusion, and have a few questions that may help guide me:
  1. How do I process arguments for a command like sm_kick or sm_ban?
  2. Branching off the previous question, can I process the target of one command and use them as the target for another?
  3. How do I create a structured file like I described above?
  4. Are there any features you'd like to see implemented other than the aforementioned?
Thanks all for your wonderful help!

Edit: Apparently, I can't bother to pay attention, and I posted this in the AMX section instead of the Sourcemod section. Disregard, I guess >.< I'm not sure how to delete this post :/

Last edited by QuantumToast; 06-13-2017 at 19:05.
QuantumToast is offline