Graal Forums  

Go Back   Graal Forums > Graal V6 forums > Announcements
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-21-2009, 11:07 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Smile NPCServer updates: wordFilterText()

This has already been added some months ago but has not been mentioned yet:

wordfiltertext(text, type) - returns integer - filters text with the rules defined in wordfilter/rules.txt, second parameter is the text type (chat, pm, toall or nick), result is a combination of 1 (log) + 2 (tell admins) + 4 (replace) + 8 (warn) + 16 (jail) + 32 (ban); use getWordFilterNewText(), getWordFilterMessage() and getWordFilterMatches() for more information about the filtered text

getwordfiltermatches(int) - returns object - returns an array of words which matched the word filter after calling wordFilterText(), parameter is the maximum number of matches you want

getwordfiltermessage() - returns string - returns the warn message after calling wordFilterText()

getwordfilternewtext() - returns string - returns the new text generated by the word filter after calling wordFilterText()

Usage example:

PHP Code:
temp.filteresult wordFilterText(player.chat"chat");

if ((
temp.filteresult 1)!=0)
  
savelog2("cursinglog.txt"player.account " used rude words: " getWordFilterMatches(3));

if ((
temp.filteresult & (16 32))!=0)
  
player.chat getWordFilterMessage();
else if ((
temp.filteresult 4)!=0)
  
player.chat getWordFilterNewText() 
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:50 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.