Ban log error
#1

Hello there.
I was going to create a ban log, however I get this error:

Код:
sinatra.pwn(465) : error 006: must be assigned to an array
sinatra.pwn(466) : error 006: must be assigned to an array
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
My code is:
pawn Код:
CMD:ban(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] > 1)
    {
    new str[128], id, reason[128];
    if(!sscanf(params, "is[128]", id, reason))
    {
    new playername[MAX_PLAYER_NAME+1];
    new bannedname[MAX_PLAYER_NAME+1];
    GetPlayerName(playerid, playername, sizeof(playername));
    GetPlayerName(id, bannedname, sizeof(bannedname));
    format(str, sizeof(str), "AdmCmd: %s was banned by %s (Reason: %s)", bannedname, playername, reason);
    SendClientMessageToAll(COLOR_RED, str);
    BanPlayer(id);
    BanInfo[playerid][banBy] = playername;
    BanInfo[playerid][banReason] = reason;
    new INI:File = INI_Open(BanPath(playerid));
    INI_WriteString(File,"Banned by:", BanInfo[playerid][banBy]);
    INI_WriteString(File,"Ban reason:", BanInfo[playerid][banReason]);
    INI_Close(File);
    } else return SendClientMessage(playerid, 0xEE0000FF, "USAGE: /ban [id] [reason]");
    } else return SendClientMessage(playerid, 0xEE0000FF, "You are not allowed to use this command!");
    return 1;
}
Any help would be appreciated. (REP +1)
Reply
#2

Close, fixed it myself.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)