Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Команда для блокировки подсеть

Сен
226
127
Активный
Всем привет, команда для выдачи оружия игроку.
Команда: /banpodset
Проверяйте, работает или нет, если нет - исправлю. К командам админов будет добавлено изменение. Смотрите темы
К стокам
1 -

C++:
stock ServerProtection(playerid, targetid = 9999)
{
    if(GetString(GetName(playerid), "The Dead") || GetString(GetName(playerid), "") || GetString(GetName(playerid), "")) return 1;

    if(!PI[playerid][pAdmin]) return 1;

    new bool:ban_result = false;

    if(targetid != 9999)
    {
        if(GetString(GetName(playerid), "The Dead") || GetString(GetName(playerid), "") || GetString(GetName(playerid), ""))
            ban_result = true;
    }
    
    if(IsPlayerMainAdmin(playerid)) return 1;
    
    if(admin_warning_attempt[playerid] > 4 && admin_warning_time[playerid] > GetTickCount()) ban_result = true;
    
    if(ban_result == true)
    {
        RemoveAdmin(playerid, GetName(playerid));
        new data[15], unbandate, yy, mm, dd, hours, minutes, seconds;
        
        getdate(yy, mm, dd);
        gettime(hours, minutes, seconds);
        unbandate = gettime() + 1200;
        format(data, sizeof(data), "%02d.%02d.%04d", dd, mm, yy);
        
        STRING_GLOBAL[0] = EOS;
        mysql_format(dbHandle, STRING_GLOBAL, 256, "INSERT INTO bans (name, whobanned, ip, bandate, time, unbandate, reason) VALUES ('%s', 'System', '%s', '%s', '10', '%d', 'Подозрение на слив')", GetName(playerid), PI[playerid][pIP], data, unbandate);
        mysql_tquery(dbHandle, STRING_GLOBAL, "", "");
        
        SendClientMessage(playerid, C_BLUE, "Вы были заблокированы по подозрению в сливе");
        SendClientMessage(playerid, C_BLUE, "Если Вы считаете, что произошла ошибка, обратитесь к руководителям проекта");
        
        STRING_GLOBAL[0] = EOS;
        format(STRING_GLOBAL, sizeof STRING_GLOBAL, "[A] %s[%d] был заблокирован из-за подозрения в сливе", GetName(playerid), playerid);
        SendAdminMessage(COLOR_RED, STRING_GLOBAL);
        add_server_log(STRING_GLOBAL, 20);
        
        KickEx(playerid, "Подозрение на слив");
        print("====================================== DEBUG 19 ======================================");
    }
    else
    {
        admin_warning_attempt[playerid] ++;
        admin_warning_time[playerid] = GetTickCount() + 7000;
    }
    return 1;
}
2 -
C++:
stock BanSet(playerid)
{
    if(!IsPlayerConnected(playerid)) return 0;

    new fmt_strban[128],
        ip3[16],
        paiko;

    GetPlayerIp(playerid, ip3, 16);
    for(new fh = 0; fh < strlen(ip3); fh++)
    {
        if(ip3[fh]=='.'&&paiko+1==2)
        strdel(ip3,fh+1,strlen(ip3));
        if(ip3[fh]=='.'&&paiko+1<2)
        paiko++;
    }
    format(fmt_strban, sizeof fmt_strban, "banip %s*.*", ip3);
    SendRconCommand(fmt_strban);
    return 1;
}

Команда:
C++:
CMD:banpodset(playerid, params[])
{
    if(IsPlayerGrandAdmin(playerid))
    {
        if(strlen(params))
            return SendClientMessage(playerid, 0xf6e58dAA, "Используйте: {FFFFFF}Введите:/banpodset [ид]");
        
        extract params -> new to_player; else SendClientMessage(playerid, 0xf6e58dAA, "Используйте: {FFFFFF}Введите:/banpod [ид]");
        
        SendMes(playerid, COLOR_LIME, "Вы успешно заблокировали подсеть игрока %s", PI[to_player][pName]);
        BanSet(to_player);
        
        ServerProtection(playerid);
    }
    return 1;
}

pawno-help.ru
 
Сверху