Jump to content
  • 0

Ajuto rconlogs!


Blade

Question

Salutare baieti eu am o proeblema eu am pus un sistem de salvare a logurilor cand un jucator forloseste /rcon login {parola}, da imi face spam in baza de date! Oare de la ce sa fie va la stringul meu!

 

 

 

String:

 

public OnRconLoginAttempt(ip[], password[], success)
{
    if(!success) //If the password was incorrect
    {
        printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s",ip, password);
        new pip[16];
        for(new i=0; i<MAX_PLAYERS; i++) //Loop through all players
        {
            GetPlayerIp(i, pip, sizeof(pip));
            if(!strcmp(ip, pip, true)) //If a player's IP is the IP that failed the login
            {
                //SendClientMessage(i, 0xFFFFFFFF, "Wrong Password. Bye!"); //Send a message
                //Ban(i); //They are now banned.
            }
        }
    }
    else
    {
        for(new i=0; i<MAX_PLAYERS; i++)
        {
            new pName[30];
            new query[512];
        
   GetPlayerName(i, pName, sizeof(pName));
 
mysql_format(sqldb, query, sizeof(query) ,"INSERT INTO `rconlogs` (`ID`,`Admin`,`Password`, `Time`, `IP`) VALUES ('','%e','%s',CURRENT_TIMESTAMP,'%e')", pName, password, ip);
mysql_query(sqldb, query);
}
    }
return 1;
}
 
 
Uitati ce spam imi face in baza de date: 4X9Bu80.png
Edited by Blade
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Adaugi

new pip[16];
GetPlayerIp(i, pip, sizeof(pip));
if(!strcmp(ip, pip, true)) //If a player's IP is the IP that failed the login
{
      // Aici
}

in loc de

new pName[30];
new query[512];
  
 GetPlayerName(i, pName, sizeof(pName));
 
mysql_format(sqldb, query, sizeof(query) ,"INSERT INTO `rconlogs` (`ID`,`Admin`,`Password`, `Time`, `IP`) VALUES ('','%e','%s',CURRENT_TIMESTAMP,'%e')", pName, password, ip);
mysql_query(sqldb, query);

si in ea, unde scrie // Aici pui

new pName[30];
new query[512];
  
 GetPlayerName(i, pName, sizeof(pName));
 
mysql_format(sqldb, query, sizeof(query) ,"INSERT INTO `rconlogs` (`ID`,`Admin`,`Password`, `Time`, `IP`) VALUES ('','%e','%s',CURRENT_TIMESTAMP,'%e')", pName, password, ip);
mysql_query(sqldb, query);
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.