ResetScore !rs

Release your plugins here!
User avatar
La Muerte
Administrator
Posts: 180
Joined: Sun Jul 15, 2012 1:48 pm
Location: Belgium
Contact:

ResetScore !rs

Postby La Muerte » Mon Jan 11, 2016 6:48 pm

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.
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Mon Jan 11, 2016 7:07 pm

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.
Image

Return to “Plugin Releases”

Who is online

Users browsing this forum: No registered users and 12 guests