SA-MP Forums Archive
Playerid? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Playerid? (/showthread.php?tid=153975)



Playerid? - TKZ227 - 11.06.2010

Nevermind.


Re: Playerid? - Tnt12340 - 11.06.2010

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.


Re: Playerid? - TKZ227 - 11.06.2010

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



Re: Playerid? - DJDhan - 11.06.2010

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);
} 
       
}



Re: Playerid? - Jefff - 11.06.2010

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;
}



Re: Playerid? - DJDhan - 11.06.2010

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.


Re: Playerid? - Jefff - 11.06.2010

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)


Re: Playerid? - DJDhan - 11.06.2010

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