09.04.2010, 09:42
how can i use playerid in public OnRconLoginAttempt(ip[], password[], success)?
please help me ;/
please help me ;/
public OnRconLoginAttempt(ip[], password[], success)
{
if(!success) //If the password was incorrect
{
printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s",ip, password);
new pip[16];
for(new i=0; i<MAX_PLAYERS; i++) //Loop through all players
{
GetPlayerIp(i, pip, sizeof(pip));
if(!strcmp(ip, pip, true)) //If a player's IP is the IP that failed the login
{
SendClientMessage(i, 0xFFFFFFFF, "Wrong Password!"); //Send a message
SetPVarInt( i, "PasswordWarnings", GetPVarInt( i, "PasswordWarnings" ) + 1 );
if( GetPVarInt( i, "PasswordWarnings" ) == 3 ) {
DeletePVar( i, "PasswordWarnings" );
Kick(i);
}
}
}
}
return 1;
}
if(success)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(strcmp(ip, PlayerIp(i), true) == 0)
{
SendClientMessage(i, COLOR, "You have logged in.");
break;
}
}
}
PlayerIp(playerid)
{
new ip[16];
GetPlayerIp(playerid, ip, sizeof(ip));
return ip;
}