27.08.2009, 19:34
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; } } 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; } |