ayudaaaaaaaa plisss
#1
no puedo arreglar zorry vuelvo abrir
e
Responder
#2
solucionadooo
Responder
#3
Prueba y me avisas
Código PHP:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#pragma semicolon 1
#define SZPREFIX "!g[fahs]"

const OFFSET_CSMENUCODE 205;
const 
OFFSET_MENU_OFFSET 5;

enum _:MUTE_STRUCT
{
    
MICROPHONE,
    
CHAT,
    
GAGGED
};

enum _:GAG_STRUCT
{
    
PLAYER,
    
TARGET,
    
TIME
};

new const 
TITTLE_MENUES[][] = { "MICROFONO""CHAT""TODO \d[GAG]" };

new 
g_mute[33][MUTE_STRUCT][33];
new 
g_gag[33][GAG_STRUCT];
new 
g_page[33];
new 
g_maxplayers[1 char];
new 
g_msgsaytext;

public 
plugin_init()
{
    
register_plugin("Mute Menú""1.0""Cristian'");
    
    
register_clcmd("say""clcmd_say");
    
register_clcmd("say_team""clcmd_say");
    
register_clcmd("say /mute""clcmd_mute");
    
register_clcmd("say_team /mute""clcmd_mute");
    
register_clcmd("AMORDAZAR_TIEMPO""clcmd_gag");
    
    
register_forward(FM_Voice_SetClientListening"fw_Voice_SetClientListening");
    
    
g_msgsaytext get_user_msgid("SayText");
    
register_message(g_msgsaytext"message_saytext");
    
    
g_maxplayers{0} = get_maxplayers();
    
    
set_task(120.0"print_message"0__"b");
}

public 
print_message()
    
chat_color(0"%s !yPon !g/mute!"SZPREFIX);
    
public 
clcmd_say(id)
{
    if (
g_gag[id][PLAYER])
    {
        
chat_color(id"%s !yEstas Muteado"SZPREFIX);
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;
}
    
public 
clcmd_mute(id)
{
    static 
menu;
    
menu menu_create("\r[fans] \y Menu""handled_clcmd_mute");
    
    
menu_additem(menu"Microfono""1"0);
    
menu_additem(menu"Chat""2"0);
    
    if (
is_user_admin(id))
        
menu_additem(menu"ADMIN MENU""3"0);
    
    
menu_display(idmenu);
    return 
PLUGIN_HANDLED;
}

public 
handled_clcmd_mute(idmenuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return;
    }
    
    
g_page[id] = item;
    
show_menu_players(id);
    
    
menu_destroy(menu);
}

public 
show_menu_players(id)
{
    static 
menuisztext[128], num[7], name[32];
    
format(sztextcharsmax(sztext), "\ySILENCIAR %s"TITTLE_MENUES[g_page[id]]);
    
menu menu_create(sztext"handled_show_players");
    
    switch(
g_page[id])
    {
        case 
MICROPHONE:
        {
            for (
1<= g_maxplayers{0}; i++)
            {
                if (!
is_user_connected(i))
                    continue;
                
                if (
== id)
                    continue;
                
                if (
get_user_flags(i) & ADMIN_IMMUNITY)
                    continue;
                
                
num_to_str(inumcharsmax(num));
                
get_user_name(inamecharsmax(name));
                
format(sztextcharsmax(sztext), "%s%s %s", (g_mute[id][MICROPHONE][i]) ? "\d" "\w"name, (g_mute[id][MICROPHONE][i]) ? "\y[SILENCIADO]" "");
                
menu_additem(menusztextnum);
            }
        }
        case 
CHAT:
        {
            for (
1<= g_maxplayers{0}; i++)
            {
                if (!
is_user_connected(i))
                    continue;
                
                if (
== id)
                    continue;
                
                if (
get_user_flags(i) & ADMIN_SLAY)
                    continue;
                
                
num_to_str(inumcharsmax(num));
                
get_user_name(inamecharsmax(name));
                
format(sztextcharsmax(sztext), "%s%s %s", (g_mute[id][CHAT][i]) ? "\d" "\w"name, (g_mute[id][CHAT][i]) ? "\y[SILENCIADO]" "");
                
menu_additem(menusztextnum);
            }
        }
        case 
GAGGED:
        {
            if (!
is_user_admin(id))
            {
                
menu_destroy(menu);
                return;
            }
            
            for (
1<= g_maxplayers{0}; i++)
            {
                if (!
is_user_connected(i))
                    continue;
                
                if (
== id)
                    continue;
                
                if (
get_user_flags(i) & ADMIN_RCON)
                    continue;
                
                
num_to_str(inumcharsmax(num));
                
get_user_name(inamecharsmax(name));
                
format(sztextcharsmax(sztext), "%s%s %s", (g_gag[i][PLAYER]) ? "\d" "\w"name, (g_gag[i][PLAYER]) ? "[MUTEADO]" "");
                
menu_additem(menusztextnum);
            }
        }
    }
    
    
menu_setprop(menuMPROP_BACKNAME"ATRAS");
    
menu_setprop(menuMPROP_NEXTNAME"SIGUIENTE");
    
menu_setprop(menuMPROP_EXITNAME"VOLVER");
    
    
set_pdata_int(idOFFSET_CSMENUCODEfalseOFFSET_MENU_OFFSET);
    
    
menu_display(idmenu);
}

