A teraz o co mi chodzi, posiadam plugin amx_ssban ale nie odpowiada mi kolor wiadomości w HUD który jest fioletowy chciałbym aby ktoś mi przerobił sma tak by kolor był zielony.
Mile widziane jeszcze by było gdyby wiadomość wyświetlała się dłużej tak o 3 sekundy.
Jak ktoś ma ochotę może dodatkowo wskazać który parametr odpowiada za kolor.
sma do przerobienia
Spoiler
[size=5]
// Includes #include <amxmodx> #include <amxmisc> #include <geoip>[/b][/size] [size=5][b]// Defines #define VERSION "2.6"[/b][/size] [size=5][b]//********** EDIT HERE if you use AMXBANS ***********// #define AMXBANS 0 // Set this to 1 to enable AmxBans support. (Uses amx_ban <minutes> <userid> [reason]) //***************************************************//[/b][/size] [size=5][b]#define MAX_PLAYERS 33 // Maximum number of players (plus 1)[/b][/size] [size=5][b]new g_Activity, g_Hostname, g_DelaySS, g_DelayBan, g_SnapShot, g_UnbanURL, g_MsgType, g_SayText new g_szBanTime[MAX_PLAYERS][8], g_szBanReason[MAX_PLAYERS][32] new Array:g_bantimes[/b][/size] [size=5][b]new g_menuPosition[MAX_PLAYERS] new g_menuPlayers[MAX_PLAYERS][32] new g_menuPlayersNum[MAX_PLAYERS] new g_menuOption[MAX_PLAYERS] new g_menuSettings[MAX_PLAYERS][/b][/size] [size=5][b]public plugin_init() { /* Register plugin name and author */ register_plugin("AMX SSBan", VERSION, "God@Dorin\Fysiks");[/b][/size] [size=5][b]/* Register plugin version */ register_cvar("screen_version", VERSION, FCVAR_SERVER | FCVAR_SPONLY);[/b][/size] [size=5][b]/* Register language file */ register_dictionary("screen_message.txt") // Language file for snapshot messages register_dictionary("admincmd.txt") // Language file for amxmodx bans[/b][/size] [size=5][b]/* Register cvars */ g_Activity = get_cvar_pointer("amx_show_activity") g_Hostname = get_cvar_pointer("hostname") g_DelaySS = register_cvar("amx_ssdelay", "1.0") // Delay between snapshots (Def.: 1.0) g_DelayBan = register_cvar("amx_bandelay", "10.0") // Delay before ban is done (Def.: 10.0) g_SnapShot = register_cvar("amx_ssnumber", "3") // Number of snapshots to take (Def.: 3) g_UnbanURL = register_cvar("amx_website", "www.yoursite.com") // Unban request site (Def.: "www.yoursite.com") g_MsgType = register_cvar("amx_msg_type", "3") // 1- chat | 2- hud | 3- chat+hud (Def.: 3)[/b][/size] [size=5][b]/* Register console admin commands */ register_concmd("amx_ss", "cmdSS",ADMIN_KICK, "<name or #userid> - Make snapshots on user !") #if AMXBANS if( get_cvar_num("amxbans_use_newbancmd") ) register_concmd("amx_ssban", "cmdBanSS", ADMIN_BAN, "<name or #userid> <minutes> [reason] - - Ban with snapshots! (AmxBans)") else register_concmd("amx_ssban", "cmdBanSS", ADMIN_BAN, "<minutes> <name or #userid> [reason] - Ban with snapshots! (AmxBans)") #else register_concmd("amx_ssban", "cmdBanSS", ADMIN_BAN, "<name or #userid> <minutes> [reason] - Ban with snapshots! (AMX Mod X)") #endif register_clcmd("_BanReason", "cmdBanReason")[/b][/size] [size=5][b]g_SayText = get_user_msgid("SayText")[/b][/size] [size=5][b]/* Register the menu for banning */ register_clcmd("amx_ssmenu", "cmdSSMenu", ADMIN_KICK, " - Displays ScreenShot Menu") register_clcmd("amx_ssbanmenu", "cmdBanMenu", ADMIN_BAN, " - Displays ScreenShot Ban Menu") register_menucmd(register_menuid("SS Menu"), 1023, "actionMenu")[/b][/size] [size=5][b]/* Set bantimes for the menu */ g_bantimes = ArrayCreate()[/b][/size] [size=5][b]ArrayPushCell(g_bantimes, 0) ArrayPushCell(g_bantimes, 5) ArrayPushCell(g_bantimes, 10) ArrayPushCell(g_bantimes, 30) ArrayPushCell(g_bantimes, 60) ArrayPushCell(g_bantimes, 240) ArrayPushCell(g_bantimes, 1440)[/b][/size] [size=5][b]register_srvcmd("amx_ssbantimes", "ssbanmenu_setbantimes") }[/b][/size] [size=5][b]public cmdSS(id,level,cid) { if(!cmd_access(id, level, cid, 1)) return PLUGIN_HANDLED[/b][/size] [size=5][b]new target[32] read_argv(1, target, 31) new player = cmd_target(id, target, CMDTARGET_OBEY_IMMUNITY)[/b][/size] [size=5][b]if(!player) return PLUGIN_HANDLED[/b][/size] [size=5][b]new name[32], name2[32] get_user_name(id, name, 31) get_user_name(player, name2, 31) /* show message in chat to all players by amx_show_activity */ switch( get_pcvar_num(g_Activity) ) { case 2: client_printc(0,"%L", LANG_PLAYER, "SS_CASE2", name, name2) case 1: client_printc(0,"%L", LANG_PLAYER, "SS_CASE1", name2) }[/b][/size] [size=5][b]new Param[2] Param[0] = id Param[1] = player /* Set the task to take snapshots */ set_task(Float:get_pcvar_float(g_DelaySS), "SS_Task", 0, Param,2, "a", get_pcvar_num(g_SnapShot)) return PLUGIN_HANDLED[/b][/size] [size=5][b]}[/b][/size] [size=5][b]public cmdBanSS(id,level,cid) { if(!cmd_access(id, level, cid, 3)) return PLUGIN_HANDLED[/b][/size] [size=5][b]new target[32][/b][/size] [size=5][b]#if AMXBANS if( get_cvar_num("amxbans_use_newbancmd") ) { read_argv(1, target, 31) read_argv(2, g_szBanTime[id], 7) } else { read_argv(1, g_szBanTime[id], 7) read_argv(2, target, 31) } #else read_argv(1, target, 31) read_argv(2, g_szBanTime[id], 7) #endif read_argv(3, g_szBanReason[id], 63)[/b][/size] [size=5][b]new player = cmd_target(id, target, CMDTARGET_OBEY_IMMUNITY)[/b][/size] [size=5][b]if(!player) return PLUGIN_HANDLED[/b][/size] [size=5][b]new Param[2] Param[0] = id Param[1] = player[/b][/size] [size=5][b]/* Set tasks to take snapshots and ban target */ set_task(Float:get_pcvar_float(g_DelaySS), "SS_Task", 0, Param,2, "a", get_pcvar_num(g_SnapShot)) set_task(Float:get_pcvar_float(g_DelayBan), "BanSS_Task", 0, Param, 2)[/b][/size] [size=5][b]return PLUGIN_HANDLED }[/b][/size] [size=5][b]public SS_Task(Param[2]) { new player = Param[1] new id = Param[0] new name[32], timer[32], hostname[64], name2[32], ip[32], authid2[32], country[33], site[64][/b][/size] [size=5][b]get_user_name(id, name, 31) get_user_name(player, name2, 31) get_user_authid(player, authid2, 31) get_user_ip(player, ip, 31, 1)[/b][/size] [size=5][b]geoip_country(ip, country) get_time("%d/%m/%Y - %H:%M:%S", timer, 63) get_pcvar_string(g_Hostname, hostname, charsmax(hostname)) get_pcvar_string(g_UnbanURL, site, charsmax(site))[/b][/size] [size=5][b]switch( get_pcvar_num(g_MsgType) ) { case 1: { /* Show screen messages in chat */ client_printc(player,"%L", player, "SS_MSG1", name) client_printc(player,"%L", player, "SS_MSG2", timer, hostname) client_printc(player,"%L", player, "SS_MSG3", name2, ip, authid2, country) client_printc(player,"%L", player, "SS_MSG4", site) } case 2: { /* Show screen messages in hud */ set_hudmessage(150, 0, 255, -1.0, 0.1, 0, 0.25, 1.0, 0.0, 0.0, 4) show_hudmessage(player, "%L", player, "SS_MSG_HUD", timer, hostname, name2, ip, authid2, country, site) } case 3: { /* Show screen messages in chat */ client_printc(player,"%L", player, "SS_MSG1", name) client_printc(player,"%L", player, "SS_MSG2", timer, hostname) client_printc(player,"%L", player, "SS_MSG3", name2, ip, authid2, country) client_printc(player,"%L", player, "SS_MSG4", site)[/b][/size] [size=5][b] /* Show screen messages in hud */ set_hudmessage(150, 0, 255, -1.0, 0.1, 0, 0.25, 1.0, 0.0, 0.0, 4) show_hudmessage(player, "%L", player, "SS_MSG_HUD", timer, hostname, name2, ip, authid2, country, site) } } /* Take the snapshots ! */ client_cmd(player,"snapshot") /* Confirm for the admin in console that the command was commited */ console_print(id,"%L", id, "SS_CONSOLE", name2)[/b][/size] [size=5][b]return PLUGIN_HANDLED }[/b][/size] [size=5][b]public BanSS_Task(Param[]) { new id = Param[0] new player = Param[1] new minutes[8], reason[32] new userid2 = get_user_userid(player)[/b][/size] [size=5][b]copy(minutes, 7, g_szBanTime[id]) copy(reason, 31, g_szBanReason[id])[/b][/size] [size=5][b]#if AMXBANS // Ban "player" using AmxBans if( get_cvar_num("amxbans_use_newbancmd") ) client_cmd(id, "amx_ban #%d %s ^"%s^"", userid2, minutes, reason) else client_cmd(id, "amx_ban %s #%d ^"%s^"", minutes, userid2, reason) #else // Ban "player" using HL Ban Method[/b][/size] [size=5][b]new authid[32], name2[32], authid2[32], name[32][/b][/size] [size=5][b]get_user_authid(player, authid2, 31) get_user_authid(id, authid, 31) get_user_name(player, name2, 31) get_user_name(id, name, 31)[/b][/size] [size=5][b]log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%s^") (reason ^"%s^")", name, get_user_userid(id), authid, name2, userid2, authid2, minutes, reason)[/b][/size] [size=5][b]new temp[64], banned[16], nNum = str_to_num(minutes) if(nNum) { formatex(temp, 63, "%L", player, "FOR_MIN", minutes) } else { formatex(temp, 63, "%L", player, "PERM") }[/b][/size] [size=5][b]formatex(banned, 15, "%L", player, "BANNED")[/b][/size] [size=5][b]if (reason[0]) server_cmd("kick #%d ^"%s (%s %s)^"", userid2, reason, banned, temp) else server_cmd("kick #%d ^"%s %s^"", userid2, banned, temp) server_cmd("banid %s %s", minutes, authid2) server_cmd("writeid")[/b][/size] [size=5][b]// Display the message to all clients new msg[256] new len new maxpl = get_maxplayers() for(new i = 1; i <= maxpl; i++) { if(is_user_connected(i) && !is_user_bot(i)) { len = formatex(msg, charsmax(msg), "%L", i, "BAN") len += formatex(msg[len], charsmax(msg) - len, " %s ", name2) if(nNum) { len += formatex(msg[len], charsmax(msg) - len, "%L", i, "FOR_MIN", minutes) } else { len += formatex(msg[len], charsmax(msg) - len, "%L", i, "PERM") } if(strlen(reason) > 0) { formatex(msg[len], charsmax(msg) - len, " (%L: %s)", i, "REASON", reason) } show_activity_id(i, id, name, msg) } } console_print(id, "[AMXX] %L", id, "CLIENT_BANNED", name2) #endif return PLUGIN_HANDLED }[/b][/size] [size=5][b]public cmdBanMenu(id, level, cid) { if (!cmd_access(id, level, cid, 1)) return PLUGIN_HANDLED[/b][/size] [size=5][b]g_menuOption[id] = 0[/b][/size] [size=5][b]if (ArraySize(g_bantimes) > 0) { g_menuSettings[id] = ArrayGetCell(g_bantimes, g_menuOption[id]) } else { // should never happen, but failsafe g_menuSettings[id] = 0 } displayMenu(id, g_menuPosition[id] = 0)[/b][/size] [size=5][b]return PLUGIN_HANDLED }[/b][/size] [size=5][b]public cmdSSMenu(id, level, cid) { if (!cmd_access(id, level, cid, 1)) return PLUGIN_HANDLED[/b][/size] [size=5][b]g_menuOption[id] = 0[/b][/size] [size=5][b]g_menuSettings[id] = -1 displayMenu(id, g_menuPosition[id] = 0)[/b][/size] [size=5][b]return PLUGIN_HANDLED }[/b][/size] [size=5][b]displayMenu(id, pos) { if (pos < 0) return[/b][/size] [size=5][b]get_players(g_menuPlayers[id], g_menuPlayersNum[id])[/b][/size] [size=5][b]new menuBody[512] new b = 0 new i new name[32] new start = pos * 7, len[/b][/size] [size=5][b]if (start >= g_menuPlayersNum[id]) start = pos = g_menuPosition[id] = 0[/b][/size] [size=5][b]len = format(menuBody, 511, "\y%L\R%d/%d^n\w^n", id, g_menuSettings[id] == -1 ? "SS_MENU" : "SSBAN_MENU", pos + 1, (g_menuPlayersNum[id] / 7 + ((g_menuPlayersNum[id] % 7) ? 1 : 0)))[/b][/size] [size=5][b]new end = start + 7 new keys = MENU_KEY_0[/b][/size] [size=5][b]if (end > g_menuPlayersNum[id]) end = g_menuPlayersNum[id][/b][/size] [size=5][b]for (new a = start; a < end; ++a) { i = g_menuPlayers[id][a] get_user_name(i, name, 31)[/b][/size] [size=5][b] if (is_user_bot(i) || (access(i, ADMIN_IMMUNITY) && i != id)) { ++b[/b][/size] [size=5][b] len += format(menuBody[len], 511-len, "\d%d. %s^n\w", b, name) } else { keys |= (1<<<img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/cool.png' class='bbc_emoticon' alt='B)' />[/b][/size] [size=5][b] if (is_user_admin(i)) len += format(menuBody[len], 511-len, "%d. %s \r*^n\w", ++b, name) else len += format(menuBody[len], 511-len, "%d. %s^n", ++b, name) } }[/b][/size] [size=5][b]if(g_menuSettings[id] != -1) { if (g_menuSettings[id]) len += format(menuBody[len], 511-len, "^n8. %L^n", id, "BAN_FOR_MIN", g_menuSettings[id]) else len += format(menuBody[len], 511-len, "^n8. %L^n", id, "BAN_PERM") keys |= MENU_KEY_8 }[/b][/size] [size=5][b]if (end != g_menuPlayersNum[id]) { format(menuBody[len], 511-len, "^n9. %L...^n0. %L", id, "MORE", id, pos ? "BACK" : "EXIT") keys |= MENU_KEY_9 } else format(menuBody[len], 511-len, "^n0. %L", id, pos ? "BACK" : "EXIT")[/b][/size] [size=5][b]show_menu(id, keys, menuBody, -1, "SS Menu") }[/b][/size] [size=5][b]public actionMenu(id, key) { switch (key) { case 7: { ++g_menuOption[id] g_menuOption[id] %= ArraySize(g_bantimes)[/b][/size] [size=5][b] g_menuSettings[id] = ArrayGetCell(g_bantimes, g_menuOption[id])[/b][/size] [size=5][b] displayMenu(id, g_menuPosition[id]) } case 8: displayMenu(id, ++g_menuPosition[id]) case 9: displayMenu(id, --g_menuPosition[id]) default: { new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key][/b][/size] [size=5][b] new minutes[8] num_to_str(g_menuSettings[id], minutes, 7)[/b][/size] [size=5][b] copy(g_szBanTime[id], 7, minutes) copy(g_szBanReason[id], 31, "_BanReason")[/b][/size] [size=5][b] new Param[2] Param[0] = id Param[1] = player[/b][/size] [size=5][b] set_task(Float:get_pcvar_float(g_DelaySS), "SS_Task", 0, Param,2, "a", get_pcvar_num(g_SnapShot)) if(g_menuSettings[id] != -1) { messagemode_reason(id) set_task(Float:get_pcvar_float(g_DelayBan), "BanSS_Task", 0, Param, 2) }[/b][/size] [size=5][b] // displayMenu(id, g_menuPosition[id]) // Uncomment this line to make menu remain open after banning } }[/b][/size] [size=5][b]return PLUGIN_HANDLED }[/b][/size] [size=5][b]messagemode_reason(id) { formatex(g_szBanReason[id], charsmax(g_szBanReason[]), "%L", id, "NO_REASON_MENU") new name[32] get_user_name(id, name, 31) set_hudmessage(255, 0, 0, 0.0, 0.24, 1, 6.0, 12.0) show_hudmessage(id, "%L", id, "REASON_HUDASK", name) client_cmd(id, "messagemode _BanReason") }[/b][/size] [size=5][b]public cmdBanReason(id) { // Client has submitted reason. new szArg[sizeof(g_szBanReason[])] read_args(szArg, charsmax(szArg)) remove_quotes(szArg)[/b][/size] [size=5][b]if(szArg[0]) { formatex(g_szBanReason[id], charsmax(g_szBanReason[]), szArg) } return PLUGIN_HANDLED }[/b][/size] [size=5][b]public ssbanmenu_setbantimes() { new buff[32] new args = read_argc()[/b][/size] [size=5][b]if (args <= 1) { server_print("usage: amx_ssbantimes <time1> [time2] [time3] ...") server_print(" use time of 0 for permanent.")[/b][/size] [size=5][b] return }[/b][/size] [size=5][b]ArrayClear(g_bantimes)[/b][/size] [size=5][b]for (new i = 1; i < args; i++) { read_argv(i, buff, charsmax(buff))[/b][/size] [size=5][b] ArrayPushCell(g_bantimes, str_to_num(buff))[/b][/size] [size=5][b]}[/b][/size] [size=5][b]}[/b][/size] [size=5][b]/* Stock colors for chat messages */ stock client_printc(const id, const string[], {Float, Sql, Resul,_}:...) {[/b][/size] [size=5][b]new msg[191], players[32], count = 1 vformat(msg, sizeof msg - 1, string, 3)[/b][/size] [size=5][b]replace_all(msg,190,"!g","^4") replace_all(msg,190,"!y","^1") replace_all(msg,190,"!t","^3")[/b][/size] [size=5][b]if(id) players[0] = id else get_players(players,count,"ch")[/b][/size] [size=5][b]for (new i = 0 ; i < count ; i++) { if (is_user_connected(players[i])) { message_begin(MSG_ONE_UNRELIABLE, g_SayText,_, players[i]) write_byte(players[i]) write_string(msg) message_end() } } } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1048\\ f0\\ fs16 \n\\ par } */[/b][/size] [b]
[size=5]