haij 169 Posted October 25, 2014 Share Posted October 25, 2014 Server: gorj.rangfort.ro Nick: haijGrad srv: DetinatorLa ce doriti ajutor? Nu memoreaza bine top15 adica: am 7000 nustu cat cu 7000 nus cat. De la ce sa fie problema ? Mentionez ca nam facut eu 7000 de kiluri sau decese nu aveam cand Am loat alt plugin si tot asa daca poti sa mil faci color primi 3 sau sa nu mai fie bug. /* CFG TOP10+ by mut2nt & razna@2009* -= CVARS =-* ----------------------------------------* cfg_top10_sound 1/0 - Sound ON/OFF* cfg_top10_msg MSG - Afiseaza un msg la sfarsit de top10* ----------------------------------------* Credits: Bugsy**/#include #include #include new g_NvID, g_sBuffer[2048], toggle_sound;static const CONTACT[] = ""public plugin_init(){register_plugin("CFG Top10+", "1.4", "dydy");register_cvar("CFG Top10+", "1.4/dydy", FCVAR_SERVER);register_clcmd("say /top15", "cmdTop15", 0);register_clcmd("say_team /top15", "cmdTop15", 0);toggle_sound = register_cvar("cfg_top10_sound", "1")register_cvar("cfg_top10_msg", CONTACT, FCVAR_SERVER)g_NvID = nvault_open("playtimevault");}public client_disconnect(id){new szPlayTime[8], szAuthID[35], iPlayTime,ts;get_user_name(id, szAuthID, 34);if( !nvault_lookup( g_NvID, szAuthID , szPlayTime , 7 , ts ) ){format(szPlayTime, 7, "%d" , get_user_time(id, 1) );nvault_set( g_NvID , szAuthID , szPlayTime);}else{iPlayTime = str_to_num(szPlayTime) + get_user_time(id, 1);format(szPlayTime, 7, "%d" , iPlayTime );nvault_set( g_NvID , szAuthID , szPlayTime);}}Float:accuracy(izStats[8]){if (!izStats[4]){return (0.0);}return (100.0 * float(izStats[5]) / float(izStats[4]));}Float:effec(izStats[8]){if (!izStats[0]){return (0.0);}return (100.0 * float(izStats[0]) / float(izStats[0] + izStats[1]));}format_top15(sBuffer[2048]){new loc1 = get_statsnum();new loc2 = get_statsnum();new loc3 = get_statsnum();new iMax = get_statsnum();new izStats[8], izBody[8], t_sName[32], msg[112];new iLen = 0;if (iMax > 15){iMax = 15;}loc1 = 1;loc2 = 2;loc3 = 3;new szTime[8];new ts;iLen = format(sBuffer, 2047, " "); iLen += format(sBuffer[iLen], 2047 - iLen, "%2s %-22.22s %6s %6s %4s %6s %4s %4s^n", "#", "Nick", " Kills", "Deaths", " HS", " Eff", "Acc", "PlayTime"); for (new i = 0; i < loc1 && 2047 - iLen > 0; i++) { get_stats(i, izStats, izBody, t_sName, 31); replace_all(t_sName, 31, "<", "["); replace_all(t_sName, 31, ">", "]"); new iCurTime = get_user_time( i , 1 ); new iTotalTime = 0; if( nvault_lookup(g_NvID, t_sName , szTime, 7, ts) ) { iTotalTime = str_to_num(szTime); } iLen += format(sBuffer[iLen], 2047 - iLen, "%2d %-22.22s %6d %6d %4d %3.0f%% %3.0f%% %4d h ^n", i + 1, t_sName, izStats[0], izStats[1], izStats[2], effec(izStats), accuracy(izStats), ((iCurTime + iTotalTime) / 3600));}for (new i = 1; i < loc2 && 2047 - iLen > 0; i++){get_stats(i, izStats, izBody, t_sName, 31);replace_all(t_sName, 31, "<", "[");replace_all(t_sName, 31, ">", "]");new iCurTime = get_user_time( i , 1 );new iTotalTime = 0;if( nvault_lookup(g_NvID, t_sName , szTime, 7, ts) ){iTotalTime = str_to_num(szTime);}iLen += format(sBuffer[iLen], 2047 - iLen, "%2d %-22.22s %6d %6d %4d %3.0f%% %3.0f%% %4d h ^n", i + 1, t_sName, izStats[0], izStats[1], izStats[2], effec(izStats), accuracy(izStats), ((iCurTime + iTotalTime) / 3600));}for (new i = 2; i < loc3 && 2047 - iLen > 0; i++){get_stats(i, izStats, izBody, t_sName, 31);replace_all(t_sName, 31, "<", "[");replace_all(t_sName, 31, ">", "]");new iCurTime = get_user_time( i , 1 );new iTotalTime = 0;if( nvault_lookup(g_NvID, t_sName , szTime, 7, ts) ){iTotalTime = str_to_num(szTime);}iLen += format(sBuffer[iLen], 2047 - iLen, "%2d %-22.22s %6d %6d %4d %3.0f%% %3.0f%% %4d h ^n", i + 1, t_sName, izStats[0], izStats[1], izStats[2], effec(izStats), accuracy(izStats), ((iCurTime + iTotalTime) / 3600));}for (new i = 3; i < iMax && 2047 - iLen > 0; i++){get_stats(i, izStats, izBody, t_sName, 31);replace_all(t_sName, 31, "<", "[");replace_all(t_sName, 31, ">", "]");new iCurTime = get_user_time( i , 1 );new iTotalTime = 0;if( nvault_lookup(g_NvID, t_sName , szTime, 7, ts) ){iTotalTime = str_to_num(szTime);}iLen += format(sBuffer[iLen], 2047 - iLen, "%2d %-22.22s %6d %6d %4d %3.0f%% %3.0f%% %4d h^n", i + 1, t_sName, izStats[0], izStats[1], izStats[2], effec(izStats), accuracy(izStats), ((iCurTime + iTotalTime) / 3600));}get_cvar_string("cfg_top10_msg", msg, 63)iLen += format(sBuffer[iLen], 2047 - iLen, "^n%s", msg);iLen += format(sBuffer[iLen], 2047 - iLen, "^nCei mai buni PLayeri se gasesc aici^n");iLen += format(sBuffer[iLen], 2047 - iLen, "^nAi onoarea de a fi in acest top!");}public cmdTop15(id){format_top15(g_sBuffer);show_motd(id, g_sBuffer, "Top 15");if (get_pcvar_num(toggle_sound) != 0){client_cmd(id,"spk ^"vox/deeoo top ten^"")}return PLUGIN_CONTINUE;}public plugin_end(){nvault_close(g_NvID);} Link to comment Share on other sites More sharing options...
LondoN eXtream 110 Posted October 25, 2014 Share Posted October 25, 2014 (edited) Ia alt plugin, sau lasa-mi .sma aici si vad cum te pot ajuta. Edited October 25, 2014 by AL3X MC Link to comment Share on other sites More sharing options...
LEGALIZE IT! 1337 54 Posted October 26, 2014 Share Posted October 26, 2014 Poftim plugin top15 cu primele 3 locuri colorate ! Link: http://www.girlshare.ro/34055844.9 Cand pui "top15.amxx" in fisierul plugins.ini vezi sa fie deasupra la statsx.amxx 2 Link to comment Share on other sites More sharing options...
haij 169 Posted October 26, 2014 Author Share Posted October 26, 2014 Mersi Darke# pare ca merge bine iti dau pm daca e ceva. Se poate da TC. Link to comment Share on other sites More sharing options...
LEGALIZE IT! 1337 54 Posted October 26, 2014 Share Posted October 26, 2014 Rezolvat ! T/C. 2 Link to comment Share on other sites More sharing options...
Recommended Posts