public 
handled_show_players(idmenuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        
clcmd_mute(id);
        return;
    }
    
    static 
targetnum[7], callbackdataname[32];
    
menu_item_getinfo(menuitemdatanumcharsmax(num), __callback);
    
    
target str_to_num(num);
    
    if (
is_user_connected(target))
    {
        switch(
g_page[id])
        {
            case 
MICROPHONE:
            {
                
g_mute[id][MICROPHONE][target] = !(g_mute[id][MICROPHONE][target]);
                
                
get_user_name(targetnamecharsmax(name));
                
chat_color(id"%s !yLe %s el microfono a !g%s!y."SZPREFIX, (g_mute[id][MICROPHONE][target]) ? "deshabilitaste" "habilitaste"name);
            }
            case 
CHAT:
            {
                
g_mute[id][CHAT][target] = !(g_mute[id][CHAT][target]);
                
                
get_user_name(targetnamecharsmax(name));
                
chat_color(id"%s !yLe %s el chat a !g%s!y."SZPREFIX, (g_mute[id][CHAT][target]) ? "deshabilitaste" "habilitaste"name);
            }
            case 
GAGGED
            {
                if (!
is_user_admin(id))
                {
                    
menu_destroy(menu);
                    return;
                }
                
                if (
g_gag[target][PLAYER])
                {
                    static 
name[32], name2[32];
                    
get_user_name(idnamecharsmax(name));
                    
get_user_name(targetname2charsmax(name2));
                    
                    
chat_color(0"%s !g%s!y Desmuteo A !g%s!y."SZPREFIXnamename2);
                    
g_gag[target][PLAYER] = false;
                    return;
                }
                
                
g_gag[id][TARGET] = target;
                
client_cmd(id"messagemode ^"AMORDAZAR_TIEMPO^"");
            }
        }
    }
    else
        
chat_color(id"%s !yEl se desconecto del servidor."SZPREFIX);
    
    
menu_destroy(menu);
    
show_menu_players(id);
}

public 
clcmd_gag(id)
{
    if (!
g_gag[id][TARGET])
        return;
    
    static 
text[12], name[32], name2[32];
    
read_args(textcharsmax(text));
    
remove_quotes(text);
    
trim(text);
    
    if (!
isdigit(text[0]))
    {
        
chat_color(id"%s !ySolo numeros."SZPREFIX);
        return;
    }
    
    if (!
strlen(text) || strlen(text) < 1)
    {
        
chat_color(id"%s !y 0."SZPREFIX);
        return;
    }
    
    
get_user_name(idnamecharsmax(name));
    
get_user_name(g_gag[id][TARGET], name2charsmax(name2));
    
    
g_gag[id][TIME] = str_to_num(text);
    
g_gag[g_gag[id][TARGET]][PLAYER] = true;
    
    
chat_color(0"%s !g!g%s!y fue Muteado  !g%d %s!y."SZPREFIXname2,
    
g_gag[id][TIME], (g_gag[id][TIME] > 1) ? "minutos" "minuto");
    
    
set_task(float(g_gag[id][TIME]) * 60.0"task_player_gag"g_gag[id][TARGET]);
}

