/bano command (offline ban)
#1

Good day, I've got a slight problem with my /bano command... it returns an error that I have no idea how to fix. Here's the code for the offline ban command:

pawn Код:
YCMD:bano(playerid, params[], help)
{
    if(help)
    {
        SendClientMessage(playerid, COLOR_WHITE, "{AFAFAF}Command /bano: {FFFFFF}Bans a player who is offline.");
    }
    else
    {
        if(PlayerInfo[playerid][pAdmin] >= 1)
        {
            new string[158], reason[120], targetname[24], filestring[79];
            if(sscanf(params, "s[24]s[120]", targetname, reason)) return SendClientMessage(playerid, COLOR_WHITE, "{AFAFAF}Syntax: {FFFFFF}/bano [fullname] [reason]");
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(filestring, sizeof(filestring), "/Users/%s.ini", targetname);
            if(!fexist(filestring)) return SendClientMessage(playerid, COLOR_WHITE, "{AFAFAF}Error: {FFFFFF}Player doesn't exist.");
            else
            {
                new INI:File = INI_Open(UserPath(filestring)); // line 705 (error line)
                INI_SetTag(File, "data");
                INI_RemoveEntry(File, "Banned");
                INI_WriteInt(File, "Banned", 1);
                INI_Close(File);
                format(string, sizeof(string), "{FF6347}Admin %s banned the offline player %s, reason: %s", sendername, targetname, reason);
                SendClientMessageToAll(COLOR_WHITE, string);
            }
        } else { SendClientMessage(playerid, COLOR_WHITE, ""MinimumAdmin1""); return 1; }
    }
    return 1;
}
And the error that it returns is stated below:

Quote:

...(705) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

Line 705 is stated in the pawn code. I'd appreciate it if anyone could help me, thanks!

PS: I'm not too good with YSI, I only started learning it this morning .
Reply
#2

pawn Код:
new INI:File = INI_Open(filestring); // line 705 (error line)
lol
Reply
#3

Quote:
Originally Posted by ProjectMan
Посмотреть сообщение
pawn Код:
new INI:File = INI_Open(filestring); // line 705 (error line)
lol
Aham.. wups . Thanks mate.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)