gejmer Napisano 5 Grudnia 2019 Witam moze mi ktos pomoc przerobic ten pluginy by dzialal ? #include <sourcemod> #include <sourcecomms> #pragma semicolon 1 #define PLUGIN_VERSION "1.1.0" Handle hcvImmunityFlag, hcvGagTime, hBannedWords; char sConfigImmunityFlag[2]; int iGagTime; public Plugin:myinfo = { name = "SOS: Autogag", author = "root", description = "Automatically gags players insulting others", version = PLUGIN_VERSION, url = "http://uwujka.pl" } public OnPluginStart() { AutoExecConfig(true); hcvImmunityFlag = CreateConVar("sm_sos_autogag_immunity_flag", "b", "Immunity flag - player with this flag won't be gagged (default: b)"); hcvGagTime = CreateConVar("sm_sos_autogag_gag_time", "240", "Gag time in minutes (default: 240)"); AddCommandListener(Command_Say, "say"); AddCommandListener(Command_Say, "say_team"); } public OnMapStart() { GetConVarString(hcvImmunityFlag, sConfigImmunityFlag, sizeof(sConfigImmunityFlag)); iGagTime = GetConVarInt(hcvGagTime); hBannedWords = CreateArray(32); char sPath[PLATFORM_MAX_PATH]; char sLine[32]; BuildPath(Path_SM, sPath, PLATFORM_MAX_PATH, "configs/sos_autogag.txt"); Handle hLinkList = OpenFile(sPath, "r"); while(ReadFileLine(hLinkList, sLine, sizeof(sLine))) { TrimString(sLine); PushArrayString(hBannedWords, sLine); } CloseHandle(hLinkList); } public Action Command_Say(int client, const char[] command, int argc) { char text[256]; GetCmdArgString(text, sizeof(text)); TrimString(text); StripQuotes(text); char sBannedWord[32]; bool bShouldBeGagged = false; int iBannedWordsArraySize = GetArraySize(hBannedWords); for(int x = 0; x < iBannedWordsArraySize; x++) { GetArrayString(hBannedWords, x, sBannedWord, sizeof(sBannedWord)); if(StrContains(text, sBannedWord, false) != -1) { int flags = GetUserFlagBits(client); if(!(flags & ReadFlagString(sConfigImmunityFlag)))//exclude players with flag set in config { bShouldBeGagged = true;//we don't want multiple gags if player uses more than one banned word } } } if(bShouldBeGagged) { if(SourceComms_GetClientGagType(client) == bNot)//if player is already gagged, we do nothing { char reason[256]; Format(reason, sizeof(reason), "[SOS] Insulting players (code 0413): %s", text); SourceComms_SetClientGag(client, true, iGagTime, true, reason); PrintToChat(client, "\x01 \x04Takie słownictwo jest u nas \x02ZABRONIONE!"); PrintToChat(client, "\x01 \x04Zablokowaliśmy Tobie możliwość pisania na \x02%i minut.", iGagTime); } return Plugin_Handled; } else { return Plugin_Continue; } } Udostępnij tę odpowiedź Odnośnik do odpowiedzi Udostępnij na innych stronach
Sqower Napisano 5 Grudnia 2019 Moja kula wróży ale nie wie co nie działa :c Udostępnij tę odpowiedź Odnośnik do odpowiedzi Udostępnij na innych stronach
VestSmart Napisano 5 Grudnia 2019 7 minut temu, gejmer napisał: Witam moze mi ktos pomoc przerobic ten pluginy by dzialal ? #include <sourcemod> #include <sourcecomms> #pragma semicolon 1 #define PLUGIN_VERSION "1.1.0" Handle hcvImmunityFlag, hcvGagTime, hBannedWords; char sConfigImmunityFlag[2]; int iGagTime; public Plugin:myinfo = { name = "SOS: Autogag", author = "root", description = "Automatically gags players insulting others", version = PLUGIN_VERSION, url = "http://uwujka.pl" } public OnPluginStart() { AutoExecConfig(true); hcvImmunityFlag = CreateConVar("sm_sos_autogag_immunity_flag", "b", "Immunity flag - player with this flag won't be gagged (default: b)"); hcvGagTime = CreateConVar("sm_sos_autogag_gag_time", "240", "Gag time in minutes (default: 240)"); AddCommandListener(Command_Say, "say"); AddCommandListener(Command_Say, "say_team"); } public OnMapStart() { GetConVarString(hcvImmunityFlag, sConfigImmunityFlag, sizeof(sConfigImmunityFlag)); iGagTime = GetConVarInt(hcvGagTime); hBannedWords = CreateArray(32); char sPath[PLATFORM_MAX_PATH]; char sLine[32]; BuildPath(Path_SM, sPath, PLATFORM_MAX_PATH, "configs/sos_autogag.txt"); Handle hLinkList = OpenFile(sPath, "r"); while(ReadFileLine(hLinkList, sLine, sizeof(sLine))) { TrimString(sLine); PushArrayString(hBannedWords, sLine); } CloseHandle(hLinkList); } public Action Command_Say(int client, const char[] command, int argc) { char text[256]; GetCmdArgString(text, sizeof(text)); TrimString(text); StripQuotes(text); char sBannedWord[32]; bool bShouldBeGagged = false; int iBannedWordsArraySize = GetArraySize(hBannedWords); for(int x = 0; x < iBannedWordsArraySize; x++) { GetArrayString(hBannedWords, x, sBannedWord, sizeof(sBannedWord)); if(StrContains(text, sBannedWord, false) != -1) { int flags = GetUserFlagBits(client); if(!(flags & ReadFlagString(sConfigImmunityFlag)))//exclude players with flag set in config { bShouldBeGagged = true;//we don't want multiple gags if player uses more than one banned word } } } if(bShouldBeGagged) { if(SourceComms_GetClientGagType(client) == bNot)//if player is already gagged, we do nothing { char reason[256]; Format(reason, sizeof(reason), "[SOS] Insulting players (code 0413): %s", text); SourceComms_SetClientGag(client, true, iGagTime, true, reason); PrintToChat(client, "\x01 \x04Takie słownictwo jest u nas \x02ZABRONIONE!"); PrintToChat(client, "\x01 \x04Zablokowaliśmy Tobie możliwość pisania na \x02%i minut.", iGagTime); } return Plugin_Handled; } else { return Plugin_Continue; } } Przecież ten plugin działa xdd I podaj errorlogi XD Udostępnij tę odpowiedź Odnośnik do odpowiedzi Udostępnij na innych stronach
fruzak Napisano 5 Grudnia 2019 Plugin wymaga zainstalowanego na serwerze SourceCommsHej! Skorzystałeś z linku lub pobrałeś załącznik? Uhonoruj naszą pracę poprzez rejestrację na forum i rośnij razem z nami!. Udostępnij tę odpowiedź Odnośnik do odpowiedzi Udostępnij na innych stronach
gejmer 1 Napisano 6 Grudnia 2019 Tak ale czy da rade ktos zmienic by wymagalo tylko sourcebans? Jestem w tym zielony Udostępnij tę odpowiedź Odnośnik do odpowiedzi Udostępnij na innych stronach
Paweł Napisano 1 Lipca 2020 Wiadomość wygenerowana automatycznie ✔ Problem został rozwiązany Jeżeli się z tym nie zgadzasz, raportuj ten post Udostępnij tę odpowiedź Odnośnik do odpowiedzi Udostępnij na innych stronach