Correct me if im wrong pls
#1

this is a stock i made for getting id of a particluar inputted IP

pawn Код:
stock GetIPId(ip[])
{
    for(new i;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i))
        {
            new IPtest[256];
            GetPlayerIp(i,IPtest,sizeof(IPtest));
            if(!strcmp(ip,IPtest,true))
            {
                return i;
            }
           
        }
    }
    return -1;
}
Reply
#2

nothing wrong in it. Change new IPtest[256]; to new IPtest[16];
Reply
#3

this doesnt seem to work but

pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(success)
    {
        new id = GetIPId(ip);
        for(new k;k<MAX_PLAYERS;k++)
        {
            if(IsPlayerAdmin(k))
            {
                new string[256];
                GetPlayerName(id,string,sizeof(string));
                format(string,sizeof(string),"Rcon Login Success | %s has logged in | Ip - %s",string,ip);
                SendClientMessage(k,COLOR_ADMIN,string);
                print(string);
            }
        }
    }
    return 1;
}
Reply
#4

try
pawn Код:
stock GetIPId(ip[])
{
    for(new i;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i))
        {
            new IPtest[16];
            GetPlayerIp(i,IPtest,sizeof(IPtest));
            if(strfind(ip,IPtest,true) != -1)
            {
                return i;
            }

        }
    }
    return -1;
}
Reply
#5

the onrconloginattemp aint working still , with your version of the stock
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)