Rcon Problem
#1

it spams chat ..why? please help


PHP код:
            public OnRconLoginAttempt(ip[], password[], success)
                    {
                        if(!
success//If the password was incorrect
                        
{
                            
printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s",ippassword);
                            new 
pip[16];
                            for(new 
i=0i<MAX_PLAYERSi++) //Loop through all players
                            
{
                                
GetPlayerIp(ipipsizeof(pip));
                                if(!
strcmp(ippiptrue)) //If a player's IP is the IP that failed the login
                                
{
                                    new 
name[24];
                                     new 
str[128];
                                     new 
ymd;
                                    new 
h,mi,s;
                                    new 
sendername[MAX_PLAYER_NAME];
                                    
GetPlayerName(isendernamesizeof(sendername));
                                    
format(strsizeof(str), "<UnionZone Bot> %s gresit rcon! Ip: %s",name,ip); // this spams!
                                    
SendAdminMessage(COLOR_YELLOWstr);
                                     
SendClientMessage(iCOLOR_RED"[Anti-RconHack]: Ai Spart Rcon.Si ai primit Admin 1.");
                                     
Kick(i);
                                    
getdate(y,m,d);
                                    
gettime(h,mi,s);
                                    
format(strsizeof(str), "(%d/%d/%d)[%d:%d:%d] %s a gresit rcon! Ip: %s Password: %s",d,m,y,h,mi,s,name,ip,password);
                                    
IntrareLog(str);
                                }
                            }
                        }
                        return 
1;
                    } 
Reply
#2

You must add
pawn Код:
if(IsPlayerConnected(i))
because pip is empty if id is not connected so strcmp returns false (IP match)
Reply
#3

how can i make so i add id..?
PHP код:
"<UnionZone Bot> %s Id: %d gresit rcon! Ip: %s" 
so there id too??no work with id..
Reply
#4

pawn Код:
name,i,ip
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)