[Urgent] OnRconLoginAttemp
#1

I made this so when someone logs on the rcon (/rcon login) Server owners gets a warning but when they log successfully i get Both of the warnings kinda spammy ANYONE HELP ME?
pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    format(string, sizeof(string), "{FF0000}AdmWarning{FFFF00}: %s is attempting to log on the Rcon.",sendername);
    ABroadCast(COLOR_WHITE,string,100001);
   
    if(success)
    {
        format(string, sizeof(string), "{FF0000}AdmWarning{FFFF00}: %s has successfully logged it on the Rcon.",sendername);
        ABroadCast(COLOR_WHITE,string,100001);
    }
}
Reply
#2

Pass the first message only if the login attempt failed.
pawn Код:
if(!success) //In case if the attempt had been failed
{
 //Warn stuff here.
}
Reply
#3

I'am stupid god , didn't think about it xD
Ty bro

and how can i make him gets KICKED i couldn't define (playerid)
Reply
#4

To slow :/ but you could also use and else statment
pawn Код:
//    
    if(success)
    {
        format(string, sizeof(string), "{FF0000}AdmWarning{FFFF00}: %s has successfully logged it on the Rcon.",sendername);
    }
    else
    {
        format(string, sizeof(string), "{FF0000}AdmWarning{FFFF00}: %s is attempting to log on the Rcon.",sendername);
    }
    ABroadCast(COLOR_WHITE,string,100001);
Reply
#5

How can i make it auto kick when player enters the Wrong password please?
EDIT: and how i can i send him a message like you have been kicked or somthing , playerid can't be added there
Reply
#6

pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(!sucess)
    {
    format(string, sizeof(string), "{FF0000}AdmWarning{FFFF00}: %s is attempting to log on the Rcon.",sendername);
    ABroadCast(COLOR_WHITE,string,100001);
    Kick(sendername);
   }
    if(success)
    {
        format(string, sizeof(string), "{FF0000}AdmWarning{FFFF00}: %s has successfully logged it on the Rcon.",sendername);
        ABroadCast(COLOR_WHITE,string,100001);
    }
}
Reply
#7

C:\Documents and Settings\Administrateur\Bureau\SA-MRP - v0.3z (V2)\gamemodes\SA-MRP.pwn(4450) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#8

pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(!success)
    {
    format(string, sizeof(string), "{FF0000}AdmWarning{FFFF00}: %s is attempting to log on the Rcon.",sendername);
    ABroadCast(COLOR_WHITE,string,100001);
    SendClientMessage(sendername,-1,"You have been kicked by anti cheat for entering wrong rcon password");
    Kick(sendername);
   }
    if(success)
    {
        format(string, sizeof(string), "{FF0000}AdmWarning{FFFF00}: %s has successfully logged it on the Rcon.",sendername);
        ABroadCast(COLOR_WHITE,string,100001);
    }
}
Reply
#9

same eRRoRs :/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)