Tastati /showkeys si veti vedea butoanele nu mai A si D.Si speclist-ul ajuta sa vada jucatorul cine este spectator pe el.
Pluginul este testat daca vreti sa vedeti cu ochii vostri testati-l.
Descarcati:
Edit:Am scos faza cu rcon pentru cei nemultumiti.
- | Afiseaza codul
#include amxmodx #include amxmisc #include engine #include fakemeta #include cstrike #include colorchat #define KEYS_STR_LEN 31 #define LIST_STR_LEN 610 #define BOTH_STR_LEN KEYS_STR_LEN + LIST_STR_LEN #define FL_LIST (1 << 0) #define FL_OWNKEYS (1 << 2) #define FL_HIDE (1 << 3) new p_enabled, p_list_enabled, p_list_default; new p_red, p_grn, p_blu, p_immunity; new g_spectarget[33] new g_specmode[33] new bool:ShowkeysON[33]; new Float:g_flDelay[33]; new cl_prefs[33]; new list_string[33][LIST_STR_LEN + 1]; new cl_names[33][21], spec_ids[33][33]; public plugin_init() { register_plugin( "Spec Info", "1.0", "sebbyz" ); register_event("TextMsg", "event_textmsg", "b", "2&#Spec_Mode") register_event("StatusValue", "event_statusvalue", "bd", "1=2") register_event("SpecHealth2", "event_spechealth2", "bd") register_event("ResetHUD", "event_resethud", "be") p_enabled = register_cvar ("speclist_enabled", "1"); p_list_enabled = register_cvar ("speclist_list_enabled", "1"); p_list_default = register_cvar ("speclist_list_default", "1"); p_immunity = register_cvar ("speclist_immunity", "0"); p_red = register_cvar ("speclist_msg_r", "0"); p_grn = register_cvar ("speclist_msg_g", "255"); p_blu = register_cvar ("speclist_msg_b", "159"); set_task( 1.0, "list_update", _, _, _, "b" ); register_clcmd("say /showkeys","cmdShowkeys"); register_clcmd("say_team /showkeys","cmdShowkeys"); } public client_connect(id) { cl_prefs[id] = 0; if( !is_user_bot(id) ) { if( get_pcvar_num( p_list_default ) ) cl_prefs[id] |= FL_LIST; } get_user_name( id, cl_names[id], 20 ); reset(id) ShowkeysON[id] = false; return PLUGIN_CONTINUE; } public client_disconnect(id) { reset(id) ShowkeysON[id] = false; remove_task(id); } public event_resethud(id) { reset(id) } public reset(id) { g_spectarget[id] = 0, g_specmode[id] = false } public cmdShowkeys(id) { if(!ShowkeysON[id]) { ShowkeysON[id] = true; ColorChat(id, RED, "Showkeys are now ^04enabled"); } else { ShowkeysON[id] = false; ColorChat(id, RED, "Showkeys are now ^04disabled"); } } public event_textmsg(id) { static specmode[12] read_data(2, specmode, 11) if(equal(specmode, "#Spec_Mode2") || equal(specmode, "#Spec_Mode4")) { g_specmode[id] = true } else { g_specmode[id] = false } return PLUGIN_CONTINUE } public event_statusvalue(id) { if(is_user_connected(id) && !is_user_alive(id)) { set_spec_target(id, read_data(2)) } } public event_spechealth2(id) { if(is_user_connected(id) && !is_user_alive(id)) { set_spec_target(id, read_data(2)) } } public set_spec_target(index, target) { if(target > 0) { g_spectarget[index] = target } } public fwd_playerpostthink(id) { if(!is_user_alive(id) || g_specmode[id]) { new target = g_spectarget[id] if((target < 1) || !is_user_alive(target)) return FMRES_IGNORED new button = pev(target, pev_button) static key[6][6] formatex(key[0], 5, "%s", (button & IN_FORWARD) && !(button & IN_BACK) ? " W " : " "); formatex(key[1], 5, "%s", (button & IN_BACK) && !(button & IN_FORWARD) ? " S " : " "); formatex(key[2], 5, "%s", (button & IN_MOVELEFT) && !(button & IN_MOVERIGHT) ? "A" : " "); formatex(key[3], 5, "%s", (button & IN_MOVERIGHT) && !(button & IN_MOVELEFT) ? "D" : " "); formatex(key[4], 5, "%s", (button & IN_DUCK) ? " DUCK " : " "); formatex(key[5], 5, "%s", (button & IN_JUMP) ? " JUMP " : " "); if(g_flDelay[id] < get_gametime()) { set_hudmessage(0, 255, 159, -1.0, 0.46, 0, 1.0, 0.1, _, _, 1); show_hudmessage(id, "%s^n%s %s %s^n^n%s %s", key[0], key[2], key[1], key[3], key[4], key[5]); g_flDelay[id] = get_gametime() + 0.1 } // fara delay... FLOOD curat // set_hudmessage(0, 255, 159, -1.0, 0.46, 0, 1.0, 0.1, _, _, 1); // show_hudmessage(id, "%s^n%s %s %s^n^n%s %s", key[0], key[2], key[1], key[3], key[4], key[5]); } else if(is_user_alive(id) && ShowkeysON[id]) { if((id < 1) || !is_user_alive(id)) return FMRES_IGNORED new buttonkey = pev(id, pev_button) static keybutton[6][6] formatex(keybutton[0], 5, "%s", (buttonkey & IN_FORWARD) && !(buttonkey & IN_BACK) ? " W " : " "); formatex(keybutton[1], 5, "%s", (buttonkey & IN_BACK) && !(buttonkey & IN_FORWARD) ? " S " : " "); formatex(keybutton[2], 5, "%s", (buttonkey & IN_MOVELEFT) && !(buttonkey & IN_MOVERIGHT) ? "A" : " "); formatex(keybutton[3], 5, "%s", (buttonkey & IN_MOVERIGHT) && !(buttonkey & IN_MOVELEFT) ? "D" : " "); formatex(keybutton[4], 5, "%s", (buttonkey & IN_DUCK) ? " DUCK " : " "); formatex(keybutton[5], 5, "%s", (buttonkey & IN_JUMP) ? " JUMP " : " "); if(g_flDelay[id] < get_gametime()) { set_hudmessage(0, 255, 159, -1.0, 0.46, 0, 1.0, 0.1, _, _, 1); show_hudmessage(id, "%s^n%s %s %s^n^n%s %s", keybutton[0], keybutton[2], keybutton[1], keybutton[3], keybutton[4], keybutton[5]); g_flDelay[id] = get_gametime() + 0.1 } // fara delay... FLOOD curat // set_hudmessage(0, 255, 159, -1.0, 0.46, 0, 1.0, 0.1, _, _, 1); // show_hudmessage(id, "%s^n%s %s %s^n^n%s %s", keybutton[0], keybutton[2], keybutton[1], keybutton[3], keybutton[4], keybutton[5]); } return FMRES_IGNORED } public client_infochanged(id) { get_user_name( id, cl_names[id], 20 ); return PLUGIN_CONTINUE; } public list_update() { if( get_pcvar_num( p_enabled ) && get_pcvar_num ( p_list_enabled ) ) { new players[32], num, id, id2, i, j; for( i = 1; i < 33; i++ ) spec_ids[0] = 0; get_players( players, num, "bch" ); for(i = 0; i < num; i++) { id = players; if(!( get_user_flags(id) & ADMIN_IMMUNITY && get_pcvar_num( p_immunity ) && cl_prefs[id] & FL_HIDE ) ) { id2 = pev( id, pev_iuser2 ); if(id2) { spec_ids[id2][0]++; spec_ids[id2][spec_ids[id2][0]] = id; } } } new tmplist[LIST_STR_LEN + 1], tmpstr[41]; new count, namelen, tmpname[21]; for(i=1; i<33; i++) { count = spec_ids[0]; if(count) { namelen = ( LIST_STR_LEN - 10 ) / count; clamp( namelen, 10, 20 ); format( tmpname, namelen, cl_names ); formatex( tmplist, LIST_STR_LEN - 1, "^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^tSpectating:^n"); for( j=1; j<=count; j++ ) { format( tmpname, namelen, cl_names[spec_ids[j]]); formatex( tmpstr, 40, "^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t%s", tmpname ); if( strlen( tmplist ) + strlen( tmpstr ) + ( 11 - j ) < ( LIST_STR_LEN - 1 ) ) format( tmplist, LIST_STR_LEN - 10, "%s%s^n", tmplist, tmpstr ); else { format( tmplist, LIST_STR_LEN, "%s...^n", tmplist ); break; } } for( j+=0; j<10; j++ ) format( tmplist, LIST_STR_LEN, "%s%s", tmplist, "^n" ); list_string = tmplist; } } get_players( players, num, "ch" ); for( i=0; i<num; i++ ) clmsg( players ); } return PLUGIN_HANDLED; } public clmsg(id) { if( !id ) return; new prefs = cl_prefs[id]; new bool:show_own = false; if( is_user_alive(id) && prefs & FL_OWNKEYS ) show_own = true; if( is_user_alive(id) && !show_own ) { if( prefs & FL_LIST && spec_ids[id][0] && get_pcvar_num( p_list_enabled ) ) { set_hudmessage( get_pcvar_num( p_red ), get_pcvar_num( p_grn ), get_pcvar_num( p_blu ), 0.7, /*x*/ 0.1, /*y*/ 1, /*fx*/ 0.0, /*fx time*/ 1.1, /*hold time*/ 0.1, /*fade in*/ 0.1, /*fade out*/ 3 /*chan*/ ); show_hudmessage( id, list_string[id], id, "SPECTATING" ); } } else { new id2; if( show_own ) id2 = id; else id2 = pev( id, pev_iuser2 ); if( !id2 ) return; if( prefs & FL_LIST || show_own ) { set_hudmessage( get_pcvar_num( p_red ), get_pcvar_num( p_grn ), get_pcvar_num( p_blu ), 0.7, /*x*/ 0.1, /*y*/ 1, /*fx*/ 0.0, /*fx time*/ 1.1, /*hold time*/ 0.1, /*fade in*/ 0.1, /*fade out*/ 3 /*chan*/ ); new msg[BOTH_STR_LEN + 1]; if( prefs & FL_LIST && get_pcvar_num( p_list_enabled ) && spec_ids[id2][0] ) formatex(msg,BOTH_STR_LEN,list_string[id2],id,"SPECTATING"); else msg ="^n^n^n^n^n^n^n^n^n^n^n^n"; show_hudmessage( id, msg ); } } }
Nume: SpecList
Versiune: 1.0
Autor: sebbyz
Link oficial: http://www.extreamcs.com/forum/
Instalare:
1. Fisierul speclist.sma il puneti in addons/amxmodx/scripting
2. Fisierul speclist.amxx il puneti in addons/amxmodx/plugins
3. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:
Code:
speclist.amxx