public 
task_player_gag(id)
{
    static 
name[32];
    
get_user_name(idnamecharsmax(name));
    
    
g_gag[id][PLAYER] = false;
    
chat_color(0"%s !yEl jugador !g%s!y ya puede volver."SZPREFIXname);
}

public 
fw_Voice_SetClientListening(receiversenderlisten)
{
    if (
receiver == sender)
        return 
FMRES_IGNORED;
    
    if (
g_mute[receiver][MICROPHONE][sender] || g_gag[sender][PLAYER])
    {
        
engfunc(EngFunc_SetClientListeningreceiversenderfalse);
        return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;
}

public 
message_saytext(msgiddestid)
{
    if (
g_mute[id][CHAT][get_msg_arg_int(1)])
        return 
PLUGIN_HANDLED;
    
    return 
PLUGIN_CONTINUE;
}

stock chat_color(id, const input[], any:...)
{
    static 
message[191];
    
vformat(message190input3);
    
    
replace_all(message190"!g""^4");
    
replace_all(message190"!t""^3");
    
replace_all(message190"!y""^1");
    
    
message_begin((id) ? MSG_ONE_UNRELIABLE MSG_BROADCASTget_user_msgid("SayText"), .player id);
    
write_byte((id) ? id 33);
    
write_string(message);
    
message_end();

Corazón I dream of someday being able to have your near. Corazón
[Imagen: 76561199006140497.png]
Responder
#4
gracias por tu ayuda amigo pero creo que no sabes pero igual gracias
Responder
#5
(01/12/2019, 12:23 PM)venzuela6969 escribió: gracias por tu ayuda amigo pero creo que no sabes pero igual gracias

Prueba ahora y me avisas
Código PHP:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#pragma semicolon 1
#define SZPREFIX "!g[fahs]"

const OFFSET_CSMENUCODE 205;
const 
OFFSET_MENU_OFFSET 5;

enum _:MUTE_STRUCT
{
    
MICROPHONE,
    
CHAT,
    
GAGGED
};

enum _:GAG_STRUCT
{
    
PLAYER,
    
TARGET,
    
TIME
};

new const 
TITTLE_MENUES[][] = { "MICROFONO""CHAT""TODO \d[GAG]" };

new 
g_mute[33][MUTE_STRUCT][33];
new 
g_gag[33][GAG_STRUCT];
new 
g_page[33];
new 
g_maxplayers[1 char];
new 
g_msgsaytext;

public 
plugin_init()
{
    
register_plugin("Mute Menú""1.0""Cristian'");
    
    
register_clcmd("say""clcmd_say");
    
register_clcmd("say_team""clcmd_say");
    
register_clcmd("say /mute""clcmd_mute");
    
register_clcmd("say_team /mute""clcmd_mute");
    
register_clcmd("AMORDAZAR_TIEMPO""clcmd_gag");
    
    
register_forward(FM_Voice_SetClientListening"fw_Voice_SetClientListening");
    
    
g_msgsaytext get_user_msgid("SayText");
    
register_message(g_msgsaytext"message_saytext");
    
    
g_maxplayers{0} = get_maxplayers();
    
    
set_task(120.0"print_message"0__"b");
}

public 
print_message()
    
chat_color(0"%s !yPon !g/mute!"SZPREFIX);
    
public 
clcmd_say(id)
{
    if (
g_gag[id][PLAYER])
    {
        
chat_color(id"%s !yEstas Muteado"SZPREFIX);
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;
}
    
public 
clcmd_mute(id)
{
    static 
menu;
    
menu menu_create("\r[fans] \y Menu""handled_clcmd_mute");
    
    
menu_additem(menu"Microfono""1"0);
    
menu_additem(menu"Chat""2"0);
    
    if (
is_user_admin(id))
        
menu_additem(menu"ADMIN MENU""3"0);
    
    
menu_display(idmenu);
    return 
PLUGIN_HANDLED;
}

public 
handled_clcmd_mute(idmenuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return;
    }
    
    
g_page[id] = item;
    
show_menu_players(id);
    
    
menu_destroy(menu);
}

public 
show_menu_players(id)
{
    static 
menuisztext[128], num[7], name[32];
    
format(sztextcharsmax(sztext), "\ySILENCIAR %s"TITTLE_MENUES[g_page[id]]);
    
menu menu_create(sztext"handled_show_players");
    
    switch(
g_page[id])
    {
        case 
MICROPHONE:
        {
            for (
1<= g_maxplayers{0}; i++)
            {
                if (!
is_user_connected(i))
                    continue;
                
                if (
== id)
                    continue;
                
                if (
get_user_flags(i) & ADMIN_SLAY)
                    continue;
                
                
num_to_str(inumcharsmax(num));
                
get_user_name(inamecharsmax(name));
                
format(sztextcharsmax(sztext), "%s%s %s", (g_mute[id][MICROPHONE][i]) ? "\d" "\w"name, (g_mute[id][MICROPHONE][i]) ? "\y[SILENCIADO]" "");
                
menu_additem(menusztextnum);
            }
        }
        case 
CHAT:
        {
            for (
1<= g_maxplayers{0}; i++)
            {
                if (!
is_user_connected(i))
                    continue;
                
                if (
== id)
                    continue;
                
                if (
get_user_flags(i) & ADMIN_SLAY)
                    continue;
                
                
num_to_str(inumcharsmax(num));
                
get_user_name(inamecharsmax(name));
                
format(sztextcharsmax(sztext), "%s%s %s", (g_mute[id][CHAT][i]) ? "\d" "\w"name, (g_mute[id][CHAT][i]) ? "\y[SILENCIADO]" "");
                
menu_additem(menusztextnum);
            }
        }
        case 
GAGGED:
        {
            if (!
is_user_admin(id))
            {
                
menu_destroy(menu);
                return;
            }
            
            for (
1<= g_maxplayers{0}; i++)
            {
                if (!
is_user_connected(i))
                    continue;
                
                if (
== id)
                    continue;
                
                if (
get_user_flags(i) & ADMIN_SLAY)
                    continue;
                
                
num_to_str(inumcharsmax(num));
                
get_user_name(inamecharsmax(name));
                
format(sztextcharsmax(sztext), "%s%s %s", (g_gag[i][PLAYER]) ? "\d" "\w"name, (g_gag[i][PLAYER]) ? "[MUTEADO]" "");
                
menu_additem(menusztextnum);
            }
        }
    }
    
    
menu_setprop(menuMPROP_BACKNAME"ATRAS");
    
menu_setprop(menuMPROP_NEXTNAME"SIGUIENTE");
    
menu_setprop(menuMPROP_EXITNAME"VOLVER");
    
    
set_pdata_int(idOFFSET_CSMENUCODEfalseOFFSET_MENU_OFFSET);
    
    
menu_display(idmenu);
}

public 
handled_show_players(idmenuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        
clcmd_mute(id);
        return;
    }
    
    static 
targetnum[7], callbackdataname[32];
    
menu_item_getinfo(menuitemdatanumcharsmax(num), __callback);
    
    
target str_to_num(num);
    
    if (
is_user_connected(target))
    {
        switch(
g_page[id])
        {
            case 
MICROPHONE:
            {
                
g_mute[id][MICROPHONE][target] = !(g_mute[id][MICROPHONE][target]);
                
                
get_user_name(targetnamecharsmax(name));
                
chat_color(id"%s !yLe %s el microfono a !g%s!y."SZPREFIX, (g_mute[id][MICROPHONE][target]) ? "deshabilitaste" "habilitaste"name);
            }
            case 
CHAT:
            {
                
g_mute[id][CHAT][target] = !(g_mute[id][CHAT][target]);
                
                
get_user_name(targetnamecharsmax(name));
                
chat_color(id"%s !yLe %s el chat a !g%s!y."SZPREFIX, (g_mute[id][CHAT][target]) ? "deshabilitaste" "habilitaste"name);
            }
            case 
GAGGED
            {
                if (!
is_user_admin(id))
                {
                    
menu_destroy(menu);
                    return;
                }
                
                if (
g_gag[target][PLAYER])
                {
                    static 
name[32], name2[32];
                    
get_user_name(idnamecharsmax(name));
                    
get_user_name(targetname2charsmax(name2));
                    
                    
chat_color(0"%s !g%s!y Desmuteo A !g%s!y."SZPREFIXnamename2);
                    
g_gag[target][PLAYER] = false;
                    return;
                }
                
                
g_gag[id][TARGET] = target;
                
client_cmd(id"messagemode ^"AMORDAZAR_TIEMPO^"");
            }
        }
    }
    else
        
chat_color(id"%s !yEl se desconecto del servidor."SZPREFIX);
    
    
menu_destroy(menu);
    
show_menu_players(id);
}

public 
clcmd_gag(id)
{
    if (!
g_gag[id][TARGET])
        return;
    
    static 
text[12], name[32], name2[32];
    
read_args(textcharsmax(text));
    
remove_quotes(text);
    
trim(text);
    
    if (!
isdigit(text[0]))
    {
        
chat_color(id"%s !ySolo numeros."SZPREFIX);
        return;
    }
    
    if (!
strlen(text) || strlen(text) < 1)
    {
        
chat_color(id"%s !y 0."SZPREFIX);
        return;
    }
    
    
get_user_name(idnamecharsmax(name));
    
get_user_name(g_gag[id][TARGET], name2charsmax(name2));
    
    
g_gag[id][TIME] = str_to_num(text);
    
g_gag[g_gag[id][TARGET]][PLAYER] = true;
    
    
chat_color(0"%s !g!g%s!y fue Muteado  !g%d %s!y."SZPREFIXname2,
    
g_gag[id][TIME], (g_gag[id][TIME] > 1) ? "minutos" "minuto");
    
    
set_task(float(g_gag[id][TIME]) * 60.0"task_player_gag"g_gag[id][TARGET]);
}

public 
task_player_gag(id)
{
    static 
name[32];
    
get_user_name(idnamecharsmax(name));
    
    
g_gag[id][PLAYER] = false;
    
chat_color(0"%s !yEl jugador !g%s!y ya puede volver."SZPREFIXname);
}

public 
fw_Voice_SetClientListening(receiversenderlisten)
{
    if (
receiver == sender)
        return 
FMRES_IGNORED;
    
    if (
g_mute[receiver][MICROPHONE][sender] || g_gag[sender][PLAYER])
    {
        
engfunc(EngFunc_SetClientListeningreceiversenderfalse);
        return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;
}

public 
message_saytext(msgiddestid)
{
    if (
g_mute[id][CHAT][get_msg_arg_int(1)])
        return 
PLUGIN_HANDLED;
    
    return 
PLUGIN_CONTINUE;
}

stock chat_color(id, const input[], any:...)
{
    static 
message[191];
    
vformat(message190input3);
    
    
replace_all(message190"!g""^4");
    
replace_all(message190"!t""^3");
    
replace_all(message190"!y""^1");
    
    
message_begin((id) ? MSG_ONE_UNRELIABLE MSG_BROADCASTget_user_msgid("SayText"), .player id);
    
write_byte((id) ? id 33);
    
write_string(message);
    
message_end();

Corazón I dream of someday being able to have your near. Corazón
[Imagen: 76561199006140497.png]
Responder
#6
compa esta igual que el que tengo , creo que no me entendiste y no sirve pero gracias igual

mejor que alguien que sepa me ayudeee
Responder
#7
(01/12/2019, 02:44 PM)venzuela6969 escribió: compa esta igual que el que tengo , creo que no me entendiste y no sirve pero gracias igual

mejor que alguien que sepa me ayudeee

Bueno suerte pacman
Corazón I dream of someday being able to have your near. Corazón
[Imagen: 76561199006140497.png]
Responder
#8
quien me ayudaaaaa porfa
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)