OnRconLoginAttempt is a spam? - 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: OnRconLoginAttempt is a spam? (
/showthread.php?tid=170348)
OnRconLoginAttempt is a spam? -
[NWA]Hannes - 22.08.2010
I got this code:
pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
if(!success)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
new pIp[30];
GetPlayerIp(i, pIp, sizeof(pIp));
if(strcmp(ip, pIp, true)==0)
{
new name[24];
GetPlayerName(i, name, 24);
printf("Rcon Login Attempt by %s(%d) using password: %s", name, ip, password);
}
}
}
return 1;
}
As you see in the picture below it doesnt return my name, and the ip returns as 49 when its 127.0.0.1, but the password is right tough.
Here is a screenie of the console after a failed in-game login with the password "Lol":
---------------------------------------
Re: OnRconLoginAttempt is a spam? -
Scenario - 22.08.2010
Switch these...
pawn Код:
if(!success)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
Re: OnRconLoginAttempt is a spam? -
CJ101 - 22.08.2010
that shouldnt matter.. try returning 0 after the print statement.
Re: OnRconLoginAttempt is a spam? -
Mikkel_Pedersen - 22.08.2010
Try this, it worked for me:
pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
if(!success)
{
new pIp[30], name[24];
for(new i=0; i<MAX_PLAYERS; i++)
{
GetPlayerIp(i, pIp, sizeof(pIp));
if(strcmp(ip, pIp, true) == 0 && IsPlayerConnected(i))
{
GetPlayerName(i, name, 24);
printf("Rcon Login Attempt by %s(%s) using password: %s", name, ip, password);
}
}
}
return 1;
}