RSSy MYGO.pl Opublikowano Listopad 15, 2021 o 20:50 RSSy Udostępnij Opublikowano Listopad 15, 2021 o 20:50 Hello i have one problem i have plugin fake full and when i see who are in top list i see bots its possible bots cant make rank just player PHP Code: #include <amxmodx>#include <nvault>#include <nvault_util>#pragma tabsize 0#define S_MINUTE 60#define S_HOUR 3600#define S_DAY 86400new vault new cv_prune#define MAX_TOP 10new Array:Player_NameRank;#define MAX_BUFFER_LENGTH 1536new szMotd[MAX_BUFFER_LENGTH+1]new const szVaultName[] = "ls-koha"static Rank_Array_Count;new bool:IsTopOnline[33];new OnlineTimeRank[33];new OnlineTime[33];native online_is_top_player(idplayer)native online_level_player(idplayer)native online_rank_player(idplayer)#define DESIGN_STYLE "<meta charset=UTF-8><style>body{background:#112233;font-family:Arial}th{background:#558866;color:#FFF;padding:5px 2px;text-align:left}td{padding:2px 1px}table{background:#EEEECC;font-size:14px;font-family:Arial}h2,h3{color:#FFF;font-family:Verdana}</style>"public plugin_init() { register_plugin("Time Play","0.1","anarkin-cs") cv_prune = register_cvar("amx_to_prune", "30") register_clcmd("say /lsonline","cmdalltime") register_clcmd("say /online","cmdtime") register_clcmd("say /onlinerank","CmdRank") vault = nvault_open(szVaultName) format_top_online()}public plugin_natives ( ){ register_native("online_level_player", "native_online_level_player", 1) register_native("online_is_top_player", "native_online_is_top_player", 1) register_native("online_rank_player", "native_online_rank_player", 1)}public native_online_rank_player(idPlayer) return OnlineTimeRank[idPlayer]; public native_online_is_top_player(idPlayer) return IsTopOnline[idPlayer]; public native_online_level_player(idPlayer){ new level = get_lvl_player(OnlineTime[idPlayer]); return level;}public plugin_precache() Player_NameRank = ArrayCreate(64, 1); public plugin_cfg(){ new prune_time=(get_systime()-(get_pcvar_num(cv_prune)*86400)) nvault_prune(vault, 0, prune_time)}public plugin_end() nvault_close(vault) public CmdRank(id){ new szMsg[128]; formatex(szMsg,charsmax(szMsg),"!g[LS ONLINE] !tRank Juaj: !g%d !tprej !g%d !tLojtareve",OnlineTimeRank[id],Rank_Array_Count) ColoredPrint(id, szMsg); return PLUGIN_HANDLED;}public client_putinserver(id){ new name[64],key[64],vaultdata[31] get_user_name(id,name,charsmax(name)) OnlineTime[id] = 0; OnlineTimeRank[id] = 0; IsTopOnline[id] = false; formatex(key,63,"%s",name) nvault_touch(vault,key) nvault_get(vault, key, vaultdata, 30); OnlineTime[id] = str_to_num(vaultdata); for (new i; i < Rank_Array_Count; i++) { new Name[64]; ArrayGetString(Player_NameRank,i, Name, charsmax(Name)); if(equali(Name,name)) { OnlineTimeRank[id] = i + 1; if(i+1<=MAX_TOP)IsTopOnline[id] = true; break; } }}public client_disconnected(id){ new key[64],data[128] new name[64] get_user_name(id,name,charsmax(name)) formatex(key,63,"%s",name) nvault_get(vault,key,data,127) new alltime = str_to_num(data) formatex(data,127,"%d",alltime+(get_user_time(id))) nvault_set(vault, key, data) }public cmdtime(id){ new thetime[64],szMsg[128],level; new time = OnlineTime[id] + get_user_time(id) get_human_time(time,thetime,sizeof(thetime)-1) level = get_lvl_player(time) formatex(szMsg,charsmax(szMsg),"!g[LS ONLINE] !tKoha !g%s !tLeveli juaj !g%d",thetime,level) ColoredPrint(id, szMsg); return PLUGIN_HANDLED;}public cmdalltime(id){ new szMotdTitle[126]; formatex(szMotdTitle, charsmax(szMotdTitle),"[LS] Top Aktivet"); show_motd(id, szMotd, szMotdTitle); return PLUGIN_CONTINUE}format_top_online(){ new iLen new lPlace[60], lTime[30], lNick[30],lLevel[30]; format(lPlace, 59, "TOP Online") format(lNick, 29, "Emri") replace_all(lNick, 29, " ", " ") format(lTime, 29, "Koha") replace_all(lTime, 29, " ", " ") format(lLevel, 29, "Level") replace_all(lLevel, 29, " ", " ") iLen = format_all_themes(szMotd, iLen) iLen += format(szMotd[iLen], MAX_BUFFER_LENGTH - iLen, "<body><h2>%s</h2> <table width=100%% border=0 align=center cellpadding=0 cellspacing=1>", lPlace) iLen += format(szMotd[iLen], MAX_BUFFER_LENGTH - iLen, "<tr><th>%s<th>%s<th>%s<th>%s</tr>", "Vendi", lNick, lTime,lLevel) new Array:aNames = ArrayCreate(64) new Array:aNum1 = ArrayCreate(1) new iPos, iCount, iTime new g_Vault = nvault_util_open(szVaultName) iCount = nvault_util_count( g_Vault ) new szName[64], szData[20],szParseNum1[32]; for(new i; i < iCount; i++) { iPos = nvault_util_read(g_Vault, iPos, szName, charsmax( szName ), szData, charsmax( szData ), iTime) parse(szData, szParseNum1, charsmax( szParseNum1 )) new len; len = strlen(szName) if(len <=2) format(szName,charsmax(szName),"Emri nuk u gjet") ArrayPushString(aNames, szName) ArrayPushCell(aNum1, str_to_num( szParseNum1 )) } nvault_util_close( g_Vault ) new iCheckNum for(new i, j; i < ( iCount - 1 ); i++) { iCheckNum = ArrayGetCell(aNum1, i) for( j = i + 1; j < iCount; j++ ) { if(iCheckNum < ArrayGetCell(aNum1, j)) { ArraySwap(aNames, i, j) ArraySwap(aNum1, i, j) i-- break } } } new szParseName[64] new iParseNum[3] new iMax if(iCount < 10) iMax = iCount else iMax = 10 for(new i; i < iMax; i++) { ArrayGetString(aNames, i, szParseName, charsmax( szParseName )) iParseNum[1] = ArrayGetCell(aNum1, i) new thetime[64],Level; new time = iParseNum[1] Level = get_lvl_player(time) get_human_time(time,thetime,sizeof(thetime)-1) if(i + 1 == 1) iLen += formatex(szMotd[iLen], charsmax( szMotd ) - iLen, "<tr><td><img src=^"https://i.imgur.com/2mx4qZD.png^" alt=^"top1^" width=^"48^" height=^"48^"></td><td>%s</td><td>%s</td><td>%d</td></td></tr>", szParseName, thetime,Level) //Создаем строки в топе else iLen += formatex(szMotd[iLen], charsmax( szMotd ) - iLen, "<tr><td>%d</td><td>%s</td><td>%s</td><td>%d</td></td></tr>", (i + 1), szParseName, thetime,Level) //Создаем строки в топе } //Для rank for(new i; i < iCount; i++) { ArrayGetString(aNames, i, szParseName, charsmax( szParseName )) ArrayPushString(Player_NameRank, szParseName) } Rank_Array_Count = ArraySize(Player_NameRank) ArrayDestroy(aNames) ArrayDestroy(aNum1)}get_lvl_player(time){ new level,h; h=time/S_HOUR; level = h / 2 return level;}get_human_time(time,output[],len){ new m,h,d if(time)formatex(output,len,"%d sek",time) // gg if(time/S_MINUTE) { m=time/S_MINUTE formatex(output,len,"%d min.",m) } if(time/S_HOUR) { h=time/S_HOUR m=(time-(h*S_HOUR))/S_MINUTE new szHour[16]; switch(h) { case 1,21:format(szHour,charsmax(szHour),"ore") case 2..4,22..24:format(szHour,charsmax(szHour),"ore") case 5..20:format(szHour,charsmax(szHour),"ore") } formatex(output,len,"%d %s dhe %d min",h,szHour,m) } if(time/S_DAY) { d=time/S_DAY h=(time-(d*S_DAY))/S_HOUR new szHour[16],szDay[16]; switch(h) { case 1,21:format(szHour,charsmax(szHour),"ore") case 2..4,22..24:format(szHour,charsmax(szHour),"ore") case 5..20:format(szHour,charsmax(szHour),"ore") } switch(d) { case 1,21,31:format(szDay,charsmax(szDay),"dite") case 2..4,22..24:format(szDay,charsmax(szDay),"dite") case 5..20,25..30:format(szDay,charsmax(szDay),"dite") } formatex(output,len,"%d %s %d %s %d min.", d,szDay,h,szHour,m) } }format_all_themes(sBuffer[MAX_BUFFER_LENGTH + 1], iLen){ //switch //{ iLen = format(sBuffer, MAX_BUFFER_LENGTH, DESIGN_STYLE) return iLen //}}//stock//ColorChatstock ColoredPrint(const id, const input[], any:...){ new count = 1, players[32] static msg[512] vformat(msg, 512, input, 3) replace_all(msg, 512, "!g", "^x04") replace_all(msg, 512, "!y", "^x01") replace_all(msg, 512, "!t", "^x03") if (id) players[0] = id; else get_players(players, count, "ch") { for (new i = 0; i < count; i++) { if (is_user_connected(players[i])) { message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]); write_byte(players[i]); write_string(msg); message_end(); } } }} Przeczytaj cały wpis Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi