Mensajes: 41
Temas: 21
Registro en: Mar 2018
Reputación:
0
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(PLUGIN, VERSION, AUTHOR) RegisterHam( Ham_Spawn, "player", "ham_PlayerSpawn", true ); } public ham_PlayerSpawn( id ){ if(!is_user_alive(id)) return; if( cs_get_user_money( id ) < 16000 ){ client_print( id, print_chat, "te dimos %i de dinero", ( 16000-cs_get_user_money( id ) ) ); cs_set_user_money( id, 16000); } }
Mensajes: 659
Temas: 97
Registro en: Feb 2016
Reputación:
12
23/10/2018, 12:08 PM
(Última modificación: 23/10/2018, 12:09 PM por Alejandro.)
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(PLUGIN, VERSION, AUTHOR) RegisterHam( Ham_Spawn, "player", "ham_PlayerSpawn", true ); } public ham_PlayerSpawn( id ){ if(!is_user_alive(id)) return; if( cs_get_user_money( id ) < 16000 ){ ColorChat( id, "!yte dimos !g%i !yde !tdinero", ( 16000-cs_get_user_money( id ) ) ); cs_set_user_money( id, 16000); } } stock ColorChat( const id, const Text[ ], any:... ) { new count = 1, players[ 32 ]; static msg[ 191 ], len, i; len = formatex( msg, charsmax(msg), "%s ", CHAT_PREFIX ); vformat( msg[ len ], 190 - len, Text, 3 ); replace_all( msg, 190, "!g", "^4" ); replace_all( msg, 190, "!y", "^1" ); replace_all( msg, 190, "!t", "^3" ); static iLen = sizeof( msg ); replace_all( msg, iLen, "á", "á" ); replace_all( msg, iLen, "Á", "Ã" ); replace_all( msg, iLen, "é", "é" ); replace_all( msg, iLen, "É", "É" ); replace_all( msg, iLen, "í", "Ã*" ); replace_all( msg, iLen, "Í", "Ã" ); replace_all( msg, iLen, "ó", "ó" ); replace_all( msg, iLen, "Ó", "Ó" ); replace_all( msg, iLen, "ú", "ú" ); replace_all( msg, iLen, "Ú", "Ú" ); replace_all( msg, iLen, "ñ", "ñ" ); replace_all( msg, iLen, "Ñ", "Ñ" ); if(id) players[ 0 ] = id; else get_players( players, count, "ch" ); for( i = 0; i < count; ++i) { if( is_user_connected( players[ i ] ) ) writeMessage( players[ i ], msg ); } }
stock writeMessage( player, message[ ] ) { message_begin( MSG_ONE, get_user_msgid( "SayText" ), { 0, 0, 0 }, player ); write_byte( player ); write_string( message ); message_end( ); }
Mensajes: 41
Temas: 21
Registro en: Mar 2018
Reputación:
0
se le puede quitar el prefix? gracias por la ayuda
Mensajes: 659
Temas: 97
Registro en: Feb 2016
Reputación:
12
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(PLUGIN, VERSION, AUTHOR) RegisterHam( Ham_Spawn, "player", "ham_PlayerSpawn", true ); } public ham_PlayerSpawn( id ){ if(!is_user_alive(id)) return; if( cs_get_user_money( id ) < 16000 ){ ColorChat( id, "!yte dimos !g%i !yde !tdinero", ( 16000-cs_get_user_money( id ) ) ); cs_set_user_money( id, 16000); } } stock ColorChat( const id, const Text[ ], any:... ) { new count = 1, players[ 32 ]; static msg[ 191 ], len, i; len = formatex( msg, charsmax(msg), " "); vformat( msg[ len ], 190 - len, Text, 3 ); replace_all( msg, 190, "!g", "^4" ); replace_all( msg, 190, "!y", "^1" ); replace_all( msg, 190, "!t", "^3" ); static iLen = sizeof( msg ); replace_all( msg, iLen, "á", "á" ); replace_all( msg, iLen, "Á", "Ã" ); replace_all( msg, iLen, "é", "é" ); replace_all( msg, iLen, "É", "É" ); replace_all( msg, iLen, "í", "Ã*" ); replace_all( msg, iLen, "Í", "Ã" ); replace_all( msg, iLen, "ó", "ó" ); replace_all( msg, iLen, "Ó", "Ó" ); replace_all( msg, iLen, "ú", "ú" ); replace_all( msg, iLen, "Ú", "Ú" ); replace_all( msg, iLen, "ñ", "ñ" ); replace_all( msg, iLen, "Ñ", "Ñ" ); if(id) players[ 0 ] = id; else get_players( players, count, "ch" ); for( i = 0; i < count; ++i) { if( is_user_connected( players[ i ] ) ) writeMessage( players[ i ], msg ); } }
stock writeMessage( player, message[ ] ) { message_begin( MSG_ONE, get_user_msgid( "SayText" ), { 0, 0, 0 }, player ); write_byte( player ); write_string( message ); message_end( ); }
|