show_ips - colorchat
'eXe'
15.08.2014
Witam,
Mam pytanie jak w tym pluginie usunąć [AMXX] Aby zobaczyc ip graczy uzyj /ip, i jak zrobić aby zamiast [AMXX] Lista IP zostala wydrukowana w konsoli na zołty kolor pisało de_dust2 # Lista IP graczy zostala wydrukowana w konsoli.
de_dust2 - na zielono, wydrukowana - na czerwono lub niebieski zależnie od teamu, reszta na normalny kolor.
#include <amxmodx> #include <amxmisc> #define PLUGIN "ShowIps" #define VERSION "1.1" #define AUTHOR "R3X" #define TASK_INFO 777 new gcvarIpInfo; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); register_clcmd("say /ip", "cmd_ShowIpList"); gcvarIpInfo=register_cvar("amx_ip_info", "60.0",0,60.0); } //Info public plugin_cfg(){ new Float:fInter=get_pcvar_float(gcvarIpInfo); if(fInter>0.0) set_task(fInter , "cbIpInfoMessage", TASK_INFO, _, _,"b"); } public cbIpInfoMessage() client_print(0, print_chat, "[AMXX] Aby zobaczyc ip graczy uzyj /ip"); //Komenda public cmd_ShowIpList(id){ /* if(!access(id, ADMIN_BAN)) return PLUGIN_CONTINUE; */ console_print(id, "ID | UserID | Nick | IP"); new Players[32], playerCount; new id2, szName[32], szIP[32]; get_players(Players, playerCount); for (new i=0; i<playerCount; i++){ id2 = Players[i]; if(is_user_bot(id2)) continue; get_user_name(id2, szName, 31); get_user_ip(id2, szIP, 31); console_print(id, "%d | #%d | %s | %s", id2, get_user_userid(id2), szName, szIP); } client_print(id, print_chat, "[AMXX] Lista IP zostala wydrukowana w konsoli"); return PLUGIN_CONTINUE; }
Za pomoc daję piwko!
Wielkie Jol
15.08.2014
1. Wszedzie w kazdej funkcji client_print usuwasz fraze [amxx]. Ctrl+f, szukasz jej i usuwasz.
2. Poczytaj o bibliotece colorchat.
2. Poczytaj o bibliotece colorchat.
'eXe'
15.08.2014
#include <amxmodx> #include <amxmisc> #include <colorchat> #define PLUGIN "ShowIps" #define VERSION "1.1" #define AUTHOR "R3X" #define TASK_INFO 777 new gcvarIpInfo; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); register_clcmd("say /ip", "cmd_ShowIpList"); gcvarIpInfo=register_cvar("amx_ip_info", "60.0",0,60.0); } //Info public plugin_cfg(){ new Float:fInter=get_pcvar_float(gcvarIpInfo); if(fInter>0.0) set_task(fInter , "cbIpInfoMessage", TASK_INFO, _, _,"b"); } public cbIpInfoMessage() client_print(0, print_chat, ""); //Komenda public cmd_ShowIpList(id){ /* if(!access(id, ADMIN_BAN)) return PLUGIN_CONTINUE; */ console_print(id, "ID | UserID | Nick | IP"); new Players[32], playerCount; new id2, szName[32], szIP[32]; get_players(Players, playerCount); for (new i=0; i<playerCount; i++){ id2 = Players[i]; if(is_user_bot(id2)) continue; get_user_name(id2, szName, 31); get_user_ip(id2, szIP, 31); console_print(id, "%d | #%d | %s | %s", id2, get_user_userid(id2), szName, szIP); } client_print(id, GREEN, "de_dust2 ^x01# Lista IP zostala ^x03wydrukowana^x01 w konsoli."); return PLUGIN_CONTINUE; }
Czy tak będzie poprawnie, nie będą żadne error logi wyskakiwać i będzie działać?
'eXe'
15.08.2014
Okej, dzięki.
Mam kolejny plugin jak zrobić żeby tu był colorchat, bo jak daje zamiast formatex ColorChat to sie skompilować nie chce:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <fakemeta> #include <colorchat> #define PLUGIN "Flash Snitch" #define VERSION "1.0" #define AUTHOR "Sn!ff3r" #define ID 3322 new msg_saytext new g_flasher public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) msg_saytext = get_user_msgid("SayText") register_event("ScreenFade", "ScreenFade", "be", "4=255", "5=255", "6=255", "7>199") register_event("23", "TEMPENTITY", "a", "1=5", "6=25", "7=6") register_forward(FM_SetModel, "SetModel") } public SetModel(ent, model[]) { if(equal(model, "models/w_flashbang.mdl")) { static owner owner = pev(ent, pev_owner) if(owner) { set_task(1.52,"get_flasher", ID + owner) } } } public TEMPENTITY() { set_task(0.05, "reset_flasher") return PLUGIN_CONTINUE } public reset_flasher() { g_flasher = 0 } public get_flasher(id) { g_flasher = (id - ID) } public ScreenFade(id) { if(is_user_alive(id)) { if(id != g_flasher && get_user_team(id) == get_user_team(g_flasher)) { static name[33], message[128] get_user_name(g_flasher, name, 32) formatex(message, 127, "^x04de_dust2^x01 # Zostales oslepiony przez ^x03%s", name) print_that(id, message) get_user_name(id, name, 32) formatex(message, 127, "^x04de_dust2^x01 # Wlasnie oslepiles: ^x03%s", name) print_that(g_flasher, message) } } } stock print_that(id, text[]) { message_begin(MSG_ONE_UNRELIABLE, msg_saytext, {0,0,0}, id) write_byte(id) write_string(text) message_end() } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ ansicpg1250\\ deff0\\ deflang1045{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par } */