SA-MP Forums Archive
GoodMorning. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: GoodMorning. (/showthread.php?tid=609117)



GoodMorning. - VinHanako - 09.06.2016

Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    /*if(success)
    {
        new pip[16];
            ////foreach(Player,i)
        for(new i; i<MAX_PLAYERS; i++)
        {
            GetPlayerIp(i, pip, sizeof(pip));
            if(!strcmp(ip, pip, true))
            if(PlayerInfo[i][pAdmin] < 3) Ban(i);
        }
    }*/
    return 1;
}
I already recompile my script i can use /rcon login <password> without getting banned?


Re: GoodMorning. - SickAttack - 09.06.2016

Set your admin level to 0.


Re: GoodMorning. - VinHanako - 09.06.2016

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Set your admin level to 0.
I already put a /* and */ because every time i rcon login i get banned


Re: GoodMorning. - SickAttack - 09.06.2016

Quote:
Originally Posted by VinHanako
Посмотреть сообщение
I already put a /* and */ because every time i rcon login i get banned
What's the issue here then?


Re: GoodMorning. - VinHanako - 09.06.2016

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
What's the issue here then?
Im asking if my code is right because my friend will try the /rcon login later to set his admin level in game.


Re: GoodMorning. - iShawn - 09.06.2016

Don't create more topics for the same problem.

Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}



Re: GoodMorning. - VinHanako - 09.06.2016

Quote:
Originally Posted by iShawn
Посмотреть сообщение
Don't create more topics for the same problem.

Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}
That code is ok too? I need a tester huhuhu


Re: GoodMorning. - SickAttack - 09.06.2016

pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(success)
    {
        new ip_address[16];
        for(new i = 0, j = GetPlayerPoolSize(); i <= j; i ++)
        {
            if(!IsPlayerConnected(i))
            {
                continue;
            }

            GetPlayerIp(i, ip_address, sizeof(ip_address));

            if(!strcmp(ip, ip_address, true) && PlayerInfo[i][pAdmin] < 3)
            {
                Ban(i);
            }
        }
    }
    return 1;
}
It should ban the player if the player's IP address is the same as the IP address passed on to the callback and if the player's admin level is below 3.

If you don't want it to ban players, then just remove all the code in the callback as shown above (and below).

pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}



Re: GoodMorning. - VinHanako - 09.06.2016

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(success)
    {
        new ip_address[16];
        for(new i = 0, j = GetPlayerPoolSize(); i <= j; i ++)
        {
            if(!IsPlayerConnected(i))
            {
                continue;
            }

            GetPlayerIp(i, ip_address, sizeof(ip_address));

            if(!strcmp(ip, ip_address, true) && PlayerInfo[i][pAdmin] < 3)
            {
                Ban(i);
            }
        }
    }
    return 1;
}
It should ban the player if the player's IP address is the same as the IP address passed on to the callback and if the player's admin level is below 3.

If you don't want it to ban players, then just remove all the code in the callback as shown above.
Because in my code it must be level 3 admin first because i got banned


Re: GoodMorning. - SickAttack - 09.06.2016

Quote:
Originally Posted by VinHanako
Посмотреть сообщение
Because in my code it must be level 3 admin first because i got banned
Yes, read my last message again.