Hello,
I've been trying to use SayCommand, but can't figure out how to get arguments(!respawn <PLAYER>), how do args work with SayCommand? Is it the right thing to use?
How to get args using SayCommand?
Re: How to get args using SayCommand?
Syntax: Select all
from commands.say import SayCommand
@SayCommand('!respawn')
def on_respawn(command, index, team_only):
print('Arg 0:', command[0])
print('All args:', tuple(command))
Though, if you want a more intelligent and secure way, you should take a look at this:
http://wiki.sourcepython.com/developing ... mands.html
Re: How to get args using SayCommand?
Ayuto wrote:Syntax: Select all
from commands.say import SayCommand
@SayCommand('!respawn')
def on_respawn(command, index, team_only):
print('Arg 0:', command[0])
print('All args:', tuple(command))
Though, if you want a more intelligent and secure way, you should take a look at this:
http://wiki.sourcepython.com/developing ... mands.html
Awesome, thank You sir :)
EDIT; what is the team_only?
Re: How to get args using SayCommand?
Whether 'say' or 'say_team' was used when issuing the command.
Re: How to get args using SayCommand?
satoon101 wrote:Whether 'say' or 'say_team' was used when issuing the command.
Does it support(SayCommand) silent commands?
Re: How to get args using SayCommand?
Yes, all you need to do is returning CommandReturn.BLOCK. If nothing was returned, it will handle it like CommandReturn.CONTINUE.
Re: How to get args using SayCommand?
Ayuto wrote:Yes, all you need to do is returning CommandReturn.BLOCK. If nothing was returned, it will handle it like CommandReturn.CONTINUE.
Thanks!
offtopic: whats the point of "Notifications"(Forums)? It doesnt notify me if someone posted on my thread
Re: How to get args using SayCommand?
Ayuto wrote:Syntax: Select all
from commands.say import SayCommand
@SayCommand('!respawn')
def on_respawn(command, index, team_only):
print('Arg 0:', command[0])
print('All args:', tuple(command))
Though, if you want a more intelligent and secure way, you should take a look at this:
http://wiki.sourcepython.com/developing ... mands.html
Cool!
Never heard of that secure way, gonna save that link :)
- L'In20Cible
- Project Leader
- Posts: 1536
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
Re: How to get args using SayCommand?
Kill wrote:offtopic: whats the point of "Notifications"(Forums)? It doesnt notify me if someone posted on my thread
You should see the number of notifications you have above the following icon:
If you click on that bell, you will be redirected to your notifications feed: ucp.php?i=ucp_notifications
You can configurate your notifications in your user panel: ucp.php?i=ucp_notifications&mode=notification_options
Re: How to get args using SayCommand?
L'In20Cible wrote:Kill wrote:offtopic: whats the point of "Notifications"(Forums)? It doesnt notify me if someone posted on my thread
You should see the number of notifications you have above the following icon:
notifications.PNG
If you click on that bell, you will be redirected to your notifications feed: ucp.php?i=ucp_notifications
You can configurate your notifications in your user panel: ucp.php?i=ucp_notifications&mode=notification_options
Ye ye, I had everything configured, for some reason now it notified me :P Thanks
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 74 guests