[Pedido] Simple admin prefix
#1
Hola, alguien le podría hacer la simple modificación de que no haya cvars y directamente se maneje sin ellos?
El hecho de notener mucho conocimiento me dificulto en diferente casos... De paso se quedan con el plugin que lo hizo "hornet" lo encontre en suggestions / requests de AM

Código PHP:
#include <amxmodx>
#include <cstrike>

#define PLUGIN                 "Player Prefix"
#define VERSION             "0.0.1"
#define AUTHOR                 "hornet"

new g_pPrefixIdg_pPrefix;

new 
g_szAuthId32 ][ 33 ];

public 
plugin_init() 
{
    
register_pluginPLUGINVERSIONAUTHOR );
    
    
g_pPrefixId register_cvar"amx_prefixid""STEAM_0:0:XXXXXXXXX" );
    
g_pPrefix register_cvar"amx_prefix""[ Prefix ]" );
    
    
register_clcmd"say""Cmd_Say" );
    
register_clcmd"say_team""Cmd_SayTeam" );
}

public 
client_connectid )
    
get_user_authididg_szAuthIdid ], 31 );

public 
Cmd_Sayid )
{
    static 
szPrefix32 ];
    
get_pcvar_stringg_pPrefixIdszPrefixcharsmaxszPrefix ) );
    
    if( 
equalg_szAuthIdid ], szPrefix ) )
    {
        
SpecialPrintidtrue );
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
Cmd_SayTeamid )
{
    static 
szPrefix32 ];
    
get_pcvar_stringg_pPrefixIdszPrefixcharsmaxszPrefix ) );
    
    if( 
equalg_szAuthIdid ], szPrefix ) )
    {
        
SpecialPrintidfalse );
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;
}

stock SpecialPrint( const idbool:bSendAll )
{
    static 
szMsg512 ], szName32 ], szPrefix32 ], szTeam16 ];
    
read_argsszMsgcharsmaxszMsg ) );
    
remove_quotesszMsg );
    
    
get_user_nameidszNamecharsmaxszName ) );
    
get_pcvar_stringg_pPrefixszPrefixcharsmaxszPrefix ) );
    
    new 
iNumiPlayers32 ];
    
    if( !
bSendAll )
    {
        switch( 
cs_get_user_teamid ) )
        {
            case 
CS_TEAM_CT
            {
                
get_playersiPlayersiNum"che""CT" );
                
szTeam "(CT) ";
            }
            
            case 
CS_TEAM_T
            {
                
get_playersiPlayersiNum"che""TERRORIST" );
                
szTeam "(Terrorist) ";
            }
            
            case 
CS_TEAM_SPECTATOR
            {
                
get_playersiPlayersiNum"che""SPECTATOR" );
                
szTeam "(Spectator) ";
            }
            
            case 
CS_TEAM_UNASSIGNED
            {
                
get_playersiPlayersiNum"che""SPECTATOR" );
                
szTeam "(Spectator) ";
            }
        }
    }
    else 
get_playersiPlayersiNum"ch" );
        
    
formatszMsgcharsmaxszMsg ), "^x01%s%s^x04%s ^x03%s: ^x01%s"is_user_aliveid ) ? "" "*DEAD* "bSendAll "" szTeamszPrefixszNameszMsg );

    for ( new 
iNum i++ )
    {
        if( 
is_user_connectediPlayers] ) )
        {
            
message_beginMSG_ONE_UNRELIABLEget_user_msgid"SayText" ), _iPlayers] );
            
write_byteiPlayers] );
            
write_stringszMsg );
            
message_end();
        }
    }


Gracias!
Responder
#2
Fijate si esto te anda:

Código PHP:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "prefijo"
#define VERSION "1.0"
#define AUTHOR "fnz"

new prefijo[] = "olakase"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)    
}

