Playerid?
#1

Nevermind.
Reply
#2

Quote:

public OnRconLoginAttempt(ip[], password[], success)
{
if (IsPlayerConnected(playerid))
}
{
if (PlayerInfo[playerid][pAdmin] < 1)
{
Ban(playerid);
}
}
return 1;
}

Try that :]

And, Yesh i know, I'm still new to scripting; I may have made a mess of it. But, What you're forgetting is the
Код:
if (IsPlayerConnected(playerid))
function.
Reply
#3

I still get the same errors. I get undefined symbol "playerid" in both "Ban(playerid);" and the Admin level < 1 line.
Reply
#4

You can't ban a "playerid" in that function

Код:
public OnRconLoginAttempt(ip[], password[], success)
{
if(!success)
{      
new cmd[32];
format(cmd,sizeof(cmd),"banip %s",ip);
SendRconCommand(cmd);
} 
       
}
Reply
#5

pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(success) //If the password was correct
    {
        new pip[16];
        for(new i,g=GetMaxPlayers(); i<g; i++) //Loop through all players
        {
            GetPlayerIp(i, pip, sizeof(pip));
            if(!strcmp(ip, pip, true))
                if(PlayerInfo[i][pAdmin] < 1)
                    BanEx(i,"Hacker"); //They are now banned.
        }
    }
    return 1;
}
Reply
#6

Quote:
Originally Posted by Jefff
pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(success) //If the password was correct
    {
        new pip[16];
        for(new i,g=GetMaxPlayers(); i<g; i++) //Loop through all players
        {
            GetPlayerIp(i, pip, sizeof(pip));
            if(!strcmp(ip, pip, true))
                if(PlayerInfo[i][pAdmin] < 1)
                    Ban(i); //They are now banned.
        }
    }
    return 1;
}
That will the ban the player if he puts in the correct password.
Reply
#7

Quote:
Originally Posted by DJDhan
Quote:
Originally Posted by Jefff
pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(success) //If the password was correct
    {
        new pip[16];
        for(new i,g=GetMaxPlayers(); i<g; i++) //Loop through all players
        {
            GetPlayerIp(i, pip, sizeof(pip));
            if(!strcmp(ip, pip, true))
                if(PlayerInfo[i][pAdmin] < 1)
                    Ban(i); //They are now banned.
        }
    }
    return 1;
}
That will the ban the player if he puts in the correct password.
Yup, but He dont using rcon because its RP and own admin system if(PlayerInfo[i][pAdmin] < 1)
Reply
#8

He is not using RCON but if other players try to login to RCON, they won't be banned with your code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)