Unban command help
#1

Hello,i coded this !unban cmd for IRC,but i get 2 errors:

4660 : error 035: argument type mismatch (argument 1)
4661 : error 035: argument type mismatch (argument 1)

Full code:

pawn Код:
IRCCMD:unban(botid, channel[], user[], host[], params[])
{
    if(IRC_IsOp(botid,channel,user))
    {
        new tmp[24];
        new msg[100];
        if(!strlen(params)) return IRC_GroupSay(gGroupID, channel,"4Error: You didnt type a name");
        if(!fexist(UserPath(tmp))) return IRC_GroupSay(gGroupID, channel,"* Sorry, Account not found.");
        new INI:File = INI_Open(UserPath(tmp));
        INI_WriteInt(File, "Banned", 0);
        INI_Close(File);
        format(msg,sizeof msg,"2Success. - Account %s Unbanned -",tmp);
        IRC_GroupSay(gGroupID,IRC_CHANNEL,msg);
    }else IRC_GroupSay(gGroupID, channel,"4Error: You must be operator to use this command.");
    return 1;
}
Line 4660:

pawn Код:
if(!fexist(UserPath(tmp))) return IRC_GroupSay(gGroupID, channel,"* Sorry, Account not found.");
Line 4661:

pawn Код:
new INI:File = INI_Open(UserPath(tmp));
I use Y_INI,what's wrong?
Reply
#2

Something wrong with UserPath(tmp)
Reply
#3

Quote:
Originally Posted by milanosie
Посмотреть сообщение
Something wrong with UserPath(tmp)
UserPath is where the players file located at.
Reply
#4

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
UserPath is where the players file located at.
Well yeah but it gives a warning on both sentences where UserPath(tmp) is,
So something is probably wrong with that,
Reply
#5

Quote:
Originally Posted by milanosie
Посмотреть сообщение
Well yeah but it gives a warning on both sentences where UserPath(tmp) is,
So something is probably wrong with that,
Ok then,let's wait for someone.
Reply
#6

What is tmp defined as?
I only see it being created,
Reply
#7

Quote:
Originally Posted by milanosie
Посмотреть сообщение
What is tmp defined as?
I only see it being created,
Tmp is playername.
Reply
#8

pawn Код:
new tmp[24];
        new msg[100];
        if(!strlen(params)) return IRC_GroupSay(gGroupID, channel,"4Error: You didnt type a name");
        if(!fexist(UserPath(tmp))) return IRC_GroupSay(gGroupID, channel,"* Sorry, Account not found.");
        new INI:File = INI_Open(UserPath(tmp));
        INI_WriteInt(File, "Banned", 0);
I'm not familier with Y_Ini but I do not see a playername?
Reply
#9

Quote:
Originally Posted by milanosie
Посмотреть сообщение
pawn Код:
new tmp[24];
        new msg[100];
        if(!strlen(params)) return IRC_GroupSay(gGroupID, channel,"4Error: You didnt type a name");
        if(!fexist(UserPath(tmp))) return IRC_GroupSay(gGroupID, channel,"* Sorry, Account not found.");
        new INI:File = INI_Open(UserPath(tmp));
        INI_WriteInt(File, "Banned", 0);
I'm not familier with Y_Ini but I do not see a playername?
I want read the player name file (so an offline player),not the online.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)