[FilterScript] [FS]Language detector
#6

Quote:
Originally Posted by jonrb
Hey.
This is a simple code i thought of (if anybody else has made something similar, i'm sorry) for admins who are tired of people who refuse to speak english.
Please give credit.

Version 1:
http://pastebin.com/f41c0f09b
Code:
// This script was made by [RTA]Dave_Alter AKA jonrb
// please give credit if you use this
#define RED 0xFF0000EE
#include <a_samp>
public OnPlayerText(playerid, text[])
{
if
(
strfind(text, "я", false) != -1 ||	strfind(text, "ю", false) != -1 ||	strfind(text, "э", false) != -1 ||
strfind(text, "ь", false) != -1 ||	strfind(text, "щ", false) != -1 ||	strfind(text, "ы", false) != -1 ||
strfind(text, "ъ", false) != -1 ||	strfind(text, "ш", false) != -1 ||	strfind(text, "ц", false) != -1 ||
strfind(text, "х", false) != -1 ||	strfind(text, "ф", false) != -1 ||	strfind(text, "у", false) != -1 ||
strfind(text, "т", false) != -1 ||	strfind(text, "с", false) != -1 ||	strfind(text, "р", false) != -1 ||
strfind(text, "п", false) != -1 ||	strfind(text, "о", false) != -1 ||	strfind(text, "н", false) != -1 ||
strfind(text, "м", false) != -1 ||	strfind(text, "л", false) != -1 ||	strfind(text, "к", false) != -1 ||
strfind(text, "й", false) != -1 ||	strfind(text, "и", false) != -1 ||	strfind(text, "з", false) != -1 ||
strfind(text, "ж", false) != -1 ||	strfind(text, "е", false) != -1 ||	strfind(text, "д", false) != -1 ||
strfind(text, "г", false) != -1 ||	strfind(text, "в", false) != -1 ||	strfind(text, "б", false) != -1 ||
strfind(text, "а", false) != -1 //here there is space for more symbols
)
{
SendClientMessage(playerid, RED, "Please speak english in the main chat.");
return 0;
}
else
{
return 1;
}
}
Version 2:
http://pastebin.com/f7ce7bba9
Code:
// This script was made by [RTA]Dave_Alter AKA jonrb
// please give credit if you use this
#define RED 0xFF0000EE
#include <a_samp>
new LangWarn[MAX_PLAYERS];
new IsMuted[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
  IsMuted[playerid] = 0;
  return 1;
}

public OnPlayerText(playerid, text[])
{
  if (IsMuted[playerid] == 1)
	{
	SendClientMessage(playerid, RED, "[RTA]AdminBot: You are muted. Stop trying to talk.");
	return 0;
	}
	else
  if
  (
  strfind(text, "я", false) != -1 ||	strfind(text, "ю", false) != -1 ||	strfind(text, "э", false) != -1 ||
  strfind(text, "ь", false) != -1 ||	strfind(text, "щ", false) != -1 ||	strfind(text, "ы", false) != -1 ||
  strfind(text, "ъ", false) != -1 ||	strfind(text, "ш", false) != -1 ||	strfind(text, "ц", false) != -1 ||
  strfind(text, "х", false) != -1 ||	strfind(text, "ф", false) != -1 ||	strfind(text, "у", false) != -1 ||
  strfind(text, "т", false) != -1 ||	strfind(text, "с", false) != -1 ||	strfind(text, "р", false) != -1 ||
  strfind(text, "п", false) != -1 ||	strfind(text, "о", false) != -1 ||	strfind(text, "н", false) != -1 ||
  strfind(text, "м", false) != -1 ||	strfind(text, "л", false) != -1 ||	strfind(text, "к", false) != -1 ||
  strfind(text, "й", false) != -1 ||	strfind(text, "и", false) != -1 ||	strfind(text, "з", false) != -1 ||
  strfind(text, "ж", false) != -1 ||	strfind(text, "е", false) != -1 ||	strfind(text, "д", false) != -1 ||
  strfind(text, "г", false) != -1 ||	strfind(text, "в", false) != -1 ||	strfind(text, "б", false) != -1 ||
  strfind(text, "а", false) != -1 //here there is space for more symbols
  )
  {
   	LangWarn[playerid] += 1;
		new str[256];
		if (LangWarn[playerid] != 4)
		{
		format(str, sizeof(str), "[RTA]AdminBot: Speak English in the main chat please! You have %i chances left!", 4-LangWarn[playerid] );
SendClientMessage(playerid, RED, str);
}
else
{
new string[256], name[256];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "** Player %s has been muted. (Reason: 'Refusing to speak english.')", name);
SendClientMessage(playerid, RED, string);
IsMuted[playerid] = 1;
}
return 0;
}
else
{
return 1;
}
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/unmuteall") == 1)
{
for(new player;player<MAX_PLAYERS;player++)
{
IsMuted[playerid] = 0;
SendClientMessage(playerid, RED, "You have been un-muted!");
}
}
return 1;
}
PS. is this in the right place?
Very Helpful for deferent languadge players!
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)