09.06.2014, 14:46
pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
return 0;
}
pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
if(!IsPlayerConnected(playerid)) return 0;
return 0;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 0;
}
public OnRconLoginAttempt(ip[], password[], success)
{
if(!IsPlayerConnected(playerid)) return 0;
return 0;
}
rcon 0
As the SA-MP Wiki says: This callback does not handle returns.
If the player tries to login as RCON via rcon remote console, the callback won't be called. This callback is called for online players only. However, you can do: pawn Код:
|
public OnRconLoginAttempt(ip[], password[], success)
{
if(!success) return 1;
new playerip[16];
for(new i = 0; i < MAX_PLAYERS; i++) //Foreach would be the better option.
{
if(!IsPlayerConnected(i)) continue; //Remove this if you are using foreach.
GetPlayerIp(i, playerip, sizeof(playerip)); //Get the player's ip
if(strcmp(playerip, ip, true)) continue; //This will compare the ip of the attempted RCON accesser and the player's ip
SendClientMessage(i, -1, "You are not permitted to access RCON.");
SetTimerEx("KickPlayer", 200, false, "i", i); //Set a timer to kick the player.
}
return 1;
}
forward KickPlayer(playerid);
public KickPlayer(playerid) return Kick(playerid);
if(!success) return 1;
public OnRconLoginAttempt(ip[], password[], success)
{
new pIP[16];
GetPlayersIp(playerid, pIP);
foreach(Player, i) {
new pIP2[16];
GetPlayersIp(i, pIP2);
if(strcmp(pIP, pIP2, true && !CanLoginToRcon[playerid])) Kick(i); }
return 1;
}