The online racing simulator
[Solved] LFS LAPPER No swearing
I do not know much English, so I apologize.Shrug
I do not want to see the curse of the player writing.
How can I do it with the lapper.Frown
** Best answer **
That's already implemented in the main LFSLapper.lpr script.

<?php 
##################
#Swearword filter#
##################
#Specify a list of swearwords seperated by ,
#Specify a file with swearwords, one word per line
#-------------------------------------------------------------------

#$SwearWordsList = "****,asholes,bastard,idiot";
$SwearWordsList "&./swearwords.txt";
$SwearWordsMax 2# Maximum number of allowed swearwords per session

Event OnSwearWords1$userName # Player event
    
privMsglangEngine"%{main_swear11}%" ) );
    
privMsglangEngine"%{main_swear12}%"GetCurrentPlayerVar("SwearWordsRem") ) );
EndEvent

Event OnSwearWords2
$userName )  # Player event
    
privMsglangEngine"%{main_swear21}%" ) );
    
cmdLFS"/spec " GetCurrentPlayerVar("NickName") );
EndEvent
?>


put your swear words in swearwords.txt and you are good to go.

Just not sure why the default code is set to spectate a player, that doesn't make much sense. You probably want to kick a player, that would look something like this:

<?php 
$SwearWordsList 
"&./swearwords.txt";
$SwearWordsMax 2# Maximum number of allowed swearwords per session

Event OnSwearWords1$userName # Player event
    
privMsglangEngine"%{main_swear11}%" ) );
    
privMsg"You will be kicked in ^2" GetCurrentPlayerVar("SwearWordsRem") . "^1 more attempt(s)" );
EndEvent

Event OnSwearWords2
$userName )  # Player event
    
privMsg"Too many swearwords, kicked" );
    
cmdLFS"/kick " GetCurrentPlayerVar("UserName") );
EndEvent
?>


This thread is closed

FGED GREDG RDFGDR GSFDG