[FilterScript] [FS]Language detector
#14

Quote:
Originally Posted by JoeBullet
You could use like this:
Code:
code
This indeed will be slower because it loops thru whole string, but you can't filter milons and milons different special letters in thousands and thousands different languages
btw. strfind loops thru string anyway...
So using a question mark, exclamation mark etc counts as foreign language now?

I would use...

Code:
public OnPlayerText(playerid, text[])
{
  new i;
  while(text[i])
  {
    if(191 <= text[i] <= 255)
    {
      SendClientMessage(playerid, 0xFF0000EE, "Please speak english in the main chat.");
      return 0;
    }
    i++;
  }
  return 1;
}
Chances are it misses out some symbols, but thats better than nothing.
Reply


Messages In This Thread
[FS]Language detector - by jonrb - 27.08.2009, 14:33
Re: [FS]Language detector - by saiberfun - 27.08.2009, 17:33
Re: [FS]Language detector - by jonrb - 27.08.2009, 17:47
Re: [FS]Language detector - by .::: Ecko :::. - 27.08.2009, 18:05
Re: [FS]Language detector - by MenaceX^ - 27.08.2009, 18:54
Re: [FS]Language detector - by SanMarinoRP - 27.08.2009, 19:34
Re: [FS]Language detector - by _Vortex - 27.08.2009, 23:14
Re: [FS]Language detector - by jonrb - 28.08.2009, 23:53
Re: [FS]Language detector - by DMSOrg - 29.08.2009, 00:17
Re: [FS]Language detector - by FreshKilla - 29.08.2009, 21:35
Re: [FS]Language detector - by Abernethy - 30.08.2009, 01:41
Re: [FS]Language detector - by yezizhu - 30.08.2009, 11:32
Re: [FS]Language detector - by Google63 - 30.08.2009, 11:43
Re: [FS]Language detector - by kc - 30.08.2009, 11:52
Re: [FS]Language detector - by Tannz0rz - 30.08.2009, 12:29
Re: [FS]Language detector - by Infamous - 30.08.2009, 13:15
Re: [FS]Language detector - by Google63 - 30.08.2009, 13:28
Re: [FS]Language detector - by jonrb - 12.09.2009, 12:11
Re: [FS]Language detector - by agusfn20 - 12.09.2009, 13:57
Re: [FS]Language detector - by jonrb - 21.10.2009, 17:40
Re: [FS]Language detector - by agusfn20 - 22.10.2009, 19:38
Re: [FS]Language detector - by Damn Right M.I.A! - 22.10.2009, 19:44
Re: [FS]Language detector - by Tannz0rz - 24.10.2009, 00:16
Re: [FS]Language detector - by Kalroz - 28.07.2012, 04:42
AW: [FS]Language detector - by Pablo Borsellino - 28.07.2012, 12:33
Re: [FS]Language detector - by JaKe Elite - 25.12.2012, 23:38

Forum Jump:


Users browsing this thread: 1 Guest(s)