public 
client_connect(id){
    if(
get_user_flags(id) == ADMIN_KICK){
        new 
name[33]
        
get_user_name(idname32)
        
client_cmd(id"name ^"[%s] %s^""prefijoname)
    }
}

public 
client_infochanged(id){
    if(
get_user_flags(id) == ADMIN_KICK){
        new 
name[33]
        
get_user_name(idname32)
        
client_cmd(id"name ^"[%s] %s^""prefijoname)
    }

Responder
#3
No se si se lo puede conciderar slowhack...
Responder
#4
set_user_info
(17/04/2015, 03:36 PM)Neeeeeeeeeel.- escribió: No se va a volver a conectar a internet en toda su puta vida... nadie sube porno a mi foro y vive para contarlo.
Responder
#5
fnz el hecho de modificar el name del player para mi no me gusta para nada...
Alguien le podría hacer la simple modificación de que no haya cvars y directamente se maneje sin ellos?
El hecho de notener mucho conocimiento me dificulto en diferente casos... De paso se quedan con el plugin que lo hizo "hornet" lo encontre en suggestions / requests de AM

Código PHP:
#include <amxmodx>
#include <cstrike>

#define PLUGIN                 "Player Prefix"
#define VERSION             "0.0.1"
#define AUTHOR                 "hornet"

new g_pPrefixIdg_pPrefix;

new 
g_szAuthId32 ][ 33 ];

public 
plugin_init() 
{
    
register_pluginPLUGINVERSIONAUTHOR );
    
    
g_pPrefixId register_cvar"amx_prefixid""STEAM_0:0:XXXXXXXXX" );
    
g_pPrefix register_cvar"amx_prefix""[ Prefix ]" );
    
    
register_clcmd"say""Cmd_Say" );
    
register_clcmd"say_team""Cmd_SayTeam" );
}

public 
client_connectid )
    
get_user_authididg_szAuthIdid ], 31 );

public 
Cmd_Sayid )
{
    static 
szPrefix32 ];
    
get_pcvar_stringg_pPrefixIdszPrefixcharsmaxszPrefix ) );
    
    if( 
equalg_szAuthIdid ], szPrefix ) )
    {
        
SpecialPrintidtrue );
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
Cmd_SayTeamid )
{
    static 
szPrefix32 ];
    
get_pcvar_stringg_pPrefixIdszPrefixcharsmaxszPrefix ) );
    
    if( 
equalg_szAuthIdid ], szPrefix ) )
    {
        
SpecialPrintidfalse );
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;
}

stock SpecialPrint( const idbool:bSendAll )
{
    static 
szMsg512 ], szName32 ], szPrefix32 ], szTeam16 ];
    
read_argsszMsgcharsmaxszMsg ) );
    
remove_quotesszMsg );
    
    
get_user_nameidszNamecharsmaxszName ) );
    
get_pcvar_stringg_pPrefixszPrefixcharsmaxszPrefix ) );
    
    new 
iNumiPlayers32 ];
    
    if( !
bSendAll )
    {
        switch( 
cs_get_user_teamid ) )
        {
            case 
CS_TEAM_CT
            {
                
get_playersiPlayersiNum"che""CT" );
                
szTeam "(CT) ";
            }
            
            case 
CS_TEAM_T
            {
                
get_playersiPlayersiNum"che""TERRORIST" );
                
szTeam "(Terrorist) ";
            }
            
            case 
CS_TEAM_SPECTATOR
            {
                
get_playersiPlayersiNum"che""SPECTATOR" );
                
szTeam "(Spectator) ";
            }
            
            case 
CS_TEAM_UNASSIGNED
            {
                
get_playersiPlayersiNum"che""SPECTATOR" );
                
szTeam "(Spectator) ";
            }
        }
    }
    else 
get_playersiPlayersiNum"ch" );
        
    
formatszMsgcharsmaxszMsg ), "^x01%s%s^x04%s ^x03%s: ^x01%s"is_user_aliveid ) ? "" "*DEAD* "bSendAll "" szTeamszPrefixszNameszMsg );

    for ( new 
iNum i++ )
    {
        if( 
is_user_connectediPlayers] ) )
        {
            
message_beginMSG_ONE_UNRELIABLEget_user_msgid"SayText" ), _iPlayers] );
            
