Raised This Month: $51 Target: $400
 12% 

Solved Say Yes and NO


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lantimilan
Senior Member
Join Date: May 2016
Old 05-05-2020 , 02:32   Say Yes and NO
Reply With Quote #1

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[], lenwhat[], with[])
{
    new 
pos;
    if ((
pos contain(stringwhat)) == -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 poswhatwith))
    {
        
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(ver63"%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"512enabledenabled);
    
register_clcmd("say""stop_say", -1572, -1);
    
register_clcmd("say !saypo""lshoy"64572, -1);
    
register_clcmd("say !sayjo""ndaloy"64572, -1);
    return 
0;
}

public 
stop_say(id)
{
    if (
get_pcvar_num(enabled))
    {
        return 
2;
    }
    return 
0;
}

chat_color(idinput[])
{
    new 
count 1;
    new 
players[32];
    static 
msg[191];
    
vformat(msg190input"");
    
replace_all(msg190"!g"1492);
    
replace_all(msg190"!y"1512);
    
replace_all(msg190"!t"1532);
    
replace_all(msg190"!team2"1568);
    if (
id)
    {
        
players[0] = id;
    }
    else
    {
        
get_players(playerscount"ch"1588);
    }
    new 
i;
    while (
count)
    {
        if (
is_user_connected(players[i]))
        {
            
message_begin(8get_user_msgid("SayText"), 1624players[i]);
            
write_byte(players[i]);
            
write_string(msg);
            
message_end();
        }
        
i++;
    }
    return 
0;
}

public 
lshoy(id)
{
    if (
get_user_flags(idenabled) & 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(idenabled) & 64)
    {
        
server_cmd("amx_cvar sc_say 1");
    }
    
chat_color(id"%L", -1"SC_CW_SAYPO");
    return 
0;


Last edited by lantimilan; 05-06-2020 at 05:37.
lantimilan is offline
Send a message via MSN to lantimilan
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-05-2020 , 07:14   Re: Say Yes and NO
Reply With Quote #2

Code:
#include <amxmodx> #include <cromchat> new g_pSayEnabled public plugin_init() {     register_plugin("Say enable/disable", "1.0", "OciXCrom")     register_clcmd("say", "OnSay")     register_clcmd("say_team", "OnSay")     g_pSayEnabled = register_cvar("say_enabled", "1") } public OnSay(id) {     if(!get_pcvar_num(g_pSayEnabled))     {         CC_SendMessage(id, "&x07Chat is currently disabled.")         return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE }
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
lantimilan
Senior Member
Join Date: May 2016
Old 05-05-2020 , 11:46   Re: Say Yes and NO
Reply With Quote #3

Thanks bro ;)
lantimilan is offline
Send a message via MSN to lantimilan
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 05-05-2020 , 12:53   Re: Say Yes and NO
Reply With Quote #4

OciXCrom, would you be willing to craft this into simple no cvar gag please? Thank you.
Approved gag has too many CVARS for my likens.

https://forums.alliedmods.net/showthread.php?p=3873

Quote:
Originally Posted by OciXCrom View Post
Code:
#include <amxmodx> #include <cromchat> new g_pSayEnabled public plugin_init() {     register_plugin("Say enable/disable", "1.0", "OciXCrom")     register_clcmd("say", "OnSay")     register_clcmd("say_team", "OnSay")     g_pSayEnabled = register_cvar("say_enabled", "1") } public OnSay(id) {     if(!get_pcvar_num(g_pSayEnabled))     {         CC_SendMessage(id, "&x07Chat is currently disabled.")         return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE }
__________________
DJEarthQuake is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode