The online racing simulator
possible to disallow a whole team from server?

<?php 
    
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
^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.
Quote from Fire_optikz001 :

<?php 
    
IF( $Nickname == "^0[^4S^0C]" )
    
THEN
        cmdLFS
"/kick " $userNtame );
    ENDIF
?>


Quote from Mikjen :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.
the best thing is the putt all the usernames of the team in the list and then use the kick/ban code.
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
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

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.

<?php 
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).

<?php 
$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..

<?php 
$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#
Quote from Fire_optikz001 :

<?php 
    
IF( $Nickname == "^0[^4S^0C]" )
    
THEN
        cmdLFS
"/kick " $userNtame );
    ENDIF
?>


Hi,
Try this.


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

Quote from Simpson :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.

<?php 
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).

<?php 
$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..

<?php 
$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
Quote from Bass-Driver :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(

Quote from Tim NL :Hi,
Try this.


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
-
(Bass-Driver) DELETED by Bass-Driver
Quote from Bass-Driver :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.)

FGED GREDG RDFGDR GSFDG