/* Uwaga: Wykorzystano kod z pluginu zm_vip na pokazanie vipow online */ #include <amxmodx> #define PLUGIN "VIP STATUS" #define VERSION "1.0" #define AUTHOR "Agent" #define VIPACCES ADMIN_RESERVATION new const VIP_STATUS[] = "VIPY ONLINE: ", VIP_STATUS_N[] = "Brak" new maxplayers, g_msgSayText public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) maxplayers = get_maxplayers() g_msgSayText = get_user_msgid("SayText") register_clcmd("say /vips", "print_adminlist") register_clcmd("say /vipsinfo", "ShowMotd") } public client_putinserver(id) { new name[32] if(get_user_flags(id) & VIPACCES) { get_user_name(id,name,32) client_print(0, print_chat,"%s - Witamy!", name) } } public print_adminlist(user) //fragemnt kodu z zm_vip (zmodyfikowany) { new adminnames[33][32] new message[256] new id, count, x, len for(id = 1 ; id <= maxplayers ; id++) if(is_user_connected(id)) if(get_user_flags(id) & VIPACCES) get_user_name(id, adminnames[count++], 31) len = format(message, 255, VIP_STATUS) 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 ) { client_printcolor(user, "/g%s", message) len = format(message, 255, "") } } client_printcolor(user, "/g%s", message) } else { len += format(message[len], 255-len, VIP_STATUS_N) client_printcolor(user, "/g%s", message) } } public ShowMotd(id) { show_motd(id, "vip.txt") // Lokalizacja pliku: cstrike/vip.txt } stock client_printcolor(const id, const input[], any:...) { new iCount = 1, iPlayers[32] static szMsg[191] vformat(szMsg, charsmax(szMsg), input, 3) replace_all(szMsg, 190, "/g", "^4") // green txt replace_all(szMsg, 190, "/y", "^1") // orange txt replace_all(szMsg, 190, "/ctr", "^3") // team txt replace_all(szMsg, 190, "/w", "^0") // team txt if(id) iPlayers[0] = id else get_players(iPlayers, iCount, "ch") for (new i = 0; i < iCount; i++) { if (is_user_connected(iPlayers[i])) { message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayers[i]) write_byte(iPlayers[i]) write_string(szMsg) message_end() } } }
Powinno być OK. Daj znać jak coś