Agregarle color al mensaje
#1
Buenas, necesito agregarle color al mensaje intente hacerlo yo, pero no me funciona :c

Código PHP:
/* Script generated by Pawn Studio */

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN    "New Plugin"
#define AUTHOR    "Unknown"
#define VERSION    "1.0"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHamHam_Spawn"player""ham_PlayerSpawn"true );
}
public 
ham_PlayerSpawnid ){
    if(!
is_user_alive(id)) return;
    
    if( 
cs_get_user_moneyid ) < 16000 ){
        
client_printidprint_chat"te dimos %i de dinero", ( 16000-cs_get_user_moneyid ) ) );
        
cs_set_user_moneyid16000);
    }

Responder
#2
ay tienes
Código PHP:
/* Script generated by Pawn Studio */

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN    "New Plugin"
#define AUTHOR    "Unknown"
#define VERSION    "1.0"

new CHAT_PREFIX[ ] = "!g[!yAMXX!g]";

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHamHam_Spawn"player""ham_PlayerSpawn"true );
}
public 
ham_PlayerSpawnid ){
    if(!
is_user_alive(id)) return;
    
    if( 
cs_get_user_moneyid ) < 16000 ){
        
ColorChatid"!yte dimos !g%i !yde !tdinero", ( 16000-cs_get_user_moneyid ) ) );
        
cs_set_user_moneyid16000);
    }
}
stock ColorChat( const id, const Text[ ], any:... ) { 
    
    new 
count 1players32 ];
    static 
msg191 ], leni;
    
    
len formatexmsgcharsmax(msg), "%s "CHAT_PREFIX );
    
vformatmsglen ], 190 lenText);
    
    
replace_allmsg190"!g""^4" );
    
replace_allmsg190"!y""^1" );
    
replace_allmsg190"!t""^3" );
    
    static 
iLen sizeofmsg );
    
    
replace_allmsgiLen"á""á" );
    
replace_allmsgiLen"Á""Ã" );
    
replace_allmsgiLen"é""é" );
    
replace_allmsgiLen"É""É" );
    
replace_allmsgiLen"í""Ã*" );
    
replace_allmsgiLen"Í""Ã" );
    
replace_allmsgiLen"ó""ó" );
    
replace_allmsgiLen"Ó""Ó" );
    
replace_allmsgiLen"ú""ú" );
    
replace_allmsgiLen"Ú""Ú" );
    
replace_allmsgiLen"ñ""ñ" );
    
replace_allmsgiLen"Ñ""Ñ" );
    
    
    if(
id
        
players] = id;
    else 
        
get_playersplayerscount"ch" );
             
    for( 
0count; ++i) {
        
        if( 
is_user_connectedplayers] ) ) 
            
writeMessageplayers], msg );    
    }
}

stock writeMessageplayermessage[ ] ) {
    
    
message_beginMSG_ONEget_user_msgid"SayText" ), { 00}, player );
    
write_byteplayer );
    
write_stringmessage );
    
message_end( );

Responder
#3
se le puede quitar el prefix? gracias por la ayuda Gran sonrisa
Responder
#4
Claro que si, sin prefix
Código PHP:
/* Script generated by Pawn Studio */

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN    "New Plugin"
#define AUTHOR    "Unknown"
#define VERSION    "1.0"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHamHam_Spawn"player""ham_PlayerSpawn"true );
}
public 
ham_PlayerSpawnid ){
    if(!
is_user_alive(id)) return;
    
    if( 
cs_get_user_moneyid ) < 16000 ){
        
ColorChatid"!yte dimos !g%i !yde !tdinero", ( 16000-cs_get_user_moneyid ) ) );
        
cs_set_user_moneyid16000);
    }
}
stock ColorChat( const id, const Text[ ], any:... ) { 
    
    new 
count 1players32 ];
    static 
msg191 ], leni;
    
    
len formatexmsgcharsmax(msg), " ");
    
vformatmsglen ], 190 lenText);
    
    
replace_allmsg190"!g""^4" );
    
replace_allmsg190"!y""^1" );
    
replace_allmsg190"!t""^3" );
    
    static 
iLen sizeofmsg );
    
    
replace_allmsgiLen"á""á" );
    
replace_allmsgiLen"Á""Ã" );
    
replace_allmsgiLen"é""é" );
    
replace_allmsgiLen"É""É" );
    
replace_allmsgiLen"í""Ã*" );
    
replace_allmsgiLen"Í""Ã" );
    
replace_allmsgiLen"ó""ó" );
    
replace_allmsgiLen"Ó""Ó" );
    
replace_allmsgiLen"ú""ú" );
    
replace_allmsgiLen"Ú""Ú" );
    
replace_allmsgiLen"ñ""ñ" );
    
replace_allmsgiLen"Ñ""Ñ" );
    
    
    if(
id
        
players] = id;
    else 
        
get_playersplayerscount"ch" );
             
    for( 
0count; ++i) {
        
        if( 
is_user_connectedplayers] ) ) 
            
writeMessageplayers], msg );    
    }
}

stock writeMessageplayermessage[ ] ) {
    
    
message_beginMSG_ONEget_user_msgid"SayText" ), { 00}, player );
    
write_byteplayer );
    
write_stringmessage );
    
message_end( );

Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)