public OnRconLoginAttempt(ip[], password[], success) - 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: public OnRconLoginAttempt(ip[], password[], success) (
/showthread.php?tid=140465)
public OnRconLoginAttempt(ip[], password[], success) -
DowNlOaD_ - 09.04.2010
how can i use playerid in public OnRconLoginAttempt(ip[], password[], success)?
please help me ;/
Re: public OnRconLoginAttempt(ip[], password[], success) -
johnathon956 - 09.04.2010
you need a R7 server
pawn Код:
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;
}
Re: public OnRconLoginAttempt(ip[], password[], success) -
DowNlOaD_ - 09.04.2010
i would like to add something like that to it:
if(success == 1)
{
SendClientMessage(playerid, COLOR, "You have logged in.");
}
but playerid isn't working
is there some way i can get it to work?
Re: public OnRconLoginAttempt(ip[], password[], success) -
Grim_ - 09.04.2010
Well it already gives you a message when logging in, but you can do a custom one depending on the ip
pawn Код:
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;
}
Re: public OnRconLoginAttempt(ip[], password[], success) -
DowNlOaD_ - 09.04.2010
ok and i have another question
how can i delete the default message "SERVER: You have logged as an admin." ?
i tried return 0; but it doesnt work
Re: public OnRconLoginAttempt(ip[], password[], success) -
Grim_ - 09.04.2010
You can't AFAIK.