Author Topic: [RESOLVED]Bad language  (Read 5082 times)

0 Members and 1 Guest are viewing this topic.

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
[RESOLVED]Bad language
« on: June 24, 2008, 02:44:22 pm »
How can i auto warn someone who says fuck or something else what's not allowed??
can someone help me??
« Last Edit: June 29, 2008, 01:06:46 pm by thijn »

Offline VRocker

  • LU Developer
  • Wiseguy
  • *
  • Posts: 63
    • View Profile
    • Liberty Unleashed - GTA3 Multiplayer Mod
Re: Bad language
« Reply #1 on: June 24, 2008, 03:19:45 pm »
Cant give you the exact code without knowing what base script your using... But heres the main part you need:

Code: [Select]
if ( $findtok( fuck shit bastard, $2-, 1, 32 ) ; Warn User
$2- would be the whatever the player said. In my scripts it would be $3- under vcmp.chat.
Sorry i cant give you the code for the other scripts, havn't got access to their signals/parameters right now (Somebody wanna grab them for me? :))

More words can be added by seperating each 'bad word' with a space
« Last Edit: June 24, 2008, 03:22:05 pm by VRocker »


Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: Bad language
« Reply #2 on: June 24, 2008, 07:15:57 pm »
ok thanks,
what means findtok?

Offline Mattz

  • VC:MP Lead Tester
  • Made Man
  • *
  • Posts: 192
  • BK-201
    • View Profile
Re: Bad language
« Reply #3 on: June 24, 2008, 07:46:15 pm »
Meaning for $findtok from mirc

Code: [Select]
$findtok(text,token,N,C)

Returns the position of the Nth matching token in text.

 

$findtok(a.b.c.d,c,1,46)        returns 3

$findtok(a.b.c.d,e,1,46)        returns $null

 

If you specify zero for N, it returns the total number of matching tokens.

 

Note: $findtokcs() is the case-sensitive version.


Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: Bad language
« Reply #4 on: June 24, 2008, 09:11:39 pm »
sorry but it doesn't work.
I'm using GUS, can someone help me??

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: Bad language
« Reply #5 on: June 27, 2008, 04:45:13 pm »
plzz can someone help me????

Offline AdTec_224

  • Administrator
  • Street Thug
  • *****
  • Posts: 30
    • View Profile
Re: Bad language
« Reply #6 on: June 27, 2008, 06:12:09 pm »
UNTESTED!

Find:

Code: [Select]
on *:SIGNAL:vcmp.text:{
Directly below add:

Code: [Select]
if ($findtok(fuck shit bastard,$2-,1,32)) vcmp.warn $vcmp.getid(%name) Autowarn Using bad language
Or create a new blank script file and add:

Code: [Select]
on *:SIGNAL:vcmp.text:{
  var %name = $left($1,-1)
  if ($findtok(fuck shit bastard,$2-,1,32)) vcmp.warn $vcmp.getid(%name) Autowarn Using bad language
}

Hope that helps

-AdTec_224

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: Bad language
« Reply #7 on: June 29, 2008, 12:54:18 pm »
it helped a lot, but i have only one problem: If i say only "fuck" it warn, when i say "fack u" it doesn't warn??
Screen:



Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: Bad language
« Reply #8 on: June 29, 2008, 01:05:31 pm »
i've done it myself:
Quote
on *:SIGNAL:vcmp.text:{
if ($findtok(fuck shit bastard,$2-,1,32)) vcmp.warn $vcmp.getid(%name) Autowarn Using bad language
  var %name = $left($1,-1)

  vcmp.check.timer %name
  vcmp.check.spam %name

  echo -a 14 $+ %name $+ : $2- $+ 

  if ($2 == brb) vcmp.say %name will Be Right Back! Reason: $iif($3-,$v1,None)
  elseif ($2 == bbs) vcmp.say %name will Be Back Soon! Reason: $iif($3-,$v1,None)
  elseif ($2 == bbl) vcmp.say %name will Be Back Later! Reason: $iif($3-,$v1,None)
  elseif ($2 == fuck) vcmp.warn $vcmp.getid(%name) Server Using bad language
  elseif (($2 == back) && ($3- == $null)) vcmp.say %name is Back!
}

Offline GTA-Roloboy

  • Made Man
  • ***
  • Posts: 135
    • View Profile
Re: [RESOLVED]Bad language
« Reply #9 on: June 29, 2008, 04:36:58 pm »
Quote
  elseif (fuck isin $2) || (*fuck* iswm $2) vcmp.warn $vcmp.getid($left($1,-1)) Server Using bad language
Better...

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: [RESOLVED]Bad language
« Reply #10 on: June 29, 2008, 05:32:54 pm »
thanks