Jump to content
  • 0

Problema Conexiuni


Kasse

Question

Salut, Vreau sa stiu cum as putea sa fac sa bag pe server mai mult de 5 conturi de pe acelasi IP. Este vreo limita de conexiuni sau ceva? Pentru ca mereu cand conectez al 6-lea cont imi da kick la TOATE conturile.

Edited by Kasse
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

GetPlayerName(playerid, PlayerInfo[playerid][pUsername], MAX_PLAYER_NAME);
    ResetVariables(playerid);
    if(CountIP(GetIP(playerid)) > 5 && strcmp(GetIP(playerid), "127.0.0.1", true) != 0) {
        SCM(playerid, COLOR_WARNING, "Sunt permise doar o conexiune!");
        KickEx(playerid);
        return true;
    } 

Link to comment
Share on other sites

  • 0
Acum 3 ore, TheBoy. a spus:

GetPlayerName(playerid, PlayerInfo[playerid][pUsername], MAX_PLAYER_NAME);
    ResetVariables(playerid);
    if(CountIP(GetIP(playerid)) > 5 && strcmp(GetIP(playerid), "127.0.0.1", true) != 0) {
        SCM(playerid, COLOR_WARNING, "Sunt permise doar o conexiune!");
        KickEx(playerid);
        return true;
    } 

Ceea ce faci tu aici e sa limitezi conexiunile la 5, omul vrea sa nu fie limitate.

Verifica daca ai o functie care limiteaza conexiunile. Cauta prin gamemode GetPlayerIp si vezi daca gasesti ceva care limiteaza conexiunile.

Link to comment
Share on other sites

  • 0

#include <a_samp>
#define IP_LIMIT 5 // = Max connections from one single IP
#define SAME_IP_CONNECT 4 // = The number of connects from the same IP before banning the flooder
new Same_IP=0,Join_Stamp,ban_s[25],exceed=0;
#define Time_Limit 3500 // = The time span between connects, adjust it to your own specifications

public OnPlayerConnect(playerid)
{
    new ConnIP[16];
    GetPlayerIp(playerid,ConnIP,16);
    new compare_IP[16];
    new number_IP = 0;
    for(new i=0; i<MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i)) {
            GetPlayerIp(i,compare_IP,16);
            if(!strcmp(compare_IP,ConnIP)) number_IP++;
        }
    }
    if((GetTickCount() - Join_Stamp) < Time_Limit)
        exceed=1;
    else
        exceed=0;
     if(strcmp(ban_s, ConnIP, false) == 0 && exceed == 1 )
     {
         Same_IP++;
         if(Same_IP > SAME_IP_CONNECT)
         {
               Ban(playerid);
             Same_IP=0;
         }
     }
     else
     {
         Same_IP=0;
    }
    if(number_IP > IP_LIMIT)
        Kick(playerid);
    GetStampIP(playerid);
    return 1;

}
stock GetStampIP(playerid){
    new S_IP[16];
    Join_Stamp=GetTickCount();
    GetPlayerIp(playerid,S_IP,16);
    format(ban_s, 16, "%s", S_IP);
}

🔥Daca ii dai cuiva a doua sansa, e ca si cum i-ai oferi un glont la pistol ca sa te nimereasca.🔥

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.