- | Afiseaza codul
#include <amxmodx> #include <cstrike> #include <ColorChat> #include <csx> new const PLUGIN[ ] = "Furien Bomb Events", VERSION[ ] = "1.0.0", AUTHOR[ ] = "Diversity" #define clamp_byte(%1) ( clamp( %1, 0, 255 ) ) #define pack_color(%1,%2,%3) ( %3 + ( %2 << 8 ) + ( %1 << 16 ) ) new c4time public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_event("HLTV", "NewRound", "a", "1=0", "2=0") } public NewRound() { c4time = 0 } public bomb_planted(planter) { c4time = get_cvar_num("mp_c4timer") set_task(1.0, "bombtimer", 1000000, _, _, "b") new money = 2000 cs_set_user_money(planter, money+cs_get_user_money(planter)) ColorChat(0, RED, "^x04[FURIEN]^x01 Planeta este aproape distrusa de catre^x03 %s^x01 prin plantarea^x03 bombei^x01!", GetName(planter)) ColorChat(0, RED, "^x04[FURIEN]^x01 Acesta a primit^x03 %d$^x01 pentru plantarea bombei.", money) } public bomb_explode(planter) { c4time = 0 new money = 3000 cs_set_user_money(planter, money+cs_get_user_money(planter)) ColorChat(0, RED, "^x04[FURIEN]^x01 Planeta a fost distrusa de catre^x03 %s^x01 prin explozia^x03 bombei^x01!", GetName(planter)) ColorChat(0, RED, "^x04[FURIEN]^x01 Acesta a primit^x03 %d$^x01 pentru explozia bombei.", money) } public bomb_defused(defuser) { c4time = 0 new money = 5500 cs_set_user_money(defuser, money+cs_get_user_money(defuser)) ColorChat(0, RED, "^x04[FURIEN]^x01 Planeta a fost salvata de catre^x03 %s^x01 prin dezamorsarea^x03 bombei^x01!", GetName(defuser)) ColorChat(0, RED, "^x04[FURIEN]^x01 Acesta a primit^x03 %d$^x01 pentru dezamorsarea bombei.", money) } public bombtimer() { if(c4time > 0) { c4time -- new string[100] formatex(string, 100, "Planeta se distruge in: %d", c4time) HudMessage(0, string, random(255), random(255), random(255), 0.02, 0.18, _, _, 0.7) } else remove_task(1000000) } stock HudMessage(const id, const message[], red = 0, green = 160, blue = 0, Float:x = -1.0, Float:y = 0.65, effects = 2, Float:fxtime = 0.01, Float:holdtime = 3.0, Float:fadeintime = 0.01, Float:fadeouttime = 0.01) { new count = 1, players[32]; if(id) players[0] = id; else get_players(players, count, "ch"); { for(new i = 0; i < count; i++) { if(is_user_connected(players)) { new color = pack_color(clamp_byte(red), clamp_byte(green), clamp_byte(blue)) message_begin(MSG_ONE_UNRELIABLE, SVC_DIRECTOR, _, players); write_byte(strlen(message) + 31); write_byte(DRC_CMD_MESSAGE); write_byte(effects); write_long(color); write_long(_:x); write_long(_:y); write_long(_:fadeintime); write_long(_:fadeouttime); write_long(_:holdtime); write_long(_:fxtime); write_string(message); message_end(); } } } } stock GetName(playerid) { new name[33] get_user_name(playerid, name, 33) return name }
EDIT: Vreau sa fie inlaturat include-ul de colorchat si daca se poate sa-mi faceti pe
- | Afiseaza codul
stock ChatColor( const id, const input[ ], any:... ) { new count = 1, players[ 32 ]; static msg[ 191 ]; vformat( msg, 190, input, 3 ); replace_all( msg, 190, ".v", "^4" ); replace_all( msg, 190, ".g", "^1" ); replace_all( msg, 190, ".e", "^3" ); replace_all( msg, 190, ".x", "^0" ); if( id ) { players[ 0 ] = id; } else get_players( players, count, "ch" ); { for( new i = 0; i < count; i++ ) { if( is_user_connected( players[ i ] ) ) { message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, players[ i ] ); write_byte( players[ i ] ); write_string( msg ); message_end( ); } } } }