View Full Version : possible to disallow a whole team from server?
Fire_optikz001
5th September 2009, 04:50
IF( $Nickname == "^0[^4S^0C]" )
THEN
cmdLFS( "/kick " . $userNtame );
ENDIF
Mikjen
5th September 2009, 09:59
Why would you want to diassalow the whole OsC team, ??
Or is it a certain indivudual who is giving you problems ?
-OsR- Mick
Bass-Driver
5th September 2009, 10:26
^0[^4S^0C] = [SC] = example
i think he want to test something
if u have the [SC] tag in your nickname
then u get automaticly kicked from the server.
broken
5th September 2009, 10:50
IF( $Nickname == "^0[^4S^0C]" )
THEN
cmdLFS( "/kick " . $userNtame );
ENDIF
Why would you want to diassalow the whole OsC team, ??
Or is it a certain indivudual who is giving you problems ?
-OsR- Mick
Not OsC... He is giving an example with his team tag lol... Removing the color codes u get [SC]...
Anyway, people can always log in with other nicknames and avoid getting kicked. :shrug:
Bass-Driver
5th September 2009, 10:56
the best thing is the putt all the usernames of the team in the list and then use the kick/ban code.
Mikjen
5th September 2009, 11:33
Could make it like the cruise insim,
you can only be a cop if u have [cop] if u havent got [SC] then u get spec`d :)
Bass-Driver
5th September 2009, 11:56
hi
i work with lapper version 5.716
i have add a code so that the user (from the notallowed.txt) get banned when he joined the server . but the code doesnt work .
i think i forgot something .
IF
($Username == "&C:\Program Files\LFS Z15\lfs lapper\bin\notallowed.txt")
THEN
cmdLFS( "/ban " . $Username . " 1" );
privMsg("^1You are not allowed to join this server!!");
ENDIF
Simpson
5th September 2009, 13:02
AFAIK $Username contains "user name", dont think that someone has username &C:\Program Files... ;)
second thing is that you can use == only if you have full username.
eg.
if( $Username == "[PL] Simpson" ) //kick the bastard
but if you want to kick everyone with [PL] in front, you need tu use regular expresions (for better result).
$username = '[PL] Simpson';
if( preg_match('#^(\[PL\])#si', $username) )
echo 'kick the bastard!';
If you want to use text file like you tried, than write each username in new line and..
$username = '[PL] Simpson';
$file = file('usr.txt', FILE_IGNORE_NEW_LINES);
$file = array_map("trim", $file);
if( in_array( $username, $file ) )
echo 'kick the bastard!';
PS. those are PHP examples, but you can rewrite it quite fast to C# ;)
Tim NL
5th September 2009, 13:23
IF( $Nickname == "^0[^4S^0C]" )
THEN
cmdLFS( "/kick " . $userNtame );
ENDIF
Hi,
Try this.:D
GlobalVar $TeamTag;
$TeamTag = "^0[^4S^0C]"; # Put here a team Tag that you want to check
GlobalVar $TeamTagLenght;
GlobalVar $TeamTagStrip;
$TeamTagLenght = StrLen( $TeamTag );
$NickName = GetCurrentPlayerVar("NickName");
$TeamTagStrip = substr( $NickName,0,$TeamTagLenght );
IF( $TeamTagStrip == $TeamTag )
THEN
do something ( kick or allow )
ENDIF
Bass-Driver
5th September 2009, 15:04
AFAIK $Username contains "user name", dont think that someone has username &C:\Program Files... ;)
second thing is that you can use == only if you have full username.
eg.
if( $Username == "[PL] Simpson" ) //kick the bastard
but if you want to kick everyone with [PL] in front, you need tu use regular expresions (for better result).
$username = '[PL] Simpson';
if( preg_match('#^(\[PL\])#si', $username) )
echo 'kick the bastard!';
If you want to use text file like you tried, than write each username in new line and..
$username = '[PL] Simpson';
$file = file('usr.txt', FILE_IGNORE_NEW_LINES);
$file = array_map("trim", $file);
if( in_array( $username, $file ) )
echo 'kick the bastard!';
PS. those are PHP examples, but you can rewrite it quite fast to C# ;)
i have this now
UserKickFile( "UserKick", "C:\Program Files\LFS Z15\Lapper 5.716\bin\UserKick.txt" );
UserBanFile( "UserBan", "C:\Program Files\LFS Z15\Lapper 5.716\bin\UserBan.txt" );
UserAdminFile( "UserAdmin", "C:\Program Files\LFS Z15\Lapper 5.716\bin\UserAdmin.txt" );
IF( UserInAdmin( "UserAdmin",$userName ) == 1 )
THEN
privMsg( "^7Welcome Back Admin!!!" );
ENDIF
IF( UserKick( "UserKick",$userName ) == 1 )
THEN
privMsg( "^1You Have A Current Ban From This Server");
cmdLFS("/kick " ."UserName");
ENDIF
IF( UserBan( "UserBan",$userName ) == 1 )
THEN
privMsg( "^1You Are Not allowed to join this server!!");
cmdLFS("/ban " . "UserName" . "1");
ENDIF
it says
UserKickFile is not a lapper fuction
UserBanFile '' '' '' '' ''
UserAdminFile " " " " "
what i need to do
Fire_optikz001
5th September 2009, 16:45
i have this now
UserKickFile( "UserKick", "C:\Program Files\LFS Z15\Lapper 5.716\bin\UserKick.txt" );
UserBanFile( "UserBan", "C:\Program Files\LFS Z15\Lapper 5.716\bin\UserBan.txt" );
UserAdminFile( "UserAdmin", "C:\Program Files\LFS Z15\Lapper 5.716\bin\UserAdmin.txt" );
IF( UserInAdmin( "UserAdmin",$userName ) == 1 )
THEN
privMsg( "^7Welcome Back Admin!!!" );
ENDIF
IF( UserKick( "UserKick",$userName ) == 1 )
THEN
privMsg( "^1You Have A Current Ban From This Server");
cmdLFS("/kick " ."UserName");
ENDIF
IF( UserBan( "UserBan",$userName ) == 1 )
THEN
privMsg( "^1You Are Not allowed to join this server!!");
cmdLFS("/ban " . "UserName" . "1");
ENDIF
it says
UserKickFile is not a lapper fuction
UserBanFile '' '' '' '' ''
UserAdminFile " " " " "
what i need to do
UserGroupFromFile(
:)
Fire_optikz001
5th September 2009, 16:52
Hi,
Try this.:D
GlobalVar $TeamTag;
$TeamTag = "^0[^4S^0C]"; # Put here a team Tag that you want to check
GlobalVar $TeamTagLenght;
GlobalVar $TeamTagStrip;
$TeamTagLenght = StrLen( $TeamTag );
$NickName = GetCurrentPlayerVar("NickName");
$TeamTagStrip = substr( $NickName,0,$TeamTagLenght );
IF( $TeamTagStrip == $TeamTag )
THEN
do something ( kick or allow )
ENDIF
just what i needed
Dygear
5th September 2009, 17:40
the best thing is the putt all the usernames of the team in the list and then use the kick/ban code.
And you can get a list of team members from the LFSWorld via a query, then ban based on that list. (It would be the most effective way.)
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.