Hello. I'm working on a blacklist. I cannot ban the player in the txt file. I tried two codes but it didn't work.
This code belongs to Yisc[NL]. But this doesn't work either. Where is my mistake?
This is my own code.
CatchEvent OnConnect( $userName )
$IPAddress = GetCurrentPlayerVar( "IPAdress" );
UserGroupFromFile( "IPAddress", "./Blacklist.txt" );
IF ( UserInGroup( "IPAdress",$IPAddress ) )
THEN
cmdLFS("/kick " . GetCurrentPlayerVar("userName") );
ENDIF
EndCatchEvent
This code belongs to Yisc[NL]. But this doesn't work either. Where is my mistake?
Event OnNewPlayerJoin( $userName )
$IPAddress = GetCurrentPlayerVar( "IPAdress" );
UserGroupFromFile( "IPAddress", "./Blacklist.txt" );
IF ( UserInGroup( "IPAdress",$IPAddress ) == 1 )
THEN
cmdLFS("/kick " . GetCurrentPlayerVar("userName") );
ENDIF
EndEvent