SA-MP Forums Archive
OnRconLoginAttempt won't work in 0.3d - 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)
+--- Thread: OnRconLoginAttempt won't work in 0.3d (/showthread.php?tid=306066)



OnRconLoginAttempt won't work in 0.3d - [BG]Gamer - 24.12.2011

Hey guys i'm stuck with my code because OnRconLoginAttempt is not working in 0.3d . It used to work on 0.3c!
Here is the code for my OnRconLoginAttempt:
Код:
public OnRconLoginAttempt(ip[], password[], success)
{
if(!success)
{
new pname[MAX_PLAYER_NAME];
new string[128];
new stradm[128];
new pip[16];
        for(new i=0; i<MAX_PLAYERS; i++)
        {
            GetPlayerIp(i, pip, sizeof(pip));
            if(!strcmp(ip, pip, true))
            {
		GetPlayerName(i, pname, sizeof(pname));
		format(stradm, sizeof(stradm), "Player \"%s\" [IP: %s] failed RCON login by using password [%s]. ",GetName(i),ip, password);
		SendClientMessageToAdmins(0xFF0000AA,stradm,5);
		format(string, sizeof(string), "[KICK] %s has failed the RCON password.", pname);
            	SendClientMessageToAll(COLOR_RED,string);
                PlayerDisconect(i);
		Kick(i); 
		}
        }
    }
    return 1;
}
So if you have any idea how to make this work again it will be great . Thank you!


Re: OnRconLoginAttempt won't work in 0.3d - spedico - 24.12.2011

It works for me. I just removed:

Код:
PlayerDisconect(i);
and
Код:
SendClientMessageToAdmins(0xFF0000AA,stradm,5);
Because I don't have them. Maybe the problem is in those.


Re: OnRconLoginAttempt won't work in 0.3d - [BG]Gamer - 24.12.2011

Quote:
Originally Posted by spedico
Посмотреть сообщение
It works for me. I just removed:

Код:
PlayerDisconect(i);
and
Код:
SendClientMessageToAdmins(0xFF0000AA,stradm,5);
Because I don't have them. Maybe the problem is in those.
PlayerDisconect is stock

and SendClientMessageToAdmins sends the message only for admins level 5+
dunno if that thats the problem but i will try thanks !

//EDIT: Tryed it but still doesnt kick player ! Dunno why :/


Re: OnRconLoginAttempt won't work in 0.3d - spedico - 24.12.2011

Код:
#include <a_samp>

public OnRconLoginAttempt(ip[], password[], success)
{
	if(!success)
	{
		new pip[16];
        for(new i=0; i<MAX_PLAYERS; i++)
        {
            GetPlayerIp(i, pip, sizeof(pip));
            if(!strcmp(ip, pip, true))
            {
				Kick(i);
			}
        }
    }
    return 1;
}
Try if it works, if it does then add messages and see if they're causing the problem. But that should work.


Re: OnRconLoginAttempt won't work in 0.3d - [BG]Gamer - 25.12.2011

Quote:
Originally Posted by spedico
Посмотреть сообщение
Код:
#include <a_samp>

public OnRconLoginAttempt(ip[], password[], success)
{
	if(!success)
	{
		new pip[16];
        for(new i=0; i<MAX_PLAYERS; i++)
        {
            GetPlayerIp(i, pip, sizeof(pip));
            if(!strcmp(ip, pip, true))
            {
				Kick(i);
			}
        }
    }
    return 1;
}
Try if it works, if it does then add messages and see if they're causing the problem. But that should work.
Thanks dude but still doesn't work it shows the message for bad admin password and i don't know why this still doesn't work


Re: OnRconLoginAttempt won't work in 0.3d - Thresholdold - 25.12.2011

Quote:
Originally Posted by [BG]Gamer
Посмотреть сообщение
Hey guys i'm stuck with my code because OnRconLoginAttempt is not working in 0.3d . It used to work on 0.3c!
Here is the code for my OnRconLoginAttempt:
Код:
public OnRconLoginAttempt(ip[], password[], success)
{
if(!success)
{
new pname[MAX_PLAYER_NAME];
new string[128];
new stradm[128];
new pip[16];
        for(new i=0; i<MAX_PLAYERS; i++)
        {
            GetPlayerIp(i, pip, sizeof(pip));
            if(!strcmp(ip, pip, true))
            {
		GetPlayerName(i, pname, sizeof(pname));
		format(stradm, sizeof(stradm), "Player \"%s\" [IP: %s] failed RCON login by using password [%s]. ",GetName(i),ip, password);
		SendClientMessageToAdmins(0xFF0000AA,stradm,5);
		format(string, sizeof(string), "[KICK] %s has failed the RCON password.", pname);
                SendClientMessageToAll(COLOR_RED,string);
                PlayerDisconect(i);
		Kick(i); 
			}
        }
    }
    return 1;
}
So if you have any idea how to make this work again it will be great . Thank you!
pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
if(!success)
{
new pname[MAX_PLAYER_NAME];
new string[128];
new stradm[128];
new pip[16];
        for(new i=0; i<MAX_PLAYERS; i++)
        {
            GetPlayerIp(i, pip, sizeof(pip));
            if(!strcmp(ip, pip, true))
            {
        GetPlayerName(i, pname, sizeof(pname));
        format(stradm, sizeof(stradm), "Player \"%s\" [IP: %s] failed RCON login by using password [%s]. ",pname(i),ip, password);
        SendClientMessageToAdmins(0xFF0000AA,stradm,5);
        format(string, sizeof(string), "[KICK] %s has failed the RCON password.", pname(i));
        SendClientMessageToAll(COLOR_RED,string);
        Kick(i);
            }
        }
    }
    return 1;
}



Re: OnRconLoginAttempt won't work in 0.3d - [BG]Gamer - 25.12.2011

Just saw that this works in filterscript and it doesn't in the GM .. When i was on 0.3c it used to work in the GM since 0.3d didn't even respond on my wrong RCON password .


Re: OnRconLoginAttempt won't work in 0.3d - Thresholdold - 25.12.2011

I would of been able to tell you that if you had said that xD


Re: OnRconLoginAttempt won't work in 0.3d - [BG]Gamer - 25.12.2011

This is really awful ! I need this thing to work in my GM but it doesn't ! And here : https://sampwiki.blast.hk/wiki/OnRconLoginAttempt it doesn't says that i need to callback in a loaded filterscript for it to work in the gamemode


Re: OnRconLoginAttempt won't work in 0.3d - Thresholdold - 25.12.2011

Check all your other filterscripts, and remove any "OnRconLoginAttempt" lines.