Page 1 of 1

ResetScore !rs

Posted: Mon Jan 11, 2016 6:48 pm
by La Muerte
Here's a simple resetscore (!rs) plugin:

Syntax: Select all

from commands.say import SayCommand
from players.entity import Player
from messages import SayText2
from commands import CommandReturn

@SayCommand('!rs')
def _rs_say_command(command, index, team):
player = Player(index)
player.kills = 0
player.deaths = 0

SayText2('You have reset your score.').send(index)

return CommandReturn.BLOCK


Updated.

Posted: Mon Jan 11, 2016 7:07 pm
by satoon101
Nice!! Instead of using a say filter, why not use a say command?

Syntax: Select all

@SayCommand('!rs')
def reset_score(command, index, team_only):
player = Player(index)
...


Also, you are missing your import for SayFilter.