Vice City Multiplayer

VC:MP => mIRC/pawn Scripting => Topic started by: thijn on June 24, 2008, 01:44:22 PM

Title: [RESOLVED]Bad language
Post by: thijn on June 24, 2008, 01:44:22 PM
How can i auto warn someone who says fuck or something else what's not allowed??
can someone help me??
Title: Re: Bad language
Post by: VRocker on June 24, 2008, 02:19:45 PM
Cant give you the exact code without knowing what base script your using... But heres the main part you need:

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
Title: Re: Bad language
Post by: thijn on June 24, 2008, 06:15:57 PM
ok thanks,
what means findtok?
Title: Re: Bad language
Post by: Mattz on June 24, 2008, 06:46:15 PM
Meaning for $findtok from mirc

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

Title: Re: Bad language
Post by: thijn on June 24, 2008, 08:11:39 PM
sorry but it doesn't work.
I'm using GUS, can someone help me??
Title: Re: Bad language
Post by: thijn on June 27, 2008, 03:45:13 PM
plzz can someone help me????
Title: Re: Bad language
Post by: AdTec_224 on June 27, 2008, 05:12:09 PM
UNTESTED!

Find:

on *:SIGNAL:vcmp.text:{

Directly below add:

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:

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
Title: Re: Bad language
Post by: thijn on June 29, 2008, 11:54:18 AM
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:
(http://img362.imageshack.us/img362/6872/screenba1.png)

(http://img300.imageshack.us/img300/4391/screeniefn7.png)
Title: Re: Bad language
Post by: thijn on June 29, 2008, 12: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!
}
Title: Re: [RESOLVED]Bad language
Post by: GTA-Roloboy on June 29, 2008, 03:36:58 PM
Quote  elseif (fuck isin $2) || (*fuck* iswm $2) vcmp.warn $vcmp.getid($left($1,-1)) Server Using bad language
Better...
Title: Re: [RESOLVED]Bad language
Post by: thijn on June 29, 2008, 04:32:54 PM
thanks