Offline |
|
|
Csatlakozott: 2014.10.31. 14:51 Hozzászólások: 462
Megköszönt másnak: 73 alkalommal Megköszönték neki: 29 alkalommal
|
Oké. 1. #include <amxmodx> #include <amxmisc> #include <hamsandwich> #if defined _dhudmessage_included #endinput #endif #define _dhudmessage_included #include <amxmodx> stock __dhud_color; stock __dhud_x; stock __dhud_y; stock __dhud_effect; stock __dhud_fxtime; stock __dhud_holdtime; stock __dhud_fadeintime; stock __dhud_fadeouttime; stock __dhud_reliable; stock set_dhudmessage( red = 0, green = 160, blue = 0, Float:x = -1.0, Float:y = 0.65, effects = 2, Float:fxtime = 6.0, Float:holdtime = 3.0, Float:fadeintime = 0.1, Float:fadeouttime = 1.5, bool:reliable = false ) { #define clamp_byte(%1) ( clamp( %1, 0, 255 ) ) #define pack_color(%1,%2,%3) ( %3 + ( %2 << 8 ) + ( %1 << 16 ) ) __dhud_color = pack_color( clamp_byte( red ), clamp_byte( green ), clamp_byte( blue ) ); __dhud_x = _:x; __dhud_y = _:y; __dhud_effect = effects; __dhud_fxtime = _:fxtime; __dhud_holdtime = _:holdtime; __dhud_fadeintime = _:fadeintime; __dhud_fadeouttime = _:fadeouttime; __dhud_reliable = _:reliable; return 1; } stock show_dhudmessage( index, const message[], any:... ) { new buffer[ 128 ]; new numArguments = numargs(); if( numArguments == 2 ) { send_dhudMessage( index, message ); } else if( index || numArguments == 3 ) { vformat( buffer, charsmax( buffer ), message, 3 ); send_dhudMessage( index, buffer ); } else { new playersList[ 32 ], numPlayers; get_players( playersList, numPlayers, "ch" ); if( !numPlayers ) { return 0; } new Array:handleArrayML = ArrayCreate(); for( new i = 2, j; i < numArguments; i++ ) { if( getarg( i ) == LANG_PLAYER ) { while( ( buffer[ j ] = getarg( i + 1, j++ ) ) ) {} j = 0; if( GetLangTransKey( buffer ) != TransKey_Bad ) { ArrayPushCell( handleArrayML, i++ ); } } } new size = ArraySize( handleArrayML ); if( !size ) { vformat( buffer, charsmax( buffer ), message, 3 ); send_dhudMessage( index, buffer ); } else { for( new i = 0, j; i < numPlayers; i++ ) { index = playersList[ i ]; for( j = 0; j < size; j++ ) { setarg( ArrayGetCell( handleArrayML, j ), 0, index ); } vformat( buffer, charsmax( buffer ), message, 3 ); send_dhudMessage( index, buffer ); } } ArrayDestroy( handleArrayML ); } return 1; } stock send_dhudMessage( const index, const message[] ) { message_begin( __dhud_reliable ? ( index ? MSG_ONE : MSG_ALL ) : ( index ? MSG_ONE_UNRELIABLE : MSG_BROADCAST ), SVC_DIRECTOR, _, index ); { write_byte( strlen( message ) + 31 ); write_byte( DRC_CMD_MESSAGE ); write_byte( __dhud_effect ); write_long( __dhud_color ); write_long( __dhud_x ); write_long( __dhud_y ); write_long( __dhud_fadeintime ); write_long( __dhud_fadeouttime ); write_long( __dhud_holdtime ); write_long( __dhud_fxtime ); write_string( message ); } message_end(); } #include <cstrike> #define PLUGIN "New Plugin" #define AUTHOR "Unknown" #define VERSION "1.0" new g_iKills[32]; new top1, top2, top3; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_event("DeathMsg", "EventDeathMsg", "a") register_logevent("RoundEnd", 2, "1=Round_End") } public client_disconnect(id) { g_iKills[id] = 0; } public EventDeathMsg() { new killer = read_data(1) new victim = read_data(2) if(killer != victim && killer && cs_get_user_team(killer) != cs_get_user_team(victim)) { g_iKills[killer]++; } else g_iKills[killer]--; } public RoundEnd() { new players[32], num; get_players(players, num); SortCustom1D(players, num, "sort_bestplayer") top1 = players[0] top2 = players[1] top3 = players[2] new top1neve[33], top2neve[33], top3neve[33]; get_user_name(top1, top1neve, charsmax(top1neve)) get_user_name(top2, top2neve, charsmax(top2neve)) get_user_name(top3, top3neve, charsmax(top3neve)) if(num == 1) { set_dhudmessage(random(256), random(256), random(256), 0.29, 0.42,0,6.0,12.0,0.1,0.2) show_dhudmessage(0, "Ebben a Körben a Legjobb játékosok:^n1. %s |Ölés:%d", top1neve, g_iKills[top1]) } else if(num == 2) { set_dhudmessage(random(256), random(256), random(256), 0.29, 0.42,0,6.0,12.0,0.1,0.2) show_dhudmessage(0, "Ebben a Körben a Legjobb játékosok:^n1. %s |Ölés:%d^n2. %s |Ölés:%d", top1neve, g_iKills[top1], top2neve, g_iKills[top2]) } else if(num >= 3) { set_dhudmessage(random(256), random(256), random(256), 0.29, 0.42,0,6.0,12.0,0.1,0.2) show_dhudmessage(0, "Ebben a Körben a Legjobb játékosok:^n1. %s |Ölés:%d^n2. %s |Ölés:%d^n3. %s |Ölés:%d", top1neve, g_iKills[top1], top2neve, g_iKills[top2],top3neve, g_iKills[top3]) } client_print(0, print_chat, "") for(new i; i < 31; i++) { g_iKills[i] = 0; } } public sort_bestplayer(id1, id2) { if(g_iKills[id1] > g_iKills[id2]) return -1; else if(g_iKills[id1] < g_iKills[id2]) return 1; return 0; } stock print_color(const id, const input[], any:...) { new count = 1, players[32] static msg[191] vformat(msg, 190, input, 3) replace_all(msg, 190, "!g", "^4") replace_all(msg, 190, "!y", "^1") replace_all(msg, 190, "!t", "^3") replace_all(msg, 190, "�", "á") replace_all(msg, 190, "�", "é") replace_all(msg, 190, "�", "í") replace_all(msg, 190, "�", "ó") replace_all(msg, 190, "�", "ö") replace_all(msg, 190, "�", "ő") replace_all(msg, 190, "�", "ú") replace_all(msg, 190, "�", "ü") replace_all(msg, 190, "�", "ű") replace_all(msg, 190, "�", "Á") replace_all(msg, 190, "�", "É") replace_all(msg, 190, "�", "Í") replace_all(msg, 190, "�", "Ó") replace_all(msg, 190, "�", "Ö") replace_all(msg, 190, "�", "Ő") replace_all(msg, 190, "�", "Ú") replace_all(msg, 190, "�", "Ü") replace_all(msg, 190, "�", "Ű") 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() } } } return PLUGIN_HANDLED }
2. #include <amxmodx> #include <fakemeta> #pragma semicolon 1 #define RED 64 #define GREEN 64 #define BLUE 64 #define UPDATEINTERVAL 1.0 // Comment below if you do not want /speclist showing up on chat #define ECHOCMD // Admin flag used for immunity #define FLAG ADMIN_IMMUNITY new const PLUGIN[] = "SpecList"; new const VERSION[] = "1.2a"; new const AUTHOR[] = "FatalisDK"; new gMaxPlayers; new gCvarOn; new gCvarImmunity; new bool:gOnOff[33] = { true, ... }; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); register_cvar(PLUGIN, VERSION, FCVAR_SERVER, 0.0); gCvarOn = register_cvar("amx_speclist", "1", 0, 0.0); gCvarImmunity = register_cvar("amx_speclist_immunity", "1", 0, 0.0); register_clcmd("say /speclist", "cmdSpecList", -1, ""); gMaxPlayers = get_maxplayers(); set_task(UPDATEINTERVAL, "tskShowSpec", 123094, "", 0, "b", 0); } public cmdSpecList(id) { if( gOnOff[id] ) { client_print(id, print_chat, "[AMXX] You will no longer see who's spectating you."); gOnOff[id] = false; } else { client_print(id, print_chat, "[AMXX] You will now see who's spectating you."); gOnOff[id] = true; } #if defined ECHOCMD return PLUGIN_CONTINUE; #else return PLUGIN_HANDLED; #endif } public tskShowSpec() { if( !get_pcvar_num(gCvarOn) ) { return PLUGIN_CONTINUE; } static szHud[1102];//32*33+45 static szName[34]; static bool:send; // FRUITLOOOOOOOOOOOOPS! for( new alive = 1; alive <= gMaxPlayers; alive++ ) { new bool:sendTo[33]; send = false; if( !is_user_alive(alive) ) { continue; } sendTo[alive] = true; get_user_name(alive, szName, 32); format(szHud, 45, "Spectating %s:^n", szName); for( new dead = 1; dead <= gMaxPlayers; dead++ ) { if( is_user_connected(dead) ) { if( is_user_alive(dead) || is_user_bot(dead) ) { continue; } if( pev(dead, pev_iuser2) == alive ) { if( !(get_pcvar_num(gCvarImmunity)&&get_user_flags(dead, 0)&FLAG) ) { get_user_name(dead, szName, 32); add(szName, 33, "^n", 0); add(szHud, 1101, szName, 0); send = true; } sendTo[dead] = true; } } } if( send == true ) { for( new i = 1; i <= gMaxPlayers; i++ ) { if( sendTo[i] == true && gOnOff[i] == true ) { set_hudmessage(RED, GREEN, BLUE, 0.75, 0.15, 0, 0.0, UPDATEINTERVAL + 0.1, 0.0, 0.0, -1); show_hudmessage(i, szHud); } } } } return PLUGIN_CONTINUE; } public client_connect(id) { gOnOff[id] = true; } public client_disconnect(id) { gOnOff[id] = true; }
|
|