29.04.2010, 01:03
More sscanf 2.0 dilemmas!
I'm rewriting my IRC script, I'm trying to add this command but I got to a certain point and got stuck... how would I do it so you can enter a password parameter and it'll use it but if you don't enter a password parameter it'll just join the channel without. I'm tired right now I can't think properly .. any help is appreciated, etc.
Also, note that the parameters will be strings, right? The usage format'd be like:
- with password
or it can also be used without
I'm rewriting my IRC script, I'm trying to add this command but I got to a certain point and got stuck... how would I do it so you can enter a password parameter and it'll use it but if you don't enter a password parameter it'll just join the channel without. I'm tired right now I can't think properly .. any help is appreciated, etc.
Also, note that the parameters will be strings, right? The usage format'd be like:
pawn Код:
!join #channel passwordhere
or it can also be used without
pawn Код:
!join #channel
pawn Код:
IRCCMD:join(botid, channel[], user[], host[], params[])
{
if(IRC_IsOp(botid, channel, user))
{
if(!isnull(params))
{
new channel, msg[128], pass;
if(sscanf(params, "s[100]z[100]", channel, pass))
{
IRC_JoinChannel(gBotID[0], channel