BAN ini
#2

pawn Код:
CMD:ban2(playerid, params[])
{
    new playerID, reason[64];
    if(sscanf(params, "us[32]", playerID, reason)) SCM(playerid, COLOR_GREY, "CMD: /ban [id] [reason]");
    else if(playerID > MAX_PLAYERS) SCM(playerid, 0xFF000000, "ID not connected.");
    else
    {
        new target[MAX_PLAYER_NAME], string[144];
        GetPlayerName(playerID,target,sizeof(target));
        format(string, 55, "/Users/%s.ini", target);
        new INI:File = INI_Open(string);
        if(File == INI_NO_FILE) SCM(playerid, 0xFF000000, "Account doesn't exists.");
        else
        {
            INI_SetTag(File, "data");
            INI_WriteInt(File, "Banned", 1);
            INI_Close(File);

            new playerName[MAX_PLAYER_NAME];
            GetPlayerName(playerid,playerName,sizeof(playerName));

            format(string, sizeof(string), "You banned %s", target);
            SendClientMessage(playerid,-1 , string);

            SetTimerEx("ZBan", 1000, false, "i", playerID);

            format(string, sizeof(string), "'%s was banned by %s.", target, playerName);
            SCMTL(COLOR_RED, string);

            SCM(playerID, -1, "Notification!");

            format(string,sizeof(string),"SRW: you was banned by  %s | reason: %s",playerName,reason);
            SCM(playerID,-1,string);

            format(string, sizeof(string), "'%s was banned by %s | reason: %s ", target, playerName, reason);
            SendMessageToAdmins(0xFF6347FF, string, 1);
        }
    }
    return 1;
}
Reply


Messages In This Thread
BAN ini - by Deny1 - 14.02.2016, 16:34
Re: BAN ini - by Jefff - 14.02.2016, 18:47
Re: BAN ini - by Deny1 - 20.02.2016, 13:49
Re: BAN ini - by Deny1 - 20.02.2016, 18:15
Re: BAN ini - by Deny1 - 20.02.2016, 18:18

Forum Jump:


Users browsing this thread: 1 Guest(s)