Hello its possible to enable /disable say i find one plugin just .amxx i decompiler oneline i see but code is wrong
PHP Code:
new enabled;
replace_all(string[], len, what[], with[])
{
new pos;
if ((pos = contain(string, what)) == -1)
{
return 0;
}
new total;
new with_len = strlen(with);
new diff = strlen(what) - with_len;
new total_len = strlen(string);
new temp_pos;
while (replace(string[pos], len - pos, what, with))
{
pos = with_len + pos;
total_len -= diff;
if (!(pos >= total_len))
{
temp_pos = contain(string[pos], what);
if (!(temp_pos == -1))
{
pos = temp_pos + pos;
total++;
}
return total;
}
return total;
}
return total;
}
public plugin_init()
{
register_plugin("Say CW by ScrappeR skype: elbasan.f", "1.0", "ScrappeR");
new ver[64];
format(ver, 63, "%s v%s", "Say CW by ScrappeR skype: elbasan.f", "1.0");
register_cvar("sc_cw_say", ver, "Say CW by ScrappeR skype: elbasan.f", enabled);
register_dictionary("sc_cw_say.txt");
enabled = register_cvar("sc_say", 512, enabled, enabled);
register_clcmd("say", "stop_say", -1, 572, -1);
register_clcmd("say !saypo", "lshoy", 64, 572, -1);
register_clcmd("say !sayjo", "ndaloy", 64, 572, -1);
return 0;
}
public stop_say(id)
{
if (get_pcvar_num(enabled))
{
return 2;
}
return 0;
}
chat_color(id, input[])
{
new count = 1;
new players[32];
static msg[191];
vformat(msg, 190, input, "");
replace_all(msg, 190, "!g", 1492);
replace_all(msg, 190, "!y", 1512);
replace_all(msg, 190, "!t", 1532);
replace_all(msg, 190, "!team2", 1568);
if (id)
{
players[0] = id;
}
else
{
get_players(players, count, "ch", 1588);
}
new i;
while (i < count)
{
if (is_user_connected(players[i]))
{
message_begin(8, get_user_msgid("SayText"), 1624, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
i++;
}
return 0;
}
public lshoy(id)
{
if (get_user_flags(id, enabled) & 64)
{
server_cmd("amx_cvar sc_say 0");
}
chat_color(id, "%L", -1, "SC_CW_SAYJO");
return 0;
}
public ndaloy(id)
{
if (get_user_flags(id, enabled) & 64)
{
server_cmd("amx_cvar sc_say 1");
}
chat_color(id, "%L", -1, "SC_CW_SAYPO");
return 0;
}