Hello!
I have a problem.
In this line
PHP Code:
SourceComms_SetClientGag(id, true, 120, true, "[GD] Insulting players (%s)", szBuffer[idx]);
I receive an error when I will add
szBuffer[idx]
PHP Code:
error 092:number of arguments does not match definition
How can I increase the number of arguments so that I can add more than once
szBuffer[idx]??
More code:
PHP Code:
public Action:ChatEvent(id, args)
{
if(!(0 < id <=MaxClients))
return Plugin_Continue;
if(!IsClientInGame(id))
return Plugin_Continue;
if(SourceComms_GetClientGagType(id) != bNot)
return Plugin_Continue;
decl String:szBuffer[191];
GetCmdArgString(szBuffer, sizeof(szBuffer));
new idx = 0;
if (szBuffer[0] == '"'){
idx = 1;
new len = strlen(szBuffer);
if (szBuffer[len-1] == '"'){
szBuffer[len-1] = '\0';
}
}
new i = 0;
new bool:found = false;
while (i < g_ilosblokslowk)
{
if (StrContains(szBuffer[idx], g_blokslowka[i], false) != -1 && StrContains(szBuffer[idx], "xxx", false) == -1)
{
found = true;
LogToFile("Warnings.log", "[Bad words] %N used the forbidden word %s", id, szBuffer[idx]);
}
i++;
}
if(found)
{
if(ilosc_ostrzezen[id] >= 3)
{
CPrintToChat(id, "★ {darkred}[GD] {lightgreen}You get {darkred}3 {lightgreen}warnings i GAG on {darkred}120 {lightgreen}minutes.");
SourceComms_SetClientGag(id, true, 120, true, "[GD] Insulting players (%s)", szBuffer[idx]);
}
else
{
ilosc_ostrzezen[id]++;
CPrintToChat(id, "★ {darkred}[GD] {lightgreen}One of the words is prohibited on this server! You get a warning {darkred}[%d/3]", ilosc_ostrzezen[id]);
found = true;
if(ilosc_ostrzezen[id] >= 3)
{
CPrintToChat(id, "★ {darkred}[GD] {lightgreen}You get {darkred}3 {lightgreen}warnings i GAG on {darkred}120 {lightgreen}minutes.");
SourceComms_SetClientGag(id, true, 120, true, "[GD] Insulting players (%s)", szBuffer[idx]);
}
}
return Plugin_Handled;
}
return Plugin_Continue;
}
Regards.