Beiträge von Eljero

    Sehr schöne Ideen :)


    Also würdet ihr das SEK/Swat als eine extra Fraktion erstellen oder in das PD mit einbauen?


    Ps: Bedenken es wird ein Roleplay Script wo viel wert auf RP gelegt wird.


    Mfg


    :)

    pawn Code:
    public OnRconLoginAttempt( ip[], password[], success )
    {
    #define R_IP_HASH 0
    #define R_FAILED_ATTEMPT 1
    #define R_PLAYER_ID 2
    static iptables[128][3], ip_index;
    new current_ip, playerid = INVALID_PLAYER_ID, str[128];
    current_ip = bernstein (ip);


    //search stored IP table
    for( new i = 0; i < ip_index && i < sizeof(iptables) ; i++ )
    {
    //IP exists in the table
    if( iptables[i][R_IP_HASH] == current_ip )
    {
    //if a player succeeded then just reset the attempt.
    if( success )
    {
    iptables[i][R_FAILED_ATTEMPT] = 0;
    return 1;
    }
    //Player failed to login. keep accumulating the number of failed attempt
    iptables[i][R_FAILED_ATTEMPT]++;
    playerid = iptables[i][R_PLAYER_ID];
    //if a false attempt exceeded the server tolerance
    if( iptables[i][R_FAILED_ATTEMPT] >= MAX_RCONLOGIN_ATTEMPT )
    {
    //follow the settings file configuration policy
    switch( POLICY_RCON_LOGINFAIL_INTERNAL )
    {
    case 1://Kick
    {
    format( str, sizeof(str), "* %s(%d) is kicked due to excessive rcon login attempt.", GetPlayerNameEx(playerid), playerid );
    SendAdminMessageAuth(AUTH_NOTICES,COLOR_RED,str);
    printf("[rcon] %s(%d) is kicked due to excessive rcon login attempt.", GetPlayerNameEx(playerid), playerid );
    Kick(playerid);
    return 1;
    }
    case 2://Ban
    {
    format( str, sizeof(str), "* %s(%d) is Kick Banned due to excessive rcon login attempt.", GetPlayerNameEx(playerid), playerid );
    SendAdminMessageAuth(AUTH_NOTICES,COLOR_RED,str);
    printf("[rcon] %s(%d) is Kick Banned due to excessive rcon login attempt.", GetPlayerNameEx(playerid), playerid );
    Ban(playerid);
    return 1;
    }
    }
    }
    //attempt didn't exceeded. notify it to administartors
    format( str, sizeof(str), "* %s(%d) failed to login to an administrator (%d times)", GetPlayerNameEx(playerid), playerid, iptables[i][R_FAILED_ATTEMPT] );
    SendAdminMessageAuth(AUTH_NOTICES,COLOR_RED,str);
    printf("[rcon] %s(%d) failed to login to an administrator (%d times)", GetPlayerNameEx(playerid), playerid, iptables[i][R_FAILED_ATTEMPT] );
    return 1;
    }
    }
    //he/she's not on the list. and he/she succeeded to login. just passing.
    if( success ) return 1;
    //this is the first time to fail login.
    for( new i = 0; i < NUM_PLAYERS ; i++ ) // using foreach-relavent iteration, find a playerid with an IP.
    {
    if( !strcmp(GetPlayerIpEx(pITT[i]), ip, false) ) // precached GetPlayerIp() alternatives
    {
    playerid = pITT[i]; //get the playerid
    break;
    }
    }
    //store it in the blacklist
    iptables[ip_index][R_IP_HASH] = current_ip;
    iptables[ip_index][R_PLAYER_ID] = playerid;
    iptables[ip_index][R_FAILED_ATTEMPT]++;
    ip_index++;
    //send a administrative mesessage
    format( str, sizeof(str), "* %s(%d) failed to login to an administrator (first time)", GetPlayerNameEx(playerid), playerid );
    //a small function, that only send a message to admins that have 'AUTH_NOTICES' privilege
    SendAdminMessageAuth(AUTH_NOTICES,COLOR_RED,str);
    printf("[rcon] player %s(%d) failed to login to an administrator (first time)", GetPlayerNameEx(playerid), playerid );
    #undef R_IP_HASH
    #undef R_FAILED_ATTEMPT
    #undef R_PLAYER_ID


    Schau mal :)

    I wiefern buggen die dann ?



    Biz kaufen usw funktionert. Danke :)


    Ein Problem nurnoch ich denke um das Biz zu betreten ist der /enter?


    Denn dann kommt SERVER: Unknown Command ;)


    Mfg