write_byteiPlayers] );
            
write_stringszMsg );
            
message_end();
        }
    }

Responder
#6
prueba este haber que tal

Código PHP:
#include <amxmodx>   
#include <amxmisc>   

#define PLUGIN "Hook Say"   
#define VERSION "1.0"   
#define AUTHOR "3MCy Daimon't"   

#define ADMIN ADMIN_LEVEL_F

public plugin_init() 
{   
    
register_plugin(PLUGINVERSIONAUTHOR)   
    
    
register_clcmd("say""message_saytext");  
    
register_clcmd("say_team""message_saytext");  
    


public 
message_saytext(id

    static 
szSay[195], txt[256]  
    
read_args(szSaycharsmax(szSay))  
    
remove_quotes(szSay)  
    if(!
szSay[0]) return PLUGIN_HANDLED  
    
    
static szNombre[33]  
    
get_user_name(idszNombre32)  
    
    if(
is_user_alive(id))  
    {  
        if(
is_user_admin(id))  
        {  
            
formatex(txtcharsmax(txt), "!g[ADMIN] --> !t%s !y: !g%s"szNombreszSay)  
        }  
        else 
formatex(txtcharsmax(txt), "!t|JUGADOR| -> %s !g: !y%s",  szNombreszSay
    }  
    else 
    { 
        if(
is_user_admin(id))  
        {  
            
formatex(txtcharsmax(txt), "!g[ADMIN] --> !y[Muerto]!t%s !y: !g%s"szNombreszSay)  
        }
        else 
formatex(txtcharsmax(txt), "!y |JUGADOR| -> [Muerto]!t%s !g: !y%s",  szNombreszSay)    
    } 
    
    
replace_all(txtcharsmax(txt), "!g""^x04")  
    
replace_all(txtcharsmax(txt), "!t""^x03")  
    
replace_all(txtcharsmax(txt), "!y""^x01")  
    
    
color_chat(0idtxt)  
    
replace_all(txtcharsmax(txt), "^x04""")  
    
replace_all(txtcharsmax(txt), "^x03""")  
    
replace_all(txtcharsmax(txt), "^x01""")  
    
console_print(idtxt)  
    
    return 
PLUGIN_HANDLED  


stock color_chat(playeridcoloridmessage[])  
{  
    
message_begin(playerid MSG_ONE MSG_ALLget_user_msgid("SayText"), {000}, playerid)  
    
write_byte(colorid)  
    
write_string(message)  
    
message_end()  


importante es que si lo usas como plugin externo ponerlo al final de todos los plugins
Responder
#7
si pones return PLUGIN_HANDLED_MAIN ya no hace falta ponerlo al final del todo.
(17/04/2015, 03:36 PM)Neeeeeeeeeel.- escribió: No se va a volver a conectar a internet en toda su puta vida... nadie sube porno a mi foro y vive para contarlo.
Responder
#8
Mi intención 3mcy daimon't, es que solo registre por steamid ya que quiero ponerlo como soporte técnico el prefijo y solo sea para mi steamid, entendes?. Igual me sirve el plugin, gracias.
Responder
#9
eso no fue lo que pusiste en el 1er post
Responder
#10
(24/02/2014, 04:03 AM)Zetz escribió: Mi intención 3mcy daimon't, es que solo registre por steamid ya que quiero ponerlo como soporte técnico el prefijo y solo sea para mi steamid, entendes?. Igual me sirve el plugin, gracias.

pues... eso deberias haberlo especificado en la creacion del thread. pero bueno lo importante es que te sirvio

undefined
Responder
#11
Ahi actualizo el post, xD. Sisisi esta bien! Lengua, perdon!
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)