Admin_check
bolek12
25.10.2008
Cześć,
Mam do was prośba, a zwłaszcza do tych, którzy znają się na pisaniu pluginów. otóż chciałbym przerobić plugin admin_check. Gdy wpisze /admins to pokazuje standardowo liste adminów kolor zielony, ale gdy nie ma adminów to miało by wyglądać to następująco
Dostepni admini: Brak adminow na serwerze - standardowy wygląd taki jak piszemy w say'u.
Proszę was o pomoc.
Mam do was prośba, a zwłaszcza do tych, którzy znają się na pisaniu pluginów. otóż chciałbym przerobić plugin admin_check. Gdy wpisze /admins to pokazuje standardowo liste adminów kolor zielony, ale gdy nie ma adminów to miało by wyglądać to następująco
Dostepni admini: Brak adminow na serwerze - standardowy wygląd taki jak piszemy w say'u.
Proszę was o pomoc.
mgr inż. Pavulon
25.10.2008
hmm, może o coś takiego Ci chodzi (nie testowałem):
#include <amxmodx> /*---------------EDIT ME------------------*/ #define ADMIN_CHECK ADMIN_KICK static const COLOR[] = "^x04" //green static const COLOR2[] = "^x01" //normal static const CONTACT[] = "" /*----------------------------------------*/ new maxplayers new gmsgSayText public plugin_init() { register_plugin("Admin Check", "1.51", "OneEyed") maxplayers = get_maxplayers() gmsgSayText = get_user_msgid("SayText") register_clcmd("say", "handle_say") register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER) } public handle_say(id) { new said[192] read_args(said,192) if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/admin") != -1 ) set_task(0.1,"print_adminlist",id) return PLUGIN_CONTINUE } public print_adminlist(user) { new adminnames[33][32] new message[256] new contactinfo[256], contact[112] new id, count, x, len for(id = 1 ; id <= maxplayers ; id++) if(is_user_connected(id)) if(get_user_flags(id) & ADMIN_CHECK) get_user_name(id, adminnames[count++], 31) len = format(message, 255, "%s Dostepni admini: ",COLOR) if(count > 0) { for(x = 0 ; x < count ; x++) { len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"") if(len > 96 ) { print_message(user, message) len = format(message, 255, "%s ",COLOR) } } print_message(user, message) } else { len += format(message[len], 255-len, "%s Brak adminow na serwerze", COLOR2) print_message(user, message) } get_cvar_string("amx_contactinfo", contact, 63) if(contact[0]) { format(contactinfo, 111, "%s Contact Server Admin -- %s", COLOR, contact) print_message(user, contactinfo) } } print_message(id, msg[]) { message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id) write_byte(id) write_string(msg) message_end() }
mgr inż. Pavulon
26.10.2008
bolek12, sorki, literówka, już poprawiłem w poprzednim poście
zamiaststatic const COLOR2[] = "^x01" //normal
static const COLOR2[] = "^x04" //normal
bolek12
26.10.2008
Działa all teraz będę wiedział co dopisać aby zmienić kolor, ale mam jeszcze jedno pytanie. Wgrałem sobie plugin ATAC i jak zaatakuje kogoś to mi pokazuje na standardowy kolor
bolek zaatakował pavulon
Chciałbym zmienić to na zielony
bolek zaatakował pavulon
Chciałbym zmienić to na zielony
bolek12
26.10.2008
Dodam cały plugin bo nie wiem, które to .sma mam dodać bo jest ich kilka.
Załączone pliki
mgr inż. Pavulon
26.10.2008
A możesz konkretnie napisać o który tekst Ci chodzi z datalangatac.txt ?