OnRconLoginAttempt won't work in 0.3d
#1

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!
Reply
#2

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.
Reply
#3

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 :/
Reply
#4

Код:
#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.
Reply
#5

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
Reply
#6

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;
}
Reply
#7

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 .
Reply
#8

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

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
Reply
#10

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


Forum Jump:


Users browsing this thread: 2 Guest(s)