GitHub repo: https://github.com/KirillMysnik/SP-SpamProofCommands
Download latest release: https://github.com/KirillMysnik/SP-SpamProofCommands/releases/latest
WHAT'S THIS?
Ever been worried of binding some resource-consuming callbacks to server, client and say (chat) commands?
Possibility of bad Russian guys coming to spam your server won't let you sleep?
Fear no more! SpamProofCommands custom package restricts your callbacks to be executed by each player only after some cooldown delay.
WORKING EXAMPLE
Syntax: Select all
from core import echo_console
from messages import SayText2
from spam_proof_commands.client import ClientCommand
from spam_proof_commands.say import SayCommand
from spam_proof_commands.server import ServerCommand
TEST_TEXT = "You've just executed a command"
test_message = SayText2(message=TEST_TEXT)
# This command will only be executed once every 3 seconds
@SayCommand(3, "!spamtest")
def say_spamtest(command, index, team_only):
test_message.send(index)
# Same with client command
@ClientCommand(3, "spamtest_client")
def client_spamtest_client(command, index):
test_message.send(index)
# And server command
@ServerCommand(3, "spamtest_server")
def server_spamtest_server(command):
echo_console(TEST_TEXT)
Hope somebody finds this useful.